




/*
     FILE ARCHIVED ON 20:57:05 Feb 3, 2011 AND RETRIEVED FROM THE
     INTERNET ARCHIVE ON 4:35:54 Dec 1, 2011.
     JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.

     ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
     SECTION 108(a)(3)).
*/
// Global JavaScript Document //

// FUNCTION:  okayToSubmit(formName)
// CHECKS TO SEE IF THE FORM NEEDS SUBMITTING //
// Requires the command value to be set to anything other than "undefined"

function okayToSubmit(formName) {
	if (formName.command.value == "undefined") {
		return false;
	} else {
		return true;
	}
}

// CANCEL THE SEND PAGE FUNCTION //
function cancelSendPageForm(pageUrl) {
	window.location.href = pageUrl;
}

// VALIDATE SEND PAGE TO FRIEND FORM //
function validateSendPageForm() {
	// Check the send form
	valid = 1;
	
	if ((valid == 1) && (document.frm_sendToFriend.txt_friendsEmail.value == "")) {
		alert("Please enter your friends email address before sending.");
		valid = 0;
	}
	
	if ((valid == 1) && (document.frm_sendToFriend.txt_friendsName.value == "")) {
		alert("Please enter your friends name before sending.");
		valid = 0;
	}	

	if ((valid == 1) && (document.frm_sendToFriend.txt_yourEmail.value == "")) {
		alert("Please enter your email address before sending.");
		valid = 0;
	}
	
	if ((valid == 1) && (document.frm_sendToFriend.txt_yourName.value == "")) {
		alert("Please enter your name before sending.");
		valid = 0;
	}

	if (valid == 1) 
	{	
		
		document.frm_sendToFriend.command.value = "sendPageToFriend";
	}
}

// VALIDATE CONTACT FORM PAGE //
function validate_frm_contact() {

	if (document.frm_contact.message.value == "") {
		alert ("Please enter your enquiry before sending.");
		return false;
	} else {
		document.frm_contact.command.value = "sendEmail";
		return true;
	}
}


// Check and set required variables for saving registering email address.
function Global_emailRegistration()
{
	valid = 1;	// Set true default.
	
	// Reg Ex to validate email
	re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
	validEmail = re.test(document.frm_emailRegistration.emailAddress.value);
		
	if ((valid == 1) && (!validEmail)) {
		alert("Sorry, it appears the email address you have entered is in an incorrect format.  Please enter a valid email address before proceeding.");
		document.frm_emailRegistration.emailAddress.focus();
		valid = 0;
	}
	
	if (valid == 1) 
	{	
		document.frm_emailRegistration.command.value = "registerEmail";
		document.frm_emailRegistration.params.value = "emailAddress=" + document.frm_emailRegistration.emailAddress.value;			
	} else {
		document.frm_emailRegistration.command.value = "undefined";
	}

}


