
function validatorNewsletter(theForm) {
var regMail = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)*\.([a-zA-Z]{2,6})$/;

	if (theForm.nome.value=="") {
		alert ("Il campo 'NOME' e' obbligatorio.");
		theForm.nome.focus();
		return false;
	} else if (theForm.cognome.value=="") {
		alert ("Il campo 'COGNOME' e' obbligatorio.");
		theForm.cognome.focus();
		return false;
	} else if (theForm.email.value=="") {
		alert ("Il campo 'EMAIL' e' obbligatorio.");
		theForm.email.focus();
		return false;
	} else if (!regMail.test(theForm.email.value)) {
		alert ("L'indirizzo email inserito non è valido.");
		theForm.email.focus();
		return false;
	} else {
		return true;
	} 
}

