function fun_valida()
	{
	var a,b,strAlert,strAlert1;
	a = 0;
	b = 0;
	strAlert = "";
	strAlert1 = "";
	var regMail=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
	
	if (document.forms[0].nome.value == "")
		{
		a++;
		strAlert += "\n* Il campo nome deve essere compilato;";
		}
	if (document.forms[0].cognome.value == "")
		{
		a++;
		strAlert += "\n* Il campo cognome deve essere compilato;";
		}
	if (!regMail.test(document.forms[0].e_mail.value))
		{
		a++;
		strAlert += "\n* Inserisci un indirizzo e-mail valido;";
		}
	else if (document.forms[0].e_mail.value != document.forms[0].e_mail1.value)
		{
		a++;
		strAlert += "\n* Gli indirizzi e-mail inseriti non corrispondono;";
		}
	if (document.forms[0].priv.checked == false)
		{
		a++;
		strAlert += "\n* Leggi ed accetta l'informativa sulla privacy;";
		}
	err_tot=a+b;
	
	if ((a!=0)&&(b!=0))
		{
		window.alert("ATTENZIONE \n " + strAlert + "\n\nED INOLTRE: \n" + strAlert1 + "\n\nTOTALE ERRORI: " + err_tot);
		return false;
		}
	if ((a!=0)&&(b==0))
		{
		window.alert("ATTENZIONE \n " + strAlert + "\n\nTOTALE ERRORI: " + err_tot);
		return false;
		}
	if ((a==0)&&(b!=0))
		{
		window.alert("ATTENZIONE \n " + strAlert1 + "\n\nTOTALE ERRORI: " + err_tot)
		return false;
		}
	if ((a==0)&&(b==0))
		{ return true; }
	}