<!-- //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.name.value == "") {
		 alert("Please enter your Full Name.");
		 theForm.name.focus();
		 return(false);
	}

	if(theForm.address.value == "") {
		 alert("Please enter your Address.");
		 theForm.address.focus();
		 return(false);

	}

	if(theForm.town.value == "") {
		 alert("Please enter your Town.");
		 theForm.town.focus();
		 return(false);

	}
	
	if(theForm.county.value == "") {
		 alert("Please enter your County.");
		 theForm.county.focus();
		 return(false);

	}
	
	if(theForm.post_code.value == "") {
		 alert("Please enter Post Code.");
		 theForm.post_code.focus();
		 return(false);

	}
	
	if(theForm.country.value == "") {
		 alert("Please enter your Country.");
		 theForm.country.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.applicants.value == "") {
		 alert("Please enter the Type of Application.");
		 theForm.applicants.focus();
		 return(false);

	}
	
	if(theForm.mortgage_rate_wanted.value == "") {
		 alert("Please select a Mortgage Type.");
		 theForm.mortgage_rate_wanted.focus();
		 return(false);

	}
	
	if(theForm.payment_type_wanted.value == "") {
		 alert("Please select a Payment Type.");
		 theForm.payment_type_wanted.focus();
		 return(false);

	}
	
	if(theForm.new_or_re_mortgage.value == "") {
		 alert("Please select a value.");
		 theForm.new_or_re_mortgage.focus();
		 return(false);

	}
	
	if(theForm.current_lender.value == "") {
		 alert("Please enter a Current Lender.");
		 theForm.current_lender.focus();
		 return(false);

	}
	
	if(theForm.occupy_or_let.value == "") {
		 alert("Please select a value.");
		 theForm.occupy_or_let.focus();
		 return(false);

	}
	
	if(theForm.mortgage_length.value == "") {
		 alert("Please select a Mortgage Length.");
		 theForm.mortgage_length.focus();
		 return(false);

	}
	
	if(theForm.loan_amount_wanted.value == "") {
		 alert("Please enter a Required Loan Amount.");
		 theForm.loan_amount_wanted.focus();
		 return(false);

	}
	
	if(theForm.property_price.value == "") {
		 alert("Please enter the Property Price.");
		 theForm.property_price.focus();
		 return(false);

	}
	
	if(theForm.property_post_code.value == "") {
		 alert("Please enter the Property Post Code.");
		 theForm.property_post_code.focus();
		 return(false);

	}
	
	if(theForm.app1_first_time_buyer.value == "") {
		 alert("Please select a value.");
		 theForm.app1_first_time_buyer.focus();
		 return(false);

	}
	
	if(theForm.app1_employment_status.value == "") {
		 alert("Please select a value.");
		 theForm.app1_employment_status.focus();
		 return(false);

	}
	
	if(theForm.app1_annual_income.value == "") {
		 alert("Please select a value.");
		 theForm.app1_annual_income.focus();
		 return(false);
	}
	
	if(theForm.app1_extra_income.value == "") {
		 alert("Please select a value.");
		 theForm.app1_extra_income.focus();
		 return(false);
	}

	if(theForm.app1_outgoings_monthly.value == "") {
		 alert("Please select a value.");
		 theForm.app1_outgoings_monthly.focus();
		 return(false);
	}
	
	if(theForm.app1_arrears_or_CCJs.value == "") {
		 alert("Please select a value.");
		 theForm.app1_arrears_or_CCJs.focus();
		 return(false);
	}

	return (true);
}
// end script hiding -->
