 function Modulo() {
     // Variabili associate ai campi del modulo
     var nome = document.modulo.nome.value;
     var cognome = document.modulo.cognome.value;
     var email = document.modulo.email.value;
     var azienda = document.modulo.azienda.value;
     var telefono = document.modulo.telefono.value;
     var note = document.modulo.note.value;
    //Espressione regolare del telefono
     var telefono_reg_expr = /^\d{0,30}\/?\d{0,30}$/;
    // Espressione regolare dell'email
     var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
     

      //Effettua il controllo sul campo NOME
       if ((nome == "") || (nome == "undefined")) {
           alert("Il campo Nome e' obbligatorio.");
           document.modulo.nome.focus();
           return false;
        }

        //Effettua il controllo sul campo COGNOME
       if ((cognome == "") || (cognome == "undefined")) {
           alert("Il campo Cognome e' obbligatorio.");
           document.modulo.cognome.focus();
           return false;
        }
       
         //Effettua il controllo sul campo EMAIL
        if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) {
           alert("Inserire un indirizzo email corretto.");
           document.modulo.email.select();
           return false;
        }
   
        //Effettua il controllo sul campo ENTE/AZIENDA
        if ((azienda == "") || (azienda == "undefined")) {
           alert("Il campo Ente/Azienda e' obbligatorio.");
           document.modulo.azienda.focus();
           return false;
        }
        
         //Effettua il controllo sul campo TELEFONO
        if ((!telefono_reg_expr.test(telefono)) || (telefono == "") || (telefono == "undefined")) {
           alert("Il campo Telefono deve essere numerico.");
           document.modulo.telefono.focus();
           return false;
        }
           
         //Effettua il controllo sul campo NOTE
        if ((note == "") || (note == "undefined")) {
           alert("Il campo Note deve contenere una richiesta di informazioni.");
           document.modulo.note.focus();
           return false;
        } 
       
        else {
           document.modulo.action = "index.php?page=pagine/domanda_inviata&menu=menucontatti&corpodestro=pagine/informazionidestra&type=a";
           document.modulo.submit();
        }
  } 

