/* form mail */
function form_iscrizione(theForm) {
	
 if (theForm.rif.value == "") {
    alert("Compilare il campo Perosna di riferimento");
    theForm.rif.focus();
    return (false);
  }
 
 
 if (theForm.rag_soc.value == "") {
    alert("Compilare il campo Ragione Sociale");
    theForm.rag_soc.focus();
    return (false);
  }
 
 if (theForm.tipologia.value == "") {
    alert("Compilare il campo Categoria merceologica");
    theForm.tipologia.focus();
    return (false);
  }

if (theForm.piva.value == "") {
    alert("Compilare il campo Partita IVA");
    theForm.piva.focus();
    return (false);
  }

if (isNaN(document.getElementById('piva').value)) {
    alert("il campo Partita IVA richiede SOLO numeri");
    theForm.piva.focus();
    return (false);
  }

if (theForm.tel.value == "") {
    alert("Compilare il campo Telefono");
    theForm.tel.focus();
    return (false);
  }
  
if (isNaN(document.getElementById('tel').value)) {
    alert("il campo Telefono richiede SOLO numeri");
    theForm.tel.focus();
    return (false);
  }

if (theForm.indirizzo.value == "") {
    alert("Compilare il campo Indirizzo sede legale");
    theForm.indirizzo.focus();
    return (false);
  }
  
if (theForm.provincia.value == "") {
    alert("Compilare il campo Provincia");
    theForm.provincia.focus();
    return (false);
  }
      
if (theForm.email.value == "") {
    alert("Compilare il campo altre richieste E-mail");
    theForm.email.focus();
    return (false);
  }
  
if (theForm.email.value.length < 7) {
    alert("L'indirizzo e-mail deve essere di almeno 6 caratteri ");
    theForm.email.focus();
    return (false);
  }
 
if (theForm.email.value.indexOf("@") == -1) {
    alert("l'indirizzo e-mail non contiene il carattere @");
    theForm.email.focus();
    return (false);
  }
 
if (theForm.email.value.indexOf(".") == -1) {
    alert("l'indirizzo e-mail non contiene estensioni");
    theForm.email.focus();
    return (false);
  }


    return (true);
}
