function apri_finestra(percorso,modalita){
switch (modalita){
 case 1 : //popup opzioni email
	window.open(percorso,"","width=380,height=400,scrollbars=0,status=0");
	break;	
 case 2 : //popup zoom prodotti
	window.open(percorso,"prodotti","width=520,height=450,scrollbars=1,status=0");
	break;
 case 3 : //popup cartina
	window.open(percorso,"prodotti","width=796,height=426,scrollbars=0,status=0");
	break;
 case 4 : //popup cartina 2
	window.open(percorso,"prodotti","width=350,height=371,scrollbars=0,status=0");
	break;
 case 5 : //popup mostra
	window.open(percorso,"prodotti","width=600,height=450,scrollbars=1,status=0");
	break;
 }
}

function verifica_semplice_textbox(form, element){
var elemento = eval('form.' + element);
if (elemento.value==""){
 alert("ATTENZIONE: Occorre che il campo non sia vuoto!!!");}
else{
 form.submit();
 }
}

function verifica_popup_email(form){
if ((form.txt_nome_mittente.value=="") || (form.txt_nome_destinatario.value=="") || (form.txt_email.value=="")){
 alert("ATTENZIONE: Occorre riempire tutti i campi per inviare l'email");}
else{
 form.submit();
 }
}

function verifica_popup_email_usa(form){
if ((form.txt_nome_mittente.value=="") || (form.txt_nome_destinatario.value=="") || (form.txt_email.value=="")){
 alert("ATTENTION: Please fill in all the fields, in order to send the e-mail");}
else{
 form.submit();
 }
}

activateMenu = function(nav) {

/* currentStyle restricts the Javascript to IE only */
	if (document.all &&
 		document.getElementById(nav).currentStyle) {  
        var navroot = document.getElementById(nav);
        
        /* Get all the list items within the menu */

        var lis=navroot.getElementsByTagName("LI");  
        for (i=0; i<lis.length; i++) {
        
           /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
            
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {	
                
                   /* display the inner menu */
                   this.lastChild.style.display="block";
                }
                lis[i].onmouseout=function() {   
                   this.lastChild.style.display="none";
                }
            }
        }
    }
}
window.onload= function(){
    /* pass the function the id of the top level UL */

    /* remove one, when only using one menu */
    activateMenu('vertnav'); 
    // activateMenu('vertnav'); 
}