//This is the contact form script
//UK_changed  not used anymore - so I changed form name in submit 
$(document).ready(function(){
	 $("#contact-form").validate();
	 
	 $("#message").rules("add", {
		 maxlength: 200		 
	 });
	
	 $("form#contact-form").submit(function(){
	 	if ($("#contact-form").valid()) {
			var str = $("form").serialize();
			$.ajax({
				type: "POST",
				url: "modules/contactform/contact.php",
				data: str,
				success: function(msg){
					$("#note").ajaxComplete(function(event, request, settings){
						if (msg == 'OK') { // Message Sent? Show the 'Thank You' message and hide the form
							result = '<div class="notification_ok">Your message has been sent. Thank you!</div>';
							$("#fields").hide();
						}
						else {
							result = msg;
						}
						$(this).html(result);
					});
				}
			});
			return false;
		}
	});
});

//end contact form script