// JavaScript Document
function IsEmailValid(checkThisEmail) {
	var myEMailIsValid = true;
	var myAtSymbolAt = checkThisEmail.indexOf('@');
	var myLastDotAt = checkThisEmail.lastIndexOf('.');
	var mySpaceAt = checkThisEmail.indexOf(' ');
	var myLength = checkThisEmail.length;
	
	if (myAtSymbolAt < 1 )
	 {myEMailIsValid = false}
	
	if (myLastDotAt < myAtSymbolAt)
	 {myEMailIsValid = false}
	
	if (myLength - myLastDotAt <= 2)
	 {myEMailIsValid = false}
	
	if (mySpaceAt != -1)
	{myEMailIsValid = false}
	
	if(myEMailIsValid==true)
	 IsEmailValid==true
	else
	 IsEmailValid==false
	
	return myEMailIsValid
}

function donl() {
	if ((document.getElementById("nome").value == "")) {
		document.getElementById("nome").focus();
		//alert("Devi inserire il tuo nome");
		return false;
	}
	if ((document.getElementById("email").value == "")) {
		document.getElementById("email").focus();
		//alert("Devi inserire la tua email");
		return false;
	}
	if ((IsEmailValid(document.getElementById("email").value)==false)) {
		alert("Attenzione, formato email non valido");
		document.getElementById("email").focus();
		return false;
	}
	document.nl.submit();
}