function showFiglio (codice,imgName) {
			
	altro_el = document.getElementById(codice).style; 
	spanName = document.getElementById(imgName).style;
	
	if(altro_el.display == "") {
		altro_el.display = "none" ;
		spanName.backgroundImage = "url(img/bot_down.gif)" ;
		spanName.backgroundRepeat = "no-repeat" ;
	}else {
		altro_el.display = "" ;
		spanName.backgroundImage = "url(img/bot_up.gif)" ;
		spanName.backgroundRepeat = "no-repeat" ;
	}
}

function showFiglioFaq (codice) {
			
	altro_el = document.getElementById(codice).style; 
	
	if(altro_el.display == "") {
		altro_el.display = "none" ;
	}else {
		altro_el.display = "" ;
	}
}

function showFiglioManager (codice,imgName) {
			
	altro_el = document.getElementById(codice).style; 
	spanName = document.getElementById(imgName).style;
	
	if(altro_el.display == "") {
		altro_el.display = "none" ;
		spanName.backgroundImage = "url(../img/bot_down.gif)" ;
		spanName.backgroundRepeat = "no-repeat" ;
	}else {
		altro_el.display = "" ;
		spanName.backgroundImage = "url(../img/bot_up.gif)" ;
		spanName.backgroundRepeat = "no-repeat" ;
	}
}

function toggleDisplay(fO){

	var ns4 = (document.layers);
	var ie4 = (document.all && !document.getElementById);
	var ie5 = (document.all && document.getElementById);
	var ns6 = (!document.all && document.getElementById);
	
	
	if(ie5 || ns6){
		if (document.getElementById(fO).style.display=="none") {
		document.getElementById(fO).style.display="inline";
		}else{
		document.getElementById(fO).style.display="none";
		}
	}
	
	if(ie4){
		if (document.all[fO].style.display=="none") {
		document.all[fO].style.display="inline";
		}else{
		document.all[fO].style.display="none";
		}
	}	
}


function popup(url_pagina) {

	
	  w = 500;
	  h = 400;
	  l = (screen.width - w) / 2;
	  t = 45;
	
	  wnd = window.open(url_pagina,"","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes, resizable=no, width="+w+", height="+h+", left="+l+", top="+t);
	  wnd.focus();		

}


function popupProd(img) {

	
	  w = 468;
	  h = 390;
	  l = (screen.width - w) / 2;
	  t = (screen.height - h) / 2;
	
	  wnd = window.open("popupprod.php?img="+img,"","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, resizable=no, width="+w+", height="+h+", left="+l+", top="+t);
	  wnd.focus();		

}

function popupProgettazione(id_progettazione) {

	
	  w = 600;
	  h = 321;
	  l = (screen.width - w) / 2;
	  t = (screen.height - h) / 2;
	
	  wnd = window.open("popupprogettazione.php?id_progettazione="+id_progettazione,"","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, resizable=no, width="+w+", height="+h+", left="+l+", top="+t);
	  wnd.focus();		

}

function popupAllestimenti(id) {

	
	  w = 447;
	  h = 370;
	  l = (screen.width - w) / 2;
	  t = (screen.height - h) / 2;
	
	  wnd = window.open("popupallestimenti.php?id_allestimenti="+id,"","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, resizable=no, width="+w+", height="+h+", left="+l+", top="+t);
	  wnd.focus();		

}

function popupmappa() {

	
	  w = 829;
	  h = 344;
	  l = (screen.width - w) / 2;
	  t = (screen.height - h) / 2;
	
	  wnd = window.open("popupmappa.php","","fullscreen=0,channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no, resizable=no, width="+w+", height="+h+", left="+l+", top="+t);
	  wnd.focus();		

}
function riportalocalita(id_regione,id_provincia,id_comune,regione,provincia,comune) {
	
	window.opener.document.form_registrati.id_regione.value=id_regione;
	window.opener.document.form_registrati.id_provincia.value=id_provincia;
	window.opener.document.form_registrati.id_comune.value=id_comune;
	window.opener.document.form_registrati.regione.value=regione;
	window.opener.document.form_registrati.provincia.value=provincia;
	window.opener.document.form_registrati.comune.value=comune;

self.close();
}



