function esiste(inputValue, inputExpected) {
	var aCharExists=0;
	if (inputValue) {
		for (var i=0; i<inputValue.length; i++) {
			if (inputValue.charAt(i)!=" ") {
				aCharExists = 1
			}
		}
	}
	
	if (!aCharExists) {
		alert("Inserisci "+inputExpected);
	 	
	}
} 

function valida()
{
  oggetto = document.inserisci;
  if ((oggetto.nome.value == ""))
  {
    alert("Inserisci il nome.");
    oggetto.nome.focus();
    return false;
  }


 if ((oggetto.cognome.value == ""))
    {
      alert("Inserisci il cognome.");
      oggetto.cognome.focus();
      return false;
     }

 
  if ((oggetto.indirizzo.value == ""))
      {
        alert("Inserisci il tuo indirizzo.");
        oggetto.indirizzo.focus();
        return false;
  }
  if ((oggetto.citta.value == ""))
        {
          alert("Inserisci la citta'.");
          oggetto.citta.focus();
          return false;
  }
  if ((oggetto.prov.value == ""))
        {
          alert("Inserisci la provincia di appartenenza.");
          oggetto.prov.focus();
          return false;
  }
  if ((oggetto.stato.value == ""))
        {
          alert("Inserisci lo stato.");
          oggetto.stato.focus();
          return false;
  }
  if ((oggetto.telefono1.value == ""))
      {
        alert("Inserisci il numero di telefono.");
        oggetto.telefono1.focus();
        return false;
  }
  
  if ((oggetto.email.value == ""))
  	{
  		alert("Inserisci la tua e-mail.");
  		oggetto.email.focus();
  		return false;
  	}
  	var address = oggetto.email.value;
  	if (address.indexOf("@")<3)
  	{
  		alert("E-mail non valida.")
  		oggetto.email.focus();
  		return false;
	}
  

 
if (!(oggetto.accetto[0].checked)) {
     alert("Il tuo consenso è necessario per procedere.");
            oggetto.accetto[0].focus();
         return false;
   }
}