
function checkForm(TheForm) {

	if (TheForm.title.value.length == 0) {
	TheForm.title.value = prompt("You forgot to enter your title! (Please enter Mr. or Mrs. or Ms.!)");
	return false;
	}

	if ( !(TheForm.firstname.value.match(/^[a-zA-Z0-9]+$/)) || TheForm.firstname.value.length == 0 || TheForm.firstname.value == "" || TheForm.firstname.value == null || !isNaN(TheForm.firstname.value) || TheForm.firstname.value.charAt(0) == ' ' || TheForm.firstname.value == 'undefined') {
//	alert('Please enter your name');	//
	TheForm.firstname.style.border="solid #00336f 2px";
	TheForm.firstname.style.background="#d1ffc8";	     
	TheForm.firstname.value = prompt("Please enter your first name!");
	return false;
	}
	
	if ( !(TheForm.surname.value.match(/^[a-zA-Z0-9]+$/)) || TheForm.surname.value.length == 0 || TheForm.surname.value == "" || TheForm.surname.value == null || !isNaN(TheForm.surname.value) || TheForm.surname.value.charAt(0) == ' ' || TheForm.surname.value == 'undefined') {
	TheForm.surname.style.border="solid #00336f 2px";
	TheForm.surname.style.background="#d1ffc8";	    
	TheForm.surname.value = prompt("Please enter your surname!");
	return false;
	}  

	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(TheForm.reply_to.value)) {
	return (true);
	}
	alert("Invalid E-mail Address! Please re-enter.")
	   TheForm.reply_to.focus();
	   TheForm.reply_to.value="";      
	   TheForm.reply_to.style.border="solid #00336f 2px";
	   TheForm.reply_to.style.background="#d1ffc8";	   
	return (false);  

	if (TheForm.medicine.value.length == 0) {
	TheForm.medicine.value = prompt("Do you take any medicine! (If no, please enter No, if yes, please specify!)");
	TheForm.medicine.focus();      
	return false;
	}
  
	if (TheForm.illness.value.length == 0) {
	TheForm.illness.value = prompt("Are you suffering from any illness! (Please enter Yes or No!)");
	TheForm.illness.focus();      
	return false;
	}

	if ( !(TheForm.note.value.match(/^[a-zA-Z0-9]+$/)) || TheForm.note.value.length == 0 || TheForm.note.value == "" || TheForm.note.value == null || !isNaN(TheForm.note.value) || TheForm.firstname.value.charAt(0) == ' ' || TheForm.note.value == 'undefined') {
	TheForm.note.value = prompt("The messagebox is empty! Please enter your message!");
	TheForm.note.focus(); 
	TheForm.note.style.border="solid #00336f 2px";
	TheForm.note.style.background="#d1ffc8";	       
	return false;
	}
	
  return true;
}
