(function(){function b(a){return a.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ").replace(/[0-9.(),;:!?%#$'"_+=\/-]*/g,"")}jQuery.validator.addMethod("maxWords",function(a,f,e){return this.optional(f)||b(a).match(/\b\w+\b/g).length<e},jQuery.validator.format("Please enter {0} words or less."));jQuery.validator.addMethod("minWords",function(a,f,e){return this.optional(f)||b(a).match(/\b\w+\b/g).length>=e},jQuery.validator.format("Please enter at least {0} words."));jQuery.validator.addMethod("rangeWords",function(a,f,e){return this.optional(f)||b(a).match(/\b\w+\b/g).length>=e[0]&&a.match(/bw+b/g).length<e[1]},jQuery.validator.format("Please enter between {0} and {1} words."))})();jQuery.validator.addMethod("letterswithbasicpunc",function(d,c){return this.optional(c)||/^[a-z-.,()'\"\s]+$/i.test(d)},"Letters or punctuation only please");jQuery.validator.addMethod("alphanumeric",function(d,c){return this.optional(c)||/^\w+$/i.test(d)},"Letters, numbers, spaces or underscores only please");jQuery.validator.addMethod("lettersonly",function(d,c){return this.optional(c)||/^[a-z]+$/i.test(d)},"Letters only please");jQuery.validator.addMethod("nowhitespace",function(d,c){return this.optional(c)||/^\S+$/i.test(d)},"No white space please");jQuery.validator.addMethod("ziprange",function(d,c){return this.optional(c)||/^90[2-5]\d\{2}-\d{4}$/.test(d)},"Your ZIP-code must be in the range 902xx-xxxx to 905-xx-xxxx");jQuery.validator.addMethod("integer",function(d,c){return this.optional(c)||/^-?\d+$/.test(d)},"A positive or negative non-decimal number please");jQuery.validator.addMethod("vinUS",function(t){if(t.length!=17){return false}var s,r,q,o,p,n=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],l=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],k=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],m=0;for(s=0;s<17;s++){o=k[s];q=t.slice(s,s+1);if(s==8){p=q}if(isNaN(q)){for(r=0;r<n.length;r++){if(q.toUpperCase()===n[r]){q=l[r];q*=o;if(isNaN(p)&&r==8){p=n[r]}break}}}else{q*=o}m+=q}t=m%11;if(t==10){t="X"}if(t==p){return true}return false},"The specified vehicle identification number (VIN) is invalid.");jQuery.validator.addMethod("dateITA",function(h,g){var l=false;if(/^\d{1,2}\/\d{1,2}\/\d{4}$/.test(h)){var k=h.split("/");l=parseInt(k[0],10);var i=parseInt(k[1],10);k=parseInt(k[2],10);var j=new Date(k,i-1,l);l=j.getFullYear()==k&&j.getMonth()==i-1&&j.getDate()==l?true:false}else{l=false}return this.optional(g)||l},"Please enter a correct date");jQuery.validator.addMethod("dateNL",function(d,c){return this.optional(c)||/^\d\d?[\.\/-]\d\d?[\.\/-]\d\d\d?\d?$/.test(d)},"Vul hier een geldige datum in.");jQuery.validator.addMethod("time",function(d,c){return this.optional(c)||/^([01][0-9])|(2[0123]):([0-5])([0-9])$/.test(d)},"Please enter a valid time, between 00:00 and 23:59");jQuery.validator.addMethod("phoneUS",function(d,c){d=d.replace(/\s+/g,"");return this.optional(c)||d.length>9&&d.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/)},"Please specify a valid phone number");jQuery.validator.addMethod("phoneUK",function(d,c){return this.optional(c)||d.length>9&&d.match(/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/)},"Please specify a valid phone number");jQuery.validator.addMethod("mobileUK",function(d,c){return this.optional(c)||d.length>9&&d.match(/^((0|\+44)7(5|6|7|8|9){1}\d{2}\s?\d{6})$/)},"Please specify a valid mobile number");jQuery.validator.addMethod("strippedminlength",function(e,d,f){return jQuery(e).text().length>=f},jQuery.validator.format("Please enter at least {0} characters"));jQuery.validator.addMethod("email2",function(d,c){return this.optional(c)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(d)},jQuery.validator.messages.email);jQuery.validator.addMethod("url2",function(d,c){return this.optional(c)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(d)},jQuery.validator.messages.url);jQuery.validator.addMethod("creditcardtypes",function(e,d,f){if(/[^0-9-]+/.test(e)){return false}e=e.replace(/\D/g,"");d=0;if(f.mastercard){d|=1}if(f.visa){d|=2}if(f.amex){d|=4}if(f.dinersclub){d|=8}if(f.enroute){d|=16}if(f.discover){d|=32}if(f.jcb){d|=64}if(f.unknown){d|=128}if(f.all){d=255}if(d&1&&/^(51|52|53|54|55)/.test(e)){return e.length==16}if(d&2&&/^(4)/.test(e)){return e.length==16}if(d&4&&/^(34|37)/.test(e)){return e.length==15}if(d&8&&/^(300|301|302|303|304|305|36|38)/.test(e)){return e.length==14}if(d&16&&/^(2014|2149)/.test(e)){return e.length==15}if(d&32&&/^(6011)/.test(e)){return e.length==16}if(d&64&&/^(3)/.test(e)){return e.length==16}if(d&64&&/^(2131|1800)/.test(e)){return e.length==15}if(d&128){return true}return false},"Please enter a valid credit card number.");jQuery.validator.addMethod("ipv4",function(d,c){return this.optional(c)||/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i.test(d)},"Please enter a valid IP v4 address.");jQuery.validator.addMethod("ipv6",function(d,c){return this.optional(c)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(d)},"Please enter a valid IP v6 address.");jQuery.validator.addMethod("ZipcodeUS",function(d,c){return this.optional(c)||/\d{5}\-\d{4}$|^\d{5}$/.test(d)},"This zip is invalid");
