ecco lo:


function setfocus() {
document.FormMail.email.focus();
return;
}
function Validate(form) {
var nRet = 1;
var sFb = "";
if(confirm("Confermi l'invio del modulo?")) {
if(form.email.value.indexOf('@',0)==-1 || form.email.value.indexOf('.',0)==-1 || form.email.value=="@") {
nRet = 0;
if(sFb == "") {
sFb = "Inserire un indirizzo e-mail valido prima dell'invio del modulo. Grazie.";
document.FormMail.email.focus();
}
}
if(form.Nome.value=="" || form.Oggetto.value==""){
nRet = 0;
if(sFb == "") {
sFb = "Inserire tutti i campi obbligatori. Grazie.";
document.FormMail.email.focus();
}
}
if(nRet == 0) {
alert(sFb);
return false
}
else { alert("La tua e-mail è stata inviata con sucesso!")
return true
}
}
else {
return false
}
}