
  function Modulo() {
     // Variabili associate ai campi del modulo
     var nome = document.modulo.nome.value;
     var cognome = document.modulo.cognome.value;
     var telefono = document.modulo.telefono.value;
     var email = document.modulo.email.value;
     var commento = document.modulo.commento.value;
     // 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 è obbligatorio.");
           document.modulo.nome.focus();
           return false;
        }
        //Effettua il controllo sul campo COGNOME
        else if ((cognome == "") || (cognome == "undefined")) {
           alert("Il campo Cognome è obbligatorio.");
           document.modulo.cognome.focus();
           return false;
        }
        //Effettua il controllo sul campo TELEFONO
        else if ((isNaN(telefono)) || (telefono == "") || (telefono == "undefined")) {
           alert("Il campo Telefono è numerico ed obbligatorio.");
           document.modulo.telefono.value = "";
           document.modulo.telefono.focus();
           return false;
        }
        else 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 COMMENTO
        else if ((commento == "") || (commento == "undefined") || (commento.indexOf("Inserisci qui il tuo commento!") != (-1))) {
           alert("Il campo Commento è obbligatorio.");
           document.modulo.commento.focus();
           return false;
        }
        //INVIA IL MODULO
        else {
           document.modulo.action = "contatti.asp";
           document.modulo.submit();
        }
  }


