function validateForm() {
	var myform = document.forms.RegForm;
	var Nome = myform.Nome;
	var Cognome = myform.Cognome;
	var Comune = myform.Comune;
	var EMail = myform.EMail;
	var Username = myform.Username;
	var Privacy = myform.Privacy;
	var errorPresent = false;
	
	if (Nome.value == "") {
		errorPresent = true;
		Nome.style.backgroundColor = "#E2EAF3";
	}
	else {
		Nome.style.backgroundColor = "";
	}
	if (Cognome.value == "") {
		errorPresent = true;
		Cognome.style.backgroundColor = "#E2EAF3";
	}
	else {
		Cognome.style.backgroundColor = "";
	}
	if (Comune.value == "") {
		errorPresent = true;
		Comune.style.backgroundColor = "#E2EAF3";
	}
	else {
		Comune.style.backgroundColor = "";
	}

	if (EMail.value == "" || EMail.value.indexOf("@")<0 || EMail.value.indexOf(".")<0) {
		errorPresent = true;
		EMail.style.backgroundColor = "#E2EAF3";
	}
	else {
		EMail.style.backgroundColor = "";
	}
	if (Username.value == "") {
		errorPresent = true;
		Username.style.backgroundColor = "#E2EAF3";
	}
	else {
		Username.style.backgroundColor = "";
	}
	if (Privacy.checked  == false ) {
		errorPresent = true;
		alert("Per la registrazione è necessaria l'autorizzazione al trattamento dei dati (D.Lgs 196/2003)");
	}
	if (!errorPresent) 	{
		myform.submit();
	} 
}

function UpdateForm() {
	var myform = document.forms.RegForm;

	myform.action="Registrazione.asp?action=update"
  	myform.submit()

}