var d = document;
var app = navigator.appVersion;
var tresholdWidth = 1000;
var htp = 160;
var wlnp = 200;
var wideScreen = false;


window.onload = function(){ AdjustWidth( true ); }
window.onresize = function(){ AdjustWidth( true ); }

function AdjustWidth( loaded )
{
	if( d.getElementById && (app.indexOf("MSIE 5")==-1) )
	{
		var w   = d.body.clientWidth;
		var h   = d.documentElement.clientHeight;
		var c   = d.getElementById( "container" );
		var cp  = d.getElementById( "content_panel");
		var hp  = d.getElementById( "heading_panel");
		var width;

/*
		if( w < tresholdWidth )
		{
			c.setAttribute( "style", "width: 780px !important" );
			c.style.width = "780px";

		
			if (app.indexOf("MSIE") != -1)
			{				
				width = 780 - wlnp;

				cp.setAttribute( "style", "width: " + width + "px" );
				cp.style.width = width + "px";
			
				hp.setAttribute ("style", "width: " + width + "px" );
				hp.style.width = width + "px";
			}
			wideScreen = false;
		}
		else if( w > tresholdWidth && wideScreen == false )
		{
			c.setAttribute( "style","width: 970px !important" );
			c.style.width = "970px";
			if (app.indexOf("MSIE") != -1)
			{				
				width = 970 - wlnp;
				cp.setAttribute( "style", "width: " + width + "px" );
				cp.style.width = width + "px";
	
	    		hp.setAttribute ("style", "width: " + width + "px" );
				hp.style.width = width + "px";
			}
			wideScreen = true;
		}
*/
		
		c.setAttribute( "style", "height: " + (h - 10)  + "px" ); 
		c.style.height = (h - 10) + "px";

		cp.setAttribute( "style", "height: " + (h - htp - 10) + "px" );
		cp.style.height = (h - htp - 10) + "px";
	}
}

