<!--

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 cifra caratteri 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\".");
    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.Via.value == "")
  {
    alert("Inserire un valore per il campo \"Via\".");
    theForm.Via.focus();
    return (false);
  }

  if (theForm.Via.value.length < 5)
  {
    alert("Inserire almeno 5 caratteri nel campo \"Via\".");
    theForm.Via.focus();
    return (false);
  }

  if (theForm.Civico.value == "")
  {
    alert("Inserire un valore per il campo \"Civico\".");
    theForm.Civico.focus();
    return (false);
  }

  if (theForm.Civico.value.length < 1)
  {
    alert("Inserire almeno 1 caratteri nel campo \"Civico\".");
    theForm.Civico.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.Civico.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 \"Civico\".");
    theForm.Civico.focus();
    return (false);
  }

  if (theForm.cap.value == "")
  {
    alert("Inserire un valore per il campo \"cap\".");
    theForm.cap.focus();
    return (false);
  }

  if (theForm.cap.value.length < 5)
  {
    alert("Inserire almeno 5 caratteri nel campo \"cap\".");
    theForm.cap.focus();
    return (false);
  }

  if (theForm.cap.value.length > 5)
  {
    alert("Inserire al massimo 5 caratteri nel campo \"cap\".");
    theForm.cap.focus();
    return (false);
  }

  var checkOK = "0123456789-";
  var checkStr = theForm.cap.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 \"cap\".");
    theForm.cap.focus();
    return (false);
  }

  if (theForm.Citta.value == "")
  {
    alert("Inserire un valore per il campo \"Citta\".");
    theForm.Citta.focus();
    return (false);
  }

  if (theForm.Citta.value.length < 5)
  {
    alert("Inserire almeno 5 caratteri nel campo \"Citta\".");
    theForm.Citta.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ \t\r\n\f";
  var checkStr = theForm.Citta.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 spazio caratteri nel campo \"Citta\".");
    theForm.Citta.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 Richiesta Banco Prova',msg)
  return (true);
}
//-->

