function yournameempty(yourname, alertbox)
{
with (yourname)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}

function emailvalidation(email, alertbox)
{
with (email)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
lastpos=value.length-1;

if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) {
	
	if (alertbox) { alert(alertbox); } return false; }
else { return true; }
}
}

function formvalidation(subscribe)
{

with (subscribe)
{
if (yournameempty(yourname,"You must enter your Name")==false) {yourname.focus(); return false;};
if (emailvalidation(email,"Invalid or empty email address")==false) {email.focus(); return false;};
}
}

