function checkform(){
	var error ="";
	if(document.registration.firstname.value==""){
		error += "Please enter the players first name\n";
	}
	if(document.registration.lastname.value==""){
		error += "Please enter the players last name\n";
	}
if(document.registration.gender.value==""){
error += "Please enter the players gender\n";
}
if(document.registration.years.value=="" || !(document.registration.years.value >= 0 || document.registration.years.value < 50)){
	
error += "Please enter the number of years the player has played\n";
}
if(document.registration.birthday.value==""){
	error += "Please enter the players birthday\n";
}
if(document.registration.healthcard.value=="" || document.registration.healthcard.value.length!=10){
error += "Please enter the players 10 digit health card number\n";
}
if(document.registration.parentfname.value==""){
error += "Please enter the parents first name\n";
}
if(document.registration.parentlname.value==""){
error += "Please enter the parents last name\n";
}
if(document.registration.address.value==""){
error += "Please enter the parents address\n";
}
re = new RegExp(/[a-z]\d[a-z] \d[a-z]\d/);
if(document.registration.postal.value=="" || !document.registration.postal.value.match(re)){
error += "Please enter a valid postal code\n";
}
if(document.registration.dayphone.value=="" || !document.registration.dayphone.value.match(new RegExp(/\d{3}-\d{3}-\d{4}/))){
error += "Please enter the parents daytime phone number in the form of ###-###-####\n";
}
if(document.registration.eveningphone.value=="" || !document.registration.eveningphone.value.match(new RegExp(/\d{3}-\d{3}-\d{4}/))){
error += "Please enter the parents evening phone number in the form of ###-###-####\n";
}
if(document.registration.email.value=="" || !document.registration.email.value.match(/\w*@\w*\.\w*/)){
error += "Please enter the parents valid email address\n";
}
if(document.registration.emergency.value==""){
error += "Please enter the information of the person to be contacted in an emergency\n";
}
if(document.registration.doctor.value==""){
error += "Please enter the players doctors name\n";
}
if(document.registration.docphone.value==""  || !document.registration.docphone.value.match(new RegExp(/\d{3}-\d{3}-\d{4}/))){
error += "Please enter the players doctors phone numberin the form of ###-###-####\n";
}
if(error!= ""){
alert(error);
}else{
document.registration.action="register.php";document.registration.submit();}}
