// 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 == "")) {
//		alert("Devi inserire il tuo nome");
//		document.getElementById("nome").focus();
//		return false;
//	}
	if ((document.getElementById("nome").value == "")|(document.getElementById("nome").value == "NOME")) {
		alert("Devi inserire il tuo nome\nPlease enter your Name");
		document.getElementById("nome").focus();
		return false;
	}
	if ((document.getElementById("cognome").value == "")|(document.getElementById("cognome").value == "COGNOME")) {
		alert("Devi inserire il tuo cognome\nPlease enter your Last name");
		document.getElementById("cognome").focus();
		return false;
	}
	if ((document.getElementById("email").value == "")|(document.getElementById("email").value == "E-MAIL")) {
		alert("Devi inserire la tua email\nPlease enter your email address");
		document.getElementById("email").focus();
		return false;
	}
	if ((IsEmailValid(document.getElementById("email").value)==false)) {
		alert("Attenzione, formato email non valido\nPlease enter a valid email address");
		document.getElementById("email").focus();
		return false;
	}
	document.getElementById("nl").submit();
}
