function ValidateForm(theform)
{
		if(theform.name.value=='') {
		alert('Please enter your first name in the space provided.')
		theform.name.focus()
		return false
	}

		if(theform.nric.value=='') {
		alert('Please enter your NRIC Number in the space provided.')
		theform.nric.focus()
		return false
	}
	
		if(theform.dob.value=='') {
		alert('Please enter your Date of Birth in the space provided.')
		theform.dob.focus()
		return false
	}
	
		if(theform.contact.value=='') {
		alert('Please enter your Tel or Mobile number in the space provided.')
		theform.contact.focus()
		return false
	}
	
		if(theform.Email.value=='') {
		alert('Please enter your e-mail address in the space provided.')
		theform.Email.focus()
		return false
	}
	
		if(checkForValidEmailAddress(theform.Email)==false) {
		alert('Please enter a valid e-mail address.')
		theform.Email.focus()
		return false
	}
	
		if(theform.emailto.selectedIndex=='0') {
		alert('Please select your preferred center.')
		theform.emailto.focus()
		return false
	}
//		if(theform.feedback.value=='') {
//		alert('Please enter your feedback in the space provided.')
//		theform.enquiry.focus()
//		return false
//	}

	
	return true
}


function checkForValidEmailAddress(theinput)
{
	s=theinput.value

	if(s.search) {
		return (s.search(new RegExp("^([a-z0-9_]|\-|\.)+@(([a-z0-9_]|\-)+\.)+[a-z]{2,4}$","gi"))>=0)
	}

	if(s.indexOf) {
		at_character=s.indexOf('@')
		if(at_character<=0 || at_character+4>s.length)
			return false
	}

	if(s.length<6)
		return false
	else
		return true
}
