/* form mail */
function form_servizi(theForm) {

if (theForm.nome.value == "") {
    alert("Compilare il campo Nome");
    theForm.nome.focus();
    return (false);
  }

if (theForm.azienda.value == "") {
    alert("Compilare il campo Azienda");
    theForm.azienda.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.email.value == "") {
    alert("Compilare il campo E-mail");
    theForm.email.focus();
    return (false);
  }
  
if (theForm.email.value.length < 7) {
    alert("L'indirizzo e-mail errato, prego controllare");
    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);
  }

if (theForm.richiesta.value == "") {
    alert("Compilare il campo Richiesta informazioni");
    theForm.richiesta.focus();
    return (false);
  }

    return (true);
}

