function ChkForm(frm) {
	now = new Date
	thisYear = now.getYear()

	if (frm.name.value == "") {
		alert("Please enter your name.")
		frm.name.focus()
		return false
	}
	if (frm.surname.value == "") {
		alert("Please enter your surname.")
		frm.surname.focus()
		return false
	}
	if (frm.email.value == "") {
		alert("Please enter the a e-mail address.")
		frm.email.focus()
		return false
	}
	if (frm.email.value != "") {
		if (!validEmail(frm.email.value)) {
			alert("The Email address you entered is invalid. Please enter a valid Email address")
			frm.email.focus()
			return false
		}
	}
	if (frm.mobile.value == "") {
		alert("Please enter the a mobile number.")
		frm.mobile.focus()
		return false
	}
	if (frm.comment.value == "") {
		alert("Please enter the a comment.")
		frm.comment.focus()
		return false
	}
	alert("Thank you, your information has been sent to you and Vukani.")
	return true
}


function validEmail(email) {
	invalidChars = " /:,;"
	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i)
		if (email.indexOf(badChar,0) > -1) {
			return false
		}
	}
	atPos = email.indexOf("@", 1)
	if (atPos == -1) {
		return false
	}
	if (email.indexOf("@", atPos + 1) > -1) {
		return false
	}
	periodPos = email.indexOf(".", atPos)
	if (periodPos == -1) {
		return false
	}
	if (periodPos+3 > email.length) {
		return false
	}
	return true
}
