/*
 * SPRONKware - Email Duplicate Checker
 * Checks email and email2 for duplication and alerts if they are different. Useful for forms, but always
 * ensure a check in the form logic as well.
 *
 * (c) 2006 SPRONKware - Keith Humm
 */
function checkEmailDuplicate(bf)
{
	var email1 = null;
	var email2 = null;

	if(bf == 1) {
		email1 = enquiryForm.email.value;
		email2 = enquiryForm.email2.value;
	}
	else {
		email1 = bookingForm.email.value;
		email2 = bookingForm.email2.value;
	}

	var BFEmailError = document.getElementById("BFEmailError");


	if(email1 != email2) {
		BFEmailError.innerHTML = "Your e-mail addresses do not match!";
		BFEmailError.className = "BFfail";
	} else {
		BFEmailError.innerHTML = "Your email addresses match.";
		BFEmailError.className = "BFpass";
	}
	BFEmailError = null;
	email1 = null;
	email2 = null;
}