jQuery.fn.daterangepicker=function(o){var b=jQuery(this);var m=jQuery.extend({presetRanges:[{text:"Gestern",dateStart:"yesterday",dateEnd:"yesterday"}],presets:{specificDate:"Zeitpunkt",dateRange:"Zeitraum"},rangeStartTitle:"Start Datum",rangeEndTitle:"Ende Datum",nextLinkText:"vor&#x3e;",prevLinkText:"&#x3c;zur�ck",doneButtonText:"Zeitraum speichern",earliestDate:Date.parse("-15years"),latestDate:Date.parse("+15years"),rangeSplitter:"-",dateFormat:"dd. M yy",closeOnSelect:true,arrows:false,posX:b.offset().left,posY:b.offset().top+b.outerHeight(),appendTo:".container",onClose:function(){},onOpen:function(){},onChange:function(){},datepickerOptions:null},o);var h={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=q(j.find(".range-start").datepicker("getDate"));var t=q(j.find(".range-end").datepicker("getDate"));if(b.length==2){b.eq(0).val(u);b.eq(1).val(t);}else{b.val((u!=t)?u+" "+m.rangeSplitter+" "+t:u);}if(m.closeOnSelect){if(!j.find("li.ui-state-active").is(".ui-daterangepicker-dateRange")&&!j.is(":animated")){c();}}m.onChange();},defaultDate:+0};b.change(m.onChange);m.datepickerOptions=(o)?jQuery.extend(h,o.datepickerOptions):h;var i,f=Date.parse("today");var d,a;if(b.size()==2){d=Date.parse(b.eq(0).val());a=Date.parse(b.eq(1).val());if(d==null){d=a;}if(a==null){a=d;}}else{d=Date.parse(b.val().split(m.rangeSplitter)[0]);a=Date.parse(b.val().split(m.rangeSplitter)[1]);if(a==null){a=d;}}if(d!=null){i=d;}if(a!=null){f=a;}var j=jQuery('<div class="ui-daterangepicker ui-widget ui-helper-clearfix ui-widget-content ui-corner-all"></div>');var s=(function(){var t=jQuery('<ul class="ui-widget-content"></ul>').appendTo(j);if(m.presetRanges[0]["text"]!==undefined){jQuery.each(m.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(t);});}var u=0;jQuery.each(m.presets,function(v,w){jQuery('<li class="ui-daterangepicker-'+v+" preset_"+u+' ui-helper-clearfix ui-corner-all"><span class="ui-icon ui-icon-triangle-1-e"></span><a href="#">'+w+"</a></li>").appendTo(t);u++;});t.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,g,l);return false;});return t;})();function q(x){if(!x.getDate()){return"";}var t=x.getDate();var w=x.getMonth();var u=x.getFullYear();w++;var v=m.dateFormat;return jQuery.datepicker.formatDate(v,x);}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 n(){if(j.data("state")=="closed"){j.data("state","open");j.fadeIn(300);m.onOpen();}}function c(){if(j.data("state")=="open"){j.data("state","closed");j.fadeOut(300);m.onClose();}}function p(){if(j.data("state")=="open"){c();}else{n();}}j.data("state","closed");jQuery.fn.clickActions=function(w,t,v){if(jQuery(this).is(".ui-daterangepicker-specificDate")){v.hide();t.show();w.find(".title-start").text(m.presets.specificDate);w.find(".range-start").restoreDateFromData().show(400);w.find(".range-end").restoreDateFromData().hide(400);setTimeout(function(){v.fadeIn();},400);}else{if(jQuery(this).is(".ui-daterangepicker-dateRange")){v.hide();t.show();w.find(".title-start").text(m.rangeStartTitle);w.find(".title-end").text(m.rangeEndTitle);w.find(".range-start").restoreDateFromData().show(400);w.find(".range-end").restoreDateFromData().show(400);setTimeout(function(){v.fadeIn();},400);}else{v.hide();w.find(".range-start, .range-end").hide(400,function(){t.hide();});var x=(typeof jQuery(this).data("dateStart")=="string")?Date.parse(jQuery(this).data("dateStart")):jQuery(this).data("dateStart")();var u=(typeof jQuery(this).data("dateEnd")=="string")?Date.parse(jQuery(this).data("dateEnd")):jQuery(this).data("dateEnd")();w.find(".range-start").datepicker("setDate",x).find(".ui-datepicker-current-day").trigger("click");w.find(".range-end").datepicker("setDate",u).find(".ui-datepicker-current-day").trigger("click");}}return false;};var g=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);g.find(".range-start, .range-end").datepicker(m.datepickerOptions);g.find(".range-start").datepicker("setDate",i);g.find(".range-end").datepicker("setDate",f);var l=jQuery('<button class="btnDone ui-state-default ui-corner-all">'+m.doneButtonText+"</button>").click(function(){j.find(".ui-datepicker-current-day").trigger("click");c();}).hover(function(){jQuery(this).addClass("ui-state-hover");},function(){jQuery(this).removeClass("ui-state-hover");}).appendTo(g);jQuery(this).click(function(){p();return false;});g.css("display","none").find(".range-start, .range-end, .btnDone").css("display","none");jQuery(m.appendTo).append(j);j.wrap('<div class="ui-daterangepickercontain"></div>');if(m.posX){j.parent().css("left",m.posX);}if(m.posY){j.parent().css("top",m.posY);}if(m.arrows&&b.size()==1){var k=jQuery('<a href="#" class="ui-daterangepicker-prev ui-corner-all" title="'+m.prevLinkText+'"><span class="ui-icon ui-icon-circle-triangle-w">'+m.prevLinkText+"</span></a>");var e=jQuery('<a href="#" class="ui-daterangepicker-next ui-corner-all" title="'+m.nextLinkText+'"><span class="ui-icon ui-icon-circle-triangle-e">'+m.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(k).before(e).parent().find("a").click(function(){var v=g.find(".range-start").datepicker("getDate");var t=g.find(".range-end").datepicker("getDate");var u=Math.abs(new TimeSpan(v-t).getTotalMilliseconds())+86400000;if(jQuery(this).is(".ui-daterangepicker-prev")){u=-u;}g.find(".range-start, .range-end ").each(function(){var w=jQuery(this).datepicker("getDate");if(w==null){return false;}jQuery(this).datepicker("setDate",w.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")){c();}});j.click(function(){return false;}).hide();return this;};Date.CultureInfo={name:"de-DE",englishName:"German (Germany)",nativeName:"Deutsch (Deutschland)",dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],abbreviatedDayNames:["So","Mo","Di","Mi","Do","Fr","Sa"],shortestDayNames:["So","Mo","Di","Mi","Do","Fr","Sa"],firstLetterDayNames:["S","M","D","M","D","F","S"],monthNames:["Januar","Februar","M�rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],abbreviatedMonthNames:["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],amDesignator:"",pmDesignator:"",firstDayOfWeek:1,twoDigitYearMax:2029,dateElementOrder:"dmy",formatPatterns:{shortDate:"dd.MM.yyyy",longDate:"dddd, d. MMMM yyyy",shortTime:"HH:mm",longTime:"HH:mm:ss",fullDateTime:"dddd, d. MMMM yyyy HH:mm:ss",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"dd MMMM",yearMonth:"MMMM yyyy"},regexPatterns:{jan:/^jan(uar)?/i,feb:/^feb(ruar)?/i,mar:/^m�rz/i,apr:/^apr(il)?/i,may:/^mai/i,jun:/^jun(i)?/i,jul:/^jul(i)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^okt(ober)?/i,nov:/^nov(ember)?/i,dec:/^dez(ember)?/i,sun:/^sonntag/i,mon:/^montag/i,tue:/^dienstag/i,wed:/^mittwoch/i,thu:/^donnerstag/i,fri:/^freitag/i,sat:/^samstag/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 c=Date.CultureInfo.monthNames,d=Date.CultureInfo.abbreviatedMonthNames,b=e.toLowerCase();for(var a=0;a<c.length;a++){if(c[a].toLowerCase()==b||d[a].toLowerCase()==b){return a;}}return -1;};Date.getDayNumberFromName=function(f){var c=Date.CultureInfo.dayNames,b=Date.CultureInfo.abbreviatedDayNames,d=Date.CultureInfo.shortestDayNames,e=f.toLowerCase();for(var a=0;a<c.length;a++){if(c[a].toLowerCase()==e||b[a].toLowerCase()==e){return a;}}return -1;};Date.isLeapYear=function(a){return(((a%4===0)&&(a%100!==0))||(a%400===0));};Date.getDaysInMonth=function(b,a){return[31,(Date.isLeapYear(b)?29:28),31,30,31,30,31,31,30,31,30,31][a];};Date.getTimezoneOffset=function(a,b){return(b||false)?Date.CultureInfo.abbreviatedTimeZoneDST[a.toUpperCase()]:Date.CultureInfo.abbreviatedTimeZoneStandard[a.toUpperCase()];};Date.getTimezoneAbbreviation=function(b,d){var c=(d||false)?Date.CultureInfo.abbreviatedTimeZoneDST:Date.CultureInfo.abbreviatedTimeZoneStandard,a;for(a in c){if(c[a]===b){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(c,a){var b=this.getTime();return b>=c.getTime()&&b<=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(b){var a=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+b);this.setDate(Math.min(a,this.getDaysInMonth()));return this;};Date.prototype.addYears=function(a){return this.addMonths(a*12);};Date.prototype.add=function(a){if(typeof a=="number"){this._orient=a;return this;}var b=a;if(b.millisecond||b.milliseconds){this.addMilliseconds(b.millisecond||b.milliseconds);}if(b.second||b.seconds){this.addSeconds(b.second||b.seconds);}if(b.minute||b.minutes){this.addMinutes(b.minute||b.minutes);}if(b.hour||b.hours){this.addHours(b.hour||b.hours);}if(b.month||b.months){this.addMonths(b.month||b.months);}if(b.year||b.years){this.addYears(b.year||b.years);}if(b.day||b.days){this.addDays(b.day||b.days);}return this;};Date._validate=function(a,b,c,d){if(typeof a!="number"){throw new TypeError(a+" is not a Number.");}else{if(a<b||a>c){throw new RangeError(a+" 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(c,a,b){return Date._validate(c,1,Date.getDaysInMonth(a,b),"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(a){var b=a;if(!b.millisecond&&b.millisecond!==0){b.millisecond=-1;}if(!b.second&&b.second!==0){b.second=-1;}if(!b.minute&&b.minute!==0){b.minute=-1;}if(!b.hour&&b.hour!==0){b.hour=-1;}if(!b.day&&b.day!==0){b.day=-1;}if(!b.month&&b.month!==0){b.month=-1;}if(!b.year&&b.year!==0){b.year=-1;}if(b.millisecond!=-1&&Date.validateMillisecond(b.millisecond)){this.addMilliseconds(b.millisecond-this.getMilliseconds());}if(b.second!=-1&&Date.validateSecond(b.second)){this.addSeconds(b.second-this.getSeconds());}if(b.minute!=-1&&Date.validateMinute(b.minute)){this.addMinutes(b.minute-this.getMinutes());}if(b.hour!=-1&&Date.validateHour(b.hour)){this.addHours(b.hour-this.getHours());}if(b.month!==-1&&Date.validateMonth(b.month)){this.addMonths(b.month-this.getMonth());}if(b.year!=-1&&Date.validateYear(b.year)){this.addYears(b.year-this.getFullYear());}if(b.day!=-1&&Date.validateDay(b.day,this.getFullYear(),this.getMonth())){this.addDays(b.day-this.getDate());}if(b.timezone){this.setTimezone(b.timezone);}if(b.timezoneOffset){this.setTimezoneOffset(b.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,b){var c=(a-this.getDay()+7*(b||+1))%7;return this.addDays((c===0)?c+=7*(b||+1):c);};Date.prototype.moveToMonth=function(c,b){var a=(c-this.getMonth()+12*(b||+1))%12;return this.addMonths((a===0)?a+=12*(b||+1):a);};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000);};Date.prototype.getWeekOfYear=function(i){var a=this.getFullYear(),c=this.getMonth(),h=this.getDate();var e=i||Date.CultureInfo.firstDayOfWeek;var g=7+1-new Date(a,0,1).getDay();if(g==8){g=1;}var f=((Date.UTC(a,c,h,0,0,0)-Date.UTC(a,0,1,0,0,0))/86400000)+1;var j=Math.floor((f-g+7)/7);if(j===e){a--;var b=7+1-new Date(a,0,1).getDay();if(b==2||b==8){j=53;}else{j=52;}}return j;};Date.prototype.isDST=function(){console.log("isDST");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(a){var b=this.getTimezoneOffset(),c=Number(a)*-6/10;this.addMinutes(c-b);return this;};Date.prototype.setTimezone=function(a){return this.setTimezoneOffset(Date.getTimezoneOffset(a));};Date.prototype.getUTCOffset=function(){var a=this.getTimezoneOffset()*-10/6,b;if(a<0){b=(a-10000).toString();return b[0]+b.substr(2);}else{b=(a+10000).toString();return"+"+b.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(a){var b=this;var c=function c(d){return(d.toString().length==1)?"0"+d:d;};return a?a.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(b.getHours()<13?b.getHours():(b.getHours()-12));case"h":return b.getHours()<13?b.getHours():(b.getHours()-12);case"HH":return c(b.getHours());case"H":return b.getHours();case"mm":return c(b.getMinutes());case"m":return b.getMinutes();case"ss":return c(b.getSeconds());case"s":return b.getSeconds();case"yyyy":return b.getFullYear();case"yy":return b.getFullYear().toString().substring(2,4);case"dddd":return b.getDayName();case"ddd":return b.getDayName(true);case"dd":return c(b.getDate());case"d":return b.getDate().toString();case"MMMM":return b.getMonthName();case"MMM":return b.getMonthName(true);case"MM":return c((b.getMonth()+1));case"M":return b.getMonth()+1;case"t":return b.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return b.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 o=Date.prototype,f=Number.prototype;var b=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),p=("january february march april may june july august september october november december").split(/\s/),m=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),c;var n=function(i){return function(){if(this._is){this._is=false;return this.getDay()==i;}return this.moveToDayOfWeek(i,this._orient);};};for(var a=0;a<b.length;a++){o[b[a]]=o[b[a].substring(0,3)]=n(a);}var d=function(i){return function(){if(this._is){this._is=false;return this.getMonth()===i;}return this.moveToMonth(i,this._orient);};};for(var h=0;h<p.length;h++){o[p[h]]=o[p[h].substring(0,3)]=d(h);}var g=function(i){return function(){if(i.substring(i.length-1)!="s"){i+="s";}return this["add"+i](this._orient);};};var e=function(i){return function(){this._dateElement=i;return this;};};for(var l=0;l<m.length;l++){c=m[l].toLowerCase();o[c]=o[c+"s"]=g(m[l]);f[c]=f[c+"s"]=e(c);}}());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 h=Date.Parsing;var d=h.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 h.Exception(k);}};},token:function(i){return function(j){return d.rtoken(new RegExp("^s*"+j+"s*"))(j);};},stoken:function(i){return d.rtoken(new RegExp("^"+i));},until:function(i){return function(l){var j=[],k=null;while(l.length){try{k=i.call(this,l);}catch(m){j.push(k[0]);l=k[1];continue;}break;}return[j,l];};},many:function(i){return function(k){var j=[],m=null;while(k.length){try{m=i.call(this,k);}catch(l){return[j,k];}j.push(m[0]);k=m[1];}return[j,k];};},optional:function(i){return function(k){var j=null;try{j=i.call(this,k);}catch(l){return[null,k];}return[j[0],j[1]];};},not:function(i){return function(k){try{i.call(this,k);}catch(j){return[null,k];}throw new h.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 m=arguments[0],j=Array.prototype.slice.call(arguments,1),k=[];for(var l=0;l<m.length;l++){k.push(d.each(m[l],j));}return k;},cache:function(i){var k={},j=null;return function(m){try{j=k[m]=(k[m]||i.call(this,m));}catch(l){j=k[m]=l;}if(j instanceof h.Exception){throw j;}else{return j;}};},any:function(){var i=arguments;return function(k){var j=null;for(var m=0;m<i.length;m++){if(i[m]==null){continue;}try{j=(i[m].call(this,k));}catch(l){j=null;}if(j){return j;}}throw new h.Exception(k);};},each:function(){var i=arguments;return function(k){var j=[],n=null;for(var l=0;l<i.length;l++){if(i[l]==null){continue;}try{n=(i[l].call(this,k));}catch(m){throw new h.Exception(k);}j.push(n[0]);k=n[1];}return[j,k];};},all:function(){var j=arguments,i=i;return i.each(i.optional(j));},sequence:function(k,j,i){j=j||d.rtoken(/^\s*/);i=i||null;if(k.length==1){return k[0];}return function(u){var t=null,p=null;var m=[];for(var l=0;l<k.length;l++){try{t=k[l].call(this,u);}catch(v){break;}m.push(t[0]);try{p=j.call(this,t[1]);}catch(n){p=null;break;}u=p[1];}if(!t){throw new h.Exception(u);}if(p){throw new h.Exception(p[1]);}if(i){try{t=i.call(this,t[1]);}catch(o){throw new h.Exception(t[1]);}}return[m,(t?t[1]:u)];};},between:function(j,l,k){k=k||j;var i=d.each(d.ignore(j),l,d.ignore(k));return function(m){var n=i.call(this,m);return[[n[0][0],r[0][2]],n[1]];};},list:function(k,j,i){j=j||d.rtoken(/^\s*/);i=i||null;return(k instanceof Array?d.each(d.product(k.slice(0,-1),d.ignore(j)),k.slice(-1),d.ignore(i)):d.each(d.many(d.each(k,d.ignore(j))),px,d.ignore(i)));},set:function(k,j,i){j=j||d.rtoken(/^\s*/);i=i||null;return function(t){var o=null,m=null,n=null,y=null,A=[[],t],z=false;for(var v=0;v<k.length;v++){n=null;m=null;o=null;z=(k.length==1);try{o=k[v].call(this,t);}catch(B){continue;}y=[[o[0]],o[1]];if(o[1].length>0&&!z){try{n=j.call(this,o[1]);}catch(l){z=true;}}else{z=true;}if(!z&&n[1].length===0){z=true;}if(!z){var x=[];for(var w=0;w<k.length;w++){if(v!=w){x.push(k[w]);}}m=d.set(x,j).call(this,n[1]);if(m[0].length>0){y[0]=y[0].concat(m[0]);y[1]=m[1];}}if(y[1].length<A[1].length){A=y;}if(A[1].length===0){break;}}if(A[0].length===0){return A;}if(i){try{n=i.call(this,A[1]);}catch(u){throw new h.Exception(A[1]);}A[1]=n[1];}return A;};},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(i,j){return function(k){var l=j.call(this,k);if(l[0].length<i){throw new h.Exception(k);}return l;};}};var f=function(i){return function(){var l=null,k=[];if(arguments.length>1){l=Array.prototype.slice.call(arguments);}else{if(arguments[0] instanceof Array){l=arguments[0];}}if(l){for(var m=0,j=l.shift();m<j.length;m++){l.unshift(j[m]);k.push(i.apply(null,l));l.shift();return k;}}else{return i.apply(null,arguments);}};};var e="optional not ignore cache".split(/\s/);for(var a=0;a<e.length;a++){d[e[a]]=f(d[e[a]]);}var c=function(i){return function(){if(arguments[0] instanceof Array){return i.apply(null,arguments[0]);}else{return i.apply(null,arguments);}};};var g="each any all".split(/\s/);for(var b=0;b<g.length;b++){d[g[b]]=c(d[g[b]]);}}());(function(){var h=function(j){var g=[];for(var k=0;k<j.length;k++){if(j[k] instanceof Array){g=g.concat(h(j[k]));}else{if(j[k]){g.push(j[k]);}}}return g;};Date.Grammar={};Date.Translator={hour:function(g){return function(){this.hour=Number(g);};},minute:function(g){return function(){this.minute=Number(g);};},second:function(g){return function(){this.second=Number(g);};},meridian:function(g){return function(){this.meridian=g.slice(0,1).toLowerCase();};},timezone:function(g){return function(){var j=g.replace(/[^\d\+\-]/g,"");if(j.length){this.timezoneOffset=Number(j);}else{this.timezone=g.toLowerCase();}};},day:function(j){var g=j[0];return function(){this.day=Number(g.match(/\d+/)[0]);};},month:function(g){return function(){this.month=((g.length==3)?Date.getMonthNumberFromName(g):(Number(g)-1));};},year:function(g){return function(){var j=Number(g);this.year=((g.length>2)?j:(j+(((j+2000)<Date.CultureInfo.twoDigitYearMax)?2000:1900)));};},rday:function(g){return function(){switch(g){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(k){k=(k instanceof Array)?k:[k];var g=new Date();this.year=g.getFullYear();this.month=g.getMonth();this.day=1;this.hour=0;this.minute=0;this.second=0;for(var l=0;l<k.length;l++){if(k[l]){k[l].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 j=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){j.set({timezone:this.timezone});}else{if(this.timezoneOffset){j.set({timezoneOffset:this.timezoneOffset});}}return j;},finish:function(g){g=(g instanceof Array)?h(g):[g];if(g.length===0){return null;}for(var j=0;j<g.length;j++){if(typeof g[j]=="function"){g[j].call(this);}}if(this.now){return new Date();}var k=Date.today();var o=null;var l=!!(this.days!=null||this.orient||this.operator);if(l){var p,m,n;n=((this.orient=="past"||this.operator=="subtract")?-1:1);if(this.weekday){this.unit="day";p=(Date.getDayNumberFromName(this.weekday)-k.getDay());m=7;this.days=p?((p+(n*m))%m):(n*m);}if(this.month){this.unit="month";p=(this.month-k.getMonth());m=12;this.months=p?((p+(n*m))%m):(n*m);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*n;}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 e=Date.Parsing.Operators,i=Date.Grammar,f=Date.Translator,b;i.datePartDelimiter=e.rtoken(/^([\s\-\.\,\/\x27]+)/);i.timePartDelimiter=e.stoken(":");i.whiteSpace=e.rtoken(/^\s*/);i.generalDelimiter=e.rtoken(/^(([\s\,]|at|on)+)/);var a={};i.ctoken=function(k){var m=a[k];if(!m){var l=Date.CultureInfo.regexPatterns;var n=k.split(/\s+/),j=[];for(var g=0;g<n.length;g++){j.push(e.replace(e.rtoken(l[n[g]]),n[g]));}m=a[k]=e.any.apply(null,j);}return m;};i.ctoken2=function(g){return e.rtoken(Date.CultureInfo.regexPatterns[g]);};i.h=e.cache(e.process(e.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),f.hour));i.hh=e.cache(e.process(e.rtoken(/^(0[0-9]|1[0-2])/),f.hour));i.H=e.cache(e.process(e.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),f.hour));i.HH=e.cache(e.process(e.rtoken(/^([0-1][0-9]|2[0-3])/),f.hour));i.m=e.cache(e.process(e.rtoken(/^([0-5][0-9]|[0-9])/),f.minute));i.mm=e.cache(e.process(e.rtoken(/^[0-5][0-9]/),f.minute));i.s=e.cache(e.process(e.rtoken(/^([0-5][0-9]|[0-9])/),f.second));i.ss=e.cache(e.process(e.rtoken(/^[0-5][0-9]/),f.second));i.hms=e.cache(e.sequence([i.H,i.mm,i.ss],i.timePartDelimiter));i.t=e.cache(e.process(i.ctoken2("shortMeridian"),f.meridian));i.tt=e.cache(e.process(i.ctoken2("longMeridian"),f.meridian));i.z=e.cache(e.process(e.rtoken(/^(\+|\-)?\s*\d\d\d\d?/),f.timezone));i.zz=e.cache(e.process(e.rtoken(/^(\+|\-)\s*\d\d\d\d/),f.timezone));i.zzz=e.cache(e.process(i.ctoken2("timezone"),f.timezone));i.timeSuffix=e.each(e.ignore(i.whiteSpace),e.set([i.tt,i.zzz]));i.time=e.each(e.optional(e.ignore(e.stoken("T"))),i.hms,i.timeSuffix);i.d=e.cache(e.process(e.each(e.rtoken(/^([0-2]\d|3[0-1]|\d)/),e.optional(i.ctoken2("ordinalSuffix"))),f.day));i.dd=e.cache(e.process(e.each(e.rtoken(/^([0-2]\d|3[0-1])/),e.optional(i.ctoken2("ordinalSuffix"))),f.day));i.ddd=i.dddd=e.cache(e.process(i.ctoken("sun mon tue wed thu fri sat"),function(g){return function(){this.weekday=g;};}));i.M=e.cache(e.process(e.rtoken(/^(1[0-2]|0\d|\d)/),f.month));i.MM=e.cache(e.process(e.rtoken(/^(1[0-2]|0\d)/),f.month));i.MMM=i.MMMM=e.cache(e.process(i.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),f.month));i.y=e.cache(e.process(e.rtoken(/^(\d\d?)/),f.year));i.yy=e.cache(e.process(e.rtoken(/^(\d\d)/),f.year));i.yyy=e.cache(e.process(e.rtoken(/^(\d\d?\d?\d?)/),f.year));i.yyyy=e.cache(e.process(e.rtoken(/^(\d\d\d\d)/),f.year));b=function(){return e.each(e.any.apply(null,arguments),e.not(i.ctoken2("timeContext")));};i.day=b(i.d,i.dd);i.month=b(i.M,i.MMM);i.year=b(i.yyyy,i.yy);i.orientation=e.process(i.ctoken("past future"),function(g){return function(){this.orient=g;};});i.operator=e.process(i.ctoken("add subtract"),function(g){return function(){this.operator=g;};});i.rday=e.process(i.ctoken("yesterday tomorrow today now"),f.rday);i.unit=e.process(i.ctoken("minute hour day week month year"),function(g){return function(){this.unit=g;};});i.value=e.process(e.rtoken(/^\d\d?(st|nd|rd|th)?/),function(g){return function(){this.value=g.replace(/\D/g,"");};});i.expression=e.set([i.rday,i.operator,i.value,i.unit,i.orientation,i.ddd,i.MMM]);b=function(){return e.set(arguments,i.datePartDelimiter);};i.mdy=b(i.ddd,i.month,i.day,i.year);i.ymd=b(i.ddd,i.year,i.month,i.day);i.dmy=b(i.ddd,i.day,i.month,i.year);i.date=function(g){return((i[Date.CultureInfo.dateElementOrder]||i.mdy).call(this,g));};i.format=e.process(e.many(e.any(e.process(e.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(g){if(i[g]){return i[g];}else{throw Date.Parsing.Exception(g);}}),e.process(e.rtoken(/^[^dMyhHmstz]+/),function(g){return e.ignore(e.stoken(g));}))),function(g){return e.process(e.each.apply(null,g),f.finishExact);});var c={};var d=function(g){return c[g]=(c[g]||i.format(g)[0]);};i.formats=function(g){if(g instanceof Array){var j=[];for(var k=0;k<g.length;k++){j.push(d(g[k]));}return e.any.apply(null,j);}else{return d(g);}};i._formats=i.formats(["yyyy-MM-ddTHH:mm:ss","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","d"]);i._start=e.process(e.set([i.date,i.time,i.expression],i.generalDelimiter,i.whiteSpace),f.finish);i.start=function(j){try{var g=i._formats.call({},j);if(g[1].length===0){return g;}}catch(k){}return i._start.call({},j);};}());Date._parse=Date.parse;Date.parse=function(b){var a=null;if(!b){return null;}try{a=Date.Grammar.start.call({},b);}catch(c){return null;}return((a[1].length===0)?a[0]:null);};Date.getParseFunction=function(a){var b=Date.Grammar.formats(a);return function(d){var c=null;try{c=b.call({},d);}catch(f){return null;}return((c[1].length===0)?c[0]:null);};};Date.parseExact=function(b,a){return Date.getParseFunction(a)(b);};var TimeSpan=function(k,d,a,g,h){var l="days hours minutes seconds milliseconds".split(/\s+/);var j=function(i){return function(){return this[i];};};var b=function(i){return function(n){this[i]=n;return this;};};for(var c=0;c<l.length;c++){var f=l[c],m=f.slice(0,1).toUpperCase()+f.slice(1);TimeSpan.prototype[f]=0;TimeSpan.prototype["get"+m]=j(f);TimeSpan.prototype["set"+m]=b(f);}if(arguments.length==4){this.setDays(k);this.setHours(d);this.setMinutes(a);this.setSeconds(g);}else{if(arguments.length==5){this.setDays(k);this.setHours(d);this.setMinutes(a);this.setSeconds(g);this.setMilliseconds(h);}else{if(arguments.length==1&&typeof k=="number"){var e=(k<0)?-1:+1;this.setMilliseconds(Math.abs(k));this.setDays(Math.floor(this.getMilliseconds()/86400000)*e);this.setMilliseconds(this.getMilliseconds()%86400000);this.setHours(Math.floor(this.getMilliseconds()/3600000)*e);this.setMilliseconds(this.getMilliseconds()%3600000);this.setMinutes(Math.floor(this.getMilliseconds()/60000)*e);this.setMilliseconds(this.getMilliseconds()%60000);this.setSeconds(Math.floor(this.getMilliseconds()/1000)*e);this.setMilliseconds(this.getMilliseconds()%1000);this.setMilliseconds(this.getMilliseconds()*e);}}}this.getTotalMilliseconds=function(){return(this.getDays()*86400000)+(this.getHours()*3600000)+(this.getMinutes()*60000)+(this.getSeconds()*1000);};this.compareTo=function(i){var n=new Date(1970,1,1,this.getHours(),this.getMinutes(),this.getSeconds()),o;if(i===null){o=new Date(1970,1,1,0,0,0);}else{o=new Date(1970,1,1,i.getHours(),i.getMinutes(),i.getSeconds());}return(n<o)?-1:(n>o)?1:0;};this.equals=function(i){return(this.compareTo(i)===0);};this.add=function(i){return(i===null)?this:this.addSeconds(i.getTotalMilliseconds()/1000);};this.subtract=function(i){return(i===null)?this:this.addSeconds(-i.getTotalMilliseconds()/1000);};this.addDays=function(i){return new TimeSpan(this.getTotalMilliseconds()+(i*86400000));};this.addHours=function(i){return new TimeSpan(this.getTotalMilliseconds()+(i*3600000));};this.addMinutes=function(i){return new TimeSpan(this.getTotalMilliseconds()+(i*60000));};this.addSeconds=function(i){return new TimeSpan(this.getTotalMilliseconds()+(i*1000));};this.addMilliseconds=function(i){return new TimeSpan(this.getTotalMilliseconds()+i);};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(i){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(o){return(o.toString().length<2)?"0"+o:o;};var n=this;return i?i.replace(/dd?|HH?|hh?|mm?|ss?|tt?/g,function(o){switch(o){case"d":return n.getDays();case"dd":return n.p(n.getDays());case"H":return n.getHours();case"HH":return n.p(n.getHours());case"h":return n.get12HourHour();case"hh":return n.p(n.get12HourHour());case"m":return n.getMinutes();case"mm":return n.p(n.getMinutes());case"s":return n.getSeconds();case"ss":return n.p(n.getSeconds());case"t":return((n.getHours()<12)?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator).substring(0,1);case"tt":return(n.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(l,h,b,o,s,j,t){var c="years months days hours minutes seconds milliseconds".split(/\s+/);var a=function(i){return function(){return this[i];};};var k=function(i){return function(v){this[i]=v;return this;};};for(var g=0;g<c.length;g++){var u=c[g],f=u.slice(0,1).toUpperCase()+u.slice(1);TimePeriod.prototype[u]=0;TimePeriod.prototype["get"+f]=a(u);TimePeriod.prototype["set"+f]=k(u);}if(arguments.length==7){this.years=l;this.months=h;this.setDays(b);this.setHours(o);this.setMinutes(s);this.setSeconds(j);this.setMilliseconds(t);}else{if(arguments.length==2&&arguments[0] instanceof Date&&arguments[1] instanceof Date){var p=l.clone();var d=h.clone();var q=p.clone();var m=(p>d)?-1:+1;this.years=d.getFullYear()-p.getFullYear();q.addYears(this.years);if(m==+1){if(q>d){if(this.years!==0){this.years--;}}}else{if(q<d){if(this.years!==0){this.years++;}}}p.addYears(this.years);if(m==+1){while(p<d&&p.clone().addDays(Date.getDaysInMonth(p.getYear(),p.getMonth()))<d){p.addMonths(1);this.months++;}}else{while(p>d&&p.clone().addDays(-p.getDaysInMonth())>d){p.addMonths(-1);this.months--;}}var n=d-p;if(n!==0){var e=new TimeSpan(n);this.setDays(e.getDays());this.setHours(e.getHours());this.setMinutes(e.getMinutes());this.setSeconds(e.getSeconds());this.setMilliseconds(e.getMilliseconds());}}}return this;};
