window.site_l10n_lang = 'en'; window.site_l10n_datepicker_format = 'j M Y'; /* JS merged. Author(s), copyright, license see in original file /w3t_js/jquery/validate/jquery.validate.custom.min.js */ (function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof module==="object"&&module.exports){module.exports=a(require("jquery"))}else{a(jQuery)}}}(function(c){c.extend(c.fn,{validate:function(d){if(!this.length){if(d&&d.debug&&window.console){console.warn("Nothing selected, can't validate, returning nothing.")}return}var e=c.data(this[0],"validator");if(e){return e}this.attr("novalidate","novalidate");e=new c.validator(d,this[0]);c.data(this[0],"validator",e);if(e.settings.onsubmit){this.on("click.validate",":submit",function(f){e.submitButton=f.currentTarget;if(c(this).hasClass("cancel")){e.cancelSubmit=true}if(c(this).attr("formnovalidate")!==undefined){e.cancelSubmit=true}});this.on("submit.validate",function(f){if(e.settings.debug){f.preventDefault()}function g(){var i,h;if(e.submitButton&&(e.settings.submitHandler||e.formSubmitted)){i=c("").attr("name",e.submitButton.name).val(c(e.submitButton).val()).appendTo(e.currentForm)}if(e.settings.submitHandler){h=e.settings.submitHandler.call(e,e.currentForm,f);if(i){i.remove()}if(h!==undefined){return h}return false}return true}if(e.cancelSubmit){e.cancelSubmit=false;return g()}if(e.form()){if(e.pendingRequest){e.formSubmitted=true;return false}return g()}else{e.focusInvalid();return false}})}return e},valid:function(){var e,d,f;if(c(this[0]).is("form")){e=this.validate().form()}else{f=[];e=true;d=c(this[0].form).validate();this.each(function(){e=d.element(this)&&e;if(!e){f=f.concat(d.errorList)}});d.errorList=f}return e},rules:function(g,d){var i=this[0],f,k,l,h,e,j;if(i==null){return}if(!i.form&&i.hasAttribute("contenteditable")){i.form=this.closest("form")[0];i.name=this.attr("name")}if(i.form==null){return}if(g){f=c.data(i.form,"validator").settings;k=f.rules;l=c.validator.staticRules(i);switch(g){case"add":c.extend(l,c.validator.normalizeRule(d));delete l.messages;k[i.name]=l;if(d.messages){f.messages[i.name]=c.extend(f.messages[i.name],d.messages)}break;case"remove":if(!d){delete k[i.name];return l}j={};c.each(d.split(/\s/),function(m,n){j[n]=l[n];delete l[n]});return j}}h=c.validator.normalizeRules(c.extend({},c.validator.classRules(i),c.validator.attributeRules(i),c.validator.dataRules(i),c.validator.staticRules(i)),i);if(h.required){e=h.required;delete h.required;h=c.extend({required:e},h)}if(h.remote){e=h.remote;delete h.remote;h=c.extend(h,{remote:e})}return h}});c.extend(c.expr.pseudos||c.expr[":"],{blank:function(d){return !c.trim(""+c(d).val())},filled:function(d){var e=c(d).val();return e!==null&&!!c.trim(""+e)},unchecked:function(d){return !c(d).prop("checked")}});c.validator=function(d,e){this.settings=c.extend(true,{},c.validator.defaults,d);this.currentForm=e;this.init()};c.validator.format=function(d,e){if(arguments.length===1){return function(){var f=c.makeArray(arguments);f.unshift(d);return c.validator.format.apply(this,f)}}if(e===undefined){return d}if(arguments.length>2&&e.constructor!==Array){e=c.makeArray(arguments).slice(1)}if(e.constructor!==Array){e=[e]}c.each(e,function(f,g){d=d.replace(new RegExp("\\{"+f+"\\}","g"),function(){return g})});return d};c.extend(c.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:false,focusInvalid:true,errorContainer:c([]),errorLabelContainer:c([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(d){this.lastActive=d;if(this.settings.focusCleanup){if(this.settings.unhighlight){this.settings.unhighlight.call(this,d,this.settings.errorClass,this.settings.validClass)}this.hideThese(this.errorsFor(d))}},onfocusout:function(d){if(!this.checkable(d)&&(d.name in this.submitted||!this.optional(d))){this.element(d)}},onkeyup:function(e,f){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];if(f.which===9&&this.elementValue(e)===""||c.inArray(f.keyCode,d)!==-1){return}else{if(e.name in this.submitted||e.name in this.invalid){this.element(e)}}},onclick:function(d){if(d.name in this.submitted){this.element(d)}else{if(d.parentNode.name in this.submitted){this.element(d.parentNode)}}},highlight:function(f,d,e){if(f.type==="radio"){this.findByName(f.name).addClass(d).removeClass(e)}else{c(f).addClass(d).removeClass(e)}},unhighlight:function(f,d,e){if(f.type==="radio"){this.findByName(f.name).removeClass(d).addClass(e)}else{c(f).removeClass(d).addClass(e)}}},setDefaults:function(d){c.extend(c.validator.defaults,d)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:c.validator.format("Please enter no more than {0} characters."),minlength:c.validator.format("Please enter at least {0} characters."),rangelength:c.validator.format("Please enter a value between {0} and {1} characters long."),range:c.validator.format("Please enter a value between {0} and {1}."),max:c.validator.format("Please enter a value less than or equal to {0}."),min:c.validator.format("Please enter a value greater than or equal to {0}."),step:c.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=c(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||c(this.currentForm);this.containers=c(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var d=(this.groups={}),f;c.each(this.settings.groups,function(g,h){if(typeof h==="string"){h=h.split(/\s/)}c.each(h,function(j,i){d[i]=g})});f=this.settings.rules;c.each(f,function(g,h){f[g]=c.validator.normalizeRule(h)});function e(j){if(!this.form&&this.hasAttribute("contenteditable")){this.form=c(this).closest("form")[0];this.name=c(this).attr("name")}var h=c.data(this.form,"validator"),g="on"+j.type.replace(/^validate/,""),i=h.settings;if(i[g]&&!c(this).is(i.ignore)){i[g].call(h,this,j)}}c(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",e).on("click.validate","select, option, [type='radio'], [type='checkbox']",e);if(this.settings.invalidHandler){c(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();c.extend(this.submitted,this.errorMap);this.invalid=c.extend({},this.errorMap);var d=this.valid();if(!d){c(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return d},checkForm:function(){this.prepareForm();for(var d=0,e=(this.currentElements=this.elements());e[d];d++){this.check(e[d])}return this.valid()},element:function(h){var i=this.clean(h),g=this.validationTargetFor(i),f=this,d=true,e,j;if(g===undefined){delete this.invalid[i.name]}else{this.prepareElement(g);this.currentElements=c(g);j=this.groups[g.name];if(j){c.each(this.groups,function(l,k){if(k===j&&l!==g.name){i=f.validationTargetFor(f.clean(f.findByName(l)));if(i&&i.name in f.invalid){f.currentElements.push(i);d=f.check(i)&&d}}})}e=this.check(g)!==false;d=d&&e;if(e){this.invalid[g.name]=false}else{this.invalid[g.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();c(h).attr("aria-invalid",!e)}return d},showErrors:function(e){if(e){var d=this;c.extend(this.errorMap,e);this.errorList=c.map(this.errorMap,function(g,f){return{message:g,element:d.findByName(f)[0]}});this.successList=c.grep(this.successList,function(f){return !(f.name in e)})}if(this.settings.showErrors){this.settings.showErrors.call(this,this.errorMap,this.errorList)}else{this.defaultShowErrors()}},resetForm:function(){if(c.fn.resetForm){c(this.currentForm).resetForm()}this.invalid={};this.submitted={};this.prepareForm();this.hideErrors();var d=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(d)},resetElements:function(e){var d;if(this.settings.unhighlight){for(d=0;e[d];d++){this.settings.unhighlight.call(this,e[d],this.settings.errorClass,"");this.findByName(e[d].name).removeClass(this.settings.validClass)}}else{e.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)}},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(f){var e=0,d;for(d in f){if(f[d]!==undefined&&f[d]!==null&&f[d]!==false){e++}}return e},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(d){d.not(this.containers).text("");this.addWrapper(d).hide()},valid:function(){return this.size()===0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{c(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(d){}}},findLastActive:function(){var d=this.lastActive;return d&&c.grep(this.errorList,function(e){return e.element.name===d.name}).length===1&&d},elements:function(){var e=this,d={};return c(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var f=this.name||c(this).attr("name");if(!f&&e.settings.debug&&window.console){console.error("%o has no name assigned",this)}if(this.hasAttribute("contenteditable")){this.form=c(this).closest("form")[0];this.name=f}if(f in d||!e.objectLength(c(this).rules())){return false}d[f]=true;return true})},clean:function(d){return c(d)[0]},errors:function(){var d=this.settings.errorClass.split(" ").join(".");return c(this.settings.errorElement+"."+d,this.errorContext)},resetInternals:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=c([]);this.toHide=c([])},reset:function(){this.resetInternals();this.currentElements=c([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(d){this.reset();this.toHide=this.errorsFor(d)},elementValue:function(f){var e=c(f),g=f.type,h,d;if(g==="radio"||g==="checkbox"){return this.findByName(f.name).filter(":checked").val()}else{if(g==="number"&&typeof f.validity!=="undefined"){return f.validity.badInput?"NaN":e.val()}}if(f.hasAttribute("contenteditable")){h=e.text()}else{h=e.val()}if(g==="file"){if(h.substr(0,12)==="C:\\fakepath\\"){return h.substr(12)}d=h.lastIndexOf("/");if(d>=0){return h.substr(d+1)}d=h.lastIndexOf("\\");if(d>=0){return h.substr(d+1)}return h}if(typeof h==="string"){return h.replace(/\r/g,"")}return h},check:function(h){h=this.validationTargetFor(this.clean(h));var l=c(h).rules(),j=c.map(l,function(o,e){return e}).length,m=false,f=this.elementValue(h),n,d,k,g;if(typeof l.normalizer==="function"){g=l.normalizer}else{if(typeof this.settings.normalizer==="function"){g=this.settings.normalizer}}if(g){f=g.call(h,f);if(typeof f!=="string"){throw new TypeError("The normalizer should return a string value.")}delete l.normalizer}for(d in l){k={method:d,parameters:l[d]};try{n=c.validator.methods[d].call(this,f,h,k.parameters);if(n==="dependency-mismatch"&&j===1){m=true;continue}m=false;if(n==="pending"){this.toHide=this.toHide.not(this.errorsFor(h));return}if(!n){this.formatAndAdd(h,k);return false}}catch(i){if(this.settings.debug&&window.console){console.log("Exception occurred when checking element "+h.id+", check the '"+k.method+"' method.",i)}if(i instanceof TypeError){i.message+=". Exception occurred when checking element "+h.id+", check the '"+k.method+"' method."}throw i}}if(m){return}if(this.objectLength(l)){this.successList.push(h)}return true},customDataMessage:function(d,e){return c(d).data("msg"+e.charAt(0).toUpperCase()+e.substring(1).toLowerCase())||c(d).data("msg")},customMessage:function(e,f){var d=this.settings.messages[e];return d&&(d.constructor===String?d:d[f])},findDefined:function(){for(var d=0;dWarning: No message defined for "+e.name+""),d=/\$?\{(\d+)\}/g;if(typeof f==="function"){f=f.call(this,g.parameters,e)}else{if(d.test(f)){f=c.validator.format(f.replace(d,"{$1}"),g.parameters)}}return f},formatAndAdd:function(d,f){var e=this.defaultMessage(d,f);this.errorList.push({message:e,element:d,method:f.method});this.errorMap[d.name]=e;this.submitted[d.name]=e},addWrapper:function(d){if(this.settings.wrapper){d=d.add(d.parent(this.settings.wrapper))}return d},defaultShowErrors:function(){var e,f,d;for(e=0;this.errorList[e];e++){d=this.errorList[e];if(this.settings.highlight){this.settings.highlight.call(this,d.element,this.settings.errorClass,this.settings.validClass)}this.showLabel(d.element,d.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(e=0;this.successList[e];e++){this.showLabel(this.successList[e])}}if(this.settings.unhighlight){for(e=0,f=this.validElements();f[e];e++){this.settings.unhighlight.call(this,f[e],this.settings.errorClass,this.settings.validClass)}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return c(this.errorList).map(function(){return this.element})},showLabel:function(g,l){var e,j,f,k,h=this.errorsFor(g),i=this.idOrName(g),d=c(g).attr("aria-describedby");if(h.length){h.removeClass(this.settings.validClass).addClass(this.settings.errorClass);h.html(l)}else{h=c("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(l||"");e=h;if(this.settings.wrapper){e=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(this.labelContainer.length){this.labelContainer.append(e)}else{if(this.settings.errorPlacement){this.settings.errorPlacement.call(this,e,c(g))}else{e.insertAfter(g)}}if(h.is("label")){h.attr("for",i)}else{if(h.parents("label[for='"+this.escapeCssMeta(i)+"']").length===0){f=h.attr("id");if(!d){d=f}else{if(!d.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))){d+=" "+f}}c(g).attr("aria-describedby",d);j=this.groups[g.name];if(j){k=this;c.each(k.groups,function(n,m){if(m===j){c("[name='"+k.escapeCssMeta(n)+"']",k.currentForm).attr("aria-describedby",h.attr("id"))}})}}}}if(!l&&this.settings.success){h.text("");if(typeof this.settings.success==="string"){h.addClass(this.settings.success)}else{this.settings.success(h,g)}}this.toShow=this.toShow.add(h)},errorsFor:function(f){var e=this.escapeCssMeta(this.idOrName(f)),g=c(f).attr("aria-describedby"),d="label[for='"+e+"'], label[for='"+e+"'] *";if(g){d=d+", #"+this.escapeCssMeta(g).replace(/\s+/g,", #")}return this.errors().filter(d)},escapeCssMeta:function(d){return d.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(d){return this.groups[d.name]||(this.checkable(d)?d.name:d.id||d.name)},validationTargetFor:function(d){if(this.checkable(d)){d=this.findByName(d.name)}return c(d).not(this.settings.ignore)[0]},checkable:function(d){return(/radio|checkbox/i).test(d.type)},findByName:function(d){return c(this.currentForm).find("[name='"+this.escapeCssMeta(d)+"']")},getLength:function(e,d){switch(d.nodeName.toLowerCase()){case"select":return c("option:selected",d).length;case"input":if(this.checkable(d)){return this.findByName(d.name).filter(":checked").length}}return e.length},depend:function(e,d){return this.dependTypes[typeof e]?this.dependTypes[typeof e](e,d):true},dependTypes:{"boolean":function(d){return d},string:function(e,d){return !!c(e,d.form).length},"function":function(e,d){return e(d)}},optional:function(d){var e=this.elementValue(d);return !c.validator.methods.required.call(this,e,d)&&"dependency-mismatch"},startRequest:function(d){if(!this.pending[d.name]){this.pendingRequest++;c(d).addClass(this.settings.pendingClass);this.pending[d.name]=true}},stopRequest:function(d,e){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[d.name];c(d).removeClass(this.settings.pendingClass);if(e&&this.pendingRequest===0&&this.formSubmitted&&this.form()){c(this.currentForm).submit();if(this.submitButton){c("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove()}this.formSubmitted=false}else{if(!e&&this.pendingRequest===0&&this.formSubmitted){c(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false}}},previousValue:function(d,e){e=typeof e==="string"&&e||"remote";return c.data(d,"previousValue")||c.data(d,"previousValue",{old:null,valid:true,message:this.defaultMessage(d,{method:e})})},destroy:function(){this.resetForm();c(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur")}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},number:{number:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(d,e){if(d.constructor===String){this.classRuleSettings[d]=e}else{c.extend(this.classRuleSettings,d)}},classRules:function(e){var f={},d=c(e).attr("class");if(d){c.each(d.split(" "),function(){if(this in c.validator.classRuleSettings){c.extend(f,c.validator.classRuleSettings[this])}})}return f},normalizeAttributeRule:function(f,d,g,e){if(/min|max|step/.test(g)&&(d===null||/number|range|text/.test(d))){e=Number(e);if(isNaN(e)){e=undefined}}if(e||e===0){f[g]=e}else{if(d===g&&d!=="range"){f[g]=true}}},attributeRules:function(e){var h={},d=c(e),f=e.getAttribute("type"),i,g;for(i in c.validator.methods){if(i==="required"){g=e.getAttribute(i);if(g===""){g=true}g=!!g}else{g=d.attr(i)}this.normalizeAttributeRule(h,f,i,g)}if(h.maxlength&&/-1|2147483647|524288/.test(h.maxlength)){delete h.maxlength}return h},dataRules:function(e){var h={},d=c(e),f=e.getAttribute("type"),i,g;for(i in c.validator.methods){g=d.data("rule"+i.charAt(0).toUpperCase()+i.substring(1).toLowerCase());this.normalizeAttributeRule(h,f,i,g)}return h},staticRules:function(e){var f={},d=c.data(e.form,"validator");if(d.settings.rules){f=c.validator.normalizeRule(d.settings.rules[e.name])||{}}return f},normalizeRules:function(e,d){c.each(e,function(h,g){if(g===false){delete e[h];return}if(g.param||g.depends){var f=true;switch(typeof g.depends){case"string":f=!!c(g.depends,d.form).length;break;case"function":f=g.depends.call(d,d);break}if(f){e[h]=g.param!==undefined?g.param:true}else{c.data(d.form,"validator").resetElements(c(d));delete e[h]}}});c.each(e,function(f,g){e[f]=c.isFunction(g)&&f!=="normalizer"?g(d):g});c.each(["minlength","maxlength"],function(){if(e[this]){e[this]=Number(e[this])}});c.each(["rangelength","range"],function(){var f;if(e[this]){if(c.isArray(e[this])){e[this]=[Number(e[this][0]),Number(e[this][1])]}else{if(typeof e[this]==="string"){f=e[this].replace(/[\[\]]/g,"").split(/[\s,]+/);e[this]=[Number(f[0]),Number(f[1])]}}}});if(c.validator.autoCreateRanges){if(e.min!=null&&e.max!=null){e.range=[e.min,e.max];delete e.min;delete e.max}if(e.minlength!=null&&e.maxlength!=null){e.rangelength=[e.minlength,e.maxlength];delete e.minlength;delete e.maxlength}}return e},normalizeRule:function(e){if(typeof e==="string"){var d={};c.each(e.split(/\s/),function(){d[this]=true});e=d}return e},addMethod:function(d,f,e){c.validator.methods[d]=f;c.validator.messages[d]=e!==undefined?e:c.validator.messages[d];if(f.length<3){c.validator.addClassRules(d,c.validator.normalizeRule(d))}},methods:{required:function(e,d,g){if(!this.depend(g,d)){return"dependency-mismatch"}if(d.nodeName.toLowerCase()==="select"){var f=c(d).val();return f&&f.length>0}if(this.checkable(d)){return this.getLength(e,d)>0}return e.length>0},email:function(e,d){return this.optional(d)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e)},url:function(e,d){return this.optional(d)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e)},date:function(e,d){return this.optional(d)||!/Invalid|NaN/.test(new Date(e).toString())},dateISO:function(e,d){return this.optional(d)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(e)},number:function(e,d){return this.optional(d)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(e)},digits:function(e,d){return this.optional(d)||/^\d+$/.test(e)},minlength:function(f,d,g){var e=c.isArray(f)?f.length:this.getLength(f,d);return this.optional(d)||e>=g},maxlength:function(f,d,g){var e=c.isArray(f)?f.length:this.getLength(f,d);return this.optional(d)||e<=g},rangelength:function(f,d,g){var e=c.isArray(f)?f.length:this.getLength(f,d);return this.optional(d)||(e>=g[0]&&e<=g[1])},min:function(e,d,f){return this.optional(d)||e>=f},max:function(e,d,f){return this.optional(d)||e<=f},range:function(e,d,f){return this.optional(d)||(e>=f[0]&&e<=f[1])},step:function(n,h,f){var m=c(h).attr("type"),l="Step attribute on input type "+m+" is not supported.",k=["text","number","range"],o=new RegExp("\\b"+m+"\\b"),i=m&&!o.test(k.join()),g=function(q){var p=(""+q).match(/(?:\.(\d+))?$/);if(!p){return 0}return p[1]?p[1].length:0},j=function(p){return Math.round(p*Math.pow(10,e))},d=true,e;if(i){throw new Error(l)}e=g(f);if(g(n)>e||j(n)%j(f)!==0){d=false}return this.optional(h)||d},equalTo:function(e,d,g){var f=c(g);if(this.settings.onfocusout&&f.not(".validate-equalTo-blur").length){f.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){c(d).valid()})}return e===f.val()},remote:function(i,e,j,k){if(this.optional(e)){return"dependency-mismatch"}k=typeof k==="string"&&k||"remote";var f=this.previousValue(e,k),d,h,g;if(!this.settings.messages[e.name]){this.settings.messages[e.name]={}}f.originalMessage=f.originalMessage||this.settings.messages[e.name][k];this.settings.messages[e.name][k]=f.message;j=typeof j==="string"&&{url:j}||j;g=c.param(c.extend({data:i},j.data));if(f.old===g){return f.valid}f.old=g;d=this;this.startRequest(e);h={};h[e.name]=i;c.ajax(c.extend(true,{mode:"abort",port:"validate"+e.name,dataType:"json",data:h,context:d.currentForm,success:function(m){var o=m===true||m==="true",p,n,l;d.settings.messages[e.name][k]=f.originalMessage;if(o){l=d.formSubmitted;d.resetInternals();d.toHide=d.errorsFor(e);d.formSubmitted=l;d.successList.push(e);d.invalid[e.name]=false;d.showErrors()}else{p={};n=m||d.defaultMessage(e,{method:k,parameters:i});p[e.name]=f.message=n;d.invalid[e.name]=true;d.showErrors(p)}f.valid=o;d.stopRequest(e,o)}},j));return"pending"}}});var a={},b;if(c.ajaxPrefilter){c.ajaxPrefilter(function(f,e,g){var d=f.port;if(f.mode==="abort"){if(a[d]){a[d].abort()}a[d]=g}})}else{b=c.ajax;c.ajax=function(e){var f=("mode" in e?e:c.ajaxSettings).mode,d=("port" in e?e:c.ajaxSettings).port;if(f==="abort"){if(a[d]){a[d].abort()}a[d]=b.apply(this,arguments);return a[d]}return b.apply(this,arguments)}}return c})); /* JS merged. Author(s), copyright, license see in original file /w3t_js/jquery/validate/additional-methods.custom.min.js */ (function(a){if(typeof define==="function"&&define.amd){define(["jquery","./jquery.validate"],a)}else{if(typeof module==="object"&&module.exports){module.exports=a(require("jquery"))}else{a(jQuery)}}}(function(a){jQuery.validator.addMethod("requiredWysiwyg",function(c,b,e){if(b.name==undefined||b.name==null){return true}var d=FCKeditorAPI.GetInstance(b.name);if(d==undefined||d==null){return true}return(d.GetXHTML().length>7)},jQuery.validator.format("Field is required"));jQuery.validator.addMethod("login",function(c,b){return this.optional(b)||/^[a-z\d\-]+$/i.test(c)},'Please enter only letters, digits or "-"');jQuery.validator.addMethod("non_only_spaces",function(c,b){return this.optional(b)||/[^\s]/i.test(c)},"Please enter non spaces only data");jQuery.validator.addMethod("alphaPlusNumeric",function(c,b){if(this.optional(b)){return true}if(!(/^[a-z\d \-]+$/i.test(c))){return false}if(!(/[a-z]/i.test(c))){return false}return true},"Letters are required and numbers are allowed");jQuery.validator.addMethod("numericPlusAlpha",function(c,b){if(this.optional(b)){return true}if(!(/^[a-z\d \-]+$/i.test(c))){return false}if(!(/[\d]/i.test(c))){return false}return true},"Numbers are required and letters are allowed");jQuery.validator.addMethod("phoneIntl",function(c,b){if(this.optional(b)){return true}if(!(/^[\d \+\(\)\-]+$/i.test(c))){return false}if(!(/[\d]/i.test(c))){return false}return true},"Please specify a valid phone number");jQuery.validator.addMethod("deadlines_order",function(d,c){var e=jQuery("#id_deadline_date").datepicker("getDate");var b=jQuery("#id_deadline_draft_date").datepicker("getDate");if(b==null||e==null){return true}if(b]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(d,c,e){return this.optional(c)||b(d).match(/\b\w+\b/g).length<=e},a.validator.format("Please enter {0} words or less."));a.validator.addMethod("minWords",function(d,c,e){return this.optional(c)||b(d).match(/\b\w+\b/g).length>=e},a.validator.format("Please enter at least {0} words."));a.validator.addMethod("rangeWords",function(f,c,g){var e=b(f),d=/\b\w+\b/g;return this.optional(c)||e.match(d).length>=g[0]&&e.match(d).length<=g[1]},a.validator.format("Please enter between {0} and {1} words."))}());a.validator.addMethod("accept",function(g,d,j){var h=typeof j==="string"?j.replace(/\s/g,""):"image/*",f=this.optional(d),c,b,e;if(f){return f}if(a(d).attr("type")==="file"){h=h.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g,"\\$&").replace(/,/g,"|").replace(/\/\*/g,"/.*");if(d.files&&d.files.length){e=new RegExp(".?("+h+")$","i");for(c=0;c9?"0":o;m="JABCDEFGHI".substr(o,1).toString();if(f.match(/[ABEH]/)){return k===o}else{if(f.match(/[KPQS]/)){return k===m}}return k===o||k===m},"Please specify a valid CIF number.");a.validator.addMethod("cpfBR",function(g){g=g.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,"");if(g.length!==11){return false}var f=0,e,d,c,b;e=parseInt(g.substring(9,10),10);d=parseInt(g.substring(10,11),10);c=function(i,j){var h=(i*10)%11;if((h===10)||(h===11)){h=0}return(h===j)};if(g===""||g==="00000000000"||g==="11111111111"||g==="22222222222"||g==="33333333333"||g==="44444444444"||g==="55555555555"||g==="66666666666"||g==="77777777777"||g==="88888888888"||g==="99999999999"){return false}for(b=1;b<=9;b++){f=f+parseInt(g.substring(b-1,b),10)*(11-b)}if(c(f,e)){f=0;for(b=1;b<=10;b++){f=f+parseInt(g.substring(b-1,b),10)*(12-b)}return c(f,d)}return false},"Please specify a valid CPF number");a.validator.addMethod("creditcard",function(f,c){if(this.optional(c)){return"dependency-mismatch"}if(/[^0-9 \-]+/.test(f)){return false}var g=0,e=0,b=false,h,d;f=f.replace(/\D/g,"");if(f.length<13||f.length>19){return false}for(h=f.length-1;h>=0;h--){d=f.charAt(h);e=parseInt(d,10);if(b){if((e*=2)>9){e-=9}}g+=e;b=!b}return(g%10)===0},"Please enter a valid credit card number.");a.validator.addMethod("creditcardtypes",function(c,b,d){if(/[^0-9\-]+/.test(c)){return false}c=c.replace(/\D/g,"");var e=0;if(d.mastercard){e|=1}if(d.visa){e|=2}if(d.amex){e|=4}if(d.dinersclub){e|=8}if(d.enroute){e|=16}if(d.discover){e|=32}if(d.jcb){e|=64}if(d.unknown){e|=128}if(d.all){e=1|2|4|8|16|32|64|128}if(e&1&&/^(5[12345])/.test(c)){return c.length===16}if(e&2&&/^(4)/.test(c)){return c.length===16}if(e&4&&/^(3[47])/.test(c)){return c.length===15}if(e&8&&/^(3(0[012345]|[68]))/.test(c)){return c.length===14}if(e&16&&/^(2(014|149))/.test(c)){return c.length===15}if(e&32&&/^(6011)/.test(c)){return c.length===16}if(e&64&&/^(3)/.test(c)){return c.length===16}if(e&64&&/^(2131|1800)/.test(c)){return c.length===15}if(e&128){return true}return false},"Please enter a valid credit card number.");a.validator.addMethod("currency",function(g,d,h){var c=typeof h==="string",f=c?h:h[0],b=c?true:h[1],e;f=f.replace(/,/g,"");f=b?f+"]":f+"]?";e="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$";e=new RegExp(e);return this.optional(d)||e.test(g)},"Please specify a valid currency");a.validator.addMethod("dateFA",function(c,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(c)},a.validator.messages.date);a.validator.addMethod("dateITA",function(f,d){var b=false,h=/^\d{1,2}\/\d{1,2}\/\d{4}$/,j,e,c,g,i;if(h.test(f)){j=f.split("/");e=parseInt(j[0],10);c=parseInt(j[1],10);g=parseInt(j[2],10);i=new Date(Date.UTC(g,c-1,e,12,0,0,0));if((i.getUTCFullYear()===g)&&(i.getUTCMonth()===c-1)&&(i.getUTCDate()===e)){b=true}else{b=false}}else{b=false}return this.optional(d)||b},a.validator.messages.date);a.validator.addMethod("dateNL",function(c,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(c)},a.validator.messages.date);a.validator.addMethod("extension",function(c,b,d){d=typeof d==="string"?d.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||c.match(new RegExp("\\.("+d+")$","i"))},a.validator.format("Please enter a value with a valid extension."));a.validator.addMethod("giroaccountNL",function(c,b){return this.optional(b)||/^[0-9]{1,7}$/.test(c)},"Please specify a valid giro account number");a.validator.addMethod("iban",function(r,l){if(this.optional(l)){return true}var g=r.replace(/ /g,"").toUpperCase(),h="",m=true,t="",s="",d,f,e,q,n,b,k,j,c;var o=5;if(g.length9&&b.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number");a.validator.addMethod("netmask",function(c,b){return this.optional(b)||/^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test(c)},"Please enter a valid netmask.");a.validator.addMethod("nieES",function(g,c){if(this.optional(c)){return true}var f=new RegExp(/^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi);var b="TRWAGMYFPDXBNJZSQVHLCKET",e=g.substr(g.length-1).toUpperCase(),d;g=g.toString().toUpperCase();if(g.length>10||g.length<9||!f.test(g)){return false}g=g.replace(/^[X]/,"0").replace(/^[Y]/,"1").replace(/^[Z]/,"2");d=g.length===9?g.substr(0,8):g.substr(0,9);return b.charAt(parseInt(d,10)%23)===e},"Please specify a valid NIE number.");a.validator.addMethod("nifES",function(c,b){if(this.optional(b)){return true}c=c.toUpperCase();if(!c.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")){return false}if(/^[0-9]{8}[A-Z]{1}$/.test(c)){return("TRWAGMYFPDXBNJZSQVHLCKE".charAt(c.substring(8,0)%23)===c.charAt(8))}if(/^[KLM]{1}/.test(c)){return(c[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(c.substring(8,1)%23))}return false},"Please specify a valid NIF number.");a.validator.addMethod("nipPL",function(f){f=f.replace(/[^0-9]/g,"");if(f.length!==10){return false}var e=[6,5,7,2,3,4,5,6,7];var b=0;for(var c=0;c<9;c++){b+=e[c]*f[c]}var g=b%11;var d=(g===10)?0:g;return(d===parseInt(f[9],10))},"Please specify a valid NIP number.");a.validator.addMethod("notEqualTo",function(c,b,d){return this.optional(b)||!a.validator.methods.equalTo.call(this,c,b,d)},"Please enter a different value, values must not be the same.");a.validator.addMethod("nowhitespace",function(c,b){return this.optional(b)||/^\S+$/i.test(c)},"No white space please");a.validator.addMethod("pattern",function(c,b,d){if(this.optional(b)){return true}if(typeof d==="string"){d=new RegExp("^(?:"+d+")$")}return d.test(c)},"Invalid format.");a.validator.addMethod("phoneNL",function(c,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(c)},"Please specify a valid phone number.");a.validator.addMethod("phonesUK",function(b,c){b=b.replace(/\(|\)|\s+|-/g,"");return this.optional(c)||b.length>9&&b.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number");a.validator.addMethod("phoneUK",function(b,c){b=b.replace(/\(|\)|\s+|-/g,"");return this.optional(c)||b.length>9&&b.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number");a.validator.addMethod("phoneUS",function(b,c){b=b.replace(/\s+/g,"");return this.optional(c)||b.length>9&&b.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/)},"Please specify a valid phone number");a.validator.addMethod("postalcodeBR",function(c,b){return this.optional(b)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(c)},"Informe um CEP válido.");a.validator.addMethod("postalCodeCA",function(c,b){return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test(c)},"Please specify a valid postal code");a.validator.addMethod("postalcodeIT",function(c,b){return this.optional(b)||/^\d{5}$/.test(c)},"Please specify a valid postal code");a.validator.addMethod("postalcodeNL",function(c,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(c)},"Please specify a valid postal code");a.validator.addMethod("postcodeUK",function(c,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(c)},"Please specify a valid UK postcode");a.validator.addMethod("require_from_group",function(f,e,c){var b=a(c[1],e.form),h=b.eq(0),d=h.data("valid_req_grp")?h.data("valid_req_grp"):a.extend({},this),g=b.filter(function(){return d.elementValue(this)}).length>=c[0];h.data("valid_req_grp",d);if(!a(e).data("being_validated")){b.data("being_validated",true);b.each(function(){d.element(this)});b.data("being_validated",false)}return g},a.validator.format("Please fill at least {0} of these fields."));a.validator.addMethod("skip_or_fill_minimum",function(f,e,c){var b=a(c[1],e.form),i=b.eq(0),d=i.data("valid_skip")?i.data("valid_skip"):a.extend({},this),h=b.filter(function(){return d.elementValue(this)}).length,g=h===0||h>=c[0];i.data("valid_skip",d);if(!a(e).data("being_validated")){b.data("being_validated",true);b.each(function(){d.element(this)});b.data("being_validated",false)}return g},a.validator.format("Please either skip these fields or fill at least {0} of them."));a.validator.addMethod("stateUS",function(h,e,d){var g=typeof d==="undefined",b=(g||typeof d.caseSensitive==="undefined")?false:d.caseSensitive,i=(g||typeof d.includeTerritories==="undefined")?false:d.includeTerritories,c=(g||typeof d.includeMilitary==="undefined")?false:d.includeMilitary,f;if(!i&&!c){f="^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"}else{if(i&&c){f="^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"}else{if(i){f="^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"}else{f="^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"}}}f=b?new RegExp(f):new RegExp(f,"i");return this.optional(e)||f.test(h)},"Please specify a valid state");a.validator.addMethod("strippedminlength",function(c,b,d){return a(c).text().length>=d},a.validator.format("Please enter at least {0} characters"));a.validator.addMethod("time",function(c,b){return this.optional(b)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(c)},"Please enter a valid time, between 00:00 and 23:59");a.validator.addMethod("time12h",function(c,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(c)},"Please enter a valid time in 12-hour am/pm format");a.validator.addMethod("url2",function(c,b){return this.optional(b)||/^(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(c)},a.validator.messages.url);a.validator.addMethod("vinUS",function(p){if(p.length!==17){return false}var e=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],o=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],g=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],h=0,j,c,m,k,b,l;for(j=0;j<17;j++){k=g[j];m=p.slice(j,j+1);if(j===8){l=m}if(!isNaN(m)){m*=k}else{for(c=0;c1){element_parent=element_parent.parent();} if(element_parent.length==1){element_parent.addClass(errorClass).removeClass(validClass);}} else if(element.type==='radio'||(element.type==='checkbox'&&element.name.substr(element.name.length-2)=='[]')){jQuery('input[name="'+element.name+'"]').addClass(errorClass).removeClass(validClass);var element_parent=jQuery('input[name="'+element.name+'"]').parent();while(element_parent.length>1){element_parent=element_parent.parent();} if(element_parent.length==1){element_parent.addClass(errorClass).removeClass(validClass);}}else{jQuery.validator.defaults.highlightOrig(element,errorClass,validClass);}} jQuery.validator.defaults.unhighlightOrig=jQuery.validator.defaults.unhighlight;jQuery.validator.defaults.unhighlight=function(element,errorClass,validClass){if(jQuery(element).hasClass('validation_error_to_parent')){var element_parent=jQuery(element).parent();while(element_parent.length>1){element_parent=element_parent.parent();} if(element_parent.length==1){element_parent.removeClass(errorClass).addClass(validClass);}} else if(element.type==='radio'||(element.type==='checkbox'&&element.name.substr(element.name.length-2)=='[]')||jQuery(element).hasClass('validation_error_to_parent')){jQuery('input[name="'+element.name+'"]').removeClass(errorClass).addClass(validClass);var element_parent=jQuery('input[name="'+element.name+'"]').parent();while(element_parent.length>1){element_parent=element_parent.parent();} if(element_parent.length==1){element_parent.removeClass(errorClass).addClass(validClass);}}else{jQuery.validator.defaults.unhighlightOrig(element,errorClass,validClass);}}} /* JS merged. Author(s), copyright, license see in original file /w3t_js/jquery/datepicker/zebra/zebra_datepicker.js */ (function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof exports==="object"){a(require("jquery"))}else{a(jQuery)}}}(function(a){a.Zebra_DatePicker=function(z,K){var O={always_visible:false,container:a("body"),custom_classes:false,days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],days_abbr:false,default_position:"above",direction:0,disabled_dates:false,enabled_dates:false,first_day_of_week:1,format:"Y-m-d",header_captions:{days:"F, Y",months:"Y",years:"Y1 - Y2"},header_navigation:["«","»"],icon_position:"right",inside:true,lang_clear_date:"Clear date",months:["January","February","March","April","May","June","July","August","September","October","November","December"],months_abbr:false,offset:[5,-5],open_icon_only:false,pair:false,readonly_element:true,select_other_months:false,show_clear_date:0,show_icon:true,show_other_months:true,show_select_today:"Today",show_week_number:false,start_date:false,strict:false,view:"days",weekend_days:[0,6],zero_pad:false,onChange:null,onClear:null,onOpen:null,onClose:null,onSelect:null};var e,N,w,j,T,b,q,Q,o,D,k,A,B,Z,p,G,J,ae,ah,ab,v,X,al,V,I,d,t,U,F,R,f,x,L,s,Y,ad,W,aj,ac;var ai=this;ai.settings={};var i=a(z);var af=function(aA){W=Math.floor((1+Math.random())*65536).toString(16);if(!aA){ai.settings=a.extend({},O,K);for(var aP in i.data()){if(aP.indexOf("zdp_")===0){aP=aP.replace(/^zdp\_/,"");if(undefined!==O[aP]){ai.settings[aP]=(aP=="pair"?a(i.data("zdp_"+aP)):i.data("zdp_"+aP))}}}}if(ai.settings.readonly_element){i.attr("readonly","readonly")}var ap={days:["d","j","D"],months:["F","m","M","n","t"],years:["o","Y","y"]},ar=false,az=false,ay=false,at=null;for(at in ap){a.each(ap[at],function(aR,aS){if(ai.settings.format.indexOf(aS)>-1){if(at=="days"){ar=true}else{if(at=="months"){az=true}else{if(at=="years"){ay=true}}}}})}if(ar&&az&&ay){f=["years","months","days"]}else{if(!ar&&az&&ay){f=["years","months"]}else{if(ar&&az&&!ay){f=["months","days"]}else{if(!ar&&!az&&ay){f=["years"]}else{if(!ar&&az&&!ay){f=["months"]}else{f=["years","months","days"]}}}}}if(a.inArray(ai.settings.view,f)==-1){ai.settings.view=f[f.length-1]}v=[];ab=[];aj={};ac=[];var av;for(var aH in ai.settings.custom_classes){if(ai.settings.custom_classes.hasOwnProperty(aH)){ac.push(aH)}}for(var aG=0;aG<2+ac.length;aG++){if(aG===0){av=ai.settings.disabled_dates}else{if(aG==1){av=ai.settings.enabled_dates}else{av=ai.settings.custom_classes[ac[aG-2]]}}if(a.isArray(av)&&av.length>0){a.each(av,function(){var aV=this.split(" ");for(var aU=0;aU<4;aU++){if(!aV[aU]){aV[aU]="*"}aV[aU]=(aV[aU].indexOf(",")>-1?aV[aU].split(","):new Array(aV[aU]));for(var aT=0;aT-1){var aS=aV[aU][aT].match(/^([0-9]+)\-([0-9]+)/);if(null!==aS){for(var aR=r(aS[1]);aR<=r(aS[2]);aR++){if(a.inArray(aR,aV[aU])==-1){aV[aU].push(aR+"")}}aV[aU].splice(aT,1)}}}for(aT=0;aT0)||(a.isArray(ai.settings.direction)&&((aJ=l(ai.settings.direction[0]))||ai.settings.direction[0]===true||(ag(ai.settings.direction[0])&&ai.settings.direction[0]>0))&&((aK=l(ai.settings.direction[1]))||ai.settings.direction[1]===false||(ag(ai.settings.direction[1])&&ai.settings.direction[1]>=0)))){if(aJ){al=aJ}else{al=new Date(B,A,Z+(!a.isArray(ai.settings.direction)?r(ai.settings.direction):r(ai.settings.direction[0]===true?0:ai.settings.direction[0])))}A=al.getMonth();B=al.getFullYear();Z=al.getDate();if(aK&&+aK>=+al){V=aK}else{if(!aK&&ai.settings.direction[1]!==false&&a.isArray(ai.settings.direction)){V=new Date(B,A,Z+r(ai.settings.direction[1]))}}if(V){t=V.getMonth();d=V.getFullYear();I=V.getDate()}}else{if((!a.isArray(ai.settings.direction)&&ag(ai.settings.direction)&&r(ai.settings.direction)<0)||(a.isArray(ai.settings.direction)&&(ai.settings.direction[0]===false||(ag(ai.settings.direction[0])&&ai.settings.direction[0]<0))&&((aJ=l(ai.settings.direction[1]))||(ag(ai.settings.direction[1])&&ai.settings.direction[1]>=0)))){V=new Date(B,A,Z+(!a.isArray(ai.settings.direction)?r(ai.settings.direction):r(ai.settings.direction[0]===false?0:ai.settings.direction[0])));t=V.getMonth();d=V.getFullYear();I=V.getDate();if(aJ&&+aJ<+V){al=aJ}else{if(!aJ&&a.isArray(ai.settings.direction)){al=new Date(d,t,I-r(ai.settings.direction[1]))}}if(al){A=al.getMonth();B=al.getFullYear();Z=al.getDate()}}else{if(a.isArray(ai.settings.disabled_dates)&&ai.settings.disabled_dates.length>0){for(var aL in v){if(v[aL][0]=="*"&&v[aL][1]=="*"&&v[aL][2]=="*"&&v[aL][3]=="*"){var aF=[];a.each(ab,function(){var aR=this;if(aR[2][0]!="*"){aF.push(parseInt(aR[2][0]+(aR[1][0]=="*"?"12":y(aR[1][0],2))+(aR[0][0]=="*"?(aR[1][0]=="*"?"31":new Date(aR[2][0],aR[1][0],0).getDate()):y(aR[0][0],2)),10))}});aF.sort();if(aF.length>0){var ao=(aF[0]+"").match(/([0-9]{4})([0-9]{2})([0-9]{2})/);B=parseInt(ao[1],10);A=parseInt(ao[2],10)-1;Z=parseInt(ao[3],10)}break}}}}}}}if(aa(B,A,Z)){while(aa(B)){if(!al){B--;A=11}else{B++;A=0}}while(aa(B,A)){if(!al){A--;Z=new Date(B,A+1,0).getDate()}else{A++;Z=1}if(A>11){B++;A=0;Z=1}else{if(A<0){B--;A=11;Z=new Date(B,A+1,0).getDate()}}}while(aa(B,A,Z)){if(!al){Z--}else{Z++}aM=new Date(B,A,Z);B=aM.getFullYear();A=aM.getMonth();Z=aM.getDate()}aM=new Date(B,A,Z);B=aM.getFullYear();A=aM.getMonth();Z=aM.getDate()}var aw=l(i.val()||(ai.settings.start_date?ai.settings.start_date:""));if(aw&&ai.settings.strict&&aa(aw.getFullYear(),aw.getMonth(),aw.getDate())){i.val("")}if(!aA&&(undefined!==al||undefined!==aw)){u(undefined!==aw?aw:al)}if(!ai.settings.always_visible){if(!aA){if(ai.settings.show_icon){if(g.name=="firefox"&&i.is('input[type="text"]')&&i.css("display")=="inline"){i.css("display","inline-block")}var aE=a('').css({display:i.css("display"),position:i.css("position")=="static"?"relative":i.css("position"),"float":i.css("float"),top:i.css("top"),right:i.css("right"),bottom:i.css("bottom"),left:i.css("left")});i.wrap(aE).css({position:"relative",top:"auto",right:"auto",bottom:"auto",left:"auto"});w=a('');ai.icon=w;x=ai.settings.open_icon_only?w:w.add(i)}else{x=i}x.bind("click",function(aR){aR.preventDefault();if(!i.attr("disabled")){if(N.hasClass("dp_visible")){ai.hide()}else{ai.show()}}});if(!ai.settings.readonly_element&&ai.settings.pair){i.bind("blur.Zebra_DatePicker_"+W,function(){var aR;if((aR=l(a(this).val()))&&!aa(aR.getFullYear(),aR.getMonth(),aR.getDate())){u(aR)}})}if(undefined!==w){w.insertAfter(i)}}if(undefined!==w){w.attr("style","");if(ai.settings.inside){w.addClass("Zebra_DatePicker_Icon_Inside");w.addClass("Zebra_DatePicker_Icon_Inside_"+(ai.settings.icon_position=="right"?"Right":"Left"))}var ax=i.outerWidth(),aI=i.outerHeight(),aQ=parseInt(i.css("marginLeft"),10)||0,aN=parseInt(i.css("marginTop"),10)||0,aq=w.outerWidth(),aD=w.outerHeight(),aB=parseInt(w.css("marginLeft"),10)||0,aO=parseInt(w.css("marginRight"),10)||0;if(ai.settings.inside){w.css("top",aN+((aI-aD)/2));if(ai.settings.icon_position=="right"){w.css("right",0)}else{w.css("left",0)}}else{w.css({top:aN+((aI-aD)/2),left:aQ+ax+aB})}w.removeClass(" Zebra_DatePicker_Icon_Disabled");if(i.attr("disabled")=="disabled"){w.addClass("Zebra_DatePicker_Icon_Disabled")}}}Y=(ai.settings.show_select_today!==false&&a.inArray("days",f)>-1&&!aa(D,o,k)?ai.settings.show_select_today:false);if(aA){a(".dp_previous",N).html(ai.settings.header_navigation[0]);a(".dp_next",N).html(ai.settings.header_navigation[1]);a(".dp_clear",N).html(ai.settings.lang_clear_date);a(".dp_today",N).html(ai.settings.show_select_today);return}a(window).bind("resize.Zebra_DatePicker_"+W+", orientationchange.Zebra_DatePicker_"+W,function(){ai.hide();if(w!==undefined){clearTimeout(ad);ad=setTimeout(function(){ai.update()},100)}});var aC='
'+ai.settings.header_navigation[0]+' '+ai.settings.header_navigation[1]+'
";N=a(aC);ai.datepicker=N;j=a("table.dp_header",N);T=a("table.dp_daypicker",N);b=a("table.dp_monthpicker",N);q=a("table.dp_yearpicker",N);s=a("table.dp_footer",N);L=a("td.dp_today",s);Q=a("td.dp_clear",s);if(!ai.settings.always_visible){ai.settings.container.append(N)}else{if(!i.attr("disabled")){ai.settings.always_visible.append(N);ai.show()}}N.delegate("td:not(.dp_disabled, .dp_weekend_disabled, .dp_not_in_month, .dp_week_number)","mouseover",function(){a(this).addClass("dp_hover")}).delegate("td:not(.dp_disabled, .dp_weekend_disabled, .dp_not_in_month, .dp_week_number)","mouseout",function(){a(this).removeClass("dp_hover")});n(a("td",j));a(".dp_previous",j).bind("click",function(){if(e=="months"){G--}else{if(e=="years"){G-=12}else{if(--p<0){p=11;G--}}}S()});a(".dp_caption",j).bind("click",function(){if(e=="days"){e=(a.inArray("months",f)>-1?"months":(a.inArray("years",f)>-1?"years":"days"))}else{if(e=="months"){e=(a.inArray("years",f)>-1?"years":(a.inArray("days",f)>-1?"days":"months"))}else{e=(a.inArray("days",f)>-1?"days":(a.inArray("months",f)>-1?"months":"years"))}}S()});a(".dp_next",j).bind("click",function(){if(e=="months"){G++}else{if(e=="years"){G+=12}else{if(++p==12){p=0;G++}}}S()});T.delegate("td:not(.dp_disabled, .dp_weekend_disabled, .dp_not_in_month, .dp_week_number)","click",function(){if(ai.settings.select_other_months&&a(this).attr("class")&&null!==(ao=a(this).attr("class").match(/date\_([0-9]{4})(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])/))){m(ao[1],ao[2]-1,ao[3],"days",a(this))}else{m(G,p,r(a(this).html()),"days",a(this))}});b.delegate("td:not(.dp_disabled)","click",function(){var aR=a(this).attr("class").match(/dp\_month\_([0-9]+)/);p=r(aR[1]);if(a.inArray("days",f)==-1){m(G,p,1,"months",a(this))}else{e="days";if(ai.settings.always_visible){i.val("")}S()}});q.delegate("td:not(.dp_disabled)","click",function(){G=r(a(this).html());if(a.inArray("months",f)==-1){m(G,1,1,"years",a(this))}else{e="months";if(ai.settings.always_visible){i.val("")}S()}});a(L).bind("click",function(aR){aR.preventDefault();m(D,o,k,"days",a(".dp_current",T));if(ai.settings.always_visible){ai.show()}ai.hide()});a(Q).bind("click",function(aR){aR.preventDefault();i.val("");if(!ai.settings.always_visible){J=null;ae=null;ah=null;p=null;G=null}else{J=null;ae=null;ah=null;a("td.dp_selected",N).removeClass("dp_selected")}ai.hide();if(ai.settings.onClear&&typeof ai.settings.onClear=="function"){ai.settings.onClear.call(i,i)}});if(!ai.settings.always_visible){a(document).bind("mousedown.Zebra_DatePicker_"+W+", touchstart.Zebra_DatePicker_"+W,function(aR){if(N.hasClass("dp_visible")){if(ai.settings.show_icon&&a(aR.target).get(0)===w.get(0)){return true}if(a(aR.target).parents().filter(".Zebra_DatePicker").length===0){ai.hide()}}});a(document).bind("keyup.Zebra_DatePicker_"+W,function(aR){if(N.hasClass("dp_visible")&&aR.which==27){ai.hide()}})}S()};ai.clear_date=function(){a(Q).trigger("click")};ai.destroy=function(){if(undefined!==ai.icon){ai.icon.remove()}ai.datepicker.remove();a(document).unbind("keyup.Zebra_DatePicker_"+W);a(document).unbind("mousedown.Zebra_DatePicker_"+W);a(window).unbind("resize.Zebra_DatePicker_"+W);a(window).unbind("orientationchange.Zebra_DatePicker_"+W);i.removeData("Zebra_DatePicker")};ai.hide=function(){if(!ai.settings.always_visible){P("hide");N.removeClass("dp_visible").addClass("dp_hidden");if(ai.settings.onClose&&typeof ai.settings.onClose=="function"){ai.settings.onClose.call(i,i)}}};ai.set_date=function(ap){var ao;if((ao=l(ap))&&!aa(ao.getFullYear(),ao.getMonth(),ao.getDate())){i.val(ap);u(ao)}};ai.show=function(){e=ai.settings.view;var ao=l(i.val()||(ai.settings.start_date?ai.settings.start_date:""));if(ao){ae=ao.getMonth();p=ao.getMonth();ah=ao.getFullYear();G=ao.getFullYear();J=ao.getDate();if(aa(ah,ae,J)){if(ai.settings.strict){i.val("")}p=A;G=B}}else{p=A;G=B}S();if(!ai.settings.always_visible){if(ai.settings.container.is("body")){var au=N.outerWidth(),at=N.outerHeight(),ar=(undefined!==w?w.offset().left+w.outerWidth(true):i.offset().left+i.outerWidth(true))+ai.settings.offset[0],aw=(undefined!==w?w.offset().top:i.offset().top)-at+ai.settings.offset[1],aq=a(window).width(),ax=a(window).height(),ap=a(window).scrollTop(),av=a(window).scrollLeft();if(ai.settings.default_position=="below"){aw=(undefined!==w?w.offset().top:i.offset().top)+ai.settings.offset[1]}if(ar+au>av+aq){ar=av+aq-au}if(arap+ax){aw=ap+ax-at}if(aw-1){ax.push({character:aD[aw],position:az})}}ax.sort(function(aH,aG){return aH.position-aG.position});a.each(ax,function(aH,aG){switch(aG.character){case"d":aC.push("0[1-9]|[12][0-9]|3[01]");break;case"D":aC.push("[^0-9]+");break;case"j":aC.push("[1-9]|[12][0-9]|3[01]");break;case"l":aC.push("[a-z]+");break;case"N":aC.push("[1-7]");break;case"S":aC.push("st|nd|rd|th");break;case"w":aC.push("[0-6]");break;case"F":aC.push("[a-z]+");break;case"m":aC.push("0[1-9]|1[012]+");break;case"M":aC.push("[^0-9]+");break;case"n":aC.push("[1-9]|1[012]");break;case"Y":aC.push("[0-9]{4}");break;case"y":aC.push("[0-9]{2}");break}});if(aC.length){ax.reverse();a.each(ax,function(aH,aG){aE=aE.replace(aG.character,"("+aC[aC.length-aH-1]+")")});aC=new RegExp("^"+aE+"$","ig");if((ay=aC.exec(at))){var aF=new Date(),aq=1,ap=aF.getMonth()+1,aB=aF.getFullYear(),aA=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],av=["January","February","March","April","May","June","July","August","September","October","November","December"],ar,ao=true;ax.reverse();a.each(ax,function(aH,aG){if(!ao){return true}switch(aG.character){case"m":case"n":ap=r(ay[aH+1]);break;case"d":case"j":aq=r(ay[aH+1]);break;case"D":case"l":case"F":case"M":if(aG.character=="D"||aG.character=="l"){ar=ai.settings.days}else{ar=ai.settings.months}ao=false;a.each(ar,function(aI,aJ){if(ao){return true}if(ay[aH+1].toLowerCase()==aJ.substring(0,(aG.character=="D"||aG.character=="M"?3:aJ.length)).toLowerCase()){switch(aG.character){case"D":ay[aH+1]=aA[aI].substring(0,3);break;case"l":ay[aH+1]=aA[aI];break;case"F":ay[aH+1]=av[aI];ap=aI+1;break;case"M":ay[aH+1]=av[aI].substring(0,3);ap=aI+1;break}ao=true}});break;case"Y":aB=r(ay[aH+1]);break;case"y":aB="19"+r(ay[aH+1]);break}});if(ao){var au=new Date(aB,(ap||1)-1,aq||1);if(au.getFullYear()==aB&&au.getDate()==(aq||1)&&au.getMonth()==((ap||1)-1)){return au}}}}return false}};var n=function(ao){if(g.name=="firefox"){ao.css("MozUserSelect","none")}else{if(g.name=="explorer"){ao.bind("selectstart",function(){return false})}else{ao.mousedown(function(){return false})}}};var H=function(ao){return ao.replace(/([-.,*+?^${}()|[\]\/\\])/g,"\\$1")};var M=function(ap){var ay="",at=ap.getDate(),ax=ap.getDay(),aq=ai.settings.days[ax],ao=ap.getMonth()+1,av=ai.settings.months[ao-1],aw=ap.getFullYear()+"";for(var au=0;au"}for(var au=0;au<7;au++){aw+=""+(a.isArray(ai.settings.days_abbr)&&undefined!==ai.settings.days_abbr[(ai.settings.first_day_of_week+au)%7]?ai.settings.days_abbr[(ai.settings.first_day_of_week+au)%7]:ai.settings.days[(ai.settings.first_day_of_week+au)%7].substr(0,2))+""}aw+="";for(au=0;au<42;au++){if(au>0&&au%7===0){aw+=""}if(au%7===0&&ai.settings.show_week_number){aw+=''+c(new Date(G,p,(au-aq+1)))+""}var aA=(au-aq+1);if(ai.settings.select_other_months&&(auat)){var aC=new Date(G,p,aA),ao=aC.getFullYear(),ax=aC.getMonth(),az=aC.getDate();aC=ao+y(ax+1,2)+y(az,2)}if(au'+(ai.settings.select_other_months||ai.settings.show_other_months?y(av-aq+au+1,ai.settings.zero_pad?2:0):" ")+""}else{if(aA>at){aw+=''+(ai.settings.select_other_months||ai.settings.show_other_months?y(aA-at,ai.settings.zero_pad?2:0):" ")+""}else{var ay=(ai.settings.first_day_of_week+au)%7,ap="",aB=ak(G,p,aA);if(aa(G,p,aA)){if(a.inArray(ay,ai.settings.weekend_days)>-1){ap="dp_weekend_disabled"}else{ap+=" dp_disabled"}if(p==o&&G==D&&k==aA){ap+=" dp_disabled_current"}if(aB!=""){ap+=" "+aB+"_disabled"}}else{if(a.inArray(ay,ai.settings.weekend_days)>-1){ap="dp_weekend"}if(p==ae&&G==ah&&J==aA){ap+=" dp_selected"}if(p==o&&G==D&&k==aA){ap+=" dp_current"}if(aB!=""){ap+=" "+aB}}aw+=""+((ai.settings.zero_pad?y(aA,2):aA)||" ")+""}}}aw+="";T.html(a(aw));if(ai.settings.always_visible){U=a("td:not(.dp_disabled, .dp_weekend_disabled, .dp_not_in_month, .dp_week_number)",T)}T.show()};var h=function(){am(ai.settings.header_captions.months);var ap="";for(var ao=0;ao<12;ao++){if(ao>0&&ao%3===0){ap+=""}var aq="dp_month_"+ao;if(aa(G,ao)){aq+=" dp_disabled"}else{if(ae!==false&&ae==ao&&G==ah){aq+=" dp_selected"}else{if(o==ao&&D==G){aq+=" dp_current"}}}ap+=''+(a.isArray(ai.settings.months_abbr)&&undefined!==ai.settings.months_abbr[ao]?ai.settings.months_abbr[ao]:ai.settings.months[ao].substr(0,3))+""}ap+="";b.html(a(ap));if(ai.settings.always_visible){F=a("td:not(.dp_disabled)",b)}b.show()};var C=function(){am(ai.settings.header_captions.years);var ap="";for(var ao=0;ao<12;ao++){if(ao>0&&ao%3===0){ap+=""}var aq="";if(aa(G-7+ao)){aq+=" dp_disabled"}else{if(ah&&ah==G-7+ao){aq+=" dp_selected"}else{if(D==(G-7+ao)){aq+=" dp_current"}}}ap+=""+(G-7+ao)+""}ap+="";q.html(a(ap));if(ai.settings.always_visible){R=a("td:not(.dp_disabled)",q)}q.show()};var ak=function(aq,au,ao){var at,ap,ar;if(typeof au!="undefined"){au=au+1}for(ap in ac){at=ac[ap];ar=false;if(a.isArray(aj)){a.each(aj[at],function(){if(ar){return}var aw=this;if(a.inArray(aq,aw[2])>-1||a.inArray("*",aw[2])>-1){if((typeof au!="undefined"&&a.inArray(au,aw[1])>-1)||a.inArray("*",aw[1])>-1){if((typeof ao!="undefined"&&a.inArray(ao,aw[0])>-1)||a.inArray("*",aw[0])>-1){if(aw[3]=="*"){return(ar=at)}var av=new Date(aq,au-1,ao).getDay();if(a.inArray(av,aw[3])>-1){return(ar=at)}}}}})}if(ar){return ar}}return ar||""};var P=function(ao){if(g.name=="explorer"&&g.version==6){if(!X){var aq=r(N.css("zIndex"))-1;X=a("