
	function  validate(sx) 
		{ 
	  		 if ((sx==4)&&(document.frm['consenso'].checked != true))
				{
				alert('ATTENTION!\n\nIt was not given consent for the processing of personal data.');
				return false;
				}
		with(document.forms.frm) 
		{	
		if  (cognome.value == "") 
			{
		    	alert('Please enter a valid value for the field Surname');
				cognome.focus();
				return false;
			}
		if (nome.value == "") 
			{
				alert('Please enter a valid value for the field Name');
				nome.focus();
				return false;
			}				
	/*	CONTROLLO SULL'EMAIL  */
		if (email2.value == "") 
			{
		    	alert('Please enter a valid value for the field E-MAIL');
				email2.focus();
				return false;
			}
			
		 if (email2.value != "")
			{
				var stato=true;
				if(email2.value.indexOf(" ")!=-1) 
				{
					email2.focus();
					stato=false;                       
				}
			
				var chiocciola=email2.value.indexOf("@");
				if(chiocciola<2) 
				{
					email2.focus();
					stato=false;		
				}
				var punto=email2.value.indexOf(".", chiocciola);
				if(punto<chiocciola+3) 
				{
					email2.focus();
					stato=false;           
				}
		
				var lung=email2.value.length;
				if(lung-punto<3) 
				{
					email2.focus();
					stato=false;     
				}           
				if(stato==false) 
				{
					alert("E-mail is not valid");
					email2.focus();
	     			return stato;   
				} 
		    }
		
	
	    }
 alert("Please, you must wait until a message will appear! ");
 return true;
}
		



