jQuery.extend(jQuery.fn,{validate:function(_1){var _2=new jQuery.validator(_1,this[0]);var _3=jQuery.data(this[0],"validator");if(_3){return _3;}_3=new jQuery.validator(_1,this[0]);jQuery.data(this[0],"validator",_3);if(_3.settings.onsubmit){this.find("input.cancel:submit").click(function(){_3.cancelSubmit=true;});this.submit(function(_4){if(_3.settings.debug){_4.preventDefault();}function handle(){if(_3.settings.submitHandler){_3.settings.submitHandler.call(_3,_3.currentForm);return false;}return true;}if(_3.cancelSubmit){_3.cancelSubmit=false;return handle();}if(_3.form()){return handle();}else{_3.focusInvalid();return false;}});}return _3;},push:function(t){return this.setArray(jQuery.merge(this.get(),t));}});jQuery.extend(jQuery.expr[":"],{blank:"!jQuery.trim(a.value)",filled:"!!jQuery.trim(a.value)",unchecked:"!a.checked"});jQuery.format=function(_6,_7){if(arguments.length==1){return function(){var _8=jQuery.makeArray(arguments);_8.unshift(_6);return jQuery.format.apply(this,_8);};}if(arguments.length>2&&_7.constructor!=Array){_7=jQuery.makeArray(arguments).slice(1);}if(_7.constructor!=Array){_7=[_7];}jQuery.each(_7,function(i,n){_6=_6.replace(new RegExp("\\{"+i+"\\}","g"),n);});return _6;};jQuery.validator=function(_b,_c){this.settings=jQuery.extend({},jQuery.validator.defaults,_b);this.currentForm=_c;this.labelContainer=jQuery(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||jQuery(_c);this.containers=jQuery(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.invalid={};this.reset();this.refresh();};jQuery.extend(jQuery.validator,{defaults:{messages:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:jQuery([]),errorLabelContainer:jQuery([]),onsubmit:true,ignore:[],onblur:function(_d){if(!this.checkable(_d)&&(_d.name in this.submitted||!this.required(_d))){this.element(_d);}},onkeyup:function(_e){if(_e.name in this.submitted||_e==this.lastElement){this.element(_e);}},onclick:function(_f){if(_f.name in this.submitted){this.element(_f);}}},setDefaults:function(_10){jQuery.extend(jQuery.validator.defaults,_10);},messages:{required:"This field is required.",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).",dateDE:"Bitte geben Sie ein g\ufffd\ufffdltiges Datum ein.",number:"Please enter a valid number.",numberDE:"Bitte geben Sie eine Nummer ein.",digits:"Please enter only digits",creditcard:"Please enter a valid credit card.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxLength:jQuery.format("Please enter a value no longer than {0} characters."),minLength:jQuery.format("Please enter a value of at least {0} characters."),rangeLength:jQuery.format("Please enter a value between {0} and {1} characters long."),rangeValue:jQuery.format("Please enter a value between {0} and {1}."),maxValue:jQuery.format("Please enter a value less than or equal to {0}."),minValue:jQuery.format("Please enter a value greater than or equal to {0}.")},prototype:{form:function(){this.prepareForm();for(var i=0;this.elements[i];i++){this.check(this.elements[i]);}jQuery.extend(this.submitted,this.errorMap);this.invalid=jQuery.extend({},this.errorMap);this.settings.invalidHandler&&this.settings.invalidHandler.call(this);this.showErrors();return this.valid();},element:function(_12){_12=this.clean(_12);this.lastElement=_12;this.prepareElement(_12);var _13=this.check(_12);if(_13){delete this.invalid[_12.name];}else{this.invalid[_12.name]=true;}if(!this.numberOfInvalids()){this.toHide.push(this.containers);}this.showErrors();return _13;},showErrors:function(_14){if(_14){jQuery.extend(this.errorMap,_14);this.errorList=[];for(name in _14){this.errorList.push({message:_14[name],element:jQuery("[@name='"+name+"']:first",this.currentForm)[0]});}this.successList=jQuery.grep(this.successList,function(_15){return !(_15.name in _14);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if(jQuery.fn.resetForm){jQuery(this.currentForm).resetForm();}this.prepareForm();this.hideErrors();this.elements.removeClass(this.settings.errorClass);},numberOfInvalids:function(){var _16=0;for(i in this.invalid){_16++;}return _16;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{jQuery(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus();}catch(e){}}},findLastActive:function(){var _17=this.lastActive;return _17&&jQuery.grep(this.errorList,function(n){return n.element.name==_17.name;}).length==1&&_17;},refresh:function(){var _19=this;_19.rulesCache={};function focused(){_19.lastActive=this;if(_19.settings.focusCleanup&&!_19.blockFocusCleanup){jQuery(this).removeClass(_19.settings.errorClass);_19.errorsFor(this).hide();}}this.elements=jQuery(this.currentForm).find("input, select, textarea").not(":submit, :reset").not("[@disabled]").not(this.settings.ignore).filter(function(){!this.name&&_19.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in _19.rulesCache||!_19.rules(this).length){return false;}_19.rulesCache[this.name]=_19.rules(this);return true;});this.elements.focus(focused);_19.settings.onblur&&_19.elements.blur(function(){_19.settings.onblur.call(_19,this);});_19.settings.onkeyup&&_19.elements.keyup(function(){_19.settings.onkeyup.call(_19,this);});if(_19.settings.onclick){var _1a=jQuery([]);_19.elements.each(function(){if(_19.checkable(this)){_1a.push(_19.checkableGroup(this));}});_1a.click(function(){_19.settings.onclick.call(_19,this);});}},clean:function(_1b){return jQuery(_1b)[0];},errors:function(){return jQuery(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=jQuery([]);this.toHide=jQuery([]);},prepareForm:function(){this.reset();this.toHide=this.errors().push(this.containers);},prepareElement:function(_1c){this.reset();this.toHide=this.errorsFor(this.clean(_1c));},check:function(_1d){_1d=this.clean(_1d);jQuery(_1d).removeClass(this.settings.errorClass);var _1e=this.rulesCache[_1d.name];for(var i=0;_1e[i];i++){var _20=_1e[i];try{var _21=jQuery.validator.methods[_20.method].call(this,jQuery.trim(_1d.value),_1d,_20.parameters);if(_21===-1){break;}if(!_21){jQuery(_1d).addClass(this.settings.errorClass);this.formatAndAdd(_20,_1d);return false;}}catch(e){this.settings.debug&&window.console&&console.warn("exception occured when checking element "+_1d.id+", check the '"+_20.method+"' method");throw e;}}if(_1e.length&&this.settings.success){this.successList.push(_1d);}return true;},configuredMessage:function(id,_23){var m=this.settings.messages[id];return m&&(m.constructor==String?m:m[_23]);},defaultMessage:function(_25,_26){return this.configuredMessage(_25.name,_26)||_25.title||jQuery.validator.messages[_26]||"<strong>Warning: No message defined for "+_25.name+"</strong>";},formatAndAdd:function(_27,_28){var _29=this.defaultMessage(_28,_27.method);if(typeof _29=="function"){_29=_29.call(this,_27.parameters,_28);}this.errorList.push({message:_29,element:_28});this.errorMap[_28.name]=_29;this.submitted[_28.name]=_29;},addWrapper:function(_2a){if(this.settings.wrapper){_2a.push(_2a.parents(this.settings.wrapper));}return _2a;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var _2c=this.errorList[i];this.showLabel(_2c.element,_2c.message);}if(this.errorList.length){this.toShow.push(this.containers);}for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},showLabel:function(_2e,_2f){var _30=this.errorsFor(_2e);if(_30.length){_30.removeClass().addClass(this.settings.errorClass);if(this.settings.overrideErrors||_30.attr("generated")){_30.html(_2f);}}else{_30=jQuery("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(_2e),generated:true}).addClass(this.settings.errorClass).html(_2f||"");if(this.settings.wrapper){_30=_30.hide().show().wrap("<"+this.settings.wrapper+">").parent();}if(!this.labelContainer.append(_30).length){this.settings.errorPlacement?this.settings.errorPlacement(_30,jQuery(_2e)):_30.insertAfter(_2e);}}if(!_2f&&this.settings.success){_30.text("");typeof this.settings.success=="string"?_30.addClass(this.settings.success):this.settings.success(_30);}this.toShow.push(_30);},errorsFor:function(_31){return this.errors().filter("[@for='"+this.idOrName(_31)+"']");},idOrName:function(_32){return this.checkable(_32)?_32.name:_32.id||_32.name;},rules:function(_33){var _34=this.data(_33);if(!_34){return [];}var _35=[];if(typeof _34=="string"){var _36={};_36[_34]=true;_34=_36;}jQuery.each(_34,function(key,_38){_35[_35.length]={method:key,parameters:_38};});return _35;},data:function(_39){return this.settings.rules?this.settings.rules[_39.name]:this.settings.meta?jQuery(_39).metadata()[this.settings.meta]:jQuery(_39).metadata();},checkable:function(_3a){return /radio|checkbox/i.test(_3a.type);},checkableGroup:function(_3b){return jQuery(_3b.form||document).find("[@name=\""+_3b.name+"\"]");},getLength:function(_3c,_3d){switch(_3d.nodeName.toLowerCase()){case "select":return jQuery("option:selected",_3d).length;case "input":if(this.checkable(_3d)){return this.checkableGroup(_3d).filter(":checked").length;}}return _3c.length;},depend:function(_3e,_3f){return this.dependTypes[typeof _3e]?this.dependTypes[typeof _3e](_3e,_3f):true;},dependTypes:{"boolean":function(_40,_41){return _40;},"string":function(_42,_43){return !!jQuery(_42,_43.form).length;},"function":function(_44,_45){return _44(_45);}},required:function(_46){return !jQuery.validator.methods.required.call(this,jQuery.trim(_46.value),_46);}},methods:{required:function(_47,_48,_49){if(!this.depend(_49,_48)){return -1;}switch(_48.nodeName.toLowerCase()){case "select":var _4a=jQuery("option:selected",_48);return _4a.length>0&&(_48.type=="select-multiple"||(jQuery.browser.msie&&!(_4a[0].attributes["value"].specified)?_4a[0].text:_4a[0].value).length>0);case "input":if(this.checkable(_48)){return this.getLength(_47,_48)>0;}default:return _47.length>0;}},minLength:function(_4b,_4c,_4d){return this.required(_4c)||this.getLength(_4b,_4c)>=_4d;},maxLength:function(_4e,_4f,_50){return this.required(_4f)||this.getLength(_4e,_4f)<=_50;},rangeLength:function(_51,_52,_53){var _54=this.getLength(_51,_52);return this.required(_52)||(_54>=_53[0]&&_54<=_53[1]);},minValue:function(_55,_56,_57){return this.required(_56)||_55>=_57;},maxValue:function(_58,_59,_5a){return this.required(_59)||_58<=_5a;},rangeValue:function(_5b,_5c,_5d){return this.required(_5c)||(_5b>=_5d[0]&&_5b<=_5d[1]);},email:function(_5e,_5f){return this.required(_5f)||/^[^\s,;]+@([^\s.,;]+\.)+[\w-]{2,}$/i.test(_5e);},url:function(_60,_61){return this.required(_61)||/^(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(_60);},date:function(_62,_63){return this.required(_63)||!/Invalid|NaN/.test(new Date(_62));},dateISO:function(_64,_65){return this.required(_65)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(_64);},dateDE:function(_66,_67){return this.required(_67)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(_66);},number:function(_68,_69){return this.required(_69)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(_68);},numberDE:function(_6a,_6b){return this.required(_6b)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(_6a);},digits:function(_6c,_6d){return this.required(_6d)||/^\d+$/.test(_6c);},creditcard:function(_6e,_6f){if(this.required(_6f)){return true;}var _70=0,nDigit=0,bEven=false;_6e=_6e.replace(/\D/g,"");for(n=_6e.length-1;n>=0;n--){var _71=_6e.charAt(n);var _72=parseInt(_71,10);if(bEven){if((_72*=2)>9){_72-=9;}}_70+=_72;bEven=!bEven;}return (_70%10)==0;},accept:function(_73,_74,_75){_75=typeof _75=="string"?_75:"png|jpe?g|gif";return this.required(_74)||_73.match(new RegExp(".("+_75+")$","i"));},equalTo:function(_76,_77,_78){return _76==jQuery(_78).val();}},addMethod:function(_79,_7a,_7b){jQuery.validator.methods[_79]=_7a;jQuery.validator.messages[_79]=_7b;}});