//<!--

function validate_mail (inp_str) {
return (inp_str.search (/\w+@\w+(.\w+)+/) != -1);
}


function Form1_Validator(theForm)
{


if (theForm.Cognome.value == "")
{
alert("Inserire il Cognome.");
theForm.Cognome.focus();
return (false);
}



if (theForm.Nome.value == "")
{
alert("Inserire il Nome.");
theForm.Nome.focus();
return (false);
}



if (theForm.Citta.value == "")
{
alert("Inserire la cittą di residenza.");
theForm.Citta.focus();
return (false);
}


if (theForm.EMail.value == "" || theForm.EMail.value.indexOf('@', 0) == -1) {

alert("Email non valida!");
theForm.EMail.focus();
return (false);

}


if (!validate_mail (theForm.EMail.value)) {
alert("Email non valida!");
theForm.EMail.focus();
return (false);
}


if (theForm.Messaggio.value == "")
{
alert("Inserite il testo del messaggio.");
theForm.Messaggio.focus();
return (false);
}


if (!(theForm[9].checked)) {
alert('Per poter utilizzare il servizio dovete autorizzare il trattamento dei Vs. dati');
theForm[9].focus();
return (false);

}
return (true);
}


//-->
