function emptyvalidation(entered, alertbox)
{
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}


function emailvalidation(entered, alertbox)
{
with (entered)
{
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(thisform)
{
with (thisform)
{
if (emptyvalidation(real_name,"Please enter your real name")==false) {real_name.focus(); return false;};
if (emptyvalidation(birthday_mmddyy,"Please enter your Birthday")==false) {birthday_mmddyy.focus(); return false;};





if (emailvalidation(emailadd,"Please enter your Email")==false) {emailadd.focus(); return false;};
if (emptyvalidation(attachment,"Please upload a picture")==false) {attachment.focus(); return false;};
}
}
