
var strPNGBehaviorURL='/C1256C8A0066623D/0/2DB86CE973CE618EC12572FE00574D17/$file/png.htc';

var intMaxWidth=980;	//css #virtualbody max-width;
var intMinWidth=756; 	//css #virtualbody min-width;
var intPaddingWidth=10+10;	//css #virtualbody padding;

var boolMSIE=(document.all ? true : false);
var boolMSIE7=(boolMSIE && document.documentElement && document.documentElement.currentStyle && typeof(document.documentElement.currentStyle.maxWidth)!='undefined' ? true : false);
var boolBackCompat=(!document.compatMode || document.compatMode.toLowerCase()=='backcompat');

if (boolMSIE && !boolMSIE7) {

	if (boolBackCompat) {
		intMaxWidth+=intPaddingWidth;
		intMinWidth+=intPaddingWidth;
	}

	var strRules=''+

	' #header, #header-nav, #header-functions, #body, #footer {width:100%;}'+ //MSIE6
	' #virtualbody {width:'+intMaxWidth+'px; overflow:hidden;}'+
	' @media print {#virtualbody {width:'+intMinWidth+'px!important;}}'+ //Added 2007-06-27

/*
' .col-right {display:inline-block; float:right; padding-left:1em;}'+
' .col-right-inner {width:100%; padding-left:0em;}'+
*/

/*
//	' .tmt-column {width:100%;}'+
	' .tmt-column-left-float-inner {word-wrap:break-word;}'+
	' .tmt-column-left {display:inline-block; float:left; padding-right:1em;}'+
	' .tmt-column-left-inner {width:100%; margin-right:0em;}'+
	' .tmt-inpageedit .tmt-column-left-inner {width:auto;}'+

	' .tmt-column-right-float-inner {word-wrap:break-word;}'+
	' .tmt-column-right {display:inline-block; float:right; padding-left:1em; }'+
	' .tmt-column-right-inner {width:100%; margin-left:0em;}'+
	' .tmt-inpageedit .tmt-column-right-inner {width:auto;}'+
*/
	' #header-functions-inner {height:0px;}'+
	' #body-inner {height:0px;}'+

	' .sh-news {overflow:hidden; width:100%;}'+
	' .sh-news li {display:inline-block;}'+

	'';

	//if (strPNGBehaviorURL) strRules+=' img {visibility:hidden; behavior:url('+strPNGBehaviorURL+');}';

	if (strRules) {		

		//The editor do not like document.write if the cache has been emptied... (?)
		//We check for the body tag - if it is already parsed we are in the editor and create a new stylesheet instead of document.write...

		if (!document.body) //document.readyState=='loading') 
			document.write('<style type="text/css">'+strRules+'</style>');
		else
			document.createStyleSheet().cssText=strRules;
	}

	if (!window.boolWindowIsInPrintVersionMode) {
		if (window.attachEvent) window.attachEvent('onresize',ResizePageWidth);
		if (document.attachEvent) document.attachEvent('onreadystatechange',ResizePageWidth);
	}
}

function ResizePageWidth() {

	var eltPage=(boolBackCompat ? document.body : document.documentElement);
	if (eltPage && document.getElementById) {

		var eltVirtualBody=document.getElementById('virtualbody');
		if (eltVirtualBody && !eltVirtualBody.parentElement.isContentEditable) {
			var intClientWidth=eltPage.clientWidth-(boolBackCompat ? 0 : intPaddingWidth);
			var intWidth=(intClientWidth>intMaxWidth ? intMaxWidth : intClientWidth<intMinWidth ? intMinWidth : intClientWidth);
			eltVirtualBody.style.width=intWidth+'px';
		}
	}
}
