function setContentHeight()
{

	/* Get the screen height and width */
	if (document.documentElement && document.documentElement.clientHeight) {
		ScreenHeight = document.documentElement.clientHeight;
		ScreenWidth = document.documentElement.clientWidth;
	} else {
		ScreenHeight = document.body.clientHeight;
		ScreenWidth = document.body.clientWidth;
	}

	/* Get the height of the page elements */
	HeaderHeight = document.getElementById('header-box').offsetHeight;
	TopNavBoxHeight = document.getElementById('topnavbox').offsetHeight;
	ContentTitleBarHeight = document.getElementById('titlebarbox').offsetHeight;
	ContentFooterHeight = document.getElementById('footnavbox').offsetHeight;
	FooterHeight = document.getElementById('footer-box').offsetHeight;
	LeftSidebarHeight = document.getElementById('left-box').offsetHeight;
	RightSidebarHeight = document.getElementById('right-box').offsetHeight;

	/* Add a Correction value to make sure full page does not scroll */
	CorrectionValue = 15;
	
	/* Calculate the ContentHeight */
	ContentHeight = ScreenHeight - HeaderHeight - TopNavBoxHeight - ContentTitleBarHeight - ContentFooterHeight - FooterHeight - CorrectionValue;
    SidebarHeight = ScreenHeight - HeaderHeight - FooterHeight - CorrectionValue;

	/* Always show the full sidebars */
	//if (LeftSidebarHeight > ContentHeight) ContentHeight = LeftSidebarHeight;
	//if (RightSidebarHeight > ContentHeight) ContentHeight = RightSidebarHeight;

	/* Set the contentbox height */
	document.getElementById('content').style.overflow = "auto";
	//document.getElementById('content').style.height = "100%";
	document.getElementById('content').style.height = ContentHeight + "px";
	document.getElementById('sidebar').style.height = SidebarHeight + "px";
	document.getElementById('rightbar').style.height = SidebarHeight + "px";

	/* Set the center box width (stupid IE fix) */
	LeftSidebarWidth = document.getElementById('left-box').offsetHeight;
	RightSidebarWidth = document.getElementById('right-box').offsetHeight;
	ContentWidth = ScreenWidth - LeftSidebarWidth - RightSidebarWidth;
	/* document.getElementById('center-box').style.width = ContentWidth + "px"; */

	/*
	alert('ScreenWidth = ' + ScreenWidth + '\n' + 'LeftSidbarWidth = ' + LeftSidebarWidth + '\n' + 'RightSidebarWidth = ' + RightSidebarWidth + '\n' + 'ContentWidth = ' + ContentWidth + '\n');
	*/

}
onload=setContentHeight;
onresize=setContentHeight;

