function FrontPage_Form1_Validator(theForm)
{
	
	
	if (theForm.ultinfo[0].checked==false) 
	{
	alert("Impossibile proseguire: non hai dato il consenso al trattamento dei dati personali.");
	return (false);
	}
	
    
	 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.profilo.selectedIndex < 0)
  {
    alert("Selezionare una delle opzioni di \"Profilo\".");
    theForm.profilo.focus();
    return (false);
  }

  	if (theForm.profilo.selectedIndex == 0)
  {
    alert("La prima opzione di \"Profilo\" non è una selezione valida. Scegliere un'altra opzione.");
    theForm.profilo.focus();
    return (false);
  }
  
  function isEmail(string) 
	{

    if (string.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) != -1)

        return 1;
	else
        return 0;
	}
	
	if (theForm.Email.value.length > 0 && isEmail(theForm.Email.value) == 0) 
		{
		alert("Inserire un valore valido per il campo \"E-mail\".");
		theForm.Email.focus();
		return (false);
		}
  
     if (theForm.Email.value == "")
  {
    alert("Inserire un valore per il campo \"Email\".");
    theForm.Email.focus();
    return (false);
  }
  
  if (theForm.prov.selectedIndex < 0)
  {
    alert("Selezionare una delle opzioni di \"Provincia\".");
    theForm.prov.focus();
    return (false);
  }

  	if (theForm.prov.selectedIndex == 0)
  {
    alert("La prima opzione di \"Provincia\" non è una selezione valida. Scegliere un'altra opzione.");
    theForm.prov.focus();
    return (false);
  }

    if (theForm.user.value == "")
  {
    alert("Inserire un valore per il campo \"User\".");
    theForm.user.focus();
    return (false);
  }
  
     if (theForm.password.value == "")
  {
    alert("Inserire un valore per il campo \"Password\".");
    theForm.password.focus();
    return (false);
  }  
	  if (theForm.password.value.length < 6) 
  {
    alert("Inserire almeno 6 caratteri nel campo \"Password\".");
    theForm.password.focus();
    return (false);
  }
    	if (theForm.password.value.length > 20) 
  {
    alert("Inserire massimo 20 caratteri nel campo \"Password\".");
    theForm.password.focus();
    return (false);
  }
	    if (theForm.VeraPass.value != theForm.password.value) 
  {
    alert("Password non corrispondente.");
	theForm.password.value=""
	theForm.VeraPass.value=""
    theForm.password.focus();
    return (false);
  }
   if (theForm.checkdiz.checked == true || theForm.checkwebusa.checked == true || theForm.checkform.checked == true) 
  {
  			if (theForm.Bollettini.value == "")
				{
    alert("Hai aderito a uno dei servizi in e-mail senza specificare \"E-mail\".");
    theForm.Bollettini.focus();
    return (false);
				}
  }
  
  return (true);
}
