<!--

function Modulo() {

var cognome = document.modulo.cognome.value;
var nome = document.modulo.nome.value;
var nato_a = document.modulo.nato_a.value;
var gg = document.modulo.gg.value;
var mm = document.modulo.mm.value;
var aa = document.modulo.aa.value;
var cod_fiscale = document.modulo.cod_fiscale.value;
var citta = document.modulo.citta.value;
var prov = document.modulo.prov.options[document.modulo.prov.selectedIndex].value;
var indirizzo = document.modulo.indirizzo.value;
var cap = document.modulo.cap.value;
var fisso = document.modulo.fisso.value;
var mobile = document.modulo.mobile.value;
var fax = document.modulo.fax.value;
var email = document.modulo.email.value;
var password = document.modulo.password.value;
var societa = document.modulo.societa.value;

var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
var cod_fiscale_reg_exp = /^[a-zA-Z]{6}\d{2}[a-zA-Z]\d{2}[a-zA-Z]\d{3}[a-zA-Z]$/;



if ((cognome == "") || (cognome == "undefined")) {
   alert("Il campo Cognome è obbligatorio.");
   document.modulo.cognome.focus();
   return false;
}


else if ((nome == "") || (nome == "undefined")) {
   alert("Il campo Nome è obbligatorio.");
   document.modulo.nome.focus();
   return false;
}


else if ((citta == "") || (citta == "undefined")) {
   alert("Il campo Città è obbligatorio.");
   document.modulo.citta.focus();
   return false;
}



else if ((prov == "") || (prov == "undefined") || (prov == "Null")) {
   alert("Il campo Provincia è obbligatorio.");
   document.modulo.prov.focus();
   return false;
}


else if ((indirizzo == "") || (indirizzo == "undefined") || (indirizzo == "Null")) {
   alert("Il campo Indirizzo è obbligatorio.");
   document.modulo.indirizzo.focus();
   return false;
}


else if ((cap == "") || (cap == "undefined") || (cap.length < 5) || (isNaN(cap))) {
   alert("Il campo Cap è obbligatorio, di 5 caratteri e numerico.");
   document.modulo.cap.focus();
   return false;
}




else if ((gg == "") || (gg == "undefined") || (gg.length > 2) || (gg.length < 2) || (isNaN(gg))) {
   alert("Il campo Data di Nascita è obbligatorio e numerico. formato: xx/xx/xxxx");
   document.modulo.gg.focus();
   return false;
}


else if ((mm == "") || (mm == "undefined") || (mm.length > 2) || (mm.length < 2) || (isNaN(mm))) {
   alert("Il campo Data di Nascita è obbligatorio e numerico. formato: xx/xx/xxxx");
   document.modulo.mm.focus();
   return false;
}


else if ((aa == "") || (aa == "undefined") || (aa.length > 4) || (aa.length < 4) || (isNaN(aa))) {
   alert("Il campo Data di Nascita è obbligatorio. formato: xx/xx/xxxx");
   document.modulo.aa.focus();
   return false;
}



else if (((!cod_fiscale == "")  || (cod_fiscale == "") || (cod_fiscale == "undefined")) && (!cod_fiscale_reg_exp.test(cod_fiscale))) {
          alert("Codice Fiscale non corretto.");
           document.modulo.cod_fiscale.focus();
           return false;
        }




else if ((fisso == "") || (fisso == "undefined") || (fisso.length < 7) || (fisso.length > 15)) {
   alert("Inserire un recapito Telefonico Fisso.");
   document.modulo.fisso.focus();
   return false;
}



else if (((!email == "")  || (email == "") || (email == "undefined")) && (!email_reg_exp.test(email))) {
          alert("Inserire un indirizzo email corretto.");
           document.modulo.email.focus();
           return false;
        }




else if ((password == "") || (password == "undefined") || (password.length < 6) || (password.length > 10)) {
   alert("Il campo Password è obbligatorio e compreso tra 6 e 10 caratteri.");
   document.modulo.password.focus();
   return false;
}



       //INVIA IL MODULO
        else {
           document.modulo.action = "registrazione_utente.asp";
           document.modulo.submit();
        }



 }




 //-->






