function adjustLayout()
{
	// Get natural heights
	var mlHeight = xHeight("menu-left");
	var cHeight = xHeight("content");
	var mHeight = xHeight("middle");
	var rHeight = xHeight("right");
	var bgHeight = xHeight("main-bg");
	
 
	// Find the maximum height
	var maxHeight = Math.max(mlHeight, cHeight, mHeight, rHeight);
	
	// Assign maximum height to all columns
	xHeight("menu-left", maxHeight);
	xHeight("content", maxHeight);
	xHeight("middle", maxHeight);
	xHeight("right", maxHeight);
	 
	// Show the footer
	xShow("footer");
}
window.onload = function()
{
	//xAddEventListener(window, "resize", adjustLayout, false);
	adjustLayout();
	getPageSize();
}


function getPageSize()
{
		var windowWidth, windowHeight;
		if (self.innerHeight) {		// all except Explorer
				windowWidth = self.innerWidth;
				windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
		} 	
		
 		
	var main = document.getElementById('main');
	var menu_left = document.getElementById('menu-left');
	var main_bg = document.getElementById('main-bg');
		
	var height_main = main.offsetHeight;
	var height_menu_left = menu_left.offsetHeight;	
	var height_menu_left_200 = height_menu_left + 239;
 
		
	if (windowHeight>height_main) {
 		main.style.height = windowHeight + "px";
 	} 
	if (windowHeight>height_menu_left_200) {
		menu_left.style.height = windowHeight - 239 + "px";
	}
	main_bg.style.height = windowHeight + "px";
	
		//arrayPageSize = new Array(windowWidth,windowHeight) 
		//return arrayPageSize;
}