<!--
function Valida(theForm)
{

// controllo campo Nome

  if (theForm.Nome.value == "")
  {
    alert("Inserire un valore per il campo \"Richiedente\".");
    theForm.Nome.focus();
    return (false);
  }

  if (theForm.Nome.value.length < 3)
  {
    alert("Inserire almeno 3 caratteri nel campo \"Richiedente\".");
    theForm.Nome.focus();
    return (false);
  }

  var checkOK = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ";
  var checkStr = theForm.Nome.value;
  var allValid = 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 solo lettera caratteri nel campo \"Richiedente\".");
    theForm.Nome.focus();
    return (false);
  }


  if (theForm.Telefono.value == "")
  {
    alert("Inserire un valore per il campo \"Telefono\".");
    theForm.Telefono.focus();
    return (false);
  }

  if (theForm.Telefono.value.length < 6)
  {
    alert("Inserire almeno 6 caratteri nel campo \"Telefono\".");
    theForm.Telefono.focus();
    return (false);
  }

  if (theForm.Telefono.value.length > 11)
  {
    alert("Inserire al massimo 11 caratteri nel campo \"Telefono\".");
    theForm.Telefono.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.Telefono.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Inserire solo cifra caratteri nel campo \"Telefono\".");
    theForm.Telefono.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 < 5)
  {
    alert("Inserire almeno 5 caratteri nel campo \"email\".");
    theForm.email.focus();
    return (false);
  }

  var chkVal = theForm.email.value;
  var prsVal = chkVal;
  if (chkVal != "" && !(prsVal != "<"))
  {
    alert("Inserire un valore diverso da \"<\" nel campo \"email\".");
    theForm.email.focus();
    return (false);
  }

  if (theForm.Contratto.value == "")
  {
    alert("Inserire un valore per il campo \"Contratto\".");
    theForm.Contratto.focus();
    return (false);
  }

  if (theForm.Contratto.value.length < 6)
  {
    alert("Inserire almeno 6 caratteri nel campo \"Contratto\".");
    theForm.Contratto.focus();
    return (false);
  }

  if (theForm.Contratto.value.length > 11)
  {
    alert("Inserire al massimo 11 caratteri nel campo \"Contratto\".");
    theForm.Contratto.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-";
  var checkStr = theForm.Contratto.value;
  var allValid = 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 solo lettera e cifra caratteri nel campo \"Contratto\".");
    theForm.Contratto.focus();
    return (false);
  }

  if (theForm.M_aziendale.value == "")
  {
    alert("Inserire un valore per il campo \"M_aziendale\".");
    theForm.M_aziendale.focus();
    return (false);
  }

  if (theForm.M_aziendale.value.length < 11)
  {
    alert("Inserire almeno 11 caratteri nel campo \"M_aziendale\".");
    theForm.M_aziendale.focus();
    return (false);
  }

  if (theForm.M_aziendale.value.length > 11)
  {
    alert("Inserire al massimo 11 caratteri nel campo \"M_aziendale\".");
    theForm.M_aziendale.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.M_aziendale.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Inserire solo cifre nel campo \"M_aziendale\".");
    theForm.M_aziendale.focus();
    return (false);
  }

  var chkVal = allNum;
  var prsVal = parseInt(allNum);
  if (chkVal != "" && !(prsVal >= "30000000000"))
  {
    alert("Inserire un valore maggiore o uguale a \"30000000000\" nel campo \"M_aziendale\".");
    theForm.M_aziendale.focus();
    return (false);
  }

  if (theForm.Matricola.value == "")
  {
    alert("Inserire le ultime 6 cifre della matricola del suo contatore \"Matricola\". Inserire le ultime sei cifre della matricola");
    theForm.Matricola.focus();
    return (false);
  }

  if (theForm.Matricola.value.length < 6)
  {
    alert("Inserire almeno 6 caratteri nel campo \"Matricola\". Inserire le ultime sei cifre della matricola");
    theForm.Matricola.focus();
    return (false);
  }

  if (theForm.Matricola.value.length > 6)
  {
    alert("Inserire al massimo 6 caratteri nel campo \"Matricola\". Inserire le ultime sei cifre della matricola");
    theForm.Matricola.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.Matricola.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("Inserire solo cifra caratteri nel campo \"Matricola\".");
    theForm.Matricola.focus();
    return (false);
  }

  var chkVal = allNum;
  var prsVal = parseInt(allNum);
  if (chkVal != "" && !(prsVal != "0"))
  {
    alert("Inserire un valore diverso da \"0\" nel campo \"Matricola\".");
    theForm.Matricola.focus();
    return (false);
  }

  if (theForm.Lettura.value == "")
  {
    alert("Inserire un valore per il campo \"Lettura contatore acqua\".");
    theForm.Lettura.focus();
    return (false);
  }

  if (theForm.Lettura.value.length < 1)
  {
    alert("Inserire almeno 1 caratteri nel campo \"Lettura contatore acqua\".");
    theForm.Lettura.focus();
    return (false);
  }

  if (theForm.Lettura.value.length > 6)
  {
    alert("Inserire al massimo 6 caratteri nel campo \"Lettura contatore acqua\".");
    theForm.Lettura.focus();
    return (false);
  }

  var checkOK = "0123456789-.";
  var checkStr = theForm.Lettura.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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 (ch != ".")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Inserire solo cifra caratteri nel campo \"Lettura contatore acqua\".");
    theForm.Lettura.focus();
    return (false);
  }

// prepara la risposta

  msg="<p class='rosso16'><b>Gentile "+theForm.Nome.value+",<br>grazie per aver richiesto i nostri servizi!</font></p>"
  PopIt('Conferma Dati Autolettura',msg)
  return (true);
}
//-->

