var LANGUAGE_CODE="en";var LANGUAGE_BIDI=false;var catalog=new Array();function pluralidx(a){return(a==1)?0:1}function gettext(a){var b=catalog[a];if(typeof(b)=="undefined"){return a}else{return(typeof(b)=="string")?b:b[0]}}function ngettext(b,a,c){value=catalog[b];if(typeof(value)=="undefined"){return(c==1)?b:a}else{return value[pluralidx(c)]}}function gettext_noop(a){return a}function interpolate(b,c,a){if(a){return b.replace(/%\(\w+\)s/g,function(d){return String(c[d.slice(2,-2)])})}else{return b.replace(/%s/g,function(d){return String(c.shift())})}}window.hgettext=function(a){return gettext(a)};window.hngettext=function(b,a,c){return ngettext(b,a,c)};(function(b){b.fn.ajaxSubmit=function(g){if(!this.length){a("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof g=="function"){g={success:g}}var s=b.trim(this.attr("action"));if(s){s=(s.match(/^([^#]+)/)||[])[1]}s=s||window.location.href||"";g=b.extend({url:s,type:this.attr("method")||"GET"},g||{});var e={};this.trigger("form-pre-serialize",[this,g,e]);if(e.veto){a("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(g.beforeSerialize&&g.beforeSerialize(this,g)===false){a("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var k=this.formToArray(g.semantic);if(g.data){g.extraData=g.data;for(var q in g.data){if(g.data[q] instanceof Array){for(var p in g.data[q]){k.push({name:q,value:g.data[q][p]})}}else{k.push({name:q,value:g.data[q]})}}}if(g.beforeSubmit&&g.beforeSubmit(k,this,g)===false){a("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[k,this,g,e]);if(e.veto){a("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var c=b.param(k);if(g.type.toUpperCase()=="GET"){g.url+=(g.url.indexOf("?")>=0?"&":"?")+c;g.data=null}else{g.data=c}var f=this,l=[];if(g.resetForm){l.push(function(){f.resetForm()})}if(g.clearForm){l.push(function(){f.clearForm()})}if(!g.dataType&&g.target){var i=g.success||function(){};l.push(function(t){b(g.target).html(t).each(i,arguments)})}else{if(g.success){l.push(g.success)}}g.success=function(t,v){for(var u=0,w=l.length;u<w;u++){l[u].apply(g,[t,v,f])}};var d=b("input:file",this).fieldValue();var h=false;for(var m=0;m<d.length;m++){if(d[m]){h=true}}var o=false;if(g.iframe||h||o){if(g.closeKeepAlive){b.get(g.closeKeepAlive,j)}else{j()}}else{b.ajax(g)}this.trigger("form-submit-notify",[this,g]);return this;function j(){var x=f[0];if(b(":input[name=submit]",x).length){alert('Error: Form elements must not be named "submit".');return}var z=b.extend({},b.ajaxSettings,g);var C=b.extend(true,{},b.extend(true,{},b.ajaxSettings),z);var y="jqFormIO"+(new Date().getTime());var G=b('<iframe id="'+y+'" name="'+y+'" src="about:blank" />');var E=G[0];G.css({position:"absolute",top:"-1000px",left:"-1000px"});var D={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;G.attr("src","about:blank")}};var F=z.global;if(F&&!b.active++){b.event.trigger("ajaxStart")}if(F){b.event.trigger("ajaxSend",[D,z])}if(C.beforeSend&&C.beforeSend(D,C)===false){C.global&&b.active--;return}if(D.aborted){return}var A=0;var v=0;var B=x.clk;if(B){var w=B.name;if(w&&!B.disabled){g.extraData=g.extraData||{};g.extraData[w]=B.value;if(B.type=="image"){g.extraData[name+".x"]=x.clk_x;g.extraData[name+".y"]=x.clk_y}}}setTimeout(function(){var J=f.attr("target"),L=f.attr("action");x.setAttribute("target",y);if(x.getAttribute("method")!="POST"){x.setAttribute("method","POST")}if(x.getAttribute("action")!=z.url){x.setAttribute("action",z.url)}if(!g.skipEncodingOverride){f.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(z.timeout){setTimeout(function(){v=true;u()},z.timeout)}var K=[];try{if(g.extraData){for(var I in g.extraData){K.push(b('<input type="hidden" name="'+I+'" value="'+g.extraData[I]+'" />').appendTo(x)[0])}}G.appendTo("body");E.attachEvent?E.attachEvent("onload",u):E.addEventListener("load",u,false);x.submit()}finally{x.setAttribute("action",L);J?x.setAttribute("target",J):f.removeAttr("target");b(K).remove()}},10);var t=0;function u(){if(A++){return}E.detachEvent?E.detachEvent("onload",u):E.removeEventListener("load",u,false);var L=true;try{if(v){throw"timeout"}var K,I;I=E.contentWindow?E.contentWindow.document:E.contentDocument?E.contentDocument:E.document;if((I.body==null||I.body.innerHTML=="")&&!t){t=1;A--;setTimeout(u,100);return}D.responseText=I.body?I.body.innerHTML:null;D.responseXML=I.XMLDocument?I.XMLDocument:I;D.getResponseHeader=function(N){var O={"content-type":z.dataType};return O[N]};if(z.dataType=="json"||z.dataType=="script"){var M=I.getElementsByTagName("textarea")[0];D.responseText=M?M.value:D.responseText}else{if(z.dataType=="xml"&&!D.responseXML&&D.responseText!=null){D.responseXML=H(D.responseText)}}K=b.httpData(D,z.dataType)}catch(J){L=false;b.handleError(z,D,"error",J)}if(L){z.success(K,"success");if(F){b.event.trigger("ajaxSuccess",[D,z])}}if(F){b.event.trigger("ajaxComplete",[D,z])}if(F&&!--b.active){b.event.trigger("ajaxStop")}if(z.complete){z.complete(D,L?"success":"error")}setTimeout(function(){G.remove();D.responseXML=null},100)}function H(J,I){if(window.ActiveXObject){I=new ActiveXObject("Microsoft.XMLDOM");I.async="false";I.loadXML(J)}else{I=(new DOMParser()).parseFromString(J,"text/xml")}return(I&&I.documentElement&&I.documentElement.tagName!="parsererror")?I:null}}};b.fn.ajaxForm=function(c){return this.ajaxFormUnbind().bind("submit.form-plugin",function(){b(this).ajaxSubmit(c);return false}).each(function(){b(":submit,input:image",this).bind("click.form-plugin",function(e){var f=this.form;f.clk=this;if(this.type=="image"){if(e.offsetX!=undefined){f.clk_x=e.offsetX;f.clk_y=e.offsetY}else{if(typeof b.fn.offset=="function"){var d=b(this).offset();f.clk_x=e.pageX-d.left;f.clk_y=e.pageY-d.top}else{f.clk_x=e.pageX-this.offsetLeft;f.clk_y=e.pageY-this.offsetTop}}}setTimeout(function(){f.clk=f.clk_x=f.clk_y=null},10)})})};b.fn.ajaxFormUnbind=function(){this.unbind("submit.form-plugin");return this.each(function(){b(":submit,input:image",this).unbind("click.form-plugin")})};b.fn.formToArray=function(f){var g=[];if(this.length==0){return g}var c=this[0];var l=f?c.getElementsByTagName("*"):c.elements;if(!l){return g}for(var k=0,i=l.length;k<i;k++){var p=l[k];var o=p.name;if(!o){continue}if(f&&c.clk&&p.type=="image"){if(!p.disabled&&c.clk==p){g.push({name:o,value:b(p).val()});g.push({name:o+".x",value:c.clk_x},{name:o+".y",value:c.clk_y})}continue}var e=b.fieldValue(p,true);if(e&&e.constructor==Array){for(var m=0,d=e.length;m<d;m++){g.push({name:o,value:e[m]})}}else{if(e!==null&&typeof e!="undefined"){g.push({name:o,value:e})}}}if(!f&&c.clk){var j=b(c.clk),h=j[0],o=h.name;if(o&&!h.disabled&&h.type=="image"){g.push({name:o,value:j.val()});g.push({name:o+".x",value:c.clk_x},{name:o+".y",value:c.clk_y})}}return g};b.fn.formSerialize=function(c){return b.param(this.formToArray(c))};b.fn.fieldSerialize=function(c){var d=[];this.each(function(){var e=this.name;if(!e){return}var g=b.fieldValue(this,c);if(g&&g.constructor==Array){for(var f=0,h=g.length;f<h;f++){d.push({name:e,value:g[f]})}}else{if(g!==null&&typeof g!="undefined"){d.push({name:this.name,value:g})}}});return b.param(d)};b.fn.fieldValue=function(c){for(var d=[],f=0,h=this.length;f<h;f++){var e=this[f];var g=b.fieldValue(e,c);if(g===null||typeof g=="undefined"||(g.constructor==Array&&!g.length)){continue}g.constructor==Array?b.merge(d,g):d.push(g)}return d};b.fieldValue=function(d,k){var p=d.name,f=d.type,e=d.tagName.toLowerCase();if(typeof k=="undefined"){k=true}if(k&&(!p||d.disabled||f=="reset"||f=="button"||(f=="checkbox"||f=="radio")&&!d.checked||(f=="submit"||f=="image")&&d.form&&d.form.clk!=d||e=="select"&&d.selectedIndex==-1)){return null}if(e=="select"){var j=d.selectedIndex;if(j<0){return null}var h=[],c=d.options;var m=(f=="select-one");var i=(m?j+1:c.length);for(var o=(m?j:0);o<i;o++){var l=c[o];if(l.selected){var g=l.value;if(!g){g=(l.attributes&&l.attributes.value&&!(l.attributes.value.specified))?l.text:l.value}if(m){return g}h.push(g)}}return h}return d.value};b.fn.clearForm=function(){return this.each(function(){b("input,select,textarea",this).clearFields()})};b.fn.clearFields=b.fn.clearInputs=function(){return this.each(function(){var c=this.type,d=this.tagName.toLowerCase();if(c=="text"||c=="password"||d=="textarea"){this.value=""}else{if(c=="checkbox"||c=="radio"){this.checked=false}else{if(d=="select"){this.selectedIndex=-1}}}})};b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};b.fn.enable=function(c){if(c==undefined){c=true}return this.each(function(){this.disabled=!c})};b.fn.selected=function(c){if(c==undefined){c=true}return this.each(function(){var e=this.type;if(e=="checkbox"||e=="radio"){this.checked=c}else{if(this.tagName.toLowerCase()=="option"){var d=b(this).parent("select");if(c&&d[0]&&d[0].type=="select-one"){d.find("option").selected(false)}this.selected=c}}})};function a(){if(b.fn.ajaxSubmit.debug&&window.console&&window.console.log){window.console.log("[jquery.form] "+Array.prototype.join.call(arguments,""))}}})(jQuery);(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;this.defaults.name=name},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length){settings.single="metadata"}var data=$.data(elem,settings.single);if(data){return data}data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m){data=m[1]}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return undefined}var e=elem.getElementsByTagName(settings.name);if(e.length){data=$.trim(e[0].innerHTML)}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr){data=attr}}}}if(data.indexOf("{")<0){data="{"+data+"}"}data=eval("("+data+")");$.data(elem,settings.single,data);return data}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts)}})(jQuery);(function(a){a.extend(a.fn,{validate:function(b){if(!this.length){b&&b.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}var c=a.data(this[0],"validator");if(c){return c}c=new a.validator(b,this[0]);a.data(this[0],"validator",c);if(c.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){c.cancelSubmit=true});this.submit(function(d){if(c.settings.debug){d.preventDefault()}function e(){if(c.settings.submitHandler){c.settings.submitHandler.call(c,c.currentForm);return false}return true}if(c.cancelSubmit){c.cancelSubmit=false;return e()}if(c.form()){if(c.pendingRequest){c.formSubmitted=true;return false}return e()}else{c.focusInvalid();return false}})}return c},valid:function(){if(a(this[0]).is("form")){return this.validate().form()}else{var c=false;var b=a(this[0].form).validate();this.each(function(){c|=b.element(this)});return c}},removeAttrs:function(d){var b={},c=this;a.each(d.split(/\s/),function(e,f){b[f]=c.attr(f);c.removeAttr(f)});return b},rules:function(e,b){var g=this[0];if(e){var d=a.data(g.form,"validator").settings;var i=d.rules;var j=a.validator.staticRules(g);switch(e){case"add":a.extend(j,a.validator.normalizeRule(b));i[g.name]=j;if(b.messages){d.messages[g.name]=a.extend(d.messages[g.name],b.messages)}break;case"remove":if(!b){delete i[g.name];return j}var h={};a.each(b.split(/\s/),function(k,l){h[l]=j[l];delete j[l]});return h}}var f=a.validator.normalizeRules(a.extend({},a.validator.metadataRules(g),a.validator.classRules(g),a.validator.attributeRules(g),a.validator.staticRules(g)),g);if(f.required){var c=f.required;delete f.required;f=a.extend({required:c},f)}return f}});a.extend(a.expr[":"],{blank:function(b){return !a.trim(b.value)},filled:function(b){return !!a.trim(b.value)},unchecked:function(b){return !b.checked}});a.format=function(b,c){if(arguments.length==1){return function(){var d=a.makeArray(arguments);d.unshift(b);return a.format.apply(this,d)}}if(arguments.length>2&&c.constructor!=Array){c=a.makeArray(arguments).slice(1)}if(c.constructor!=Array){c=[c]}a.each(c,function(d,e){b=b.replace(new RegExp("\\{"+d+"\\}","g"),e)});return b};a.validator=function(b,c){this.settings=a.extend({},a.validator.defaults,b);this.currentForm=c;this.init()};a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",errorElement:"label",focusInvalid:true,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(b){this.lastActive=b;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,b,this.settings.errorClass);this.errorsFor(b).hide()}},onfocusout:function(b){if(!this.checkable(b)&&(b.name in this.submitted||!this.optional(b))){this.element(b)}},onkeyup:function(b){if(b.name in this.submitted||b==this.lastElement){this.element(b)}},onclick:function(b){if(b.name in this.submitted){this.element(b)}},highlight:function(c,b){a(c).addClass(b)},unhighlight:function(c,b){a(c).removeClass(b)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},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).",dateDE:"Bitte geben Sie ein gültiges 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 number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:a.format("Please enter no more than {0} characters."),minlength:a.format("Please enter at least {0} characters."),rangelength:a.format("Please enter a value between {0} and {1} characters long."),range:a.format("Please enter a value between {0} and {1}."),max:a.format("Please enter a value less than or equal to {0}."),min:a.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=a(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm);this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=(this.groups={});a.each(this.settings.groups,function(e,f){a.each(f.split(/\s/),function(h,g){b[g]=e})});var d=this.settings.rules;a.each(d,function(e,f){d[e]=a.validator.normalizeRule(f)});function c(f){var e=a.data(this[0].form,"validator");e.settings["on"+f.type]&&e.settings["on"+f.type].call(e,this[0])}a(this.currentForm).delegate("focusin focusout keyup",":text, :password, :file, select, textarea",c).delegate("click",":radio, :checkbox",c);if(this.settings.invalidHandler){a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();a.extend(this.submitted,this.errorMap);this.invalid=a.extend({},this.errorMap);if(!this.valid()){a(this.currentForm).triggerHandler("invalid-form",[this])}this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var b=0,c=(this.currentElements=this.elements());c[b];b++){this.check(c[b])}return this.valid()},element:function(c){c=this.clean(c);this.lastElement=c;this.prepareElement(c);this.currentElements=a(c);var b=this.check(c);if(b){delete this.invalid[c.name]}else{this.invalid[c.name]=true}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)}this.showErrors();return b},showErrors:function(c){if(c){a.extend(this.errorMap,c);this.errorList=[];for(var b in c){this.errorList.push({message:c[b],element:this.findByName(b)[0]})}this.successList=a.grep(this.successList,function(d){return !(d.name in c)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){if(a.fn.resetForm){a(this.currentForm).resetForm()}this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(d){var c=0;for(var b in d){c++}return c},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{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus()}catch(b){}}},findLastActive:function(){var b=this.lastActive;return b&&a.grep(this.errorList,function(c){return c.element.name==b.name}).length==1&&b},elements:function(){var c=this,b={};return a([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&c.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!c.objectLength(a(this).rules())){return false}b[this.name]=true;return true})},clean:function(b){return a(b)[0]},errors:function(){return a(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=a([]);this.toHide=a([]);this.formSubmitted=false;this.currentElements=a([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(b){this.reset();this.toHide=this.errorsFor(b)},check:function(c){c=this.clean(c);if(this.checkable(c)){c=this.findByName(c.name)[0]}var h=a(c).rules();var d=false;for(method in h){var g={method:method,parameters:h[method]};try{var b=a.validator.methods[method].call(this,c.value.replace(/\r/g,""),c,g.parameters);if(b=="dependency-mismatch"){d=true;continue}d=false;if(b=="pending"){this.toHide=this.toHide.not(this.errorsFor(c));return}if(!b){this.formatAndAdd(c,g);return false}}catch(f){this.settings.debug&&window.console&&console.log("exception occured when checking element "+c.id+", check the '"+g.method+"' method");throw f}}if(d){return}if(this.objectLength(h)){this.successList.push(c)}return true},customMetaMessage:function(b,d){if(!a.metadata){return}var c=this.settings.meta?a(b).metadata()[this.settings.meta]:a(b).metadata();return c&&c.messages&&c.messages[d]},customMessage:function(c,d){var b=this.settings.messages[c];return b&&(b.constructor==String?b:b[d])},findDefined:function(){for(var b=0;b<arguments.length;b++){if(arguments[b]!==undefined){return arguments[b]}}return undefined},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customMetaMessage(b,c),!this.settings.ignoreTitle&&b.title||undefined,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,d){var c=this.defaultMessage(b,d.method);if(typeof c=="function"){c=c.call(this,d.parameters,b)}this.errorList.push({message:c,element:b});this.errorMap[b.name]=c;this.submitted[b.name]=c},addWrapper:function(b){if(this.settings.wrapper){b=b.add(b.parents(this.settings.wrapper))}return b},defaultShowErrors:function(){for(var c=0;this.errorList[c];c++){var b=this.errorList[c];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass);this.showLabel(b.element,b.message)}if(this.errorList.length){this.toShow=this.toShow.add(this.containers)}if(this.settings.success){for(var c=0;this.successList[c];c++){this.showLabel(this.successList[c])}}if(this.settings.unhighlight){for(var c=0,d=this.validElements();d[c];c++){this.settings.unhighlight.call(this,d[c],this.settings.errorClass)}}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 a(this.errorList).map(function(){return this.element})},showLabel:function(c,d){var b=this.errorsFor(c);if(b.length){b.removeClass().addClass(this.settings.errorClass);b.attr("generated")&&b.html(d)}else{b=a("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(c),generated:true}).addClass(this.settings.errorClass).html(d||"");if(this.settings.wrapper){b=b.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()}if(!this.labelContainer.append(b).length){this.settings.errorPlacement?this.settings.errorPlacement(b,a(c)):b.insertAfter(c)}}if(!d&&this.settings.success){b.text("");typeof this.settings.success=="string"?b.addClass(this.settings.success):this.settings.success(b)}this.toShow=this.toShow.add(b)},errorsFor:function(b){return this.errors().filter("[for='"+this.idOrName(b)+"']")},idOrName:function(b){return this.groups[b.name]||(this.checkable(b)?b.name:b.id||b.name)},checkable:function(b){return/radio|checkbox/i.test(b.type)},findByName:function(b){var c=this.currentForm;return a(document.getElementsByName(b)).map(function(d,e){return e.form==c&&e.name==b&&e||null})},getLength:function(c,b){switch(b.nodeName.toLowerCase()){case"select":return a("option:selected",b).length;case"input":if(this.checkable(b)){return this.findByName(b.name).filter(":checked").length}}return c.length},depend:function(c,b){return this.dependTypes[typeof c]?this.dependTypes[typeof c](c,b):true},dependTypes:{"boolean":function(c,b){return c},string:function(c,b){return !!a(c,b.form).length},"function":function(c,b){return c(b)}},optional:function(b){return !a.validator.methods.required.call(this,a.trim(b.value),b)&&"dependency-mismatch"},startRequest:function(b){if(!this.pending[b.name]){this.pendingRequest++;this.pending[b.name]=true}},stopRequest:function(b,c){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0}delete this.pending[b.name];if(c&&this.pendingRequest==0&&this.formSubmitted&&this.form()){a(this.currentForm).submit()}else{if(!c&&this.pendingRequest==0&&this.formSubmitted){a(this.currentForm).triggerHandler("invalid-form",[this])}}},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",previous={old:null,valid:true,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(b,c){b.constructor==String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(c){var d={};var b=a(c).attr("class");b&&a.each(b.split(" "),function(){if(this in a.validator.classRuleSettings){a.extend(d,a.validator.classRuleSettings[this])}});return d},attributeRules:function(c){var e={};var b=a(c);for(method in a.validator.methods){var d=b.attr(method);if(d){e[method]=d}}if(e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)){delete e.maxlength}return e},metadataRules:function(b){if(!a.metadata){return{}}var c=a.data(b.form,"validator").settings.meta;return c?a(b).metadata()[c]:a(b).metadata()},staticRules:function(c){var d={};var b=a.data(c.form,"validator");if(b.settings.rules){d=a.validator.normalizeRule(b.settings.rules[c.name])||{}}return d},normalizeRules:function(c,b){a.each(c,function(f,e){if(e===false){delete c[f];return}if(e.param||e.depends){var d=true;switch(typeof e.depends){case"string":d=!!a(e.depends,b.form).length;break;case"function":d=e.depends.call(b,b);break}if(d){c[f]=e.param!==undefined?e.param:true}else{delete c[f]}}});a.each(c,function(d,e){c[d]=a.isFunction(e)?e(b):e});a.each(["minlength","maxlength","min","max"],function(){if(c[this]){c[this]=Number(c[this])}});a.each(["rangelength","range"],function(){if(c[this]){c[this]=[Number(c[this][0]),Number(c[this][1])]}});if(a.validator.autoCreateRanges){if(c.min&&c.max){c.range=[c.min,c.max];delete c.min;delete c.max}if(c.minlength&&c.maxlength){c.rangelength=[c.minlength,c.maxlength];delete c.minlength;delete c.maxlength}}if(c.messages){delete c.messages}return c},normalizeRule:function(c){if(typeof c=="string"){var b={};a.each(c.split(/\s/),function(){b[this]=true});c=b}return c},addMethod:function(b,d,c){a.validator.methods[b]=d;a.validator.messages[b]=c;if(d.length<3){a.validator.addClassRules(b,a.validator.normalizeRule(b))}},methods:{required:function(d,c,e){if(!this.depend(e,c)){return"dependency-mismatch"}switch(c.nodeName.toLowerCase()){case"select":var b=a("option:selected",c);return b.length>0&&(c.type=="select-multiple"||(a.browser.msie&&!(b[0].attributes.value.specified)?b[0].text:b[0].value).length>0);case"input":if(this.checkable(c)){return this.getLength(d,c)>0}default:return a.trim(d).length>0}},remote:function(f,c,g){if(this.optional(c)){return"dependency-mismatch"}var d=this.previousValue(c);if(!this.settings.messages[c.name]){this.settings.messages[c.name]={}}this.settings.messages[c.name].remote=typeof d.message=="function"?d.message(f):d.message;g=typeof g=="string"&&{url:g}||g;if(d.old!==f){d.old=f;var b=this;this.startRequest(c);var e={};e[c.name]=f;a.ajax(a.extend(true,{url:g,mode:"abort",port:"validate"+c.name,dataType:"json",data:e,success:function(i){if(i){var h=b.formSubmitted;b.prepareElement(c);b.formSubmitted=h;b.successList.push(c);b.showErrors()}else{var j={};j[c.name]=i||b.defaultMessage(c,"remote");b.showErrors(j)}d.valid=i;b.stopRequest(c,i)}},g));return"pending"}else{if(this.pending[c.name]){return"pending"}}return d.valid},minlength:function(c,b,d){return this.optional(b)||this.getLength(a.trim(c),b)>=d},maxlength:function(c,b,d){return this.optional(b)||this.getLength(a.trim(c),b)<=d},rangelength:function(d,b,e){var c=this.getLength(a.trim(d),b);return this.optional(b)||(c>=e[0]&&c<=e[1])},min:function(c,b,d){return this.optional(b)||c>=d},max:function(c,b,d){return this.optional(b)||c<=d},range:function(c,b,d){return this.optional(b)||(c>=d[0]&&c<=d[1])},email:function(c,b){return this.optional(b)||/^((([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(c)},url: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)},date:function(c,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(c))},dateISO:function(c,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(c)},dateDE:function(c,b){return this.optional(b)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(c)},number:function(c,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(c)},numberDE:function(c,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(c)},digits:function(c,b){return this.optional(b)||/^\d+$/.test(c)},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;f=f.replace(/\D/g,"");for(n=f.length-1;n>=0;n--){var d=f.charAt(n);var e=parseInt(d,10);if(b){if((e*=2)>9){e-=9}}g+=e;b=!b}return(g%10)==0},accept:function(c,b,d){d=typeof d=="string"?d:"png|jpe?g|gif";return this.optional(b)||c.match(new RegExp(".("+d+")$","i"))},equalTo:function(c,b,d){return c==a(d).val()}}})})(jQuery);(function(c){var b=c.ajax;var a={};c.ajax=function(e){e=c.extend(e,c.extend({},c.ajaxSettings,e));var d=e.port;if(e.mode=="abort"){if(a[d]){a[d].abort()}return(a[d]=b.apply(this,arguments))}return b.apply(this,arguments)}})(jQuery);(function(a){a.each({focus:"focusin",blur:"focusout"},function(c,b){a.event.special[b]={setup:function(){if(a.browser.msie){return false}this.addEventListener(c,a.event.special[b].handler,true)},teardown:function(){if(a.browser.msie){return false}this.removeEventListener(c,a.event.special[b].handler,true)},handler:function(d){arguments[0]=a.event.fix(d);arguments[0].type=b;return a.event.handle.apply(this,arguments)}}});a.extend(a.fn,{delegate:function(d,c,b){return this.bind(d,function(e){var f=a(e.target);if(f.is(c)){return b.apply(f,arguments)}})},triggerEvent:function(b,c){return this.triggerHandler(b,[a.event.fix({type:b,target:c})])}})})(jQuery);jQuery.fn.daterangepicker=function(c){var q=jQuery(this);var p=jQuery.extend({presetRanges:[{text:"Today",dateStart:"today",dateEnd:"today"},{text:"Last 7 days",dateStart:"today-7days",dateEnd:"today"},{text:"Month to date",dateStart:function(){return Date.parse("today").moveToFirstDayOfMonth()},dateEnd:"today"},{text:"Year to date",dateStart:function(){var u=Date.parse("today");u.setMonth(0);u.setDate(1);return u},dateEnd:"today"},{text:"The previous Month",dateStart:function(){return Date.parse("1 month ago").moveToFirstDayOfMonth()},dateEnd:function(){return Date.parse("1 month ago").moveToLastDayOfMonth()}}],presets:{specificDate:"Specific Date",allDatesBefore:"All Dates Before",allDatesAfter:"All Dates After",dateRange:"Date Range"},rangeStartTitle:"Start date",rangeEndTitle:"End date",nextLinkText:"Next",prevLinkText:"Prev",doneButtonText:"Done",earliestDate:Date.parse("-15years"),latestDate:Date.parse("+15years"),rangeSplitter:"-",dateFormat:"m/d/yy",closeOnSelect:true,arrows:false,posX:q.offset().left,posY:q.offset().top+q.outerHeight(),appendTo:"body",onClose:function(){},onOpen:function(){},onChange:function(){},datepickerOptions:null},c);var m={onSelect:function(){if(j.find(".ui-daterangepicker-specificDate").is(".ui-state-active")){j.find(".range-end").datepicker("setDate",j.find(".range-start").datepicker("getDate"))}var u=t(j.find(".range-start").datepicker("getDate"));var v=t(j.find(".range-end").datepicker("getDate"));if(q.length==2){q.eq(0).val(u);q.eq(1).val(v)}else{q.val((u!=v)?u+" "+p.rangeSplitter+" "+v:u)}if(p.closeOnSelect){if(!j.find("li.ui-state-active").is(".ui-daterangepicker-dateRange")&&!j.is(":animated")){i()}}p.onChange()},defaultDate:+0};q.change(p.onChange);p.datepickerOptions=(c)?jQuery.extend(m,c.datepickerOptions):m;var g,h=Date.parse("today");var e,k;if(q.size()==2){e=Date.parse(q.eq(0).val());k=Date.parse(q.eq(1).val());if(e==null){e=k}if(k==null){k=e}}else{e=Date.parse(q.val().split(p.rangeSplitter)[0]);k=Date.parse(q.val().split(p.rangeSplitter)[1]);if(k==null){k=e}}if(e!=null){g=e}if(k!=null){h=k}var j=jQuery('<div class="ui-daterangepicker ui-widget ui-helper-clearfix ui-widget-content ui-corner-all"></div>');var a=(function(){var u=jQuery('<ul class="ui-widget-content"></ul>').appendTo(j);jQuery.each(p.presetRanges,function(){jQuery('<li class="ui-daterangepicker-'+this.text.replace(/ /g,"")+' ui-corner-all"><a href="#">'+this.text+"</a></li>").data("dateStart",this.dateStart).data("dateEnd",this.dateEnd).appendTo(u)});var v=0;jQuery.each(p.presets,function(x,w){jQuery('<li class="ui-daterangepicker-'+x+" preset_"+v+' ui-helper-clearfix ui-corner-all"><span class="ui-icon ui-icon-triangle-1-e"></span><a href="#">'+w+"</a></li>").appendTo(u);v++});u.find("li").hover(function(){jQuery(this).addClass("ui-state-hover")},function(){jQuery(this).removeClass("ui-state-hover")}).click(function(){j.find(".ui-state-active").removeClass("ui-state-active");jQuery(this).addClass("ui-state-active").clickActions(j,f,o);return false});return u})();function t(w){if(!w.getDate()){return""}var x=w.getDate();var u=w.getMonth();var v=w.getFullYear();u++;var y=p.dateFormat;return jQuery.datepicker.formatDate(y,w)}jQuery.fn.restoreDateFromData=function(){if(jQuery(this).data("saveDate")){jQuery(this).datepicker("setDate",jQuery(this).data("saveDate")).removeData("saveDate")}return this};jQuery.fn.saveDateToData=function(){if(!jQuery(this).data("saveDate")){jQuery(this).data("saveDate",jQuery(this).datepicker("getDate"))}return this};function b(){if(j.data("state")=="closed"){j.data("state","open");j.fadeIn(300);p.onOpen()}}function i(){if(j.data("state")=="open"){j.data("state","closed");j.fadeOut(300);p.onClose()}}function s(){if(j.data("state")=="open"){i()}else{b()}}j.data("state","closed");jQuery.fn.clickActions=function(w,v,y){if(jQuery(this).is(".ui-daterangepicker-specificDate")){y.hide();v.show();w.find(".title-start").text(p.presets.specificDate);w.find(".range-start").restoreDateFromData().show(400);w.find(".range-end").restoreDateFromData().hide(400);setTimeout(function(){y.fadeIn()},400)}else{if(jQuery(this).is(".ui-daterangepicker-allDatesBefore")){y.hide();v.show();w.find(".title-end").text(p.presets.allDatesBefore);w.find(".range-start").saveDateToData().datepicker("setDate",p.earliestDate).hide(400);w.find(".range-end").restoreDateFromData().show(400);setTimeout(function(){y.fadeIn()},400)}else{if(jQuery(this).is(".ui-daterangepicker-allDatesAfter")){y.hide();v.show();w.find(".title-start").text(p.presets.allDatesAfter);w.find(".range-start").restoreDateFromData().show(400);w.find(".range-end").saveDateToData().datepicker("setDate",p.latestDate).hide(400);setTimeout(function(){y.fadeIn()},400)}else{if(jQuery(this).is(".ui-daterangepicker-dateRange")){y.hide();v.show();w.find(".title-start").text(p.rangeStartTitle);w.find(".title-end").text(p.rangeEndTitle);w.find(".range-start").restoreDateFromData().show(400);w.find(".range-end").restoreDateFromData().show(400);setTimeout(function(){y.fadeIn()},400)}else{y.hide();w.find(".range-start, .range-end").hide(400,function(){v.hide()});var u=(typeof jQuery(this).data("dateStart")=="string")?Date.parse(jQuery(this).data("dateStart")):jQuery(this).data("dateStart")();var x=(typeof jQuery(this).data("dateEnd")=="string")?Date.parse(jQuery(this).data("dateEnd")):jQuery(this).data("dateEnd")();w.find(".range-start").datepicker("setDate",u).find(".ui-datepicker-current-day").trigger("click");w.find(".range-end").datepicker("setDate",x).find(".ui-datepicker-current-day").trigger("click")}}}}return false};var f=jQuery('<div class="ranges ui-widget-header ui-corner-all ui-helper-clearfix"><div class="range-start"><span class="title-start">Start Date</span></div><div class="range-end"><span class="title-end">End Date</span></div></div>').appendTo(j);f.find(".range-start, .range-end").datepicker(p.datepickerOptions);f.find(".range-start").datepicker("setDate",g);f.find(".range-end").datepicker("setDate",h);var o=jQuery('<button class="btnDone ui-state-default ui-corner-all">'+p.doneButtonText+"</button>").click(function(){j.find(".ui-datepicker-current-day").trigger("click");i()}).hover(function(){jQuery(this).addClass("ui-state-hover")},function(){jQuery(this).removeClass("ui-state-hover")}).appendTo(f);jQuery(this).click(function(){s();return false});f.css("display","none").find(".range-start, .range-end, .btnDone").css("display","none");jQuery(p.appendTo).append(j);j.wrap('<div class="ui-daterangepickercontain"></div>');if(p.posX){j.parent().css("left",p.posX)}if(p.posY){j.parent().css("top",p.posY)}if(p.arrows&&q.size()==1){var l=jQuery('<a href="#" class="ui-daterangepicker-prev ui-corner-all" title="'+p.prevLinkText+'"><span class="ui-icon ui-icon-circle-triangle-w">'+p.prevLinkText+"</span></a>");var d=jQuery('<a href="#" class="ui-daterangepicker-next ui-corner-all" title="'+p.nextLinkText+'"><span class="ui-icon ui-icon-circle-triangle-e">'+p.nextLinkText+"</span></a>");jQuery(this).addClass("ui-rangepicker-input ui-widget-content").wrap('<div class="ui-daterangepicker-arrows ui-widget ui-widget-header ui-helper-clearfix ui-corner-all"></div>').before(l).before(d).parent().find("a").click(function(){var v=f.find(".range-start").datepicker("getDate");var w=f.find(".range-end").datepicker("getDate");var u=Math.abs(new TimeSpan(v-w).getTotalMilliseconds())+86400000;if(jQuery(this).is(".ui-daterangepicker-prev")){u=-u}f.find(".range-start, .range-end ").each(function(){var x=jQuery(this).datepicker("getDate");if(x==null){return false}jQuery(this).datepicker("setDate",x.add({milliseconds:u})).find(".ui-datepicker-current-day").trigger("click")});return false}).hover(function(){jQuery(this).addClass("ui-state-hover")},function(){jQuery(this).removeClass("ui-state-hover")})}jQuery(document).click(function(){if(j.is(":visible")){i()}});j.click(function(){return false}).hide();return this};Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};Date.getMonthNumberFromName=function(e){var b=Date.CultureInfo.monthNames,a=Date.CultureInfo.abbreviatedMonthNames,c=e.toLowerCase();for(var d=0;d<b.length;d++){if(b[d].toLowerCase()==c||a[d].toLowerCase()==c){return d}}return -1};Date.getDayNumberFromName=function(f){var b=Date.CultureInfo.dayNames,a=Date.CultureInfo.abbreviatedDayNames,c=Date.CultureInfo.shortestDayNames,d=f.toLowerCase();for(var e=0;e<b.length;e++){if(b[e].toLowerCase()==d||a[e].toLowerCase()==d){return e}}return -1};Date.isLeapYear=function(a){return(((a%4===0)&&(a%100!==0))||(a%400===0))};Date.getDaysInMonth=function(a,b){return[31,(Date.isLeapYear(a)?29:28),31,30,31,30,31,31,30,31,30,31][b]};Date.getTimezoneOffset=function(a,b){return(b||false)?Date.CultureInfo.abbreviatedTimeZoneDST[a.toUpperCase()]:Date.CultureInfo.abbreviatedTimeZoneStandard[a.toUpperCase()]};Date.getTimezoneAbbreviation=function(d,b){var c=(b||false)?Date.CultureInfo.abbreviatedTimeZoneDST:Date.CultureInfo.abbreviatedTimeZoneStandard,a;for(a in c){if(c[a]===d){return a}}return null};Date.prototype.clone=function(){return new Date(this.getTime())};Date.prototype.compareTo=function(a){if(isNaN(this)){throw new Error(this)}if(a instanceof Date&&!isNaN(a)){return(this>a)?1:(this<a)?-1:0}else{throw new TypeError(a)}};Date.prototype.equals=function(a){return(this.compareTo(a)===0)};Date.prototype.between=function(b,a){var c=this.getTime();return c>=b.getTime()&&c<=a.getTime()};Date.prototype.addMilliseconds=function(a){this.setMilliseconds(this.getMilliseconds()+a);return this};Date.prototype.addSeconds=function(a){return this.addMilliseconds(a*1000)};Date.prototype.addMinutes=function(a){return this.addMilliseconds(a*60000)};Date.prototype.addHours=function(a){return this.addMilliseconds(a*3600000)};Date.prototype.addDays=function(a){return this.addMilliseconds(a*86400000)};Date.prototype.addWeeks=function(a){return this.addMilliseconds(a*604800000)};Date.prototype.addMonths=function(a){var b=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+a);this.setDate(Math.min(b,this.getDaysInMonth()));return this};Date.prototype.addYears=function(a){return this.addMonths(a*12)};Date.prototype.add=function(b){if(typeof b=="number"){this._orient=b;return this}var a=b;if(a.millisecond||a.milliseconds){this.addMilliseconds(a.millisecond||a.milliseconds)}if(a.second||a.seconds){this.addSeconds(a.second||a.seconds)}if(a.minute||a.minutes){this.addMinutes(a.minute||a.minutes)}if(a.hour||a.hours){this.addHours(a.hour||a.hours)}if(a.month||a.months){this.addMonths(a.month||a.months)}if(a.year||a.years){this.addYears(a.year||a.years)}if(a.day||a.days){this.addDays(a.day||a.days)}return this};Date._validate=function(b,c,a,d){if(typeof b!="number"){throw new TypeError(b+" is not a Number.")}else{if(b<c||b>a){throw new RangeError(b+" is not a valid value for "+d+".")}}return true};Date.validateMillisecond=function(a){return Date._validate(a,0,999,"milliseconds")};Date.validateSecond=function(a){return Date._validate(a,0,59,"seconds")};Date.validateMinute=function(a){return Date._validate(a,0,59,"minutes")};Date.validateHour=function(a){return Date._validate(a,0,23,"hours")};Date.validateDay=function(b,a,c){return Date._validate(b,1,Date.getDaysInMonth(a,c),"days")};Date.validateMonth=function(a){return Date._validate(a,0,11,"months")};Date.validateYear=function(a){return Date._validate(a,1,9999,"seconds")};Date.prototype.set=function(b){var a=b;if(!a.millisecond&&a.millisecond!==0){a.millisecond=-1}if(!a.second&&a.second!==0){a.second=-1}if(!a.minute&&a.minute!==0){a.minute=-1}if(!a.hour&&a.hour!==0){a.hour=-1}if(!a.day&&a.day!==0){a.day=-1}if(!a.month&&a.month!==0){a.month=-1}if(!a.year&&a.year!==0){a.year=-1}if(a.millisecond!=-1&&Date.validateMillisecond(a.millisecond)){this.addMilliseconds(a.millisecond-this.getMilliseconds())}if(a.second!=-1&&Date.validateSecond(a.second)){this.addSeconds(a.second-this.getSeconds())}if(a.minute!=-1&&Date.validateMinute(a.minute)){this.addMinutes(a.minute-this.getMinutes())}if(a.hour!=-1&&Date.validateHour(a.hour)){this.addHours(a.hour-this.getHours())}if(a.month!==-1&&Date.validateMonth(a.month)){this.addMonths(a.month-this.getMonth())}if(a.year!=-1&&Date.validateYear(a.year)){this.addYears(a.year-this.getFullYear())}if(a.day!=-1&&Date.validateDay(a.day,this.getFullYear(),this.getMonth())){this.addDays(a.day-this.getDate())}if(a.timezone){this.setTimezone(a.timezone)}if(a.timezoneOffset){this.setTimezoneOffset(a.timezoneOffset)}return this};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this};Date.prototype.isLeapYear=function(){var a=this.getFullYear();return(((a%4===0)&&(a%100!==0))||(a%400===0))};Date.prototype.isWeekday=function(){return !(this.is().sat()||this.is().sun())};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1})};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()})};Date.prototype.moveToDayOfWeek=function(a,c){var b=(a-this.getDay()+7*(c||+1))%7;return this.addDays((b===0)?b+=7*(c||+1):b)};Date.prototype.moveToMonth=function(b,a){var c=(b-this.getMonth()+12*(a||+1))%12;return this.addMonths((c===0)?c+=12*(a||+1):c)};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000)};Date.prototype.getWeekOfYear=function(d){var g=this.getFullYear(),b=this.getMonth(),i=this.getDate();var e=d||Date.CultureInfo.firstDayOfWeek;var a=7+1-new Date(g,0,1).getDay();if(a==8){a=1}var c=((Date.UTC(g,b,i,0,0,0)-Date.UTC(g,0,1,0,0,0))/86400000)+1;var f=Math.floor((c-a+7)/7);if(f===e){g--;var h=7+1-new Date(g,0,1).getDay();if(h==2||h==8){f=53}else{f=52}}return f};Date.prototype.isDST=function(){return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D"};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST())};Date.prototype.setTimezoneOffset=function(c){var a=this.getTimezoneOffset(),b=Number(c)*-6/10;this.addMinutes(b-a);return this};Date.prototype.setTimezone=function(a){return this.setTimezoneOffset(Date.getTimezoneOffset(a))};Date.prototype.getUTCOffset=function(){var b=this.getTimezoneOffset()*-10/6,a;if(b<0){a=(b-10000).toString();return a[0]+a.substr(2)}else{a=(b+10000).toString();return"+"+a.substr(1)}};Date.prototype.getDayName=function(a){return a?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()]};Date.prototype.getMonthName=function(a){return a?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()]};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(b){var a=this;var c=function c(d){return(d.toString().length==1)?"0"+d:d};return b?b.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(d){switch(d){case"hh":return c(a.getHours()<13?a.getHours():(a.getHours()-12));case"h":return a.getHours()<13?a.getHours():(a.getHours()-12);case"HH":return c(a.getHours());case"H":return a.getHours();case"mm":return c(a.getMinutes());case"m":return a.getMinutes();case"ss":return c(a.getSeconds());case"s":return a.getSeconds();case"yyyy":return a.getFullYear();case"yy":return a.getFullYear().toString().substring(2,4);case"dddd":return a.getDayName();case"ddd":return a.getDayName(true);case"dd":return c(a.getDate());case"d":return a.getDate().toString();case"MMMM":return a.getMonthName();case"MMM":return a.getMonthName(true);case"MM":return c((a.getMonth()+1));case"M":return a.getMonth()+1;case"t":return a.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return a.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return""}}):this._toString()};Date.now=function(){return new Date()};Date.today=function(){return Date.now().clearTime()};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var a={};a[this._dateElement]=this;return Date.now().add(a)};Number.prototype.ago=function(){var a={};a[this._dateElement]=this*-1;return Date.now().add(a)};(function(){var k=Date.prototype,d=Number.prototype;var e=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),f=("january february march april may june july august september october november december").split(/\s/),g=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),h;var i=function(o){return function(){if(this._is){this._is=false;return this.getDay()==o}return this.moveToDayOfWeek(o,this._orient)}};for(var l=0;l<e.length;l++){k[e[l]]=k[e[l].substring(0,3)]=i(l)}var j=function(o){return function(){if(this._is){this._is=false;return this.getMonth()===o}return this.moveToMonth(o,this._orient)}};for(var a=0;a<f.length;a++){k[f[a]]=k[f[a].substring(0,3)]=j(a)}var m=function(o){return function(){if(o.substring(o.length-1)!="s"){o+="s"}return this["add"+o](this._orient)}};var c=function(o){return function(){this._dateElement=o;return this}};for(var b=0;b<g.length;b++){h=g[b].toLowerCase();k[h]=k[h+"s"]=m(g[b]);d[h]=d[h+"s"]=c(h)}}());Date.prototype.toJSONString=function(){return this.toString("yyyy-MM-ddThh:mm:ssZ")};Date.prototype.toShortDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern)};Date.prototype.toLongDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.longDatePattern)};Date.prototype.toShortTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortTimePattern)};Date.prototype.toLongTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.longTimePattern)};Date.prototype.getOrdinal=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}};(function(){Date.Parsing={Exception:function(i){this.message="Parse error at '"+i.substring(0,10)+" ...'"}};var a=Date.Parsing;var g=a.Operators={rtoken:function(i){return function(k){var j=k.match(i);if(j){return([j[0],k.substring(j[0].length)])}else{throw new a.Exception(k)}}},token:function(i){return function(j){return g.rtoken(new RegExp("^s*"+j+"s*"))(j)}},stoken:function(i){return g.rtoken(new RegExp("^"+i))},until:function(i){return function(l){var k=[],m=null;while(l.length){try{m=i.call(this,l)}catch(j){k.push(m[0]);l=m[1];continue}break}return[k,l]}},many:function(i){return function(l){var m=[],k=null;while(l.length){try{k=i.call(this,l)}catch(j){return[m,l]}m.push(k[0]);l=k[1]}return[m,l]}},optional:function(i){return function(l){var k=null;try{k=i.call(this,l)}catch(j){return[null,l]}return[k[0],k[1]]}},not:function(i){return function(k){try{i.call(this,k)}catch(j){return[null,k]}throw new a.Exception(k)}},ignore:function(i){return i?function(k){var j=null;j=i.call(this,k);return[null,j[1]]}:null},product:function(){var k=arguments[0],j=Array.prototype.slice.call(arguments,1),i=[];for(var l=0;l<k.length;l++){i.push(g.each(k[l],j))}return i},cache:function(i){var k={},j=null;return function(l){try{j=k[l]=(k[l]||i.call(this,l))}catch(m){j=k[l]=m}if(j instanceof a.Exception){throw j}else{return j}}},any:function(){var i=arguments;return function(k){var j=null;for(var l=0;l<i.length;l++){if(i[l]==null){continue}try{j=(i[l].call(this,k))}catch(m){j=null}if(j){return j}}throw new a.Exception(k)}},each:function(){var i=arguments;return function(k){var m=[],j=null;for(var l=0;l<i.length;l++){if(i[l]==null){continue}try{j=(i[l].call(this,k))}catch(o){throw new a.Exception(k)}m.push(j[0]);k=j[1]}return[m,k]}},all:function(){var i=arguments,j=j;return j.each(j.optional(i))},sequence:function(k,j,i){j=j||g.rtoken(/^\s*/);i=i||null;if(k.length==1){return k[0]}return function(s){var q=null,p=null;var m=[];for(var t=0;t<k.length;t++){try{q=k[t].call(this,s)}catch(o){break}m.push(q[0]);try{p=j.call(this,q[1])}catch(u){p=null;break}s=p[1]}if(!q){throw new a.Exception(s)}if(p){throw new a.Exception(p[1])}if(i){try{q=i.call(this,q[1])}catch(l){throw new a.Exception(q[1])}}return[m,(q?q[1]:s)]}},between:function(k,j,l){l=l||k;var i=g.each(g.ignore(k),j,g.ignore(l));return function(o){var m=i.call(this,o);return[[m[0][0],r[0][2]],m[1]]}},list:function(k,j,i){j=j||g.rtoken(/^\s*/);i=i||null;return(k instanceof Array?g.each(g.product(k.slice(0,-1),g.ignore(j)),k.slice(-1),g.ignore(i)):g.each(g.many(g.each(k,g.ignore(j))),px,g.ignore(i)))},set:function(k,j,i){j=j||g.rtoken(/^\s*/);i=i||null;return function(l){var z=null,x=null,y=null,w=null,v=[[],l],m=false;for(var t=0;t<k.length;t++){y=null;x=null;z=null;m=(k.length==1);try{z=k[t].call(this,l)}catch(p){continue}w=[[z[0]],z[1]];if(z[1].length>0&&!m){try{y=j.call(this,z[1])}catch(o){m=true}}else{m=true}if(!m&&y[1].length===0){m=true}if(!m){var s=[];for(var u=0;u<k.length;u++){if(t!=u){s.push(k[u])}}x=g.set(s,j).call(this,y[1]);if(x[0].length>0){w[0]=w[0].concat(x[0]);w[1]=x[1]}}if(w[1].length<v[1].length){v=w}if(v[1].length===0){break}}if(v[0].length===0){return v}if(i){try{y=i.call(this,v[1])}catch(q){throw new a.Exception(v[1])}v[1]=y[1]}return v}},forward:function(j,i){return function(k){return j[i].call(this,k)}},replace:function(i,j){return function(l){var k=i.call(this,l);return[j,k[1]]}},process:function(i,j){return function(l){var k=i.call(this,l);return[j.call(this,k[0]),k[1]]}},min:function(j,i){return function(l){var k=i.call(this,l);if(k[0].length<j){throw new a.Exception(l)}return k}}};var b=function(i){return function(){var l=null,m=[];if(arguments.length>1){l=Array.prototype.slice.call(arguments)}else{if(arguments[0] instanceof Array){l=arguments[0]}}if(l){for(var j=0,k=l.shift();j<k.length;j++){l.unshift(k[j]);m.push(i.apply(null,l));l.shift();return m}}else{return i.apply(null,arguments)}}};var c="optional not ignore cache".split(/\s/);for(var f=0;f<c.length;f++){g[c[f]]=b(g[c[f]])}var d=function(i){return function(){if(arguments[0] instanceof Array){return i.apply(null,arguments[0])}else{return i.apply(null,arguments)}}};var e="each any all".split(/\s/);for(var h=0;h<e.length;h++){g[e[h]]=d(g[e[h]])}}());(function(){var d=function(j){var i=[];for(var k=0;k<j.length;k++){if(j[k] instanceof Array){i=i.concat(d(j[k]))}else{if(j[k]){i.push(j[k])}}}return i};Date.Grammar={};Date.Translator={hour:function(i){return function(){this.hour=Number(i)}},minute:function(i){return function(){this.minute=Number(i)}},second:function(i){return function(){this.second=Number(i)}},meridian:function(i){return function(){this.meridian=i.slice(0,1).toLowerCase()}},timezone:function(i){return function(){var j=i.replace(/[^\d\+\-]/g,"");if(j.length){this.timezoneOffset=Number(j)}else{this.timezone=i.toLowerCase()}}},day:function(j){var i=j[0];return function(){this.day=Number(i.match(/\d+/)[0])}},month:function(i){return function(){this.month=((i.length==3)?Date.getMonthNumberFromName(i):(Number(i)-1))}},year:function(i){return function(){var j=Number(i);this.year=((i.length>2)?j:(j+(((j+2000)<Date.CultureInfo.twoDigitYearMax)?2000:1900)))}},rday:function(i){return function(){switch(i){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break}}},finishExact:function(l){l=(l instanceof Array)?l:[l];var k=new Date();this.year=k.getFullYear();this.month=k.getMonth();this.day=1;this.hour=0;this.minute=0;this.second=0;for(var j=0;j<l.length;j++){if(l[j]){l[j].call(this)}}this.hour=(this.meridian=="p"&&this.hour<13)?this.hour+12:this.hour;if(this.day>Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.")}var i=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){i.set({timezone:this.timezone})}else{if(this.timezoneOffset){i.set({timezoneOffset:this.timezoneOffset})}}return i},finish:function(l){l=(l instanceof Array)?d(l):[l];if(l.length===0){return null}for(var q=0;q<l.length;q++){if(typeof l[q]=="function"){l[q].call(this)}}if(this.now){return new Date()}var k=Date.today();var m=null;var p=!!(this.days!=null||this.orient||this.operator);if(p){var o,i,j;j=((this.orient=="past"||this.operator=="subtract")?-1:1);if(this.weekday){this.unit="day";o=(Date.getDayNumberFromName(this.weekday)-k.getDay());i=7;this.days=o?((o+(j*i))%i):(j*i)}if(this.month){this.unit="month";o=(this.month-k.getMonth());i=12;this.months=o?((o+(j*i))%i):(j*i);this.month=null}if(!this.unit){this.unit="day"}if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1}if(this.unit=="week"){this.unit="day";this.value=this.value*7}this[this.unit+"s"]=this.value*j}return k.add(this)}else{if(this.meridian&&this.hour){this.hour=(this.hour<13&&this.meridian=="p")?this.hour+12:this.hour}if(this.weekday&&!this.day){this.day=(k.addDays((Date.getDayNumberFromName(this.weekday)-k.getDay()))).getDate()}if(this.month&&!this.day){this.day=1}return k.set(this)}}};var h=Date.Parsing.Operators,e=Date.Grammar,f=Date.Translator,b;e.datePartDelimiter=h.rtoken(/^([\s\-\.\,\/\x27]+)/);e.timePartDelimiter=h.stoken(":");e.whiteSpace=h.rtoken(/^\s*/);e.generalDelimiter=h.rtoken(/^(([\s\,]|at|on)+)/);var a={};e.ctoken=function(o){var i=a[o];if(!i){var m=Date.CultureInfo.regexPatterns;var j=o.split(/\s+/),k=[];for(var l=0;l<j.length;l++){k.push(h.replace(h.rtoken(m[j[l]]),j[l]))}i=a[o]=h.any.apply(null,k)}return i};e.ctoken2=function(i){return h.rtoken(Date.CultureInfo.regexPatterns[i])};e.h=h.cache(h.process(h.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),f.hour));e.hh=h.cache(h.process(h.rtoken(/^(0[0-9]|1[0-2])/),f.hour));e.H=h.cache(h.process(h.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),f.hour));e.HH=h.cache(h.process(h.rtoken(/^([0-1][0-9]|2[0-3])/),f.hour));e.m=h.cache(h.process(h.rtoken(/^([0-5][0-9]|[0-9])/),f.minute));e.mm=h.cache(h.process(h.rtoken(/^[0-5][0-9]/),f.minute));e.s=h.cache(h.process(h.rtoken(/^([0-5][0-9]|[0-9])/),f.second));e.ss=h.cache(h.process(h.rtoken(/^[0-5][0-9]/),f.second));e.hms=h.cache(h.sequence([e.H,e.mm,e.ss],e.timePartDelimiter));e.t=h.cache(h.process(e.ctoken2("shortMeridian"),f.meridian));e.tt=h.cache(h.process(e.ctoken2("longMeridian"),f.meridian));e.z=h.cache(h.process(h.rtoken(/^(\+|\-)?\s*\d\d\d\d?/),f.timezone));e.zz=h.cache(h.process(h.rtoken(/^(\+|\-)\s*\d\d\d\d/),f.timezone));e.zzz=h.cache(h.process(e.ctoken2("timezone"),f.timezone));e.timeSuffix=h.each(h.ignore(e.whiteSpace),h.set([e.tt,e.zzz]));e.time=h.each(h.optional(h.ignore(h.stoken("T"))),e.hms,e.timeSuffix);e.d=h.cache(h.process(h.each(h.rtoken(/^([0-2]\d|3[0-1]|\d)/),h.optional(e.ctoken2("ordinalSuffix"))),f.day));e.dd=h.cache(h.process(h.each(h.rtoken(/^([0-2]\d|3[0-1])/),h.optional(e.ctoken2("ordinalSuffix"))),f.day));e.ddd=e.dddd=h.cache(h.process(e.ctoken("sun mon tue wed thu fri sat"),function(i){return function(){this.weekday=i}}));e.M=h.cache(h.process(h.rtoken(/^(1[0-2]|0\d|\d)/),f.month));e.MM=h.cache(h.process(h.rtoken(/^(1[0-2]|0\d)/),f.month));e.MMM=e.MMMM=h.cache(h.process(e.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),f.month));e.y=h.cache(h.process(h.rtoken(/^(\d\d?)/),f.year));e.yy=h.cache(h.process(h.rtoken(/^(\d\d)/),f.year));e.yyy=h.cache(h.process(h.rtoken(/^(\d\d?\d?\d?)/),f.year));e.yyyy=h.cache(h.process(h.rtoken(/^(\d\d\d\d)/),f.year));b=function(){return h.each(h.any.apply(null,arguments),h.not(e.ctoken2("timeContext")))};e.day=b(e.d,e.dd);e.month=b(e.M,e.MMM);e.year=b(e.yyyy,e.yy);e.orientation=h.process(e.ctoken("past future"),function(i){return function(){this.orient=i}});e.operator=h.process(e.ctoken("add subtract"),function(i){return function(){this.operator=i}});e.rday=h.process(e.ctoken("yesterday tomorrow today now"),f.rday);e.unit=h.process(e.ctoken("minute hour day week month year"),function(i){return function(){this.unit=i}});e.value=h.process(h.rtoken(/^\d\d?(st|nd|rd|th)?/),function(i){return function(){this.value=i.replace(/\D/g,"")}});e.expression=h.set([e.rday,e.operator,e.value,e.unit,e.orientation,e.ddd,e.MMM]);b=function(){return h.set(arguments,e.datePartDelimiter)};e.mdy=b(e.ddd,e.month,e.day,e.year);e.ymd=b(e.ddd,e.year,e.month,e.day);e.dmy=b(e.ddd,e.day,e.month,e.year);e.date=function(i){return((e[Date.CultureInfo.dateElementOrder]||e.mdy).call(this,i))};e.format=h.process(h.many(h.any(h.process(h.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(i){if(e[i]){return e[i]}else{throw Date.Parsing.Exception(i)}}),h.process(h.rtoken(/^[^dMyhHmstz]+/),function(i){return h.ignore(h.stoken(i))}))),function(i){return h.process(h.each.apply(null,i),f.finishExact)});var c={};var g=function(i){return c[i]=(c[i]||e.format(i)[0])};e.formats=function(j){if(j instanceof Array){var i=[];for(var k=0;k<j.length;k++){i.push(g(j[k]))}return h.any.apply(null,i)}else{return g(j)}};e._formats=e.formats(["yyyy-MM-ddTHH:mm:ss","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","d"]);e._start=h.process(h.set([e.date,e.time,e.expression],e.generalDelimiter,e.whiteSpace),f.finish);e.start=function(k){try{var j=e._formats.call({},k);if(j[1].length===0){return j}}catch(i){}return e._start.call({},k)}}());Date._parse=Date.parse;Date.parse=function(a){var c=null;if(!a){return null}try{c=Date.Grammar.start.call({},a)}catch(b){return null}return((c[1].length===0)?c[0]:null)};Date.getParseFunction=function(b){var a=Date.Grammar.formats(b);return function(e){var d=null;try{d=a.call({},e)}catch(c){return null}return((d[1].length===0)?d[0]:null)}};Date.parseExact=function(a,b){return Date.getParseFunction(b)(a)};var TimeSpan=function(e,i,l,h,a){var f="days hours minutes seconds milliseconds".split(/\s+/);var b=function(m){return function(){return this[m]}};var g=function(m){return function(o){this[m]=o;return this}};for(var j=0;j<f.length;j++){var c=f[j],d=c.slice(0,1).toUpperCase()+c.slice(1);TimeSpan.prototype[c]=0;TimeSpan.prototype["get"+d]=b(c);TimeSpan.prototype["set"+d]=g(c)}if(arguments.length==4){this.setDays(e);this.setHours(i);this.setMinutes(l);this.setSeconds(h)}else{if(arguments.length==5){this.setDays(e);this.setHours(i);this.setMinutes(l);this.setSeconds(h);this.setMilliseconds(a)}else{if(arguments.length==1&&typeof e=="number"){var k=(e<0)?-1:+1;this.setMilliseconds(Math.abs(e));this.setDays(Math.floor(this.getMilliseconds()/86400000)*k);this.setMilliseconds(this.getMilliseconds()%86400000);this.setHours(Math.floor(this.getMilliseconds()/3600000)*k);this.setMilliseconds(this.getMilliseconds()%3600000);this.setMinutes(Math.floor(this.getMilliseconds()/60000)*k);this.setMilliseconds(this.getMilliseconds()%60000);this.setSeconds(Math.floor(this.getMilliseconds()/1000)*k);this.setMilliseconds(this.getMilliseconds()%1000);this.setMilliseconds(this.getMilliseconds()*k)}}}this.getTotalMilliseconds=function(){return(this.getDays()*86400000)+(this.getHours()*3600000)+(this.getMinutes()*60000)+(this.getSeconds()*1000)};this.compareTo=function(m){var o=new Date(1970,1,1,this.getHours(),this.getMinutes(),this.getSeconds()),p;if(m===null){p=new Date(1970,1,1,0,0,0)}else{p=new Date(1970,1,1,m.getHours(),m.getMinutes(),m.getSeconds())}return(o<p)?-1:(o>p)?1:0};this.equals=function(m){return(this.compareTo(m)===0)};this.add=function(m){return(m===null)?this:this.addSeconds(m.getTotalMilliseconds()/1000)};this.subtract=function(m){return(m===null)?this:this.addSeconds(-m.getTotalMilliseconds()/1000)};this.addDays=function(m){return new TimeSpan(this.getTotalMilliseconds()+(m*86400000))};this.addHours=function(m){return new TimeSpan(this.getTotalMilliseconds()+(m*3600000))};this.addMinutes=function(m){return new TimeSpan(this.getTotalMilliseconds()+(m*60000))};this.addSeconds=function(m){return new TimeSpan(this.getTotalMilliseconds()+(m*1000))};this.addMilliseconds=function(m){return new TimeSpan(this.getTotalMilliseconds()+m)};this.get12HourHour=function(){return(this.getHours()>12)?this.getHours()-12:(this.getHours()===0)?12:this.getHours()};this.getDesignator=function(){return(this.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator};this.toString=function(m){this._toString=function(){if(this.getDays()!==null&&this.getDays()>0){return this.getDays()+"."+this.getHours()+":"+this.p(this.getMinutes())+":"+this.p(this.getSeconds())}else{return this.getHours()+":"+this.p(this.getMinutes())+":"+this.p(this.getSeconds())}};this.p=function(p){return(p.toString().length<2)?"0"+p:p};var o=this;return m?m.replace(/dd?|HH?|hh?|mm?|ss?|tt?/g,function(p){switch(p){case"d":return o.getDays();case"dd":return o.p(o.getDays());case"H":return o.getHours();case"HH":return o.p(o.getHours());case"h":return o.get12HourHour();case"hh":return o.p(o.get12HourHour());case"m":return o.getMinutes();case"mm":return o.p(o.getMinutes());case"s":return o.getSeconds();case"ss":return o.p(o.getSeconds());case"t":return((o.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator).substring(0,1);case"tt":return(o.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator}}):this._toString()};return this};Date.prototype.getTimeOfDay=function(){return new TimeSpan(0,this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())};var TimePeriod=function(g,o,p,d,f,j,m){var h="years months days hours minutes seconds milliseconds".split(/\s+/);var k=function(v){return function(){return this[v]}};var t=function(v){return function(w){this[v]=w;return this}};for(var e=0;e<h.length;e++){var q=h[e],s=q.slice(0,1).toUpperCase()+q.slice(1);TimePeriod.prototype[q]=0;TimePeriod.prototype["get"+s]=k(q);TimePeriod.prototype["set"+s]=t(q)}if(arguments.length==7){this.years=g;this.months=o;this.setDays(p);this.setHours(d);this.setMinutes(f);this.setSeconds(j);this.setMilliseconds(m)}else{if(arguments.length==2&&arguments[0] instanceof Date&&arguments[1] instanceof Date){var a=g.clone();var b=o.clone();var c=a.clone();var l=(a>b)?-1:+1;this.years=b.getFullYear()-a.getFullYear();c.addYears(this.years);if(l==+1){if(c>b){if(this.years!==0){this.years--}}}else{if(c<b){if(this.years!==0){this.years++}}}a.addYears(this.years);if(l==+1){while(a<b&&a.clone().addDays(Date.getDaysInMonth(a.getYear(),a.getMonth()))<b){a.addMonths(1);this.months++}}else{while(a>b&&a.clone().addDays(-a.getDaysInMonth())>b){a.addMonths(-1);this.months--}}var i=b-a;if(i!==0){var u=new TimeSpan(i);this.setDays(u.getDays());this.setHours(u.getHours());this.setMinutes(u.getMinutes());this.setSeconds(u.getSeconds());this.setMilliseconds(u.getMilliseconds())}}}return this};(function(c){var a="http://maps.google.com/staticmap?";var b;c.widget("ui.gmap",{_init:function(){var d=c(this.options.latselector).val();var g=c(this.options.lngselector).val();if(this.options.static_map){var e="markers="+d+","+g;e=e+"&size="+this.options.width+"x"+this.options.height;e=e+"&key="+this.options.apikey;e=e+"&zoom=13&sensor=false";var f="<img src='"+a+e+"'/>";this.element.html(f);return}else{cachedLocations={};var h={zoom:1,mapTypeControl:false,center:new google.maps.LatLng(0,0),mapTypeId:google.maps.MapTypeId.ROADMAP};map=new google.maps.Map(this.element.get(0),h);marker=null;if(c.trim(d)!=""){this.placeMarker()}geocoder=new google.maps.Geocoder()}},search:function(d,f){var e=this;var g=this.options.getAddress();geocoder.geocode({address:g},function(i,j){if(marker){marker.set_map(null)}c(e.options.latselector).val("");c(e.options.lngselector).val("");var h=null;if(j==google.maps.GeocoderStatus.OK&&i.length){if(j!=google.maps.GeocoderStatus.ZERO_RESULTS){var h=i[0].geometry.location;map.set_center(h);map.set_zoom(13);marker=new google.maps.Marker({position:h,map:map});if(f){marker.set_icon(f)}c(e.options.latselector).val(h.lat());c(e.options.lngselector).val(h.lng())}}cachedLocations[g]=h?h:"invalid";if(d){d(h!=null)}})},set:function(d){if(marker){marker.set_map(null)}marker=new google.maps.Marker({position:d,map:map});map.set_center(d);map.set_zoom(13);c(this.options.latselector).val(d.lat());c(this.options.lngselector).val(d.lng())},addMarker:function(e,d,h){var j=new google.maps.LatLng(e,d);var f=c.extend({},h,{position:j,map:map});var i=new google.maps.Marker(f);if(h.infoWindowContent){i.infoWindow=new google.maps.InfoWindow({content:h.infoWindowContent,pixelOffset:new google.maps.Size(0,2),size:new google.maps.Size(200,30)});google.maps.event.addListener(i,"click",function(){if(!!b&&!!b.infoWindow){b.infoWindow.close()}b=this;this.infoWindow.open(this.map,this)})}var g=map.get_bounds();g.extend(j);map.fitBounds(g)},placeMarker:function(){var d=c(this.options.latselector).val();var e=c(this.options.lngselector).val();if(c.trim(d)==""){if(marker){marker.set_map(null)}return}var f=new google.maps.LatLng(d,e);if(marker){marker.set_map(map);marker.set_position(f)}else{marker=new google.maps.Marker({position:f,map:map})}map.set_center(f);map.set_zoom(13)},cachedValue:function(){var d=this.options.getAddress();if(d in cachedLocations){return cachedLocations[d]}return"unchecked"}});c.ui.gmap.getter="cachedValue"})(jQuery);function addLocationValidation(){$.validator.addMethod("location",function(b,e,a){var c=false;var f=this;var d=$(a).gmap("cachedValue");if(d!="unchecked"){if(d=="invalid"){return false}else{$(a).gmap("set",d);return true}}f.startRequest(e);$(a).gmap("search",function(h){f.stopRequest(e,h);if(!h){var g={};g[e.name]=f.defaultMessage(e,"location");f.showErrors(g)}else{var i=f.formSubmitted;f.prepareElement(e);f.formSubmitted=i;f.successList.push(e);f.showErrors();f.form()}});return"pending"},"The given location is not valid.")}(function(a){a.fn.renameAttr=function(c,b){val=a(this).attr(c);a(this).removeAttr(c);a(this).attr(b,val)};a.widget("ui.ajaxMachine",{_init:function(){this.options.plugins=this.options.plugins||{};if(this.options.startStateName){var b=this.options.startStateName;if(a.isFunction(b)){b=b(this)}this.bindState(b)}},bindState:function(b){var c=this.options.states[b];var d=this;a.each(c.actions,function(){this.bind(d)})}});a.ajaxActionWithMixins=function(d,b,f,e){if(!e){e={}}var c={};a.each(f,function(g,h){c=a.extend({},c,h)});c=a.extend(c,e);return a.ajaxAction(d,b,c)};a.ajaxAction=function(c,b,d){if(!d){d={}}return a.extend({},a.ajaxActionDefault,d,{name:c,nextState:b})};a.submitAjaxAction=function(c,b,d){return a.ajaxAction(c,b,a.extend({},a.submitAjaxActionDefault,d))};a.validatedSubmitAjaxAction=function(c,b,d){return a.ajaxAction(c,b,a.extend({},a.validatedSubmitAjaxActionDefault,d))};a.addAjaxAction=function(c,b,d){return a.ajaxAction(c,b,a.extend({},a.addAjaxActionDefault,d))};a.deleteAjaxAction=function(c,b,d){return a.ajaxAction(c,b,a.extend({},a.deleteAjaxActionDefault,d))};a.ajaxActionDefault={_prefix:function(b){return b.options.prefix(b.element)},_hook:function(b,c){if(!this[b](c)){return false}var d=this;var e=true;a.each(c.options.plugins,function(){if(!a.isFunction(this[b])){e=true}else{if(!this[b](c,d)){e=false}}return e});return e},actionButton:function(b){return a(this._prefix(b)+"_"+this.name+"_action")},bind:function(b){if(!this._hook("beforeBind",b)){return}var d=this.actionButton(b);if(!d.length){return}d.renameAttr("href","action");var c=this;d.unbind("click").bind("click",function(){c.act(b)});if(!this._hook("afterBind",b)){return}},act:function(b){var c=this;if(!this._beforeHook(b)){return}this.sendRequest(b,function(e,d){if(c.processResponse(b,e,d)){if(c._afterHook(b)&&c.nextState){b.bindState(c.nextState)}}})},_beforeHook:function(b){return this._hook("before",b)},_afterHook:function(b){return this._hook("after",b)},sendRequest:function(b,c){a.ajax({url:this.actionButton(b).attr("action"),success:c})},processResponse:function(c,d,b){if(b!="success"){alert(d);return false}this.responseContainer(c).html(d);return true},responseContainer:function(b){return a(b.element)},before:function(b){return true},after:function(b){return true},beforeBind:function(b){return true},afterBind:function(b){return true},nextState:null};a.submitAjaxActionMixin={actionForm:function(b){return a(this._prefix(b)+"_"+this.name+"_form")},afterBind:function(b){var c=this;var d=this.actionForm(b);if(!d.length){return}d.removeAttr("action");this.bindForm(d,b)},bindForm:function(c,b){c.unbind("submit").bind("submit",function(d){if(d.target==this){action.act(b)}return false})},actWithoutAjax:function(b){this.actionForm(b).unbind("submit");this.actionForm(b).attr("action",this.actionButton(b).attr("action"));this.actionForm(b).submit()},sendRequest:function(b,c){this.actionForm(b).ajaxSubmit({url:a(this.actionButton(b)).attr("action"),success:c})}};a.submitAjaxActionDefault=a.extend({},a.ajaxActionDefault,a.submitAjaxActionMixin);a.validatedSubmitAjaxActionMixin=a.extend({},a.submitAjaxActionMixin,{bindForm:function(d,b){var c=this;d.validate(a.extend({},this.validationOptions(),{submitHandler:function(e){c.act(b)}}))},_beforeHook:function(b){if(!this.actionForm(b).valid()){return false}return this._hook("before",b)},validationOptions:function(){return{}}});a.validatedSubmitAjaxActionDefault=a.extend({},a.ajaxActionDefault,a.validatedSubmitAjaxActionMixin);a.addAjaxActionMixin={processResponse:function(c,d,b){a(this._prefix(c)+"_container").append(this.wrapResponse(c,d));return true},wrapResponse:function(b,c){return"<li>"+c+"</li>"}};a.addAjaxActionDefault=a.extend({},a.submitAjaxActionDefault,a.addAjaxActionMixin);a.deleteAjaxActionMixin={processResponse:function(c,d,b){var e=a(this.actionButton(c)).parent();while(e.length&&e[0]!=c.element&&e[0].tagName!="LI"){e=e.parent()}if(e[0].tagName=="LI"){a(e[0]).remove()}return true}};a.deleteAjaxActionDefault=a.extend({},a.ajaxActionDefault,a.deleteAjaxActionMixin)})(jQuery);function datepickerX(g,d,a,e){options={altField:g};$.extend(options,e);var b=$(g).val();$(d).datepicker(options);$(g).blur(function(){setDate(g,d)});$(g).focus(function(){setDate(g,d)});if($.trim(b)!=""){var f=null;try{f=$.datepicker.parseDate("yy-mm-dd",b)}catch(c){f=$.datepicker.parseDate("mm/dd/yy",b)}$(d).datepicker("setDate",f)}else{if(!a){$(g).val(b)}}}function setDate(a,c){var b=$(a).val();if($.trim(b)!=""){var d=$.datepicker.parseDate("mm/dd/yy",b);$(c).datepicker("setDate",d)}else{$(c).datepicker("setDate",null);$(a).val("")}}function addEndDateValidation(){$.validator.addMethod("endDate",function(c,d,a){if(!c||$.trim(c)==""){return true}var b=$.datepicker.parseDate("mm/dd/yy",c);var a=$.datepicker.parseDate("mm/dd/yy",$(a).val());return b>=a},"End date must be greater than or equal to start date.")}function addFutureDateValidation(){$.validator.addMethod("futureDate",function(b,c){if(!b||$.trim(b)==""){return true}var a=$.datepicker.parseDate("mm/dd/yy",b);var d=new Date();d.setHours(0);d.setMinutes(0);d.setSeconds(0);d.setMilliseconds(0);return a>=d},"Date should be greater than or equal to today's date.")}function addDependentFieldsPopulatedValidation(){$.validator.addMethod("dependenciesFilled",function(b,a,c){var d=true;$.each(c,function(f){var e=$(f).val();if(!e||$.trim(e)==""){d=false}return d});return d},"Dependent fields seem to be unpopulated.")};
