 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLA LA DIMENSIONE DELLO SCHERMO
 ///////////////////////////////////////////////////////////////////////////////////
 
 // getBrowserWidth is taken from The Man in Blue Resolution Dependent Layout Script
// http://www.themaninblue.com/experiment/ResolutionLayout/
	function getBrowserWidth(){
		if (window.innerWidth){
			return window.innerWidth;}	
		else if (document.documentElement && document.documentElement.clientWidth != 0){
			return document.documentElement.clientWidth;	}
		else if (document.body){return document.body.clientWidth;}		
			return 0;
	}
	function getBrowserHeight(){
		if (window.innerHeight){
			return window.innerHeight;}	
		else if (document.documentElement && document.documentElement.clientHeight != 0){
			return document.documentElement.clientHeight;	}
		else if (document.body){return document.body.clientHeight;}		
			return 0;
	}
// dynamicLayout by Kevin Hale
function dynamicLayout(){
	var browserWidth = getBrowserWidth();
	var browserHeight = getBrowserHeight();
	var mioDiv="centra";
	//change CSS Height
	if ((browserWidth < 983)||(browserHeight < 700)){
		// Explorer 
		if(document.all) 
		{ 
		//alert("browserHeight");
		document.all[mioDiv].style.position='relative'; 
		document.all[mioDiv].style.margin='0 auto'; 
		document.all[mioDiv].style.top='0px'; 
		document.all[mioDiv].style.left='0px'; 
		} 
		//netscape 4.73 
		if (document.layers) 
		{
		//alert("browserHeight");
		document.layers(mioDiv).style.position='relative'; 
		document.layers(mioDiv).style.margin='0 auto'; 
		document.layers(mioDiv).style.top='0px'; 
		document.layers(mioDiv).style.left='0px'; 
		} 
		//netscape 7.1 
		if (document.getElementById) 
		{ 
		//alert(browserHeight);
		document.getElementById(mioDiv).style.position='relative'; 
		document.getElementById(mioDiv).style.margin='0 auto'; 
		document.getElementById(mioDiv).style.top='0px'; 
		document.getElementById(mioDiv).style.left='0px'; 
		} 
	} else if ((browserWidth > 983)||(browserHeight > 700)){
		// Explorer 
		if(document.all) 
		{ 
		//alert("browserHeight");
		document.all[mioDiv].style.position=''; 
		document.all[mioDiv].style.margin=''; 
		document.all[mioDiv].style.top=''; 
		document.all[mioDiv].style.left=''; 
		} 
		//netscape 4.73 
		if (document.layers) 
		{
		//alert("browserHeight");
		document.layers(mioDiv).style.position=''; 
		document.layers(mioDiv).style.margin=''; 
		document.layers(mioDiv).style.top=''; 
		document.layers(mioDiv).style.left=''; 
		} 
		//netscape 7.1 
		if (document.getElementById) 
		{ 
		//alert(browserHeight);
		document.getElementById(mioDiv).style.position=''; 
		document.getElementById(mioDiv).style.margin=''; 
		document.getElementById(mioDiv).style.top=''; 
		document.getElementById(mioDiv).style.left=''; 
		} 
	}
}
//addEvent() by John Resig
function addEvent( obj, type, fn ){ 
   if (obj.addEventListener){ 
	  obj.addEventListener( type, fn, false );
   }
   else if (obj.attachEvent){ 
	  obj["e"+type+fn] = fn; 
	  obj[type+fn] = function(){ obj["e"+type+fn]( window.event ); } 
	  obj.attachEvent( "on"+type, obj[type+fn] ); 
   } 
} 
//Run dynamicLayout function when page loads and when it resizes.
addEvent(window, 'load', dynamicLayout);
addEvent(window, 'resize', dynamicLayout);