window.onresize = delayResize;

function delayResize() {
	setTimeout("setupContentArea();",500);
}
function setupContentArea () {
	//Break out of any frames
	if (top.location != location) {
    	top.location.href = document.location.href ;
		}

	//Get the current window size

	if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			winW = window.innerWidth;
			winH = window.innerHeight;
		} else if( document.documentElement &&
			( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			winW = document.documentElement.clientWidth;
			winH = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			winW = document.body.clientWidth;
			winH = document.body.clientHeight;
	}

	//Set the commom page areas			
	var objTopbar = document.getElementById('topbar');
	var objContent = document.getElementById('content');
	var objLeftbar = document.getElementById('leftbar');
	var objBottombar = document.getElementById('bottombar');
	var objContainer = document.getElementById('container');
	
	objContent.style.left = 108 + "px";
	objContent.style.height = (winH-140)+"px";
	objContent.style.width = (winW-108)+"px";
	objLeftbar.style.height = winH-100+"px";
	objTopbar.style.width = winW+"px";
	objBottombar.style.top = winH-20+"px";
	objBottombar.style.width = winW-108+"px";
	
	//Page specific areas	
	if(strPage == 'pubs') {		
		var objl_Content = document.getElementById('l_content');
		objl_Content.style.height = (parseInt(objContent.style.height)-104)+"px";
	}

	if(strPage == 'ts') {		
		var objl_Content = document.getElementById('l_content');
		objl_Content.style.height = (parseInt(objContent.style.height)-104)+"px";

		var objr_Content = document.getElementById('r_content');
		objr_Content.style.height = (parseInt(objContent.style.height)-180)+"px";
		objr_Content.style.width = (parseInt(objContent.style.width)-220)+"px";
	}

	if(strPage == 'register') {		
		var objl_Content = document.getElementById('l_content');
		objl_Content.style.height = (parseInt(objContent.style.height)-75)+"px";

		var objr_Content = document.getElementById('r_content');
		objr_Content.style.height = (parseInt(objContent.style.height)-25)+"px";
		objr_Content.style.width = (parseInt(objContent.style.width)-225)+"px";
		
		var objr_Content_scroll = document.getElementById('r_content_scroll');
		objr_Content_scroll.style.height = (parseInt(objContent.style.height)-125)+"px";
		objr_Content_scroll.style.width = (parseInt(objContent.style.width)-235)+"px";		
	}

	if(strPage == 'index') {		
		var objl_Content = document.getElementById('l_content');
		objl_Content.style.height = (parseInt(objContent.style.height)-60)+"px";
		objl_Content.style.width = (parseInt(objContent.style.width)-20)+"px";

	}
	
	if(strPage == 'search') {		
		var objsearch_results = document.getElementById('search_results');
		objsearch_results.style.height = (parseInt(objContent.style.height)-40)+"px";
		objsearch_results.style.width = (parseInt(objContent.style.width)-10)+"px";

	}
	
	if(strPage == 'chart') {		
		var objl_Content = document.getElementById('l_content');
		objl_Content.style.height = (parseInt(objContent.style.height)-104)+"px";

		var objr_Content = document.getElementById('r_content');
		objr_Content.style.height = (parseInt(objContent.style.height)-60)+"px";
		objr_Content.style.width = (parseInt(objContent.style.width)-220)+"px";
		
	}

	if(strPage == 'chart_v2') {		
		var objl_Content = document.getElementById('l_content');
		objl_Content.style.height = (parseInt(objContent.style.height)-104)+"px";

		var objr_Content = document.getElementById('r_content');
		objr_Content.style.height = (parseInt(objContent.style.height)-60)+"px";
		objr_Content.style.width = (parseInt(objContent.style.width)-220)+"px";
		
	}

	//Page specific areas	
	if(strPage == 'contact_display') {		
		var objl_Content = document.getElementById('l_content');
		objl_Content.style.height = (parseInt(objContent.style.height)-104)+"px";
	}

	//Update graphs if a markets page
	if(strPage == 'markets') {		
		updateGraph();
	}

	//Update graphs if a markets page
	if(strPage == 'market_display') {		
		updateGraph();
	}
}


