<!--
function FormAddSubscriber_Validator(theForm)
{
// check if email field is blank
var form_email = theForm.txtEmail.value;
var invalidChars = " /:;,"
var badChar =""
if (form_email== "")
{
alert("You must enter an 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("You cannot have a /:;, or a space in the Email");
theForm.txtEmail.focus();
return (false);
}
}
atPos=form_email.indexOf("@",1)
if(atPos==-1)
{
alert("Your Email is not Valid, must have an @");
theForm.txtEmail.focus();
return (false);
}
if(form_email.indexOf("@",atPos+1)>-1)
{
alert("You cannot have two @'s in the Email");
theForm.txtEmail.focus();
return (false);
}
periodPos=form_email.indexOf(".",atPos)
if(periodPos==-1)
{
alert("There must be an . in your email address");
theForm.txtEmail.focus();
return (false);
}
if(periodPos+3>form_email.length)
{
alert("There must be atleast two letters after .");
theForm.txtEmail.focus();
return (false);
}
return(true);
}


function FormSendEmail_Validator(theForm)
{

if(theForm.txtFrom.value=="")
{
alert("You must enter who the email is from");
theForm.txtFrom.focus();
return (false);
}

if(theForm.txtSubject.value=="")
{
alert("You must enter a subject");
theForm.txtSubject.focus();
return (false);
}

if(theForm.txtBody.value=="")
{
alert("You must enter your email body.");
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("You must enter an 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("You cannot have a /:;, or a space in the Email");
theForm.txtEmail.focus();
return (false);
}
}
atPos=form_email.indexOf("@",1)
if(atPos==-1)
{
alert("Your Email is not Valid, must have an @");
theForm.txtEmail.focus();
return (false);
}
if(form_email.indexOf("@",atPos+1)>-1)
{
alert("You cannot have two @'s in the Email");
theForm.txtEmail.focus();
return (false);
}
periodPos=form_email.indexOf(".",atPos)
if(periodPos==-1)
{
alert("There must be an . in your email address");
theForm.txtEmail.focus();
return (false);
}
if(periodPos+3>form_email.length)
{
alert("There must be atleast two letters after .");
theForm.txtEmail.focus();
return (false);
}
return(true);
}

//----------------------------------------------------------
//--- Function to check the Newsletter form before submitting
function CheckNLField () {

	if (document.FormMailingList.txtEmail.value == " Enter your e-mail "||document.FormMailingList.txtEmail.value==""){
		alert("Please enter your email. ");
		document.FormMailingList.txtEmail.focus();
		return false;
	}

	return true
}
	
//--- Function to clear the Newsletter form field onfocus
function clearNLfield(){
if (document.FormMailingList.txtEmail.value != "")
	document.FormMailingList.txtEmail.value = "";
}

//-->
