Array.prototype.max = function() {
	var max = this[0];
	var len = this.length;
	for (var i = 1; i < len; i++) if (this[i] > max) max = this[i];
	return max;
}
Array.prototype.min = function() {
	var min = this[0];
	var len = this.length;
	for (var i = 1; i < len; i++) if (this[i] < min) min = this[i];
	return min;
}

function resizeHomepageCols() {
	var heights = [];
	heights.push(jQuery("#homepage_left_container").height());
	heights.push(jQuery("#homepage_mid_container").height());
	heights.push(jQuery("#homepage_mid_container2").height());
	heights.push(jQuery("#homepage_right_container").height());
	var maxcolheight = heights.max();
	jQuery("#homepage_left_container").height(maxcolheight);
	jQuery("#homepage_mid_container").height(maxcolheight);
	jQuery("#homepage_mid_container2").height(maxcolheight);
	jQuery("#homepage_right_container").height(maxcolheight);
}

function resizeContentCols() {
	var heights = [];
	heights.push(jQuery("#nav_col").height());
	heights.push(jQuery("#content_col").height());
	heights.push(jQuery("#midcontent_col").height());
	heights.push(jQuery("#right_col").height());
	var maxcolheight = heights.max();
	jQuery("#nav_col").height(maxcolheight);
	jQuery("#content_col").height(maxcolheight);
}

function navAnimate() {
	var li = jQuery("#topnav_template_editable").children("ul").children("li");
	for (var x = 0; x < li.length; x++) {
		jQuery(li.get(x)).children("a").mouseenter(function() {
			jQuery(this).animate({paddingRight: '+=20'},250);
		});
		jQuery(li.get(x)).children("a").mouseleave(function() {
			jQuery(this).animate({paddingRight: '-=20'},250);
		});
	}
}
