
function validateForm()
{
	var ret=true;
	var campo=document.getElementById("Cognome").value;
	var campo2=document.getElementById("Email").value;
	var campo3=document.getElementById("regione").value;
	var campo4=document.getElementById("privacy").checked;
	
	if (campo3==null || campo3=="")
 	{
	  	alert("Prego riempire tutti i campi segnati con (*)\n\nPlease fill all fields marked with (*)");
	  	ret=false;
    }
    else
    {
		if (campo==null || campo=="")
	 	{
		  	alert("Prego riempire tutti i campi segnati con (*)\n\nPlease fill all fields marked with (*)");
		  	ret=false;
	    }
	    else
	    {
			if (campo2==null || campo2=="")
		 	{
			  	alert("Prego riempire tutti i campi segnati con (*)\nPlease fill all fields marked with (*)");
			  	ret=false;
		    }
		    else
		    {
				var atpos=campo2.indexOf("@");
				var dotpos=campo2.lastIndexOf(".");
				if (atpos<1 || dotpos<atpos+2 || dotpos+2>=campo2.length)
	  			{
	  				alert("Attenzione, mail non valida\n\nNot a valid e-mail address");
	  				ret=false;
				}
		    }
	    }
    }
    
    if (ret)
    {
	    if (campo4)
	    {
	    	ret=true;
	    }
	    else
	    {
			alert("Attenzione, manca il consenso alla privacy\n\nPlease accept the privacy statement");
	    	ret=false;
	    }
   }
    
  	return ret;
}
