
// Validate Enquiry form
function validate_enquiry_form(f) {
	if (isFilled(f.frmName)==false) {
		alert("Name field cannot be blank");
		f.frmName.focus();
		return false;
	}
	if (isFilled(f.frmEmail)==false) {
		alert("Email field cannot be blank!");
		f.frmEmail.focus();
		return false;
  	}
	if (isFilled(f.frmAddress)==false) {
		alert("Address field cannot be blank");
		f.frmAddress.focus();
		return false;
	}
	if ((!f.frmContactMe.checked) && (isFilled(f.frmContactMethod)==true)) {
		alert("If you would like us to contact you please check the contact me checkbox!");
		f.frmContactMe.focus();
		return false;
	}
	if ((f.frmContactMe.checked) && (isFilled(f.frmContactMethod)==false)) {
		alert("Please enter your preferred way of being contacted!");
		f.frmContactMethod.focus();
		return false;
	}
	if (isFilled(f.frmEnquiry)==false) {
		alert("Your Enquiry field cannot be blank");
		f.frmEnquiry.focus();
		return false;
	}
  	if (validEmail(f.frmEmail.value)==false) {  // check e-mail address is valid
		alert("Invalid email address!");
		f.frmEmail.focus();
		f.frmEmail.select();
		return false;
  	}
	return true;
}

// Validate 'Tell a Friend' form
function validate_tell_a_friend_form(f) {
	if (isFilled(f.to_first_name)==false) {
		alert("TO First Name field cannot be blank");
		f.to_first_name.focus();
		return false;
	}
	if (isFilled(f.to_last_name)==false) {
		alert("TO Last Name field cannot be blank");
		f.to_last_name.focus();
		return false;
	}
	if (isFilled(f.to_email)==false) {
		alert("TO Email Address field cannot be blank");
		f.to_email.focus();
		return false;
	}
  	if (validEmail(f.to_email.value)==false) {
		alert("Invalid TO Email Address!");
		f.to_email.focus();
		f.to_email.select();
		return false;
  	}
	if (isFilled(f.from_first_name)==false) {
		alert("FROM First Name field cannot be blank");
		f.from_first_name.focus();
		return false;
	}
	if (isFilled(f.from_last_name)==false) {
		alert("FROM Last Name field cannot be blank");
		f.from_last_name.focus();
		return false;
	}
	if (isFilled(f.from_email)==false) {
		alert("FROM Email Address field cannot be blank");
		f.from_email.focus();
		return false;
	}
  	if (validEmail(f.from_email.value)==false) {
		alert("Invalid FROM Email Address!");
		f.from_email.focus();
		f.from_email.select();
		return false;
  	}
	return true;
}