/*
 ROLLOVER
*/

if (document.images) {            // Active Images
            pama_HI = new Image();      
            pama_HI.src = "img/botpama_HI.gif";
            pama = new Image(); 
            pama.src = "img/botpama.gif";

            contatto_HI = new Image();      
            contatto_HI.src = "img/botcontatto_HI.gif";
            contatto = new Image(); 
            contatto.src = "img/botcontatto.gif";

            progettazione_HI = new Image();      
            progettazione_HI.src = "img/botprogettazione_HI.gif";
            progettazione = new Image(); 
            progettazione.src = "img/botprogettazione.gif";
            
            produzione_HI = new Image();      
            produzione_HI.src = "img/botproduzione_HI.gif";
            produzione = new Image(); 
            produzione.src = "img/botproduzione.gif";

            allestimento_HI = new Image();      
            allestimento_HI.src = "img/botallestimento_HI.gif";
            allestimento = new Image(); 
            allestimento.src = "img/botallestimento.gif";


    }

// Function to 'activate' images.
function imgOn(imgName) {

	
        if (document.images) {
            document[imgName].src = eval(imgName + "_HI.src");
        }
}

// Function to 'deactivate' images.
function imgOff(imgName) {

	
        if (document.images) {
            document[imgName].src = eval(imgName + ".src");
        }
}



function checkForm() { 	
		var swKO = 0 ;
		
 
		// sezione valida email
		var x = document.form_contatto.email.value;
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (filter.test(x)) {
		//alert('YES! Correct email address');
		} else {
		alert('Indirizzo email inesatto.');
		swKO = 1 ;	
		} 

		
		
		 
		// sezione campi obbligatori
		if (document.form_contatto.nome.value == "" ) {
		alert('Manca il nome.');
		swKO = 1 ;
		}
		if (document.form_contatto.cognome.value == "" ) {
		alert('Manca il cognome.');
		swKO = 1 ;
		}	
		if (document.form_contatto.messaggio.value == "" ) {
		alert('Manca il messaggio.');
		swKO = 1 ;
		}
		if (document.form_contatto.email.value == "" ) {
		alert('Manca l\' email.');
		swKO = 1 ;
		} 
 		if (document.form_contatto.azienda.value == "" ) {
		alert('Manca l\' azienda.');
		swKO = 1 ;
		}
		if (document.form_contatto.telefono.value == "" ) {
		alert('Manca il telefono.');
		swKO = 1 ;
		}
		
		 			
		if (swKO == 1) {
		return false ;	
		}  
		 


}


function checkFormRegistrati() { 	
		var swKO = 0 ;
		
  
		// sezione valida email
		var x = document.form_registrati.email.value;
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (filter.test(x)) {
		//alert('YES! Correct email address');
		} else {
		alert('Indirizzo email inesatto.');
		swKO = 1 ;	
		} 

		 
		// sezione campi obbligatori

		if (document.form_registrati.nome.value == "" ) {
		alert('Manca il nome.');
		swKO = 1 ;
		}
		if (document.form_registrati.cognome.value == "" ) {
		alert('Manca il cognome.');
		swKO = 1 ;
		}	
		if (document.form_registrati.indirizzo.value == "" ) {
		alert('Manca l\' indirizzo.');
		swKO = 1 ;
		}
		if (document.form_registrati.email.value == "" ) {
		alert('Manca l\' email.');
		swKO = 1 ;
		} 
 		if (document.form_registrati.tel.value == "" ) {
		alert('Manca il telefono.');
		swKO = 1 ;
		}
		if (document.form_registrati.login.value == "" ) {
		alert('Manca il login.');
		swKO = 1 ;
		}
		if (document.form_registrati.passwd.value == "" ) {
		alert('Manca la password.');
		swKO = 1 ;
		}		
	
		var the_box = document.form_registrati.autorizzo[1].checked;
		 
		if (the_box == true) {
		alert('Devi accettare la clausola.');
		swKO = 1 ;
		}  	
	 			
		if (swKO == 1) {
		return false ;	
		}  
		 


}