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 = "Il campo \"Tipo Richiesta\" \u00E8 un campo obbligatorio";
alert_2 = "Il campo \"Nome\" \u00E8 un campo obbligatorio";
alert_3 = "Il campo \"Societ\u00E0\" \u00E8 un campo obbligatorio";
alert_4 = "Il campo \"Indirizzo\" non \u00E8 corretto";
alert_5 = "Il campo \"Citta'\" non \u00E8 corretto";
alert_6 = "Il campo \"Telefono\" \u00E8 un campo obbligatorio";
alert_7 = "Il campo \"Nazione\" \u00E8 un campo obbligatorio";
alert_10 = "Il campo \"Messaggio\" \u00E8 un campo obbligatorio";

alert_check = "Devi acconsentire all'informativa sulla privacy";
alert_mail = "Il campo \"Email\" non \u00E8 corretto";
alert_number = "Il campo deve contenere solo numeri";

	// Tipo richiesta *
	if ( document.forms[0].tipo.value == "") {
		alert(alert_1);
		document.forms[0].tipo.focus();
		return;
	}
	
	// Nome *
	if ( (document.forms[0].nome.value=="") || (re_emptyall.test(document.forms[0].nome.value)) ) {
		alert(alert_2);
		document.forms[0].nome.focus();
		return;
	}
	
	// Societa *
	if ( (document.forms[0].azienda.value=="") || (re_emptyall.test(document.forms[0].azienda.value)) ) {
			alert(alert_3);
			document.forms[0].azienda.focus();
			return;
	}

	// Indirizzo
	if (document.forms[0].indirizzo.value != '') {
		if ( (document.forms[0].indirizzo.value=="") || (re_emptyall.test(document.forms[0].indirizzo.value)) ) {
			alert(alert_4);
			document.forms[0].indirizzo.focus();
			return;
		}
	}
	
	// Citta
	if (document.forms[0].citta.value != '') {
		if ( (document.forms[0].citta.value=="") || (re_emptyall.test(document.forms[0].citta.value)) ) {
			alert(alert_5);
			document.forms[0].citta.focus();
			return;
		}
	}
	
	// Telefono *
	if ( (document.forms[0].telefono.value == "") || (re_emptyall.test(document.forms[0].telefono.value)) ) {
		alert(alert_6);
		document.forms[0].telefono.focus();
		return;
	}
	
	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;
		}
	}
	
	// Fax
	if ( document.forms[0].fax.value != '') {
		if (re_not_number.test(document.forms[0].fax.value)) {
			alert(alert_number);
			document.forms[0].fax.focus();
			return;
		}
	}
	
	// Nazione *
	if (document.forms[0].stato.value == "") {
		alert(alert_7);
		document.forms[0].stato.focus();
		return;
	}
	
	// E-mail
	if ( document.forms[0].mail.value != "" ) {
		if (!re_email.test(document.forms[0].mail.value)) {
			alert(alert_mail);
			document.forms[0].mail.focus();
			return;
		}
	}
	
	// Richiesta *
	if ( (document.forms[0].richiesta.value == '') || (re_emptyall.test(document.forms[0].richiesta.value)) ) {
		alert(alert_10);
		document.forms[0].richiesta.focus();
		return;
	}
	
	// Check privacy
	if (document.forms[0].accetto.checked==false) {
		alert(alert_check);
		return;
	}
	
	document.forms[0].submit();

} // end function

