UNPKG

nodebb-plugin-teamspeak

Version:
2 lines (1 loc) 41.4 kB
(function(e){"use strict";var t={i18n:{ar:{months:["كانون الثاني","شباط","آذار","نيسان","مايو","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول"],dayOfWeek:["ن","ث","ع","خ","ج","س","ح"]},ro:{months:["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"],dayOfWeek:["l","ma","mi","j","v","s","d"]},id:{months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],dayOfWeek:["Sen","Sel","Rab","Kam","Jum","Sab","Min"]},bg:{months:["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],dayOfWeek:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"]},fa:{months:["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],dayOfWeek:["یکشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"]},ru:{months:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],dayOfWeek:["Вск","Пн","Вт","Ср","Чт","Пт","Сб"]},uk:{months:["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"],dayOfWeek:["Ндл","Пнд","Втр","Срд","Чтв","Птн","Сбт"]},en:{months:["January","February","March","April","May","June","July","August","September","October","November","December"],dayOfWeek:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},el:{months:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],dayOfWeek:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"]},de:{months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],dayOfWeek:["So","Mo","Di","Mi","Do","Fr","Sa"]},nl:{months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],dayOfWeek:["zo","ma","di","wo","do","vr","za"]},tr:{months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],dayOfWeek:["Paz","Pts","Sal","Çar","Per","Cum","Cts"]},fr:{months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],dayOfWeek:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"]},es:{months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],dayOfWeek:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"]},th:{months:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],dayOfWeek:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."]},pl:{months:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],dayOfWeek:["nd","pn","wt","śr","cz","pt","sb"]},pt:{months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],dayOfWeek:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"]},ch:{months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayOfWeek:["日","一","二","三","四","五","六"]},se:{months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],dayOfWeek:["Sön","Mån","Tis","Ons","Tor","Fre","Lör"]},kr:{months:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],dayOfWeek:["일","월","화","수","목","금","토"]},it:{months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],dayOfWeek:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"]},da:{months:["January","Februar","Marts","April","Maj","Juni","July","August","September","Oktober","November","December"],dayOfWeek:["Søn","Man","Tir","Ons","Tor","Fre","Lør"]},no:{months:["Januar","Februar","Mars","April","Mai","Juni","Juli","August","September","Oktober","November","Desember"],dayOfWeek:["Søn","Man","Tir","Ons","Tor","Fre","Lør"]},ja:{months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["日","月","火","水","木","金","土"]},vi:{months:["Tháng 1","Tháng 2","Tháng 3","Tháng 4","Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],dayOfWeek:["CN","T2","T3","T4","T5","T6","T7"]},sl:{months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],dayOfWeek:["Ned","Pon","Tor","Sre","Čet","Pet","Sob"]},cs:{months:["Leden","Únor","Březen","Duben","Květen","Červen","Červenec","Srpen","Září","Říjen","Listopad","Prosinec"],dayOfWeek:["Ne","Po","Út","St","Čt","Pá","So"]},hu:{months:["Január","Február","Március","Április","Május","Június","Július","Augusztus","Szeptember","Október","November","December"],dayOfWeek:["Va","Hé","Ke","Sze","Cs","Pé","Szo"]}},value:"",lang:"en",format:"Y/m/d H:i",formatTime:"H:i",formatDate:"Y/m/d",startDate:false,step:60,monthChangeSpinner:true,closeOnDateSelect:false,closeOnWithoutClick:true,closeOnInputClick:true,timepicker:true,datepicker:true,weeks:false,defaultTime:false,defaultDate:false,minDate:false,maxDate:false,minTime:false,maxTime:false,allowTimes:[],opened:false,initTime:true,inline:false,theme:"",onSelectDate:function(){},onSelectTime:function(){},onChangeMonth:function(){},onChangeYear:function(){},onChangeDateTime:function(){},onShow:function(){},onClose:function(){},onGenerate:function(){},withoutCopyright:true,inverseButton:false,hours12:false,next:"xdsoft_next",prev:"xdsoft_prev",dayOfWeekStart:0,parentID:"body",timeHeightInTimePicker:25,timepickerScrollbar:true,todayButton:true,defaultSelect:true,scrollMonth:true,scrollTime:true,scrollInput:true,lazyInit:false,mask:false,validateOnBlur:true,allowBlank:true,yearStart:1950,yearEnd:2050,style:"",id:"",fixed:false,roundTime:"round",className:"",weekends:[],yearOffset:0,beforeShowDay:null};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(e,t){for(var n=t||0,r=this.length;n<r;n++){if(this[n]===e){return n}}return-1}}Date.prototype.countDaysInMonth=function(){return(new Date(this.getFullYear(),this.getMonth()+1,0)).getDate()};e.fn.xdsoftScroller=function(t){return this.each(function(){var n=e(this);if(!e(this).hasClass("xdsoft_scroller_box")){var r=function(e){var t={x:0,y:0};if(e.type=="touchstart"||e.type=="touchmove"||e.type=="touchend"||e.type=="touchcancel"){var n=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];t.x=n.pageX;t.y=n.pageY}else if(e.type=="mousedown"||e.type=="mouseup"||e.type=="mousemove"||e.type=="mouseover"||e.type=="mouseout"||e.type=="mouseenter"||e.type=="mouseleave"){t.x=e.pageX;t.y=e.pageY}return t},i=0,s=n.children().eq(0),o=n[0].clientHeight,u=s[0].offsetHeight,a=e('<div class="xdsoft_scrollbar"></div>'),f=e('<div class="xdsoft_scroller"></div>'),l=100,c=false;a.append(f);n.addClass("xdsoft_scroller_box").append(a);f.on("mousedown.xdsoft_scroller",function(r){if(!o)n.trigger("resize_scroll.xdsoft_scroller",[t]);var s=r.pageY,u=parseInt(f.css("margin-top")),c=a[0].offsetHeight;e(document.body).addClass("xdsoft_noselect");e([document.body,window]).on("mouseup.xdsoft_scroller",function h(){e([document.body,window]).off("mouseup.xdsoft_scroller",h).off("mousemove.xdsoft_scroller",i).removeClass("xdsoft_noselect")});e(document.body).on("mousemove.xdsoft_scroller",i=function(e){var t=e.pageY-s+u;if(t<0)t=0;if(t+f[0].offsetHeight>c)t=c-f[0].offsetHeight;n.trigger("scroll_element.xdsoft_scroller",[l?t/l:0])})});n.on("scroll_element.xdsoft_scroller",function(e,t){if(!o)n.trigger("resize_scroll.xdsoft_scroller",[t,true]);t=t>1?1:t<0||isNaN(t)?0:t;f.css("margin-top",l*t);setTimeout(function(){s.css("marginTop",-parseInt((s[0].offsetHeight-o)*t))},10)}).on("resize_scroll.xdsoft_scroller",function(e,t,r){o=n[0].clientHeight;u=s[0].offsetHeight;var i=o/u,c=i*a[0].offsetHeight;if(i>1)f.hide();else{f.show();f.css("height",parseInt(c>10?c:10));l=a[0].offsetHeight-f[0].offsetHeight;if(r!==true)n.trigger("scroll_element.xdsoft_scroller",[t?t:Math.abs(parseInt(s.css("marginTop")))/(u-o)])}});n.mousewheel&&n.mousewheel(function(e,t,r,i){var a=Math.abs(parseInt(s.css("marginTop")));n.trigger("scroll_element.xdsoft_scroller",[(a-t*20)/(u-o)]);e.stopPropagation();return false});n.on("touchstart",function(e){c=r(e)});n.on("touchmove",function(e){if(c){var t=r(e),i=Math.abs(parseInt(s.css("marginTop")));n.trigger("scroll_element.xdsoft_scroller",[(i-(t.y-c.y))/(u-o)]);e.stopPropagation();e.preventDefault();c=r(e)}});n.on("touchend touchcancel",function(e){c=false})}n.trigger("resize_scroll.xdsoft_scroller",[t])})};e.fn.datetimepicker=function(n){var r=48,i=57,s=96,o=105,u=17,a=46,f=13,l=27,c=8,h=37,p=38,d=39,v=40,m=9,g=116,y=65,b=67,w=86,E=90,S=89,x=false,T=e.isPlainObject(n)||!n?e.extend(true,{},t,n):e.extend(true,{},t),N=0,C=function(e){e.on("open.xdsoft focusin.xdsoft mousedown.xdsoft",function t(n){if(e.is(":disabled")||e.is(":hidden")||!e.is(":visible")||e.data("xdsoft_datetimepicker"))return;clearTimeout(N);N=setTimeout(function(){if(!e.data("xdsoft_datetimepicker"))k(e);e.off("open.xdsoft focusin.xdsoft mousedown.xdsoft",t).trigger("open.xdsoft")},100)})},k=function(t){function X(){var e=false;if(T.startDate){e=j.strToDate(T.startDate)}else{e=T.value?T.value:t&&t.val&&t.val()?t.val():"";if(e){e=j.strToDateTime(e)}else if(T.defaultDate){e=j.strToDate(T.defaultDate);if(T.defaultTime){var r=j.strtotime(T.defaultTime);e.setHours(r.getHours());e.setMinutes(r.getMinutes())}}}if(e&&j.isValidDate(e)){n.data("changed",true)}else{e=""}return e?e:0}var n=e("<div "+(T.id?'id="'+T.id+'"':"")+" "+(T.style?'style="'+T.style+'"':"")+' class="xdsoft_datetimepicker xdsoft_'+T.theme+" xdsoft_noselect "+(T.weeks?" xdsoft_showweeks":"")+T.className+'"></div>'),N=e('<div class="xdsoft_copyright"><a target="_blank" href="http://xdsoft.net/jqplugins/datetimepicker/">xdsoft.net</a></div>'),C=e('<div class="xdsoft_datepicker active"></div>'),k=e('<div class="xdsoft_mounthpicker"><button type="button" class="xdsoft_prev"></button><button type="button" class="xdsoft_today_button"></button>'+'<div class="xdsoft_label xdsoft_month"><span></span><i></i></div>'+'<div class="xdsoft_label xdsoft_year"><span></span><i></i></div>'+'<button type="button" class="xdsoft_next"></button></div>'),L=e('<div class="xdsoft_calendar"></div>'),A=e('<div class="xdsoft_timepicker active"><button type="button" class="xdsoft_prev"></button><div class="xdsoft_time_box"></div><button type="button" class="xdsoft_next"></button></div>'),O=A.find(".xdsoft_time_box").eq(0),M=e('<div class="xdsoft_time_variant"></div>'),_=e('<div class="xdsoft_scrollbar"></div>'),D=e('<div class="xdsoft_scroller"></div>'),P=e('<div class="xdsoft_select xdsoft_monthselect"><div></div></div>'),H=e('<div class="xdsoft_select xdsoft_yearselect"><div></div></div>');k.find(".xdsoft_month span").after(P);k.find(".xdsoft_year span").after(H);k.find(".xdsoft_month,.xdsoft_year").on("mousedown.xdsoft",function(t){var n=e(this).find(".xdsoft_select").eq(0),r=0,i=0,s=n.is(":visible");k.find(".xdsoft_select").hide();if(j.currentTime)r=j.currentTime[e(this).hasClass("xdsoft_month")?"getMonth":"getFullYear"]();n[s?"hide":"show"]();for(var o=n.find("div.xdsoft_option"),u=0;u<o.length;u++){if(o.eq(u).data("value")==r){break}else i+=o[0].offsetHeight}n.xdsoftScroller(i/(n.children()[0].offsetHeight-n[0].clientHeight));t.stopPropagation();return false});k.find(".xdsoft_select").xdsoftScroller().on("mousedown.xdsoft",function(e){e.stopPropagation();e.preventDefault()}).on("mousedown.xdsoft",".xdsoft_option",function(t){var r=j.currentTime.getFullYear();if(j&&j.currentTime)j.currentTime[e(this).parent().parent().hasClass("xdsoft_monthselect")?"setMonth":"setFullYear"](e(this).data("value"));e(this).parent().parent().hide();n.trigger("xchange.xdsoft");T.onChangeMonth&&T.onChangeMonth.call&&T.onChangeMonth.call(n,j.currentTime,n.data("input"));if(r!=j.currentTime.getFullYear()&&e.isFunction(T.onChangeYear)){T.onChangeYear.call(n,j.currentTime,n.data("input"))}});n.setOptions=function(N){T=e.extend(true,{},T,N);if(N.allowTimes&&e.isArray(N.allowTimes)&&N.allowTimes.length){T["allowTimes"]=e.extend(true,[],N.allowTimes)}if(N.weekends&&e.isArray(N.weekends)&&N.weekends.length){T["weekends"]=e.extend(true,[],N.weekends)}if((T.open||T.opened)&&!T.inline){t.trigger("open.xdsoft")}if(T.inline){q=true;n.addClass("xdsoft_inline");t.after(n).hide()}if(T.inverseButton){T.next="xdsoft_prev";T.prev="xdsoft_next"}if(T.datepicker)C.addClass("active");else C.removeClass("active");if(T.timepicker)A.addClass("active");else A.removeClass("active");if(T.value){t&&t.val&&t.val(T.value);j.setCurrentTime(T.value)}if(isNaN(T.dayOfWeekStart))T.dayOfWeekStart=0;else T.dayOfWeekStart=parseInt(T.dayOfWeekStart)%7;if(!T.timepickerScrollbar)_.hide();if(T.minDate&&/^-(.*)$/.test(T.minDate)){T.minDate=j.strToDateTime(T.minDate).dateFormat(T.formatDate)}if(T.maxDate&&/^\+(.*)$/.test(T.maxDate)){T.maxDate=j.strToDateTime(T.maxDate).dateFormat(T.formatDate)}k.find(".xdsoft_today_button").css("visibility",!T.todayButton?"hidden":"visible");if(T.mask){var L,O=function(e){try{if(document.selection&&document.selection.createRange){var t=document.selection.createRange();return t.getBookmark().charCodeAt(2)-2}else if(e.setSelectionRange)return e.selectionStart}catch(n){return 0}},M=function(e,t){e=typeof e=="string"||e instanceof String?document.getElementById(e):e;if(!e){return false}else if(e.createTextRange){var n=e.createTextRange();n.collapse(true);n.moveEnd(t);n.moveStart(t);n.select();return true}else if(e.setSelectionRange){e.setSelectionRange(t,t);return true}return false},D=function(e,t){var n=e.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g,"\\$1").replace(/_/g,"{digit+}").replace(/([0-9]{1})/g,"{digit$1}").replace(/\{digit([0-9]{1})\}/g,"[0-$1_]{1}").replace(/\{digit[\+]\}/g,"[0-9_]{1}");return RegExp(n).test(t)};t.off("keydown.xdsoft");switch(true){case T.mask===true:T.mask=T.format.replace(/Y/g,"9999").replace(/F/g,"9999").replace(/m/g,"19").replace(/d/g,"39").replace(/H/g,"29").replace(/i/g,"59").replace(/s/g,"59");case e.type(T.mask)=="string":if(!D(T.mask,t.val()))t.val(T.mask.replace(/[0-9]/g,"_"));t.on("keydown.xdsoft",function(n){var N=this.value,C=n.which;switch(true){case C>=r&&C<=i||C>=s&&C<=o||C==c||C==a:var k=O(this),L=C!=c&&C!=a?String.fromCharCode(s<=C&&C<=o?C-r:C):"_";if((C==c||C==a)&&k){k--;L="_"}while(/[^0-9_]/.test(T.mask.substr(k,1))&&k<T.mask.length&&k>0)k+=C==c||C==a?-1:1;N=N.substr(0,k)+L+N.substr(k+1);if(e.trim(N)==""){N=T.mask.replace(/[0-9]/g,"_")}else{if(k==T.mask.length)break}k+=C==c||C==a?0:1;while(/[^0-9_]/.test(T.mask.substr(k,1))&&k<T.mask.length&&k>0)k+=C==c||C==a?-1:1;if(D(T.mask,N)){this.value=N;M(this,k)}else if(e.trim(N)=="")this.value=T.mask.replace(/[0-9]/g,"_");else{t.trigger("error_input.xdsoft")}break;case!!~[y,b,w,E,S].indexOf(C)&&x:case!!~[l,p,v,h,d,g,u,m,f].indexOf(C):return true}n.preventDefault();return false});break}}if(T.validateOnBlur){t.off("blur.xdsoft").on("blur.xdsoft",function(){if(T.allowBlank&&!e.trim(e(this).val()).length){e(this).val(null);n.data("xdsoft_datetime").empty()}else if(!Date.parseDate(e(this).val(),T.format)){e(this).val(j.now().dateFormat(T.format));n.data("xdsoft_datetime").setCurrentTime(e(this).val())}else{n.data("xdsoft_datetime").setCurrentTime(e(this).val())}n.trigger("changedatetime.xdsoft")})}T.dayOfWeekStartPrev=T.dayOfWeekStart==0?6:T.dayOfWeekStart-1;n.trigger("xchange.xdsoft").trigger("afterOpen.xdsoft")};n.data("options",T).on("mousedown.xdsoft",function(e){e.stopPropagation();e.preventDefault();H.hide();P.hide();return false});var B=A.find(".xdsoft_time_box");B.append(M);B.xdsoftScroller();n.on("afterOpen.xdsoft",function(){B.xdsoftScroller()});n.append(C).append(A);if(T.withoutCopyright!==true)n.append(N);C.append(k).append(L);e(T.parentID).append(n);var j=new function(){var t=this;t.now=function(e){var n=new Date;if(!e&&T.defaultDate){var r=t.strToDate(T.defaultDate);n.setFullYear(r.getFullYear());n.setMonth(r.getMonth());n.setDate(r.getDate())}if(T.yearOffset){n.setFullYear(n.getFullYear()+T.yearOffset)}if(!e&&T.defaultTime){var i=t.strtotime(T.defaultTime);n.setHours(i.getHours());n.setMinutes(i.getMinutes())}return n};t.isValidDate=function(e){if(Object.prototype.toString.call(e)!=="[object Date]")return false;return!isNaN(e.getTime())};t.setCurrentTime=function(e){t.currentTime=typeof e=="string"?t.strToDateTime(e):t.isValidDate(e)?e:t.now();n.trigger("xchange.xdsoft")};t.empty=function(){t.currentTime=null};t.getCurrentTime=function(e){return t.currentTime};t.nextMonth=function(){var r=t.currentTime.getMonth()+1;if(r==12){t.currentTime.setFullYear(t.currentTime.getFullYear()+1);r=0}var i=t.currentTime.getFullYear();t.currentTime.setDate(Math.min((new Date(t.currentTime.getFullYear(),r+1,0)).getDate(),t.currentTime.getDate()));t.currentTime.setMonth(r);T.onChangeMonth&&T.onChangeMonth.call&&T.onChangeMonth.call(n,j.currentTime,n.data("input"));if(i!=t.currentTime.getFullYear()&&e.isFunction(T.onChangeYear)){T.onChangeYear.call(n,j.currentTime,n.data("input"))}n.trigger("xchange.xdsoft");return r};t.prevMonth=function(){var e=t.currentTime.getMonth()-1;if(e==-1){t.currentTime.setFullYear(t.currentTime.getFullYear()-1);e=11}t.currentTime.setDate(Math.min((new Date(t.currentTime.getFullYear(),e+1,0)).getDate(),t.currentTime.getDate()));t.currentTime.setMonth(e);T.onChangeMonth&&T.onChangeMonth.call&&T.onChangeMonth.call(n,j.currentTime,n.data("input"));n.trigger("xchange.xdsoft");return e};t.getWeekOfYear=function(e){var t=new Date(e.getFullYear(),0,1);return Math.ceil(((e-t)/864e5+t.getDay()+1)/7)};t.strToDateTime=function(e){if(e&&e instanceof Date&&t.isValidDate(e))return e;var n=[],r,i;if((n=/^(\+|\-)(.*)$/.exec(e))&&(n[2]=Date.parseDate(n[2],T.formatDate))){r=n[2].getTime()-n[2].getTimezoneOffset()*6e4;i=new Date(j.now().getTime()+parseInt(n[1]+"1")*r)}else i=e?Date.parseDate(e,T.format):t.now();if(!t.isValidDate(i))i=t.now();return i};t.strToDate=function(e){if(e&&e instanceof Date&&t.isValidDate(e))return e;var n=e?Date.parseDate(e,T.formatDate):t.now(true);if(!t.isValidDate(n))n=t.now(true);return n};t.strtotime=function(e){if(e&&e instanceof Date&&t.isValidDate(e))return e;var n=e?Date.parseDate(e,T.formatTime):t.now(true);if(!t.isValidDate(n))n=t.now(true);return n};t.str=function(){return t.currentTime.dateFormat(T.format)};t.currentTime=this.now()};k.find(".xdsoft_today_button").on("mousedown.xdsoft",function(){n.data("changed",true);j.setCurrentTime(0);n.trigger("afterOpen.xdsoft")}).on("dblclick.xdsoft",function(){t.val(j.str());n.trigger("close.xdsoft")});k.find(".xdsoft_prev,.xdsoft_next").on("mousedown.xdsoft",function(){var t=e(this),n=0,r=false;(function i(e){var s=j.currentTime.getMonth();if(t.hasClass(T.next)){j.nextMonth()}else if(t.hasClass(T.prev)){j.prevMonth()}if(T.monthChangeSpinner){!r&&(n=setTimeout(i,e?e:100))}})(500);e([document.body,window]).on("mouseup.xdsoft",function s(){clearTimeout(n);r=true;e([document.body,window]).off("mouseup.xdsoft",s)})});A.find(".xdsoft_prev,.xdsoft_next").on("mousedown.xdsoft",function(){var t=e(this),n=0,r=false,i=110;(function s(e){var o=O[0].clientHeight,u=M[0].offsetHeight,a=Math.abs(parseInt(M.css("marginTop")));if(t.hasClass(T.next)&&u-o-T.timeHeightInTimePicker>=a){M.css("marginTop","-"+(a+T.timeHeightInTimePicker)+"px")}else if(t.hasClass(T.prev)&&a-T.timeHeightInTimePicker>=0){M.css("marginTop","-"+(a-T.timeHeightInTimePicker)+"px")}O.trigger("scroll_element.xdsoft_scroller",[Math.abs(parseInt(M.css("marginTop"))/(u-o))]);i=i>10?10:i-10;!r&&(n=setTimeout(s,e?e:i))})(500);e([document.body,window]).on("mouseup.xdsoft",function o(){clearTimeout(n);r=true;e([document.body,window]).off("mouseup.xdsoft",o)})});var F=0;n.on("xchange.xdsoft",function(t){clearTimeout(F);F=setTimeout(function(){var t="",r=new Date(j.currentTime.getFullYear(),j.currentTime.getMonth(),1,12,0,0),i=0,s=j.now();while(r.getDay()!=T.dayOfWeekStart)r.setDate(r.getDate()-1);t+="<table><thead><tr>";if(T.weeks){t+="<th></th>"}for(var o=0;o<7;o++){t+="<th>"+T.i18n[T.lang].dayOfWeek[(o+T.dayOfWeekStart)%7]+"</th>"}t+="</tr></thead>";t+="<tbody>";var u=false,a=false;if(T.maxDate!==false){u=j.strToDate(T.maxDate);u=new Date(u.getFullYear(),u.getMonth(),u.getDate(),23,59,59,999)}if(T.minDate!==false){a=j.strToDate(T.minDate);a=new Date(a.getFullYear(),a.getMonth(),a.getDate())}var f,l,c,h,p=[],d,v=true;while(i<j.currentTime.countDaysInMonth()||r.getDay()!=T.dayOfWeekStart||j.currentTime.getMonth()==r.getMonth()){p=[];i++;f=r.getDate();l=r.getFullYear();c=r.getMonth();h=j.getWeekOfYear(r);p.push("xdsoft_date");if(T.beforeShowDay&&T.beforeShowDay.call){d=T.beforeShowDay.call(n,r)}else{d=null}if(u!==false&&r>u||a!==false&&r<a||d&&d[0]===false){p.push("xdsoft_disabled")}if(d&&d[1]!=""){p.push(d[1])}if(j.currentTime.getMonth()!=c)p.push("xdsoft_other_month");if((T.defaultSelect||n.data("changed"))&&j.currentTime.dateFormat(T.formatDate)==r.dateFormat(T.formatDate)){p.push("xdsoft_current")}if(s.dateFormat(T.formatDate)==r.dateFormat(T.formatDate)){p.push("xdsoft_today")}if(r.getDay()==0||r.getDay()==6||~T.weekends.indexOf(r.dateFormat(T.formatDate))){p.push("xdsoft_weekend")}if(T.beforeShowDay&&typeof T.beforeShowDay=="function"){p.push(T.beforeShowDay(r))}if(v){t+="<tr>";v=false;if(T.weeks){t+="<th>"+h+"</th>"}}t+='<td data-date="'+f+'" data-month="'+c+'" data-year="'+l+'"'+' class="xdsoft_date xdsoft_day_of_week'+r.getDay()+" "+p.join(" ")+'">'+"<div>"+f+"</div>"+"</td>";if(r.getDay()==T.dayOfWeekStartPrev){t+="</tr>";v=true}r.setDate(f+1)}t+="</tbody></table>";L.html(t);k.find(".xdsoft_label span").eq(0).text(T.i18n[T.lang].months[j.currentTime.getMonth()]);k.find(".xdsoft_label span").eq(1).text(j.currentTime.getFullYear());var m="",g="",c="",y=function(t,r){var i=j.now();i.setHours(t);t=parseInt(i.getHours());i.setMinutes(r);r=parseInt(i.getMinutes());p=[];if(T.maxTime!==false&&j.strtotime(T.maxTime).getTime()<i.getTime()||T.minTime!==false&&j.strtotime(T.minTime).getTime()>i.getTime())p.push("xdsoft_disabled");if((T.initTime||T.defaultSelect||n.data("changed"))&&parseInt(j.currentTime.getHours())==parseInt(t)&&(T.step>59||Math[T.roundTime](j.currentTime.getMinutes()/T.step)*T.step==parseInt(r))){if(T.defaultSelect||n.data("changed")){p.push("xdsoft_current")}else if(T.initTime){p.push("xdsoft_init_time")}}if(parseInt(s.getHours())==parseInt(t)&&parseInt(s.getMinutes())==parseInt(r))p.push("xdsoft_today");m+='<div class="xdsoft_time '+p.join(" ")+'" data-hour="'+t+'" data-minute="'+r+'">'+i.dateFormat(T.formatTime)+"</div>"};if(!T.allowTimes||!e.isArray(T.allowTimes)||!T.allowTimes.length){for(var i=0,o=0;i<(T.hours12?12:24);i++){for(o=0;o<60;o+=T.step){g=(i<10?"0":"")+i;c=(o<10?"0":"")+o;y(g,c)}}}else{for(var i=0;i<T.allowTimes.length;i++){g=j.strtotime(T.allowTimes[i]).getHours();c=j.strtotime(T.allowTimes[i]).getMinutes();y(g,c)}}M.html(m);var b="",i=0;for(i=parseInt(T.yearStart,10)+T.yearOffset;i<=parseInt(T.yearEnd,10)+T.yearOffset;i++){b+='<div class="xdsoft_option '+(j.currentTime.getFullYear()==i?"xdsoft_current":"")+'" data-value="'+i+'">'+i+"</div>"}H.children().eq(0).html(b);for(i=0,b="";i<=11;i++){b+='<div class="xdsoft_option '+(j.currentTime.getMonth()==i?"xdsoft_current":"")+'" data-value="'+i+'">'+T.i18n[T.lang].months[i]+"</div>"}P.children().eq(0).html(b);e(n).trigger("generate.xdsoft")},10);t.stopPropagation()}).on("afterOpen.xdsoft",function(){if(T.timepicker){var e;if(M.find(".xdsoft_current").length){e=".xdsoft_current"}else if(M.find(".xdsoft_init_time").length){e=".xdsoft_init_time"}if(e){var t=O[0].clientHeight,n=M[0].offsetHeight,r=M.find(e).index()*T.timeHeightInTimePicker+1;if(n-t<r)r=n-t;O.trigger("scroll_element.xdsoft_scroller",[parseInt(r)/(n-t)])}else{O.trigger("scroll_element.xdsoft_scroller",[0])}}});var I=0;L.on("click.xdsoft","td",function(r){r.stopPropagation();I++;var i=e(this),s=j.currentTime;if(s===undefined||s===null){j.currentTime=j.now();s=j.currentTime}if(i.hasClass("xdsoft_disabled"))return false;s.setDate(1);s.setFullYear(i.data("year"));s.setMonth(i.data("month"));s.setDate(i.data("date"));n.trigger("select.xdsoft",[s]);t.val(j.str());if((I>1||T.closeOnDateSelect===true||T.closeOnDateSelect===0&&!T.timepicker)&&!T.inline){n.trigger("close.xdsoft")}if(T.onSelectDate&&T.onSelectDate.call){T.onSelectDate.call(n,j.currentTime,n.data("input"))}n.data("changed",true);n.trigger("xchange.xdsoft");n.trigger("changedatetime.xdsoft");setTimeout(function(){I=0},200)});M.on("click.xdsoft","div",function(t){t.stopPropagation();var r=e(this),i=j.currentTime;if(i===undefined||i===null){j.currentTime=j.now();i=j.currentTime}if(r.hasClass("xdsoft_disabled"))return false;i.setHours(r.data("hour"));i.setMinutes(r.data("minute"));n.trigger("select.xdsoft",[i]);n.data("input").val(j.str());!T.inline&&n.trigger("close.xdsoft");if(T.onSelectTime&&T.onSelectTime.call){T.onSelectTime.call(n,j.currentTime,n.data("input"))}n.data("changed",true);n.trigger("xchange.xdsoft");n.trigger("changedatetime.xdsoft")});n.mousewheel&&C.mousewheel(function(e,t,n,r){if(!T.scrollMonth)return true;if(t<0)j.nextMonth();else j.prevMonth();return false});n.mousewheel&&O.unmousewheel().mousewheel(function(e,t,n,r){if(!T.scrollTime)return true;var i=O[0].clientHeight,s=M[0].offsetHeight,o=Math.abs(parseInt(M.css("marginTop"))),u=true;if(t<0&&s-i-T.timeHeightInTimePicker>=o){M.css("marginTop","-"+(o+T.timeHeightInTimePicker)+"px");u=false}else if(t>0&&o-T.timeHeightInTimePicker>=0){M.css("marginTop","-"+(o-T.timeHeightInTimePicker)+"px");u=false}O.trigger("scroll_element.xdsoft_scroller",[Math.abs(parseInt(M.css("marginTop"))/(s-i))]);e.stopPropagation();return u});var q=false;n.on("changedatetime.xdsoft",function(){if(T.onChangeDateTime&&T.onChangeDateTime.call){var e=n.data("input");T.onChangeDateTime.call(n,j.currentTime,e);delete T.value;e.trigger("change")}}).on("generate.xdsoft",function(){if(T.onGenerate&&T.onGenerate.call)T.onGenerate.call(n,j.currentTime,n.data("input"));if(q){n.trigger("afterOpen.xdsoft");q=false}}).on("click.xdsoft",function(e){e.stopPropagation()});var R=0;t.mousewheel&&t.mousewheel(function(e,r,i,s){if(!T.scrollInput)return true;if(!T.datepicker&&T.timepicker){R=M.find(".xdsoft_current").length?M.find(".xdsoft_current").eq(0).index():0;if(R+r>=0&&R+r<M.children().length)R+=r;M.children().eq(R).length&&M.children().eq(R).trigger("mousedown");return false}else if(T.datepicker&&!T.timepicker){C.trigger(e,[r,i,s]);t.val&&t.val(j.str());n.trigger("changedatetime.xdsoft");return false}});var U=function(){var t=n.data("input").offset(),r=t.top+n.data("input")[0].offsetHeight-1,i=t.left,s="absolute";if(T.fixed){r-=e(window).scrollTop();i-=e(window).scrollLeft();s="fixed"}else{if(r+n[0].offsetHeight>e(window).height()+e(window).scrollTop())r=t.top-n[0].offsetHeight+1;if(r<0)r=0;if(i+n[0].offsetWidth>e(window).width())i=e(window).width()-n[0].offsetWidth}n.css({left:i,top:r,position:s})};n.on("open.xdsoft",function(){var t=true;if(T.onShow&&T.onShow.call){t=T.onShow.call(n,j.currentTime,n.data("input"))}if(t!==false){n.show();U();e(window).off("resize.xdsoft",U).on("resize.xdsoft",U);if(T.closeOnWithoutClick){e([document.body,window]).on("mousedown.xdsoft",function r(){n.trigger("close.xdsoft");e([document.body,window]).off("mousedown.xdsoft",r)})}}}).on("close.xdsoft",function(e){var t=true;k.find(".xdsoft_month,.xdsoft_year").find(".xdsoft_select").hide();if(T.onClose&&T.onClose.call){t=T.onClose.call(n,j.currentTime,n.data("input"))}if(t!==false&&!T.opened&&!T.inline){n.hide()}e.stopPropagation()}).data("input",t);var z=0,W=0;n.data("xdsoft_datetime",j);n.setOptions(T);j.setCurrentTime(X());t.data("xdsoft_datetimepicker",n).on("open.xdsoft focusin.xdsoft mousedown.xdsoft",function(e){if(t.is(":disabled")||t.is(":hidden")||!t.is(":visible")||t.data("xdsoft_datetimepicker").is(":visible")&&T.closeOnInputClick)return;clearTimeout(z);z=setTimeout(function(){if(t.is(":disabled")||t.is(":hidden")||!t.is(":visible"))return;q=true;j.setCurrentTime(X());n.trigger("open.xdsoft")},100)}).on("keydown.xdsoft",function(t){var r=this.value,i=t.which;switch(true){case!!~[f].indexOf(i):var s=e("input:visible,textarea:visible");n.trigger("close.xdsoft");s.eq(s.index(this)+1).focus();return false;case!!~[m].indexOf(i):n.trigger("close.xdsoft");return true}})},L=function(t){var n=t.data("xdsoft_datetimepicker");if(n){n.data("xdsoft_datetime",null);n.remove();t.data("xdsoft_datetimepicker",null).off("open.xdsoft focusin.xdsoft focusout.xdsoft mousedown.xdsoft blur.xdsoft keydown.xdsoft");e(window).off("resize.xdsoft");e([window,document.body]).off("mousedown.xdsoft");t.unmousewheel&&t.unmousewheel()}};e(document).off("keydown.xdsoftctrl keyup.xdsoftctrl").on("keydown.xdsoftctrl",function(e){if(e.keyCode==u)x=true}).on("keyup.xdsoftctrl",function(e){if(e.keyCode==u)x=false});return this.each(function(){var t;if(t=e(this).data("xdsoft_datetimepicker")){if(e.type(n)==="string"){switch(n){case"show":e(this).select().focus();t.trigger("open.xdsoft");break;case"hide":t.trigger("close.xdsoft");break;case"destroy":L(e(this));break;case"reset":this.value=this.defaultValue;if(!this.value||!t.data("xdsoft_datetime").isValidDate(Date.parseDate(this.value,T.format)))t.data("changed",false);t.data("xdsoft_datetime").setCurrentTime(this.value);break}}else{t.setOptions(n)}return 0}else if(e.type(n)!=="string"){if(!T.lazyInit||T.open||T.inline){k(e(this))}else C(e(this))}})};e.fn.datetimepicker.defaults=t})(jQuery);(function(e){function o(t){var n=t||window.event,s=[].slice.call(arguments,1),o=0,u=0,a=0,f=0,l=0,c;t=e.event.fix(n);t.type="mousewheel";if(n.wheelDelta){o=n.wheelDelta}if(n.detail){o=n.detail*-1}if(n.deltaY){a=n.deltaY*-1;o=a}if(n.deltaX){u=n.deltaX;o=u*-1}if(n.wheelDeltaY!==undefined){a=n.wheelDeltaY}if(n.wheelDeltaX!==undefined){u=n.wheelDeltaX*-1}f=Math.abs(o);if(!r||f<r){r=f}l=Math.max(Math.abs(a),Math.abs(u));if(!i||l<i){i=l}c=o>0?"floor":"ceil";o=Math[c](o/r);u=Math[c](u/i);a=Math[c](a/i);s.unshift(t,o,u,a);return(e.event.dispatch||e.event.handle).apply(this,s)}var t=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"];var n="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"];var r,i;if(e.event.fixHooks){for(var s=t.length;s;){e.event.fixHooks[t[--s]]=e.event.mouseHooks}}e.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var e=n.length;e;){this.addEventListener(n[--e],o,false)}}else{this.onmousewheel=o}},teardown:function(){if(this.removeEventListener){for(var e=n.length;e;){this.removeEventListener(n[--e],o,false)}}else{this.onmousewheel=null}}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})})(jQuery);Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(e){if(e=="unixtime"){return parseInt(this.getTime()/1e3)}if(Date.formatFunctions[e]==null){Date.createNewFormat(e)}var t=Date.formatFunctions[e];return this[t]()};Date.createNewFormat=function(format){var funcName="format"+Date.formatFunctions.count++;Date.formatFunctions[format]=funcName;var code="Date.prototype."+funcName+" = function() {return ";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true}else{if(special){special=false;code+="'"+String.escape(ch)+"' + "}else{code+=Date.getFormatCode(ch)}}}eval(code.substring(0,code.length-3)+";}")};Date.getFormatCode=function(e){switch(e){case"d":return"String.leftPad(this.getDate(), 2, '0') + ";case"D":return"Date.dayNames[this.getDay()].substring(0, 3) + ";case"j":return"this.getDate() + ";case"l":return"Date.dayNames[this.getDay()] + ";case"S":return"this.getSuffix() + ";case"w":return"this.getDay() + ";case"z":return"this.getDayOfYear() + ";case"W":return"this.getWeekOfYear() + ";case"F":return"Date.monthNames[this.getMonth()] + ";case"m":return"String.leftPad(this.getMonth() + 1, 2, '0') + ";case"M":return"Date.monthNames[this.getMonth()].substring(0, 3) + ";case"n":return"(this.getMonth() + 1) + ";case"t":return"this.getDaysInMonth() + ";case"L":return"(this.isLeapYear() ? 1 : 0) + ";case"Y":return"this.getFullYear() + ";case"y":return"('' + this.getFullYear()).substring(2, 4) + ";case"a":return"(this.getHours() < 12 ? 'am' : 'pm') + ";case"A":return"(this.getHours() < 12 ? 'AM' : 'PM') + ";case"g":return"((this.getHours() %12) ? this.getHours() % 12 : 12) + ";case"G":return"this.getHours() + ";case"h":return"String.leftPad((this.getHours() %12) ? this.getHours() % 12 : 12, 2, '0') + ";case"H":return"String.leftPad(this.getHours(), 2, '0') + ";case"i":return"String.leftPad(this.getMinutes(), 2, '0') + ";case"s":return"String.leftPad(this.getSeconds(), 2, '0') + ";case"O":return"this.getGMTOffset() + ";case"T":return"this.getTimezone() + ";case"Z":return"(this.getTimezoneOffset() * -60) + ";default:return"'"+String.escape(e)+"' + "}};Date.parseDate=function(e,t){if(t=="unixtime"){return new Date(!isNaN(parseInt(e))?parseInt(e)*1e3:0)}if(Date.parseFunctions[t]==null){Date.createParser(t)}var n=Date.parseFunctions[t];return Date[n](e)};Date.createParser=function(format){var funcName="parse"+Date.parseFunctions.count++;var regexNum=Date.parseRegexes.length;var currentGroup=1;Date.parseFunctions[format]=funcName;var code="Date."+funcName+" = function(input) {\nvar y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, z = -1;\nvar d = new Date();\ny = d.getFullYear();\nm = d.getMonth();\nd = d.getDate();\nvar results = input.match(Date.parseRegexes["+regexNum+"]);\nif (results && results.length > 0) {";var regex="";var special=false;var ch="";for(var i=0;i<format.length;++i){ch=format.charAt(i);if(!special&&ch=="\\"){special=true}else{if(special){special=false;regex+=String.escape(ch)}else{obj=Date.formatCodeToRegex(ch,currentGroup);currentGroup+=obj.g;regex+=obj.s;if(obj.g&&obj.c){code+=obj.c}}}}code+="if (y > 0 && z > 0){\nvar doyDate = new Date(y,0);\ndoyDate.setDate(z);\nm = doyDate.getMonth();\nd = doyDate.getDate();\n}";code+="if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n{return new Date(y, m, d, h, i, s);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n{return new Date(y, m, d, h, i);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0)\n{return new Date(y, m, d, h);}\nelse if (y > 0 && m >= 0 && d > 0)\n{return new Date(y, m, d);}\nelse if (y > 0 && m >= 0)\n{return new Date(y, m);}\nelse if (y > 0)\n{return new Date(y);}\n}return null;}";Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$");eval(code)};Date.formatCodeToRegex=function(e,t){switch(e){case"D":return{g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case"j":case"d":return{g:1,c:"d = parseInt(results["+t+"], 10);\n",s:"(\\d{1,2})"};case"l":return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case"S":return{g:0,c:null,s:"(?:st|nd|rd|th)"};case"w":return{g:0,c:null,s:"\\d"};case"z":return{g:1,c:"z = parseInt(results["+t+"], 10);\n",s:"(\\d{1,3})"};case"W":return{g:0,c:null,s:"(?:\\d{2})"};case"F":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+t+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case"M":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+t+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case"n":case"m":return{g:1,c:"m = parseInt(results["+t+"], 10) - 1;\n",s:"(\\d{1,2})"};case"t":return{g:0,c:null,s:"\\d{1,2}"};case"L":return{g:0,c:null,s:"(?:1|0)"};case"Y":return{g:1,c:"y = parseInt(results["+t+"], 10);\n",s:"(\\d{4})"};case"y":return{g:1,c:"var ty = parseInt(results["+t+"], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case"a":return{g:1,c:"if (results["+t+"] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case"A":return{g:1,c:"if (results["+t+"] == 'AM') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case"g":case"G":case"h":case"H":return{g:1,c:"h = parseInt(results["+t+"], 10);\n",s:"(\\d{1,2})"};case"i":return{g:1,c:"i = parseInt(results["+t+"], 10);\n",s:"(\\d{2})"};case"s":return{g:1,c:"s = parseInt(results["+t+"], 10);\n",s:"(\\d{2})"};case"O":return{g:0,c:null,s:"[+-]\\d{4}"};case"T":return{g:0,c:null,s:"[A-Z]{3}"};case"Z":return{g:0,c:null,s:"[+-]\\d{1,5}"};default:return{g:0,c:null,s:String.escape(e)}}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{3}) [0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3")};Date.prototype.getGMTOffset=function(){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+String.leftPad(Math.abs(this.getTimezoneOffset())%60,2,"0")};Date.prototype.getDayOfYear=function(){var e=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var t=0;t<this.getMonth();++t){e+=Date.daysInMonth[t]}return e+this.getDate()};Date.prototype.getWeekOfYear=function(){var e=this.getDayOfYear()+(4-this.getDay());var t=new Date(this.getFullYear(),0,1);var n=7-t.getDay()+4;return String.leftPad(Math.ceil((e-n)/7)+1,2,"0")};Date.prototype.isLeapYear=function(){var e=this.getFullYear();return(e&3)==0&&(e%100||e%400==0&&e)};Date.prototype.getFirstDayOfMonth=function(){var e=(this.getDay()-(this.getDate()-1))%7;return e<0?e+7:e};Date.prototype.getLastDayOfMonth=function(){var e=(this.getDay()+(Date.daysInMonth[this.getMonth()]-this.getDate()))%7;return e<0?e+7:e};Date.prototype.getDaysInMonth=function(){Date.daysInMonth[1]=this.isLeapYear()?29:28;return Date.daysInMonth[this.getMonth()]};Date.prototype.getSuffix=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"}};String.escape=function(e){return e.replace(/('|\\)/g,"\\$1")};String.leftPad=function(e,t,n){var r=new String(e);if(n==null){n=" "}while(r.length<t){r=n+r}return r};Date.daysInMonth=[31,28,31,30,31,30,31,31,30,31,30,31];Date.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"];Date.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Date.y2kYear=50;Date.monthNumbers={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11};Date.patterns={ISO8601LongPattern:"Y-m-d H:i:s",ISO8601ShortPattern:"Y-m-d",ShortDatePattern:"n/j/Y",LongDatePattern:"l, F d, Y",FullDateTimePattern:"l, F d, Y g:i:s A",MonthDayPattern:"F d",ShortTimePattern:"g:i A",LongTimePattern:"g:i:s A",SortableDateTimePattern:"Y-m-d\\TH:i:s",UniversalSortableDateTimePattern:"Y-m-d H:i:sO",YearMonthPattern:"F, Y"}