function checkEmail(NameObject) {
	var temp; var space;
	if (NameObject.value == "") {
		alert("Il campo \"E-mail\" è obbligatorio");
		NameObject.focus();
		return (false);
	}
	// check validità email
	txt=NameObject.value;
	
	// check presenza @
	if (txt.indexOf("@")<2) {
		alert("Invalid E-Mail Address");
		NameObject.focus();
		return (false);
	}
	// check presenza .
	if (txt.lastIndexOf(".")<txt.indexOf("@")) {
		alert("Invalid E-Mail Address");
		NameObject.focus();
		return (false);
	}
	 
	// check lunghezza almeno 6 char
	if (txt.length<6) {
		alert("Invalid E-Mail Address");
		NameObject.focus();
		return (false);
	}
	return (true);
}

function checkNomeCognome () {
	
	if (document.forms[0].Nome.value.length == 0) {
		alert("You have to insert your first name");
		document.forms[0].Nome.focus();
		return false;
	}
	if (document.forms[0].Cognome.value.length == 0) {
		alert("You have to insert your last name");
		document.forms[0].Cognome.focus();
		return false;
	}
	
	return true;
}

function checkTesto () {
	if (document.forms[0].Testo.value.length < 10) {
		alert("Message text is empty or too short (at least 10 characters)");
		document.forms[0].Testo.focus();
		return false;
	} else {
		return true;
	}
}
