<!--
// Check all fields
function testallreg(form)
{
 if ( !testsldreg(form) ) return false;
   return true;
}
// Check the sld form
function testsldreg(myfrm)
{
    nome            = myfrm.nome.value;
    cognome         = myfrm.cognome.value;
    indirizzo       = myfrm.indirizzo.value;
    citta           = myfrm.citta.value;
    email           = myfrm.email.value;
    telefono        = myfrm.telefono.value;
 		randcode				= myfrm.randcode.value;

    len_nome        = nome.length;
    len_cognome     = cognome.length;
    len_indirizzo   = indirizzo.length;
    len_citta    = citta.length;
    len_email       = email.length;
    len_telefono    = telefono.length;
 		len_randcode		= randcode.length;

   // fail if nome blank
   if ( len_nome == "" ) {
      alert("\nNon č stato inserito il Nome.");
      myfrm.nome.focus();
      return false;
   }

   // fail if cognome blank
   if ( len_cognome == "" ) {
      alert("\nNon č stato inserito il Cognome.");
      myfrm.cognome.focus();
      return false;
   }

   // fail if indirizzo blank
   if ( len_indirizzo == "" ) {
      alert("\nNon č stato inserito l'Indirizzo.");
      myfrm.indirizzo.focus();
      return false;
   }

   // fail if citta blank
   if ( len_citta == "" ) {
      alert("\nNon č stata inserita la Cittā.");
      myfrm.citta.focus();
      return false;
   }

   // fail if email blank
   if ( len_email == "" ) {
      alert("\nNon č stata inserita l'E-Mail.");
      myfrm.email.focus();
      return false;
   }

   // fail if email not contains any '@'
   if ( email.indexOf('@', 0) == -1) {
      alert("\nIndirizzo E-Mail non corretto.");
      myfrm.email.value = "";
      myfrm.email.focus();
      return false;
   }

   // fail if telefono blank
   if ( len_telefono == "" ) {
      alert("\nNon č stato inserito il numero di Telefono.");
      myfrm.telefono.focus();
      return false;
   }

   // fail if telefono blank
   if ( len_randcode == "" ) {
      alert("\nNon č stato inserito il Codice di Sicurezza.");
      myfrm.randcode.focus();
      return false;
   }
   return true;
}

// -->

