function ChangeTemplateSize(hdFieldWidth) 
{
	var winW;
	var templateWidth;
//	var winH;
	
//	var numOfStyles = document.styleSheets.length;
	
	 if (navigator.appName=="Netscape") 
	 {
		winW = window.innerWidth;
//		winH = window.innerHeight;

		if(winW <= 800)
		{
			templateWidth = 780;				
		}
		else if( winW > 800 && winW <= 1024)
		{				
			templateWidth = winW;
		}
		else if(winWidth > 1024)
		{
			templateWidth = 0;				
		}
		
	//	var numOfStyleSheets = document.styleSheets.length;
	//	document.styleSheets[numOfStyleSheets - 1].cssRules[0].style.setProperty('width', templateWidth, null);
		
	}

	if (navigator.appName.indexOf("Microsoft")!=-1) 
	{
		winW = document.body.offsetWidth;
//		winH = document.body.offsetHeight;

		if(winW <= 800)
		{
			templateWidth = 780;				
		}
		else if( winW > 800 && winW <= 1024)
		{				
			templateWidth = winW;
		}
		else if(winW > 1024)
		{
			templateWidth = 0;				
		}
		
	//	var numOfStyleSheets = document.styleSheets.length;
	//	document.styleSheets[numOfStyleSheets - 1].rules[0].style.width = templateWidth;
		
	}
	
	var hdField = document.getElementById(hdFieldWidth);
	hdField.value = templateWidth;
}

//		How to change style on the fly IE
//		document.styleSheets[0].rules[0].style.width = winW;
//		How to change style on the fly Netscape
//		document.styleSheets[0].cssRules[0].style.setProperty('width', winW, null);
document.onkeydown = function (){
   return !(window.event && window.event.keyCode == 13);
}
