function controlli(theForm)
{

/**************** NOME ****************/

  if (document.form1.nome.value == "")
  {
    alert("Compilare il campo Nome");
    theForm.nome.focus();
    return (false);
  }
  
/**************** COGNOME ****************/

  if (document.form1.cognome.value == "")
  {
    alert("Compilare il campo Cognome");
    theForm.cognome.focus();
    return (false);
  }

  	
/**************** NASCITA1 ****************/

	if (document.form1.data_nascita1.value == "")
  {
    alert("Selezionare il giorno di nascita");
    theForm.data_nascita1.focus();
    return (false);
  }
  
/**************** NASCITA2 ****************/
  
	if (document.form1.data_nascita2.value == "")
  {
    alert("Selezionare il mese di nascita");
    theForm.data_nascita2.focus();
    return (false);
  }

/**************** NASCITA3 ****************/	

	if (document.form1.data_nascita3.value == "")
  {
    alert("Selezionare l\'anno di nascita");
    theForm.data_nascita3.focus();
    return (false);
  }
  
/**************** tipo_via ****************/

  if(document.form1.indirizzo_tipovia.value == "")
  {
    alert("Compilare interamente il campo indirizzo");
    theForm.indirizzo_tipovia.focus();
    return (false);
  }
  
/**************** indirizzo ****************/  
  
  if(document.form1.indirizzo.value == "") {
	  alert("Compilare interamente il campo indirizzo");
	  theForm.indirizzo.focus();
	  return (false);
  }
  
/**************** N_CIVICO ****************/
  
  if(document.form1.numero_civico.value == "") {
  	  alert("Compilare interamente il campo indirizzo");
	  theForm.numero_civico.focus();
	  return (false);
  }
  
/**************** CAP ****************/

  if (document.form1.CAP.value == "")
  {
    alert("Compilare il campo C.A.P.");
    theForm.CAP.focus();
    return (false);
  }
  
/**************** CITTA ****************/

  if (document.form1.citta.value == "")
  {
    alert("Compilare il campo citta'");
    theForm.citta.focus();
    return (false);
  }
  
/**************** PROVINCIA ****************/

  if (document.form1.provincia.value == "")
  {
    alert("Compilare il campo provincia");
    theForm.provincia.focus();
    return (false);
  }

/**************** TELEFONO ***************/

/*
  	if (document.form1.prefisso_t.value == "")
  {
    alert("Compilare il campo Telefono");
    theForm.prefisso_t.focus();
    return (false);
  }
  
  if (document.form1.numero_t.value == "")
  {
    alert("Compilare il campo Telefono");
    theForm.numero_t.focus();
    return (false);
  }

  var checkOK = "0123456789 ";
  var checkStr = theForm.prefisso_t.value;
  var valido = 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)
    {
      valido = false;
      break;
    }
  }
  
  if (!valido)
  {
    alert("Inserire solo numeri nel campo Prefisso Telefono");
    theForm.prefisso_t.focus();
    return (false);
  }
		
  var checkOK = "0123456789 ";
  var checkStr = theForm.numero_t.value;
  var valido = 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)
    {
      valido = false;
      break;
    }
  }
  
  if (!valido)
  {
    alert("Inserire solo numeri nel campo Telefono");
    theForm.numero_t.focus();
    return (false);
  }
  */
  
/**************** E-MAIL ****************/		  

  if (document.form1.email_id.value == "")
  {
    alert("Compilare il campo e-mail");
    theForm.email_id.focus();
    return (false);
  }
  
	if (document.form1.email_dominio.value == "")
  {
    alert("Compilare il campo e-mail");
    theForm.email_dominio.focus();
    return (false);
  }
	
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-_@. \t\r\n\f";
  var checkStr = theForm.email_id.value;
  var valido = 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)
    {
      valido = false;
      break;
    }
  }
  
  if (!valido)
  {
    alert("Inserire solo lettere, numeri, whitespace e i caratteri \"@\" e \".\" nel campo e-mail");
    theForm.email_id.focus();
    return (false);
  }
 
 
  if (!valido)
  {
    alert("Indirizzo E-Mail non valido");
    theForm.email_id.focus();
    return (false);
  }
	
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ0123456789-_@. \t\r\n\f";
  var checkStr = theForm.email_dominio.value;
  var valido = 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)
    {
      valido = false;
      break;
    }
  }
  if (!valido)
  {
    alert("Inserire solo lettere, numeri, whitespace e i caratteri \"@\" e \".\" nel campo e-mail");
    theForm.email_dominio.focus();
    return (false);
  }
 
 
  if (!valido)
  {
    alert("Indirizzo E-Mail non valido");
    theForm.email_dominio.focus();
    return (false);
  }

/*************** CONTATTI ***************/

  if ((document.form1.numero_f.value == "")&&(document.form1.canale.value == "Fax")) 
  {
    alert("Se si desidera essere contattati via fax è necessario compilare il campo Fax");
    theForm.prefisso_f.focus();
    return (false);
  }
	
	if ((document.form1.numero_c.value == "")&&(document.form1.canale.value == "SMS"))
  {
    alert("Se si desidera essere contattati via sms è necessario compilare il campo Cellulare");
    theForm.prefisso_c.focus();
    return (false);
  }
  

return confirm('Invio i dati?')

}