function formCheck(theForm){
errstr = "";
if(theForm.email.value != ""){
mailRE = /^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z0-9\-]+\.)+([a-zA-Z]{2,4})))$/;
if(!mailRE.exec(theForm.email.value)){
errstr += "Your email address must be entered in the correct format.\n";
}
}else{
errstr += "You need to enter your email address.\n";
}
if(Trim(theForm.cBirthYear.value) == ""){
errstr += "You need to enter  Parents Year of Birth\n";
}else if(isNaN(theForm.cBirthYear.value) || theForm.cBirthYear.value.length != 4){
errstr += "Parents Year of Birth must be made of only numbers and 4 digits long.\n";
}


if(Trim(theForm.mm.value) == ""){
errstr += "Month of birth is missing \n";
}else if(isNaN(theForm.mm.value) || theForm.mm.value.length != 2){
errstr += "Month of birth  must be made of only numbers and 2 digits long.\n";
}
if(Trim(theForm.dd.value) == ""){
errstr += "Day of birth is missing \n";
}else if(isNaN(theForm.dd.value) || theForm.dd.value.length != 2){
errstr += "Day of birth  must be made of only numbers and 2 digits long.\n";
}
if(Trim(theForm.yy.value) == ""){
errstr += "Year of birth is missing \n";
}else if(isNaN(theForm.yy.value) || theForm.yy.value.length != 2){
errstr += "Year of birth  must be made of only numbers and 2 digits long.\n";
}



if(!theForm.agree.status){
errstr += "You must agree to the terms and conditions.\n";
}



if(errstr != ""){
alert(errstr);
return false;
}
}
function Trim(strValue)
{
return LTrim(RTrim(strValue));
}
function LTrim(strValue)
{
var LTRIMrgExp = /^\s */;
return strValue.replace(LTRIMrgExp, "");
}
function RTrim(strValue)
{
var RTRIMrgExp = /\s *$/;
return strValue.replace(RTRIMrgExp, "");
}