

function checkForm() {
	var theForm = document.hflform;
	var msg = "Please enter the following required information\n\n";
	var blnValid = true;
	
 	
	if(isBlank(theForm.name.value)){
		blnValid = false;
		msg += "\tName\n";
	} 
	
	if(isBlank(theForm.email.value)){
		blnValid = false;
		msg += "\tEmail\n";
	} 

	if(!isBlank(theForm.email.value)){
		
		
		var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
		
		if (!filter.test(theForm.email.value)){
			blnValid = false;
			msg += "\tA valid E-mail Address\n";
		}
		
	}
	
	
	if(isBlank(theForm.postcode.value)){
		blnValid = false;
		msg += "\tPostcode\n";
	}
	else if (!isUKPostCode(theForm.postcode.value))
	{
		blnValid = false;
		msg += "\tA valid Post Code\n";
	}
	if (blnValid) {
		theForm.action='thank_you.php';
		theForm.submit();
	}else{
		alert(msg);
	}
}
