function Controllo() {

var re_emptyall = new RegExp("^[ ]*$");
var re_not_number = new RegExp("[^0-9]");
var re_password = new RegExp("[^0-9a-zA-Z]");
var re_email = /^([a-zA-Z0-9])+([\.&a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+$/;

alert_1 = "The field \"Request type\" is mandatory";
alert_2 = "The field \"Name\" is mandatory";
alert_3 = "The field \"Surname\" is mandatory";
alert_4 = "The field \"Address\" is mandatory";
alert_5 = "The field \"City\" is mandatory";
alert_6 = "The field \"Post Code\" is mandatory";
alert_7 = "The field \"Country\" is mandatory";
alert_8 = "The field \"Phone\" is mandatory";
alert_9 = "The field \"E-mail\" is mandatory";
alert_10 = "The field \"Request\" is mandatory";
alert_11 = "The field \"Nation\" is mandatory";

alert_check = "You must authorize handling of your personal data.";
alert_mail = "The field \"E-mail\" is wrong";
alert_number = "The field must contain only numbers";

	// Tipo richiesta
	if ( document.forms[0].tipo.value == "") {
		alert(alert_1);
		document.forms[0].tipo.focus();
		return false;
	}

	// Nome
	if ( (document.forms[0].nome.value=="") || (re_emptyall.test(document.forms[0].nome.value)) ) {
		alert(alert_2);
		document.forms[0].nome.focus();
		return false;
	}
	
	// Cognome
	if ( (document.forms[0].cognome.value=="") || (re_emptyall.test(document.forms[0].cognome.value)) ) {
		alert(alert_3);
		document.forms[0].cognome.focus();
		return false;
	}
	
	// Indirizzo
	//if ( (document.forms[0].indirizzo.value=="") || (re_emptyall.test(document.forms[0].indirizzo.value)) ) {
	//	alert(alert_4);
	//	document.forms[0].indirizzo.focus();
	//	return false;
	//}
	
	// Citta
	//if ( (document.forms[0].citta.value=="") || (re_emptyall.test(document.forms[0].citta.value)) ) {
	//	alert(alert_5);
	//	document.forms[0].citta.focus();
	//	return false;
	//}

	// Cap
	//if ( (document.forms[0].cap.value=="") || (re_emptyall.test(document.forms[0].cap.value)) ) {
	//	alert(alert_6);
	//	document.forms[0].cap.focus();
	//	return false;
	//}

	// Provincia
/*	if ( (document.forms[0].provincia.value=="") || (re_emptyall.test(document.forms[0].provincia.value)) ) {
		alert(alert_7);
		document.forms[0].provincia.focus();
		return false;
	}
*/	
	// nazione
	if ( (document.forms[0].stato.value=="") || (re_emptyall.test(document.forms[0].stato.value)) ) {
		alert(alert_11);
		document.forms[0].stato.focus();
		return false;
	}
	
	// Telefono
	//if ( (document.forms[0].telefono.value == "") || (re_emptyall.test(document.forms[0].telefono.value)) ) {
	//	alert(alert_8);
	//	document.forms[0].telefono.focus();
	//	return false;
	//}
	
	//if (document.forms[0].telefono.value != '') {
	//	if (re_not_number.test(document.forms[0].telefono.value)) {
	//		alert(alert_number);
	//		document.forms[0].telefono.focus();
	//		return false;
	//	}
	//}
	
	// E-mail
	if ( (document.forms[0].mail.value == "") || (re_emptyall.test(document.forms[0].mail.value)) ) {
		alert(alert_9);
		document.forms[0].mail.focus();
		return false;
	}

	if ( document.forms[0].mail.value != "" ) {
		if (!re_email.test(document.forms[0].mail.value)) {
			alert(alert_mail);
			document.forms[0].mail.focus();
			return false;
		}
	}
	
	// Richiesta *
	if ( (document.forms[0].rich.value == '') || (re_emptyall.test(document.forms[0].rich.value)) ) {
		alert(alert_10);
		document.forms[0].rich.focus();
		return false;
	}
	
	// Check privacy
	if (document.forms[0].accetto.checked==false) {
		alert(alert_check);
		return false;
	}
	
	document.forms[0].submit();

} // end function

