// JavaScript Document

// script modulo informazioni //
function checkFields(theForm)
{
  if (theForm.nome.value == "")
  {
    alert("Inserire un valore per il campo \"Nome\".");
    theForm.nome.focus();
    return (false);
  }
  if (theForm.email.value == "")
  {
    alert("Inserire un valore per il campo \"E-Mail\".");
    theForm.email.focus();
    return (false);
  }
  if (theForm.email.value.length < 6)
  {
    alert("Inserire un indirizzo e-mail valido.");
    theForm.email.focus();
    return (false);
  }
  else if (theForm.email.value.indexOf("@")==-1)
  {
    alert("Inserire un indirizzo e-mail valido.");
    theForm.email.focus();
    return (false);
  }
  else if (theForm.email.value.indexOf(".")==-1)
  {
    alert("Inserire un indirizzo e-mail valido.");
    theForm.email.focus();
    return (false);
  }
    if (theForm.note.value == "")
  {
    alert("Inserire la richiesta nel campo \"Testo\".");
    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);
}

