<!-- //hide the script
function checkEmail(strng) {
	var error = "";

	var emailFilter=/^.+@.+\..{2,6}$/;

	if (!(emailFilter.test(strng))) {
		return false;
	}

	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\] ']/

	if (strng.match(illegalChars)) {
		return false;
	}

	return true;
}


function form_validator(theForm)
{

 	if(theForm.sender.value == "") {
 		 alert("Please enter your name.");
 		 theForm.sender.focus();
 		 return false;
 	}

 	 if(theForm.postcode.value == "") {
	 	 alert("Please enter your postcode.");
	 	 theForm.postcode.focus();
	 	 return false;
 	}
 	
 	 if(theForm.telephone.value == "") {
	 	 alert("Please enter your telephone number.");
	 	 theForm.telephone.focus();
	 	 return false;
 	}

 	 if(!checkEmail(theForm.email.value)) {
	 	 alert("Please enter a valid email address.");
	 	 theForm.email.focus();
	 	 return false;
 	}
 	
 	 if(theForm.marketing.value == "") {
	 	 alert("Please tell us how you found us.");
	 	 theForm.marketing.focus();
	 	 return false;
 	}
 	
 	 if(theForm.marketing.value == "through another company") {
		 if(theForm.othermarketing.value == "") {
			 alert("Please tell us which company you found us through.");
			 theForm.othermarketing.focus();
			 return false;
		}
 	}
 	

	return (true);
}
// end script hiding -->
