$(document).ready(function(){$("span.help").hide();$("#name_help").text("What's your name (required!) ?");$("#location_help").text("Tell me where you are in the world (optional).");$("#email_help").text("Enter a contact email address (optional). This will never be displayed or passed on to anyone!");$("#website_help").text("Got a website of your own? Enter the address here for a link from this page (optional).");$("#message_help").text("What do you want to say (required!) ?");$("#subpub_help").text("Send your message and have it displayed on this page.");$("#subpri_help").text("Send your message but exclude it from being displayed on this page.");$.validator.addMethod("namechars",function(B){return !(/[^\w \.\-\']/.test(B))},"Contains invalid characters");$.validator.addMethod("locationchars",function(B){return !(/[^\w\d \.\-\']/.test(B))},"Contains invalid characters");$.validator.addMethod("messagechars",function(B){return !(/[^\w\d \.\,\_\*\/\#\+\=\-\!\?\$\&\(\)\@\:\;\"\']/.test(B))},"Contains invalid characters");var A=$("#contact_form").validate({rules:{name:{required:true,namechars:true},location:{locationchars:true},email:{email:true},website:{url:true},message:{required:true,maxlength:1024,messagechars:true}},messages:{name:{required:"A name is required"},email:{email:"Enter a valid address"},website:{url:"Enter a valid address"},message:{required:"A message is required"}},event:"keyup",errorPlacement:function(B,C){C.after(B).after("<br>")},showErrors:function(C,B){$("#contact_form :input").removeClass("focussed");A.defaultShowErrors()},success:function(B){B.siblings(":input").removeClass("error")}});$("#contact_form :input").focus(function(){$(this).addClass("focussed");$("span.help").hide();$("#"+this.name+"_help").fadeIn("fast")});$("#contact_form :input").blur(function(){$(this).removeClass("focussed");$("#"+this.name+"_help").hide()})});
