function hide_button(){
 document.getElementById('Invia').style.display='none';
}
function agree(){
 var IE=(window.navigator.userAgent.indexOf('MSIE')>-1)?1:0; 
 if (document.getElementById('frm_agree').checked){
  document.getElementById('Invia').style.display=(IE)?'block':'block';
 }else{
  document.getElementById('Invia').style.display='none';
 }
}
function inizio(){
  document.getElementById('frm_agree').checked=false;
 }
///////////////////////////////////////////////////////////////////
function printpage() {
	window.print();  
}
///////////////////////////////////////////////////////////////////
function change(img){
	document.images["photo"].src = img;
}
////////////////////////////////////////////////////////////////////

var putItThere = null; 

var chasm = screen.availWidth;
var mount = screen.availHeight;


var w = 0;
var h = 0;


function deadCenter(u,w,h) {
  putItThere = window.open(u,'posB','width=' + w + ',height=' + h + ',left=' + ((chasm - w - 10) * .5) + ',top=' + ((mount - h - 10) * .5));
}

pagina=null;
function apri (url,w,h,x,y){
if (pagina != null)
	pagina.close();
	pagina=window.open(url,null,"fullscreen=no,status=no,resizable=yes,toolbar=no,scrollbars=yes,width="+w+",height="+h+",top="+x+",left="+y);
}
//////////////////////////////////////////////////////////////////////
(function(){

	/*Use Object Detection to detect IE6*/
	var  m = document.uniqueID /*IE*/
	&& document.compatMode  /*>=IE6*/
	&& !window.XMLHttpRequest /*<=IE6*/
	&& document.execCommand ;
	
	try{
		if(!!m){
			m("BackgroundImageCache", false, true) /* = IE6 only */ 
		}
		
	}catch(oh){};
})();

/*//////////////////////////////////////////////////////////////////////////////////////*/
pagina=null;
function apriPopup(url,w,h){
	x=screen.width/2-w/2;
	y=screen.height/2-h/2;
	if (pagina != null)
		pagina.close();
	pagina=window.open(url,"","fullscreen=no,status=no,toolbar=no,scrollbars=yes,width="+w+",height="+h+",top="+y+",left="+x);
}




 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLA LA DIMENSIONE DELLO SCHERMO
 ///////////////////////////////////////////////////////////////////////////////////
 
 // getBrowserWidth is taken from The Man in Blue Resolution Dependent Layout Script
// http://www.themaninblue.com/experiment/ResolutionLayout/
	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 browserHeight = getBrowserHeight();
	var mioDiv="container";
	var idbody="container";
	//change CSS Height
	if (browserHeight < 521){
		// 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'; 
		} 
	}
	if (browserHeight > 521){
		// 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);

//////////////////////////////////////////////////////////////////////////////////////





 ///////////////////////////////////////////////////////////////////////////////////
 // CONTROLLA LA DIMENSIONE DELLO SCHERMO
 ///////////////////////////////////////////////////////////////////////////////////

function show_hide_misure(){
	if(document.getElementById){
		if(document.getElementById("box_misure").style.display != "block"){
			document.getElementById("box_misure").style.display = "block";
			document.getElementById("misure_show").style.display = "none";
			document.getElementById("misure_hide").style.display = "block";
		}else{
			document.getElementById("box_misure").style.display = "none";
			document.getElementById("misure_show").style.display = "block";
			document.getElementById("misure_hide").style.display = "none";
		}
	}
}