window.onload = function(){
	resize();
}


window.onresize = function() {
	resize();
}

function resize() {
	
	divMain = document.getElementById("main");
	/*
	divHeader = document.getElementById("header");
	divNavigation = document.getElementById("navigation");
	divExtra = document.getElementById("extra");
	divContent = document.getElementById("content");
	divSidebar = document.getElementById("sidebar");
	
	height = divHeader.offsetHeight + divNavigation.offsetHeight + 15;
	height += divExtra.offsetHeight>divContent.offsetHeight?divExtra.offsetHeight:divContent.offsetHeight;
	height = divSidebar.offsetHeight>height?divSidebar.offsetHeight:height;
	*/
	
	/*
	if (divMain.style.height != height) {
		divMain.style.height = height + 'px';
	}
	*/
	
	windowHeight = (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight);
	bodyHeight = document.body.offsetHeight;
	x = 0	
	if (windowHeight > bodyHeight) {
		x = windowHeight - bodyHeight;
		divMain.style.height = divMain.offsetHeight + x + 'px';
	}
	//alert ('asd');
	//if (divMain.style.height != (divMain.offsetHeight + x)) {
		
	//}
		
	
}