function locat(page)
{  
    clearTimeout(timerID);
    if (page==1) window.location="profile.php";
    if (page==2) window.location="results.php";
}


function formsubmit(a)
{
 if (a.agree[0].checked==false) { alert("Oops. You forgot to agree to the Terms of Service -- it's a must in order to use ASM."); a.agree[0].focus(); return false; } 

 if (a.username.value=="")      { alert("Username?"); a.username.focus(); return false; }
 if (a.nickname.value=="")      { alert("Nickname?"); a.nickname.focus(); return false; }
   
 if (a.email.value=="")         { alert("Email?");  a.email.focus();  return false; }

 
 if (checkEmail(a.email.value)==false) 
 {
   alert("Incorrect Email!");
   a.email.focus(); 
   return false;
 }
 
 if (a.email_confirm.value=="") { alert("Confirm email?"); a.email_confirm.focus();  return false; }
 if (a.email_confirm.value!=a.email.value) { alert("Confirm email correctly!"); a.email_confirm.focus(); return false; }	 
 
 if (a.password.value=="")      { alert("Password?"); a.password.focus(); return false; } 
 if (a.password_confirm.value=="") { alert("Confirm password?");  a.password_confirm.focus(); return false; } 
 if (a.password_confirm.value!=a.password.value) { alert("Confirm password correctly!"); a.password_confirm.focus(); return false; }	
 
 if (a.first_name.value=="")    { alert("First name?"); a.first_name.focus(); return false; }
 if (a.last_name.value=="")     { alert("Last name?"); a.last_name.focus(); return false; }
 
 if ((a.gender[0].checked==false)&&(a.gender[1].checked==false)) { alert("Gender?"); a.gender[1].focus(); return false;} 
 
 if (a.birthDate_month.selectedIndex==0) { alert("Month of birth?"); a.birthDate_month.focus(); return false;} 
 if (a.birthDate_day.selectedIndex==0) { alert("Day of birth?");   a.birthDate_day.focus(); return false;} 
 if (a.birthDate_year.selectedIndex==0) { alert("Year of birth?");  a.birthDate_year.focus(); return false;} 
 
 if (a.city.value=="")     { alert("City?"); a.city.focus(); return false; }
 if (a.state.value=="")    { alert("State?"); a.state.focus(); return false; }
 if (a.zipcode.value=="")  { alert("Zip/Postal Code?"); a.zipcode.focus(); return false; }
 
 if (a.imagecod.value=="")  { alert("Please type in the code from the image into the input box?"); a.imagecod.focus(); return false; }
 
 return true;	
}


