<!--
function FormAddSubscriber_Validator(theForm)
{
// check if email field is blank
var form_email = theForm.txtEmail.value;
var invalidChars = " /:;,"
var badChar =""
if (form_email== "")
{
alert("Devi inserire un indirizzo email");
theForm.txtEmail.focus();
 return (false);
}
for (i = 0;  i < invalidChars.length;  i++)
{
badChar=invalidChars.charAt(i);
if(form_email.indexOf(badChar,0)>-1)
{
alert("Non ci possono essere caratteri come / : ; , e neppure spazi");
theForm.txtEmail.focus();
return (false);
}
}
atPos=form_email.indexOf("@",1)
if(atPos==-1)
{
alert("L'email inserita non e' valida, deve avere la @");
theForm.txtEmail.focus();
return (false);
}
if(form_email.indexOf("@",atPos+1)>-1)
{
alert("Non ci possono essere due @ nell'indirizzo email");
theForm.txtEmail.focus();
return (false);
}
periodPos=form_email.indexOf(".",atPos)
if(periodPos==-1)
{
alert("Deve esserci un . nell'indirizzo email");
theForm.txtEmail.focus();
return (false);
}
if(periodPos+3>form_email.length)
{
alert("Ci devono essere almeno due lettere dopo il .");
theForm.txtEmail.focus();
return (false);
}
return(true);
}


function FormSendEmail_Validator(theForm)
{

if(theForm.txtFrom.value=="")
{
alert("Manca il mittente della mail");
theForm.txtFrom.focus();
return (false);
}

if(theForm.txtSubject.value=="")
{
alert("Manca l'Oggetto della mail");
theForm.txtSubject.focus();
return (false);
}

if(theForm.txtBody.value=="")
{
alert("Manca il corpo della mail.");
theForm.txtBody.focus();
return (false);
}

return(true);
}


function FormSubscribe(theForm)
{
// check if email field is blank
var form_email = theForm.txtEmail.value;
var invalidChars = " /:;,"
var badChar =""
if (form_email== "")
{
alert("Manca l'indirizzo email");
theForm.txtEmail.focus();
 return (false);
}
for (i = 0;  i < invalidChars.length;  i++)
{
badChar=invalidChars.charAt(i);
if(form_email.indexOf(badChar,0)>-1)
{
alert("Non ci possono essere caratteri come / : ; , e neppure spazi");
theForm.txtEmail.focus();
return (false);
}
}
atPos=form_email.indexOf("@",1)
if(atPos==-1)
{
alert("L'email inserita non e' valida, deve avere la @");
theForm.txtEmail.focus();
return (false);
}
if(form_email.indexOf("@",atPos+1)>-1)
{
alert("Non ci possono essere due @ nell'indirizzo email");
theForm.txtEmail.focus();
return (false);
}
periodPos=form_email.indexOf(".",atPos)
if(periodPos==-1)
{
alert("Deve esserci un . nell'indirizzo email");
theForm.txtEmail.focus();
return (false);
}
if(periodPos+3>form_email.length)
{
alert("Ci devono essere almeno due lettere dopo il .");
theForm.txtEmail.focus();
return (false);
}
return(true);
}


//-->
