function submitbutton_reg() {
 //var form = document.mosForm;
//var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i");
if(isNull(document.mosForm.forename,"ForeName")) return false;
if(isNull(document.mosForm.surname,"SurName")) return false;
if(isNull(document.mosForm.address,"Full Address")) return false;
if(isNull(document.mosForm.telephone,"Telephone Number")) return false;
/*if(chkNumber(document.mosForm.telephone,"Telephone Number")) return false;*/
if(notChecked(document.mosForm.course_to_attend,"Course to Attend")) return false;

if(document.mosForm.course_to_attend[0].checked==true){ 
 if(!document.mosForm.paper1[0].checked && !document.mosForm.paper1[1].checked){
  alert("Please Select Options"); return false; }
}

else if(document.mosForm.course_to_attend[1].checked==true){ 
 if(!document.mosForm.paper2[0].checked && !document.mosForm.paper2[1].checked){
 alert("Please Select Options"); return false; } 
} 

else if(document.mosForm.course_to_attend[2].checked==true){ 
 if(!document.mosForm.paper3[0].checked && !document.mosForm.paper3[1].checked){
  alert("Please Select Options"); return false; }
} 
else if(document.mosForm.course_to_attend[5].checked==true){
if(!document.mosForm.papers1_2.checked){
  alert("Please Select Options"); return false; }
}

if(document.mosForm.exm_dates.options[document.mosForm.exm_dates.selectedIndex].value==""){
alert("Please select Exam Date"); return false;	
}
//if(notSelected(document.mosForm.exm_dates,"Exam Date")) return false;  
if(isNull(document.mosForm.prefered_date,"Preferred Date")) return false;
if(isNull(document.mosForm.username,"User Name")) return false;
if(notEmail(document.mosForm.username)) return false;
if(isNull(document.mosForm.password,"Password")) return false;
if(document.mosForm.password.value.length < 6){ alert("Please enter a valid password.  No spaces, more than 6 characters and contain 0-9,a-z,A-Z"); document.mosForm.password.focus(); return false;}
if((document.mosForm.password.value != "") && (document.mosForm.password.value != document.mosForm.password2.value)){
alert("Password is not match"); document.mosForm.password2.focus(); return false;
}
if(notChecked(document.mosForm.payment,"Payment Method")) return false;
}
function testval(){
var email=document.mosForm.username.value;
var mail=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
if (mail.test(email)) showhint1(email); else alert("Not a Valid Email");
}
