// JavaScript Document

function sameheight() {	
  	// Get natural heights
	var cHeight = xHeight("container");
	var c2Height = xHeight("container1");
	var lHeight = xHeight("sidebar");
	var rHeight = xHeight("sidebar1");
	
	// Find the maximum height
	var maxHeight =
	Math.max(Math.max(cHeight, c2Height), Math.max(lHeight, rHeight));
	
	// Assign maximum height to all columns
	xHeight("container", maxHeight);
	xHeight("container1", maxHeight);
	xHeight("sidebar", maxHeight);
	xHeight("sidebar1", maxHeight);
	
	// Show the footer
	xShow("footer");
}

window.onload = function() {
	xAddEventListener(window, "resize", sameheight, false);
  	sameheight();
}