function infoValidator(theForm)
{
  if (theForm.from.value.length < 1)
  {
    alert("Specificare il periodo di interesse \"Da quando\".");
    theForm.from.focus();
    return (false);
  }
  
  if (theForm.to.value.length < 1)
  {
    alert("Specificare il periodo di interesse \"..a quando\".");
    theForm.to.focus();
    return (false);
  }

  if (theForm.firstname.value == "")
  {
    alert("Inserire un valore per il campo \"Nome\".");
    theForm.firstname.focus();
    return (false);
  }

  if (theForm.firstname.value.length < 3)
  {
    alert("Inserire almeno 3 caratteri nel campo \"Nome\".");
    theForm.firstname.focus();
    return (false);
  }

  if (theForm.firstname.value.length > 20)
  {
    alert("Inserire al massimo 20 caratteri nel campo \"Nome\".");
    theForm.firstname.focus();
    return (false);
  }
  
  if (theForm.lastname.value == "")
  {
    alert("Inserire un valore per il campo \"Cognome\".");
    theForm.lastname.focus();
    return (false);
  }

  if (theForm.lastname.value.length < 2)
  {
    alert("Inserire almeno 2 caratteri nel campo \"Cognome\".");
    theForm.lastname.focus();
    return (false);
  }

  if (theForm.lastname.value.length > 30)
  {
    alert("Inserire al massimo 30 caratteri nel campo \"Cognome\".");
    theForm.lastname.focus();
    return (false);
  }
  
  if (theForm.email.value == "")
  {
    alert("Inserire un valore per il campo \"email\".");
    theForm.email.focus();
    return (false);
  }

  if (theForm.email.value.length < 6)
  {
    alert("Inserire almeno 6 caratteri nel campo \"email\".");
    theForm.email.focus();
    return (false);
  }

  if (theForm.email.value.length > 50)
  {
    alert("Inserire al massimo 50 caratteri nel campo \"email\".");
    theForm.email.focus();
    return (false);
  }
  
  if (theForm.r_email.value != theForm.email.value)
  {
    alert("I due valori Email non coincidono.");
    theForm.r_email.focus();
    return (false);
  }

  if (theForm.phone.value.length > 20)
  {
    alert("Inserire al massimo 20 caratteri nel campo \"telefono\".");
    theForm.phone.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.phone.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Inserire un numero valido nel campo \"telefono\".");
    theForm.phone.focus();
    return (false);
  }

   if (theForm.question.value.length > 100)
  {
    alert("Inserire al massimo 100 caratteri nel campo \"domanda\".");
    theForm.question.focus();
    return (false);
  }
  
  var chkVal = theForm.phone.value;
  var prsVal = chkVal;
  if (chkVal != "" && !(prsVal > 0))
  {
    alert("Inserire un numero valido nel campo \"telefono\".");
    theForm.phone.focus();
    return (false);
  }

  if (theForm.howyouknow.selectedIndex == 0 && theForm.howyouknowother.value.length < 1)
  {
    alert("Ti chiediamo di comunicarci come hai conosciuto il nostro sito prima di procedere.");
    theForm.howyouknow.focus();
    return (false);
  }

  var maxOptions = theForm.howyouknow.length - 1;

  if (theForm.howyouknow.selectedIndex == maxOptions  && theForm.howyouknowother.value.length < 1)
  {
	 alert("Hai selezionato \"Altro (specificare)\" .Prego specificare.");
	 theForm.howyouknowother.focus();
	 return (false);
  }

  return (true);
}
