	$(document).ready(function() {
		//###   FAQ - ASK A QUESTION FORM   ###
		if ( $("#faqask").length > 0 ) {
			$("#faqask").validate({
				submitHandler: function(form) {
					$(form).ajaxSubmit({ beforeSubmit: showRequest,	 success: faq_Response });
					return false;
				},
				highlight: function(element, errorClass) {
					$(element).addClass('error');
				}
			});
		}

		//###   NEWSLETTER SIGNUP FORM   ###
		if ( $("#signup").length > 0 ) {
			$("#signup").validate({
				submitHandler: function(form) {
					$(form).ajaxSubmit({ beforeSubmit: showRequest,	 success: signup_Response });
					return false;
				},
				highlight: function(element, errorClass) {
					$(element).addClass('error');
				}
			});
		}

		//###   GET CATALOGUE FORM   ###
		if ( $("#getcatalogue").length > 0 ) {
			$("#getcatalogue").validate({
				submitHandler: function(form) {
					$(form).ajaxSubmit({ beforeSubmit: showRequest,	 success: getCat_Response });
					return false;
				},
				highlight: function(element, errorClass) {
					$(element).addClass('error');
				}
			});
		}

		//###   CONTACT US FORM   ###
		if ( $("#contactus").length > 0 ) {
			$("#contactus").validate({
				submitHandler: function(form) {
					$(form).ajaxSubmit({ beforeSubmit: showRequest,	 success: contact_Response });
					return false;
				},
				highlight: function(element, errorClass) {
					$(element).addClass('error');
				}
			});
		}

		//###   SEARCHING   ###
		if ( $("#sitesearch").length > 0 ) {
			$("#sitesearch").validate({
				showErrors: function(errorMap, errorList) {
					var errors = this.numberOfInvalids();
					if (errors) {
						//$("#sitesearch input").addClass('error');
					}
				}
			});
		}
		if ( $("#cataloguesearch").length > 0 ) {
			$("#cataloguesearch").validate({
				showErrors: function(errorMap, errorList) {
					var errors = this.numberOfInvalids();
					if (errors) {
						//$("#cataloguesearch input").addClass('error');
					}
				}
			});
		}
	});

	function showRequest(formData, jqForm, options) {
		return true; 
	}
	function errorCheck(Errors) {
		//###   Check for errors   ###
//alert("error:"+jQuery("h1", responseText).html());
//		if ( jQuery("h1", responseText):contains("Error").length > 0 ) {
//alert("error found");
//}

	}
	function faq_Response(responseText, statusText) {
		//errorCheck();

		if ( $("#faqask").length > 0 ) {
			$("#faqask").hide(1000);
			$("#faqask").after("<p id='form-success'>Thank you - your question has been sent successfully.<p>");
		}
	}
	function signup_Response(responseText, statusText) {
		if ( $("#signup").length > 0 ) {
			$("#signup").hide(1000);
			$("#signup").after("<p id='form-success'>Thank you - you've successfully subscribed to our newsletter.<p>");
		}
	}
	function contact_Response(responseText, statusText) {
		if ( $("#contactus").length > 0 ) {
			$("#contactus").hide(1000);
			$("#contactus").after("<p id='form-success'>Thank you - we'll process your enquiry as soon as possible.<p>");
		}
	}
	function getCat_Response(responseText, statusText) {
		if ( $("#getcatalogue").length > 0 ) {
			$("#getcatalogue").hide(1000);
			$("#getcatalogue").after("<p id='form-success'>Thank you - we'll process your request as soon as possible.<p>");
		}
	}