// JScript source code
function isValidEmail(str) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)){
		return true;
	}
	else {
		return false;
	}
}

function checkenquiry(){
	var ftxt = '';

	if (document.enquiry.Name.value==''){
		ftxt += '\n- Please enter your Name.';
	}
	
	if (document.enquiry.Company.value==''){
		ftxt += '\n- Please enter your Company.';
	}
	
	if (document.enquiry.Telephone.value==''){
		ftxt += '\n- Please enter your Telephone Number.';
	}
	
	if (isValidEmail(document.enquiry.email.value)==false){
		ftxt += '\n- Please enter your Email Address.';
	}
	
	if (document.enquiry.subject.value==''){
		ftxt += '\n- Please select an enquiry Subject.';
	}
	
	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else {
		return true;
	}
}

function checkcallform(){
	var ftxt = '';
	
	if (document.callform.Name.value==''){
		ftxt += '\n- Please enter your Name.';
	}
	
	if (document.callform.Company.value==''){
		ftxt += '\n- Please enter your Company Name.';
	}
	
	if (document.callform.Telephone.value==''){
		ftxt += '\n- Please enter your Telephone Number.';
	}	
	
	if (ftxt!==''){
		alert('One or more errors were found while submitting this form. The errors found are displayed below.\n' + ftxt + '\n\nPlease correct the above errors and try again.');
		return false;
	}
	else {
		return true;
	}
}

function checknewsletterform(){
	if (isValidEmail(document.newsletterform.email.value)==false){
		alert('Please enter your Email Address.');
		return false;
	}
	else {
		return true;
	}
}

function clearemailfield(fieldVal){
	if (isValidEmail(fieldVal)==false){
		document.newsletterform.email.value='';
	}
}

/* Replacement calls. Please see documentation for more information. */
if(typeof sIFR == "function"){	
	// This is the older, ordered syntax	
	sIFR.replaceElement("h2", named({sFlashSrc: "Scripts/Square721.swf", sColor: "#4D6996"}));	
	sIFR.replaceElement("h3", named({sFlashSrc: "Scripts/Square721.swf", sColor: "#FFFFFF", sWmode: "transparent"}));
};