
function clearQuotes(theForm) {
	for (i=0;i<theForm.elements.length;i++) {
		if (theForm.elements[i].value) {
			theForm.elements[i].value = theForm.elements[i].value.replace(/'/gi,"`");
		}
	}
}

function checkEmail(theEmail) {
	if (theEmail.indexOf('.')==-1) return false;
	if (theEmail.indexOf('@')==-1) return false;
	if (theEmail.length<6) return false;
	return true;
}

function checkBookingForm() {
	var theForm = document.Booking_Form;
	clearQuotes(theForm);

	if (theForm.fname.value.length<1) {alert("Please enter your first or given name.");theForm.fname.focus();return false;}
	if (theForm.lname.value.length<1) {alert("Please enter your family name.");theForm.lname.focus();return false;}

	if (theForm.phone1.value.length<1 && theForm.mobile.value.length<1 ) {alert("Please enter a contact phone number.");theForm.phone1.focus();return false;}

	if (theForm.email.value.length<1) {alert("Please enter your email address.");theForm.email.focus();return false;}


	if (checkEmail(theForm.email.value)==false) {alert("The email address you have entered does not seem to be valid.");theForm.email.focus();return false;}



}