// verifica campi modulo informazioni

function checkFields(theForm)
{
  if (theForm.nome.value == "")
  {
    alert("Inserire un valore per il campo \"NOME\".");
    theForm.nome.focus();
    return (false);
  }
  if (theForm.cognome.value == "")
  {
    alert("Inserire un valore per il campo \"COGNOME\".");
    theForm.cognome.focus();
    return (false);
  }
   if (theForm.email.value == "")
  {
    alert("Inserire un valore per il campo \MAIL\".");
    theForm.email.focus();
    return (false);
  }
  if (theForm.email.value.length < 6)
  {
    alert("L'indirizzo di posta elettronica inserito non e' corretto.");
    theForm.email.focus();
    return (false);
  }
  else if (theForm.email.value.indexOf("@")==-1)
  {
    alert("L'indirizzo di posta elettronica inserito non e' corretto.");
    theForm.email.focus();
    return (false);
  }
  else if (theForm.email.value.indexOf(".")==-1)
  {
    alert("L'indirizzo di posta elettronica inserito non e' corretto.");
    theForm.email.focus();
    return (false);
  }
  if (theForm.note.value == "")
  {
    alert("Inserire un valore per il campo \"MESSAGGIO\".");
    theForm.note.focus();
    return (false);
  }
  if (theForm.privacy.checked == false)
  {
    alert("E' necessario autorizzare il trattamento dei dati personali per poter proseguire.");
    theForm.privacy.focus();
    return (false);
  }
  return (true);
}


