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));
}

var 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){};
})();

/*//////////////////////////////////////////////////////////////////////////////////////*/
var 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);
}






/*//////////////////////////////////////////////////////////////////////////////////////*/
function ShowHide(elem){
	if(document.getElementById){
	var el = document.getElementById(elem);
		if(el.style.display != "block"){
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}





 ///////////////////////////////////////////////////////////////////////////////////
 // MOSTRA/NASCONDI MENU VARIANTI
 ///////////////////////////////////////////////////////////////////////////////////

function show_hide_varianti(){
	if(document.getElementById){
		if(document.getElementById("menu_varianti").style.display != "block"){
			document.getElementById("menu_varianti").style.display = "block";
			document.getElementById("tasto_varianti_show").style.display = "none";
			document.getElementById("tasto_varianti_hide").style.display = "block";
		}else{
			document.getElementById("menu_varianti").style.display = "none";
			document.getElementById("tasto_varianti_show").style.display = "block";
			document.getElementById("tasto_varianti_hide").style.display = "none";
		}
	}
}




/*//////////////////////////////////////////////////////////////////////////////////////*/

var fotoPrecedente="foto_00";

// Funzione per l'accensione di un livello (con spegnimento del precedente)
function mostraFoto (dopo) {
	scambiaFoto (dopo,fotoPrecedente);
	fotoPrecedente = dopo;
}

// Funzione per scambia la visibilità delle foto
function scambiaFoto(dopo, prima) { 
//alert(dopo);
//alert(prima);
	if (prima != '') {
		if (document.getElementById) 
		{ 
			document.getElementById(prima).style.display='none'; 
		} 
	}
	if (dopo != '') {
		if (document.getElementById) 
		{ 
			document.getElementById(dopo).style.display='block'; 
		} 
	}
}

/*//////////////////////////////////////////////////////////////////////////////////////*/

var layerPrecedente="sottomenu1";
var linkPrecedente="linkattivo1";

// Funzione per l'accensione di un livello (con spegnimento del precedente)
function accendiMenu (dopo,dopoLink) {

	Scambia (dopo,layerPrecedente,dopoLink,linkPrecedente);
	layerPrecedente = dopo;
	linkPrecedente = dopoLink;
}


// Funzione per scambia la visibilità delle foto
function Scambia(dopo, prima, dopoLink, primaLink) 
{ 
if (prima != '') {
	if (document.getElementById) 
	{ 
	document.getElementById(prima).style.visibility='hidden'; 
	document.getElementById(prima).style.display='none'; 
	} 
}
if (dopo != '') {
	if (document.getElementById) 
	{ 
	document.getElementById(dopo).style.visibility='visible'; 
	document.getElementById(dopo).style.display='block'; 
	} 
}

if (primaLink != '') {
	if (document.getElementById) 
	{ 
	document.getElementById(primaLink).className="";
	} 
}
if (dopoLink != '') {
	if (document.getElementById) 
	{ 
	document.getElementById(dopoLink).className="attivo";
	} 
}


}



/*// ANTI-SPAM ////////////////////////////////////////////////////////////////////////////////////*/
function DisplayMail(Server, Login, Display){
if ((Display.length == 0) || (Display.indexOf('@')+1)) {
document.write("<a href=" + "'mai" + "lto:" + Login + "@" + Server + "'>" + Login + "@" + Server + "</a>"); }
else {
document.write("<a href=" + "'mai" + "lto:" + Login + "@" + Server + "'>" + Display + "</a>"); }
}