text: /*
  Copyright (c) 2012 jqWidgets.
  http://jqwidgets.com/license/
  */
  
  (function(a){a.jqx.jqxWidget("jqxDateTimeInput","",{});a.extend(a.jqx._jqxDateTimeInput.prototype,{defineInstance:function(){if(this.value==undefined){this.value=a.jqx._jqxDateTimeInput.getDateTime(new Date())}if(this.minDate==undefined){this.minDate=a.jqx._jqxDateTimeInput.getDateTime(new Date());this.minDate._setYear(1900);this.minDate._setMonth(1);this.minDate._setDay(1);this.minDate._setHours(1);this.minDate._setMinutes(1);this.minDate._setSeconds(1);this.minDate._setMilliseconds(1)}if(this.maxDate==undefined){this.maxDate=a.jqx._jqxDateTimeInput.getDateTime(new Date());this.maxDate._setYear(2100);this.maxDate._setMonth(1);this.maxDate._setDay(1);this.maxDate._setHours(1);this.maxDate._setMinutes(1);this.maxDate._setSeconds(1);this.maxDate._setMilliseconds(1)}this.cookies=false;this.cookieoptions=null;if(this.formatString==undefined){this.formatString="dd/MM/yyyy"}if(this.width==undefined){this.width=null}if(this.height==undefined){this.height=null}if(this.textAlign==undefined){this.textAlign="left"}if(this.readonly==undefined){this.readonly=false}if(this.culture==undefined){this.culture="default"}this.activeEditor=this.activeEditor||null;if(this.showCalendarButton==undefined){this.showCalendarButton=true}if(this.showDelay==undefined){this.showDelay=350}if(this.hideDelay==undefined){this.hideDelay=400}if(this.closeCalendarAfterSelection==undefined){this.closeCalendarAfterSelection=true}this.isEditing=false;this.enableBrowserBoundsDetection=false;this.enableAbsoluteSelection=false;this.disabled=false;this.buttonSize=18;this.animationType="default";this.dropDownWidth="200px";this.dropDownHeight="200px";this.events=["valuechanged","textchanged","mousedown","mouseup","keydown","keyup","keypress","open","close"]},createInstance:function(l){this.host.attr({role:"dateTimeInput"});input=this;if(this.width!=null&&this.width.toString().indexOf("px")!=-1){this.host.width(this.width)}else{if(this.width!=undefined&&!isNaN(this.width)){this.host.width(this.width)}}if(this.height!=null&&this.height.toString().indexOf("px")!=-1){this.host.height(this.height)}else{if(this.height!=undefined&&!isNaN(this.height)){this.host.height(this.height)}}var d=this.createID();var j=this.createID();var b=a("<div style='width:100%; height: 100%; border: 0px;'><div id='dateTimeWrapper' style='float: none; position: relative; width: 100%; height: 100%;'><div id='dateTimeContent"+d+"' style='position: relative; overflow: hidden; height: 100%; float: left;'/><div id='dateTimeButton"+j+"' style='position: relative; height: 100%; float: right;'/></div></div>");this.host.append(b);this.dateTimeWrapper=this.host.find("#dateTimeWrapper");this.inputElement=this.host.find("#dateTimeContent"+d);this.calendarElement=this.host.find("#dateTimeButton"+j);this.dateTimeInput=a("<input style='position: relative; border: none; margin: 0; padding: 0;' id='inputElement' class='jqx-input-content' type='textarea'/>").appendTo(this.inputElement);this.dateTimeInput.removeClass(this.toThemeProperty("jqx-input-content"));this.dateTimeInput.addClass(this.toThemeProperty("jqx-input-content"));this.inputElement.addClass(this.toThemeProperty("jqx-input"));this.inputElement.addClass(this.toThemeProperty("jqx-rc-all"));this.calendarButton=a("<div style='padding: 0px; margin: 0px; top: 0; font-size: 3px; position: relative;' class='jqx-input-button-header'><div style='position: relative; font-size: 3px;' class='jqx-input-button-innerheader'></div></div><div style='padding: 0px; margin: 0px; top: 0; position: relative;' class='jqx-input-button-content'/>").appendTo(this.calendarElement);this.calendarButtonContent=this.host.find(".jqx-input-button-content");this.calendarButtonHeader=this.host.find(".jqx-input-button-header");this.calendarButtonInnerHeader=this.host.find(".jqx-input-button-innerheader");this.calendarButtonContent.removeClass(this.toThemeProperty("jqx-input-button-content"));this.calendarButtonContent.addClass(this.toThemeProperty("jqx-input-button-content"));this.calendarButtonHeader.removeClass(this.toThemeProperty("jqx-input-button-header"));this.calendarButtonHeader.addClass(this.toThemeProperty("jqx-input-button-header"));this.calendarButtonInnerHeader.removeClass(this.toThemeProperty("jqx-input-button-innerHeader"));this.calendarButtonInnerHeader.addClass(this.toThemeProperty("jqx-input-button-innerHeader"));this._arrange();if(this.showCalendarButton){this.calendarButton.css("display","block")}else{this.calendarButton.css("display","none")}if(a.jqx._jqxCalendar!=null&&a.jqx._jqxCalendar!=undefined){try{var h="calendar"+this.element.id;var g=a(a.find("#"+h));if(g.length>0){g.remove()}var c=a("<div style='overflow: hidden; background: transparent; position: absolute;' id='calendar"+this.element.id+"'><div id='innerCalendar"+this.element.id+"'></div></div>");c.appendTo(document.body);this.container=c;this.calendarContainer=a(a.find("#innerCalendar"+this.element.id)).jqxCalendar({width:this.dropDownWidth,height:this.dropDownHeight,theme:this.theme});this.calendarContainer.css({position:"absolute",zIndex:100000,top:0,left:0});this.calendar=a.data(this.calendarContainer[0],"jqxCalendar").instance;this.calendar.render();c.height(parseInt(this.calendarContainer.height())+25);c.width(parseInt(this.calendarContainer.width())+25);if(this.animationType=="none"){this.container.css("display","none")}else{this.container.hide()}}catch(k){}}var m=this;if(a.global==null||a.global==undefined){throw"jquery.global.js is not loaded."}a.global.preferCulture(this.culture);this.selectedText="";this._addHandlers();this.self=this;this.oldValue=this.getDate();this.items=new Array();this.editors=new Array();if(this.value==null){this.value=a.jqx._jqxDateTimeInput.getDateTime(new Date())}this.calendarButtonContent.html("<div style='line-height: 16px;  color: inherit; background: transparent; margin: 0; border: 0; padding: 0px; text-align: center; vertical-align: middle;'><b style='border: 0; padding: 0px; margin: 0px; background: transparent;'>"+this.value.day+"</b></div>");this._loadItems();this._applyArrayExtension();this.editorText="";if(this.readonly==true){this.dateTimeInput.css("readonly",this.readonly)}this.dateTimeInput.css("text-align",this.textAlign);this.propertyChangeMap.disabled=function(e,o,n,p){if(m.disabled){m.host.addClass(m.toThemeProperty("jqx-input-disabled"));m.dateTimeInput.addClass(m.toThemeProperty("jqx-input-disabled"))}else{m.host.removeClass(m.toThemeProperty("jqx-input-disabled"));m.dateTimeInput.removeClass(m.toThemeProperty("jqx-input-disabled"))}};if(this.disabled){this.host.addClass(this.toThemeProperty("jqx-input-disabled"));this.dateTimeInput.addClass(this.toThemeProperty("jqx-input-disabled"))}if(this.host.parents("form").length>0){this.host.parents("form").bind("reset",function(){setTimeout(function(){m.setDate(new Date())},10)})}if(this.cookies){var f=a.jqx.cookie.cookie("jqxDateTimeInput"+this.element.id);if(f!=null){this.setDate(new Date(f))}}},_arrange:function(){var c=parseInt(this.host.width());var k=parseInt(this.host.height());var h=this.buttonSize;var e=3;this.calendarButtonHeader.width(h);this.calendarButtonContent.height(h-e);this.calendarButtonContent.width(h);var g=parseInt(this.inputElement.outerHeight())-parseInt(this.inputElement.height());g=0;var b=c-parseInt(this.calendarButton.outerWidth())-1*e;if(b>0){this.inputElement.width(b+"px")}this.dateTimeInput.width(b-e+"px");this.dateTimeInput.css("left",0);this.dateTimeInput.css("top",0);this.inputElement.css("left",0);this.inputElement.css("top",0);var j=parseInt(this.calendarButtonHeader.outerWidth())/2-parseInt(this.calendarButtonInnerHeader.outerWidth())/2;this.calendarButtonInnerHeader.css("left",j);var l=parseInt(this.calendarButtonContent.outerHeight())+parseInt(this.calendarButtonHeader.outerHeight());var f=parseInt(this.inputElement.outerHeight())/2-l/2;this.calendarElement.css("top",parseInt(f)+"px");var d=parseInt(this.inputElement.height())/2-parseInt(this.dateTimeInput.outerHeight())/2;this.dateTimeInput.css("margin","0px");this.dateTimeInput.css("padding","0px");this.dateTimeInput.css("top",parseInt(d))},_removeHandlers:function(){var b=this;this.removeHandler(a(document),"mousedown");this.removeHandler(a(document),"keydown");this.removeHandler(this.dateTimeInput,"blur");this.removeHandler(this.dateTimeInput,"focus");this.removeHandler(this.calendarButton,"mousedown");this.removeHandler(this.dateTimeInput,"mousedown");this.removeHandler(this.dateTimeInput,"mouseup");this.removeHandler(this.dateTimeInput,"keydown");this.removeHandler(this.dateTimeInput,"keyup");this.removeHandler(this.dateTimeInput,"keypress");if(this.calendarContainer!=null){this.removeHandler(this.calendarContainer,"cellSelected");this.removeHandler(this.calendarContainer,"cellMouseDown")}},isOpened:function(){var c=this;var b=a.data(document.body,"openedJQXCalendar");if(b!=null&&b==c.calendarContainer){return true}return false},wheel:function(d,c){var e=0;if(!d){d=window.event}if(d.originalEvent&&d.originalEvent.wheelDelta){d.wheelDelta=d.originalEvent.wheelDelta}if(d.wheelDelta){e=d.wheelDelta/120}else{if(d.detail){e=-d.detail/3}}if(e){var b=c._handleDelta(e);if(!b){if(d.preventDefault){d.preventDefault()}return b}else{return}}if(d.preventDefault){d.preventDefault()}d.returnValue=false},_handleDelta:function(b){if(b<0){this.spinDown()}else{this.spinUp()}return false},_addHandlers:function(){var d=this.element.id;var b=this.element;var c=this;this.addHandler(this.host,"mousewheel",function(e){c.wheel(e,c)});this.addHandler(a(document),"mousedown",this._closeOpenedCalendar);this.addHandler(a(document),"keydown",function(g){var f=a.data(document.body,"openedJQXCalendar");if(f!=null&&f==c.calendarContainer){var e=c.handleCalendarKey(g);return e}});if(this.calendarContainer!=null){this.addHandler(this.calendarContainer,"cellSelected",function(f){if(c.closeCalendarAfterSelection){var e=a.data(document.body,"openedJQXCalendarValue");if(f.args.selectionType=="mouse"){c.hideCalendar()}}});this.addHandler(this.calendarContainer,"cellMouseDown",function(e){if(c.closeCalendarAfterSelection){a.data(document.body,"openedJQXCalendarValue",new a.jqx._jqxDateTimeInput.getDateTime(c.calendar.value.dateTime))}})}this.addHandler(this.dateTimeInput,"blur",function(){c.isEditing=false;c._validateValue();c._updateText()});this.addHandler(this.dateTimeInput,"focus",function(){var e=c._selection();c.isEditing=true;c._validateValue();c._updateText();c._setSelectionStart(e.start);c._selectGroup(-1)});this.addHandler(this.calendarButton,"mousedown",function(f){var g=c.container;var e=g.css("display")=="block";if(!c.disabled){if(e){c.hideCalendar()}else{c.showCalendar()}return false}});this.addHandler(this.dateTimeInput,"mousedown",function(e){return c._raiseEvent(2,e)});this.addHandler(this.dateTimeInput,"mouseup",function(e){return c._raiseEvent(3,e)});this.addHandler(this.dateTimeInput,"keydown",function(e){return c._raiseEvent(4,e)});this.addHandler(this.dateTimeInput,"keyup",function(e){return c._raiseEvent(5,e)});this.addHandler(this.dateTimeInput,"keypress",function(e){return c._raiseEvent(6,e)})},createID:function(){var b=Math.random()+"";b=b.replace(".","");b="99"+b;b=b/1;return"dateTimeInput"+b},setMaxDate:function(b){if(b==null){return}this.maxDate=a.jqx._jqxDateTimeInput.getDateTime(b);if(this.calendar!=null){this.calendar.setMaxDate(b)}},getMaxDate:function(){if(this.maxDate!=null&&this.maxDate!=undefined){return this.maxDate.dateTime}return null},setMinDate:function(b){if(b==null){return}this.minDate=a.jqx._jqxDateTimeInput.getDateTime(b);if(this.calendar!=null){this.calendar.setMinDate(b)}},getMinDate:function(){if(this.minDate!=null&&this.minDate!=undefined){return this.minDate.dateTime}return null},propertyChangedHandler:function(b,c,e,d){if(this.isInitialized==undefined||this.isInitialized==false){return}if(c=="culture"){this._loadItems();if(this.calendar!=null){this.calendar.culture=d;this.calendar.render()}}else{if(c=="formatString"){this._loadItems()}}this._setOption(c,d);if(c=="dropDownWidth"||c=="dropDownHeight"){this.calendarContainer.jqxCalendar({width:this.dropDownWidth,height:this.dropDownHeight});this.calendar.render();this.container.height(this.calendarContainer.height());this.container.width(this.calendarContainer.width())}},setDate:function(b){if(b<this.getMinDate()||b>this.getMaxDate()){return}this.value._setYear(b.getFullYear());this.value._setDay(b.getDate());this.value._setMonth(b.getMonth()+1);this._refreshValue();if(this.cookies){if(this.value!=null){a.jqx.cookie.cookie("jqxDateTimeInput"+this.element.id,this.value.dateTime.toString(),this.cookieoptions)}}this._raiseEvent("0",b)},getDate:function(){if(this.value==undefined){return new Date()}return this.value.dateTime},spinUp:function(){var d=this.value;if(this.activeEditor!=null){var b=this.editors.indexOf(this.activeEditor);if(this.items[b].type=="Day"){if(this.value!=null){this.activeEditor.maxValue=this.value._daysInMonth(this.value.year,this.value.month)}}var c=this.activeEditor.positions;this.activeEditor.increaseValue(this.enableAbsoluteSelection);this.activeEditor.positions=c}this.isEditing=false;this.updateValue();this._updateText();var e=this.editors.indexOf(this.activeEditor);if(e>=0){this._selectGroup(e)}},_validateValue:function(){var b=false;for(i=0;i<this.items.length;i++){var c=this.editors[i].value;switch(this.items[i].type){case"FORMAT_AMPM":if(c<0){c=0}else{if(c>1){c=1}}break;case"Character":break;case"Day":if(c<1){c=1}else{if(c>31){c=31}}break;case"FORMAT_hh":case"FORMAT_HH":if(c<0){c=0}else{if(c>23){c=23}}break;case"Millisecond":if(c<0){c=0}else{if(c>99){c=99}}break;case"Minute":if(c<0){c=0}else{if(c>59){c=59}}break;case"Month":if(c<1){c=1}else{if(c>12){c=12}}break;case"ReadOnly":break;case"Second":if(c<0){c=0}else{if(c>59){c=59}}break;case"Year":if(c<this.minDate.year){c=this.minDate.year}else{if(c>this.maxDate.year){c=this.maxDate.year}}break}if(this.editors[i].value!=c){this.editors[i].value=c;b=true}}this.updateValue();if(this.value.dateTime>this.maxDate.dateTime){this._internalSetValue(this.maxDate);this._updateEditorsValue()}else{if(this.value.dateTime<this.minDate.dateTime){this._internalSetValue(this.minDate);this._updateEditorsValue()}}},spinDown:function(){var d=this.value;if(this.activeEditor!=null){var b=this.editors.indexOf(this.activeEditor);if(this.items[b].type=="Day"){if(this.value!=null){this.activeEditor.maxValue=this.value._daysInMonth(this.value.year,this.value.month)}}var c=this.activeEditor.positions;this.activeEditor.decreaseValue(this.enableAbsoluteSelection);this.activeEditor.positions=c}this.isEditing=false;this.updateValue();this._updateText();var e=this.editors.indexOf(this.activeEditor);if(e>=0){this._selectGroup(e)}},_passKeyToCalendar:function(c){if(c.keyCode==13){this.hideCalendar();return}else{if(c.keyCode==27){var e=this.calendarContainer;var d=this.calendar;var f=this.closeCalendarAfterSelection;this.closeCalendarAfterSelection=false;d.setDate(this.value.dateTime);d.selectDate(this.value.dateTime);this.closeCalendarAfterSelection=f;this.hideCalendar()}}var f=this.closeCalendarAfterSelection;this.closeCalendarAfterSelection=false;var b=this.calendar._handleKey(c);this.closeCalendarAfterSelection=f;return b},handleCalendarKey:function(j){var c=a(j.target);var e=a.data(document.body,"openedJQXCalendar");if(e!=null){if(e.length>0){var h=e[0].id.toString();var d=h.toString().substring(13);var g=a(document).find("#"+d);var f=a.data(g[0],"jqxDateTimeInput").instance;var b=f._passKeyToCalendar(j);return b}}return true},_findPos:function(c){if(c==null){return}while(c&&(c.type=="hidden"||c.nodeType!=1||a.expr.filters.hidden(c))){c=c.nextSibling}var b=a(c).offset();return[b.left,b.top]},testOffset:function(d,h,f){var g=d.outerWidth();var c=d.outerHeight();var e=document.documentElement.clientWidth+a(window).scrollLeft();var b=document.documentElement.clientHeight+a(window).scrollTop();h.left-=0;h.left-=0;h.top-=0;h.left-=Math.min(h.left,(h.left+g>e&&e>g)?Math.abs(h.left+g-e):0);h.top-=Math.min(h.top,(h.top+c>b&&b>c)?Math.abs(c+f):0);return h},showCalendar:function(){var f=this.calendarContainer;var j=this.calendar;var b=this.container;var l=a(window).scrollTop();var e=a(window).scrollLeft();var k=parseInt(this._findPos(this.inputElement[0])[1])+parseInt(this.inputElement.outerHeight())-1+"px";var d=parseInt(this.host.offset().left)+"px";var n=a.jqx.mobile.isSafariMobileBrowser();if(n!=null&&n){k=parseInt(k)-l+"px";d=parseInt(d)-e+"px"}this.container.css("left",d);this.container.css("top",k);var c=this.closeCalendarAfterSelection;this.closeCalendarAfterSelection=false;this.isEditing=false;this._validateValue();this._updateText();j.setDate(this.value.dateTime);j.selectDate(this.value.dateTime);this.closeCalendarAfterSelection=c;if(this.enableBrowserBoundsDetection){var g=this.testOffset(f,{left:parseInt(this.container.css("left")),top:parseInt(k)},parseInt(this.inputElement.outerHeight()));this.container.css("top",g.top)}this._raiseEvent(7,f);if(this.animationType=="default"){a.data(document.body,"openedJQXCalendar",f);this.container.css("display","block");var m=f.outerHeight();f.css("margin-top",-m);var h=this;f.animate({"margin-top":0},this.showDelay,function(){var o=a(window).scrollTop();var s=a(window).scrollLeft();var r=parseInt(h._findPos(h.inputElement[0])[1])+parseInt(h.inputElement.outerHeight())-1+"px";var q=parseInt(h.host.offset().left)+"px";var p=a.jqx.mobile.isSafariMobileBrowser();if(p!=null&&p){r=parseInt(r)-o+"px";q=parseInt(q)-s+"px"}if(parseInt(h.container.css("top"))!=parseInt(r)){h.container.css("top",r)}})}else{this.container.css("display","block");a.data(document.body,"openedJQXCalendar",f)}},hideCalendar:function(){var h=this.calendarContainer;var d=this.container;a.data(document.body,"openedJQXCalendar",null);if(this.animationType=="default"){var b=h.outerHeight();h.css("margin-top",0);h.animate({"margin-top":-b},this.hideDelay,function(){d.css("display","none")})}else{d.css("display","none")}var c=this.value.hour;var j=this.value.minute;var g=this.value.second;var e=this.value.millisecond;var f=new a.jqx._jqxDateTimeInput.getDateTime(this.calendar.value.dateTime);f._setHours(c);f._setMinutes(j);f._setSeconds(g);f._setMilliseconds(e);this.setDate(f.dateTime);this._raiseEvent(8,h)},_closeOpenedCalendar:function(j){var b=a(j.target);var d=a.data(document.body,"openedJQXCalendar");var h=false;a.each(b.parents(),function(){if(this.className.indexOf("jqx-calendar")!=-1){h=true;return false}if(this.className.indexOf("jqx-input")!=-1){h=true;return false}});if(d!=null&&!h){if(d.length>0){var g=d[0].id.toString();var c=g.toString().substring(13);var f=a(document).find("#"+c);var e=a.data(f[0],"jqxDateTimeInput").instance;e.hideCalendar();a.data(document.body,"openedJQXCalendar",null)}}},_applyArrayExtension:function(){if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c){var b=this.length;var d=Number(arguments[1])||0;d=(d<0)?Math.ceil(d):Math.floor(d);if(d<0){d+=b}for(;d<b;d++){if(d in this&&this[d]===c){return d}}return -1}}},_loadItems:function(){if(this.value!=null){this.items=new Array();var c=this._getFormatValue(this.formatString);this.items=this._parseFormatValue(c);this.editors=new Array();for(i=0;i<this.items.length;i++){var b=this.items[i].getDateTimeEditorByItemType(this.value);this.editors[i]=b}}this._updateEditorsValue();this._updateText()},_updateText:function(){var c="";if(this.items.length>=1){c=this.format(this.value,0,this.items.length)}var b=this.dateTimeInput.val();if(b!=c){this._raiseEvent(1,this.value)}this.dateTimeInput.val(c)},format:function(f,g,e){var b="";for(i=g;i<e;++i){var c=this.items[i].dateParser(f);if(this.isEditing&&this.items[i].type!="ReadOnly"){var d=this.items[i].type=="Day"&&this.items[i].format.length>2;if(this.items[i].type=="FORMAT_AMPM"){d=true}if(!d){c=this.items[i].dateParserInEditMode(new Number(this.editors[i].value),"d"+this.editors[i].maxEditPositions);while(c.length<this.editors[i].maxEditPositions){c="0"+c}}}b+=c}return b},_getFormatValueGroupLength:function(b){for(i=1;i<b.toString().length;++i){if(b.substring(i,i+1)!=b.substring(0,1)){return i}}return b.length},_parseFormatValue:function(h){var c=new Array();var f=h.toString();var e=0;while(f.length>0){var d=this._getFormatValueGroupLength(f);var g=null;switch(f.substring(0,1)){case":":case"/":d=1;g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,1),"ReadOnly",this.culture);break;case'"':case"'":var b=f.indexOf(f[0],1);g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(1,1+Math.max(1,b-1)),"ReadOnly",this.culture);d=Math.max(1,b+1);break;case"\\":if(f.length>=2){g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(1,1),"ReadOnly",this.culture);d=2}break;case"d":case"D":if(d>2){g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,d),"Day",this.culture)}else{g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,d),"Day",this.culture)}break;case"f":case"F":if(d>7){d=7}if(d>3){g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,d),"ReadOnly",this.culture)}else{g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,d),"Millisecond",this.culture)}break;case"g":g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,d),"ReadOnly",this.culture);break;case"h":g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,d),"FORMAT_hh",this.culture);break;case"H":g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,d),"FORMAT_HH",this.culture);break;case"m":g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,d),"Minute",this.culture);break;case"M":if(d>4){d=4}g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,d),"Month",this.culture);break;case"s":case"S":g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,d),"Second",this.culture);break;case"t":case"T":g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,d),"FORMAT_AMPM",this.culture);break;case"y":case"Y":if(d>1){g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,d),"Year",this.culture)}else{d=1;g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,1),dateTimeFormatInfo,"ReadOnly",this.culture)}break;case"z":g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,d),"ReadOnly",this.culture);break;default:d=1;g=a.jqx._jqxDateTimeInput.DateTimeFormatItem._create(f.substring(0,1),"ReadOnly",this.culture);break}c[e]=a.extend(true,{},g);f=f.substring(d);e++}return c},_getFormatValue:function(b){if(b==null||b.length==0){b="d"}if(b.length==1){switch(b.substring(0,1)){case"d":return a.global.culture.calendar.patterns.d;case"D":return a.global.culture.calendar.patterns.D;case"t":return a.global.culture.calendar.patterns.t;case"T":return a.global.culture.calendar.patterns.T;case"f":return a.global.culture.calendar.patterns.f;case"F":return a.global.culture.calendar.patterns.F;case"M":return a.global.culture.calendar.patterns.M;case"Y":return a.global.culture.calendar.patterns.Y;case"S":return a.global.culture.calendar.patterns.S}}if(b.length==2&&b.substring(0,1)=="%"){b=b.substring(1)}return b},_updateEditorsValue:function(){var g=this.value;var e=g.year;var c=g.day;var b=g.hour;var f=g.millisecond;var d=g.second;var j=g.minute;var h=g.month;if(this.items==null){return}for(i=0;i<this.items.length;i++){switch(this.items[i].type){case"FORMAT_AMPM":this.editors[i].value=0;break;case"Day":this.editors[i].value=c;break;case"FORMAT_hh":this.editors[i].value=b;break;case"FORMAT_HH":this.editors[i].value=b;break;case"Millisecond":this.editors[i].value=f;break;case"Minute":this.editors[i].value=j;break;case"Month":this.editors[i].value=h;break;case"Second":this.editors[i].value=d;break;case"Year":this.editors[i].value=e;break}}},updateValue:function(){if(this.isEditing){return}var j=0;var n=1;var u=1;var g=0;var b=0;var B=0;var p=0;var A=1;var e=0;var h=false;var m=false;var v=false;var o=new Array();var c=null;var s=0;for(i=0;i<this.items.length;i++){switch(this.items[i].type){case"FORMAT_AMPM":e=this.editors[i].value;c=this.editors[i];break;case"Character":break;case"Day":if(this.items[i].format.length<4){u=this.editors[i].value;o[s++]=this.editors[i];if(u==0){u=1}v=true}break;case"FORMAT_hh":var x=this.editors[i];g=x.value;break;case"FORMAT_HH":g=this.editors[i].value;break;case"Millisecond":b=this.editors[i].value;break;case"Minute":p=this.editors[i].value;break;case"Month":A=this.editors[i].value;m=true;if(A==0){A=1}break;case"ReadOnly":break;case"Second":B=this.editors[i].value;break;case"Year":h=true;n=this.editors[i].value;var z=this.editors[i].getDateTimeItem().format;if(z.length<3){var r="1900";if(r.Length==4){var q=""+r[0]+r[1];var w;w=parseInt(q);n=n+(w*100)}}if(n==0){n=1}break}}var y=new Date(this.value.dateTime);if(n>0&&A>0&&u>0&&p>=0&&g>=0&&B>=0&&b>=0){var C=this.value;if(!h){n=C.year}if(!m){A=C.month}if(!v){u=C.day}try{if(A>12){A=12}if(A<1){A=1}if(C._daysInMonth(n,A)<=u){u=C._daysInMonth(n,A);if(o!=null&&o.length>0){for(i=0;i<o.length;i++){o[i].value=u}}}if(c!=null){c.value=g<12?0:1}this.value._setYear(parseInt(n));this.value._setDay(u);this.value._setMonth(A);this.value._setHours(g);this.value._setMinutes(p);this.value._setSeconds(B);this.value._setMilliseconds(b)}catch(f){this.value=C}var t=this.value.dateTime.getFullYear()==y.getFullYear()&&this.value.dateTime.getDate()==y.getDate()&&this.value.dateTime.getMonth()==y.getMonth()&&this.value.dateTime.getHours()==y.getHours()&&this.value.dateTime.getMinutes()==y.getMinutes()&&this.value.dateTime.getSeconds()==y.getSeconds();if(!t){this._raiseEvent("0",this.value.dateTime);if(this.cookies){if(this.value!=null){a.jqx.cookie.cookie("jqxDateTimeInput"+this.element.id,this.value.dateTime.toString(),this.cookieoptions)}}}this.calendarButtonContent.html("<div style='line-height: 16px; background: transparent; margin: 0; border: 0; padding: 0px; text-align: center; vertical-align: middle;'><b style='border: 0; padding: 0px; margin: 0px; background: transparent;'>"+this.value.day+"</b></div>")}var d=this.editors.indexOf(this.activeEditor);var l=this.items[d]},_internalSetValue:function(b){this.value._setYear(parseInt(b.year));this.value._setDay(b.day);this.value._setMonth(b.month);this.value._setHours(b.hour);this.value._setMinutes(b.minute);this.value._setSeconds(b.second);this.value._setMilliseconds(b.milisecond)},_raiseEvent:function(c,j){var h=this.events[c];var d={};d.owner=this;var g=j.charCode?j.charCode:j.keyCode?j.keyCode:0;var k=true;var f=this.readonly;var b=new jQuery.Event(h);b.owner=this;b.args=d;b.args.date=this.getDate();k=this.host.trigger(b);var e=this;if(!f){if(c==2&&!this.disabled){setTimeout(function(){e.isEditing=true;e._selectGroup(-1)},25)}}if(c==4){if(f||this.disabled){return false}k=this._handleKeyDown(j,g)}else{if(c==5){if(f||this.disabled){return false}}else{if(c==6){if(f||this.disabled){return false}k=this._handleKeyPress(j,g)}}}return k},_doLeftKey:function(){if(this.activeEditor!=null){if(!this.isEditing){this.isEditing=true}var b=this.activeEditor;var d=false;var e=this.editors.indexOf(this.activeEditor);var c=e;if(this.enableAbsoluteSelection){if(e>=0&&this.activeEditor.positions>0){this.activeEditor.positions--;this._selectGroup(e);return}}while(e>0){this.activeEditor=this.editors[--e];this._selectGroup(e);if(this.items[e].type!="ReadOnly"){d=true;break}}if(!d){if(c>=0){this.activeEditor=this.editors[c]}}if(this.activeEditor!=null&&b!=this.activeEditor){if(this.items[e].type!="ReadOnly"){if(this.enableAbsoluteSelection){this.activeEditor.positions=this.activeEditor.maxEditPositions-1}else{this.activeEditor.positions=0}}}if(this.activeEditor!=b){this._validateValue();this._updateText();this._selectGroup(this.editors.indexOf(this.activeEditor))}}},_doRightKey:function(){if(this.activeEditor!=null){if(!this.isEditing){this.isEditing=true}var b=this.activeEditor;var d=false;var e=this.editors.indexOf(this.activeEditor);var c=e;if(this.enableAbsoluteSelection){if(e>=0&&this.activeEditor.positions<this.activeEditor.maxEditPositions-1){this.activeEditor.positions++;this._selectGroup(e);return}}while(e<=this.editors.length-2){this.activeEditor=this.editors[++e];this._selectGroup(e);if(this.items[e].type!="ReadOnly"){if(this.items[e].type=="Day"&&this.items[e].format.length>2){break}if(this.items[e].type=="FORMAT_AMPM"){break}d=true;break}}if(!d){if(c>=0){this.activeEditor=this.editors[c]}}if(this.activeEditor!=null&&this.activeEditor!=b){if(this.items[e].type!="ReadOnly"){this.activeEditor.positions=0}}if(this.activeEditor!=b){this._validateValue();this._updateText();this._selectGroup(this.editors.indexOf(this.activeEditor))}}},_saveSelectedText:function(){var b=this._selection();var d="";var c=this.dateTimeInput.val();if(b.start>0||b.length>0){for(i=b.start;i<b.end;i++){d+=c[i]}}window.clipboardData.setData("Text",d);return d},_selectWithAdvancePattern:function(){var f=this.editors.indexOf(this.activeEditor);var g=false;if(this.items[f].type!="ReadOnly"&&this.items[f].type!="Format_AMPM"){g=true}if(!g){return}var d=this.activeEditor;if(d!=null){var e=d.positions==d.maxEditPositions;if(e){this.editorText="";var c=d.value;var b=false;switch(this.items[f].type){case"FORMAT_AMPM":if(c<0){c=0}else{if(c>1){c=1}}break;case"Character":break;case"Day":if(c<1){c=1}else{if(c>31){c=31}}break;case"FORMAT_hh":case"FORMAT_HH":if(c<0){c=0}else{if(c>23){c=23}}break;case"Millisecond":if(c<0){c=0}else{if(c>99){c=99}}break;case"Minute":if(c<0){c=0}else{if(c>59){c=59}}break;case"Month":if(c<1){c=1}else{if(c>12){c=12}}break;case"ReadOnly":break;case"Second":if(c<0){c=0}else{if(c>59){c=59}}break;case"Year":if(c<this.minDate.year){c=this.minDate.year}else{if(c>this.maxDate.year){c=this.maxDate.year}}break}if(d.value!=c){b=true}if(!b){this.isEditing=false;this._validateValue();this._updateText();this.isEditing=true;this._doRightKey();return true}return false}}},_handleKeyPress:function(j,n){var m=this._selection();var b=this;if((j.ctrlKey&&n==97)||(j.ctrlKey&&n==65)){return true}if(n==8){if(m.start>0){b._setSelectionStart(m.start)}return false}if(n==46){if(m.start<this.items.length){b._setSelectionStart(m.start)}return false}if(m.start>=0){var d=String.fromCharCode(n);var k=parseInt(d);if(!isNaN(k)){if(this.container.css("display")=="block"){this.hideCalendar()}this.updateValue();this._updateText();var g=false;var h=this.editors.indexOf(this.activeEditor);var c=null;this.isEditing=true;if(h.type!="ReadOnly"&&h.type!="FORMAT_AMPM"){c=this.activeEditor}if(c!=null&&c.positions==0){this.editorText=""}if(this.activeEditor==null){this.activeEditor=this.editors[0]}this.activeEditor.insert(d);if(c!=null&&this.editorText.length>=c.maxEditPositions){this.editorText=""}this.editorText+=d;var o=this._selectWithAdvancePattern();if(this.activeEditor.positions==this.activeEditor.maxEditPositions){var f=this._getLastEditableEditorIndex();if(this.editors.indexOf(this.activeEditor)==f&&o&&this.enableAbsoluteSelection){this.activeEditor.positions=this.activeEditor.maxEditPositions-1}else{this.activeEditor.positions=0}}g=true;this.updateValue();this._updateText();this._selectGroup(this.editors.indexOf(this.activeEditor));return false}}var l=this._isSpecialKey(n);return l},_getLastEditableEditorIndex:function(){var b=0;var c=this;for(itemIndex=this.items.length-1;itemIndex>=0;itemIndex--){if(this.items[itemIndex].type!="ReadOnly"){return itemIndex}}return -1},_handleKeyDown:function(h,b){var f=this._selection();if((h.ctrlKey&&b==99)||(h.ctrlKey&&b==67)){this._saveSelectedText(h);return false}if((h.ctrlKey&&b==122)||(h.ctrlKey&&b==90)){return false}if((h.ctrlKey&&b==118)||(h.ctrlKey&&b==86)||(h.shiftKey&&b==45)){return false}if(b==8||b==46){if(this.activeEditor!=null){var j=this.editors.indexOf(this.activeEditor);if(this.activeEditor.positions>=0){var d=a.global.format(Number(this.activeEditor.value),"d"+this.activeEditor.maxEditPositions,this.culture);tmp=d;tmp=tmp.substring(0,this.activeEditor.positions)+"0"+tmp.substring(this.activeEditor.positions+1);if(parseInt(tmp)<this.activeEditor.minValue){tmp=a.global.format(Number(this.activeEditor.minValue),"d"+this.activeEditor.maxEditPositions,this.culture)}if(this.enableAbsoluteSelection){this.activeEditor.value=tmp}else{this.activeEditor.value=this.activeEditor.minValue}this._validateValue();this._updateText();if(b==8){var c=this;if(this.enableAbsoluteSelection&&this.activeEditor.positions>0){setTimeout(function(){c.activeEditor.positions=c.activeEditor.positions-1;c._selectGroup(j)},10)}else{setTimeout(function(){c._doLeftKey()},10)}}else{this._selectGroup(j)}}else{this._doLeftKey()}}return false}if(b==38){this.spinUp();return false}else{if(b==40){this.spinDown();return false}}if(b==37){this._doLeftKey();return false}else{if(b==39){this._doRightKey();return false}}var g=this._isSpecialKey(b);if(!a.browser.mozilla){return true}return g},_isSpecialKey:function(b){if(b!=8&&b!=9&&b!=13&&b!=35&&b!=36&&b!=37&&b!=39&&b!=46){return false}return true},_selection:function(){if("selectionStart" in this.dateTimeInput[0]){var f=this.dateTimeInput[0];var g=f.selectionEnd-f.selectionStart;return{start:f.selectionStart,end:f.selectionEnd,length:g,text:f.value}}else{var c=document.selection.createRange();if(c==null){return{start:0,end:f.value.length,length:0}}var b=this.dateTimeInput[0].createTextRange();var d=b.duplicate();b.moveToBookmark(c.getBookmark());d.setEndPoint("EndToStart",b);var g=c.text.length;return{start:d.text.length,end:d.text.length+c.text.length,length:g,text:c.text}}},_selectGroup:function(j){var l=this._selection();var e="";var b="";var c=null;for(i=0;i<this.items.length;i++){b=this.items[i].dateParser(this.value);if(this.isEditing&&this.items[i].type!="ReadOnly"){var h=this.items[i].type=="Day"&&this.items[i].format.length>2;if(this.items[i].type=="FORMAT_AMPM"){h=true}if(!h){b=this.items[i].dateParserInEditMode(new Number(this.editors[i].value),"d"+this.editors[i].maxEditPositions);while(b.length<this.editors[i].maxEditPositions){b="0"+b}}}e+=b;if(this.items[i].type=="ReadOnly"){continue}if(this.items[i].type=="Day"&&this.items[i].format.length>2){continue}if(this.items[i].type=="FORMAT_AMPM"){continue}if(j!=undefined&&j!=-1){if(i>=j){var k=e.length-b.length;var d=b.length;if(this.enableAbsoluteSelection){if(!isNaN(parseInt(b))&&this.isEditing&&j!=-1){d=1;k+=this.editors[i].positions}}if(k==this.dateTimeInput.val().length){k--}this._setSelection(k,k+d);c=this.editors[i];this.activeEditor=c;break}}else{if(e.length>=l.start){c=this.editors[i];this.activeEditor=c;var k=e.length-b.length;var d=1;if(this.enableAbsoluteSelection){if(!isNaN(parseInt(b))&&this.isEditing&&j!=-1){d=1;k+=this.editors[i].positions}}else{d=b.length}this._setSelection(k,k+d);break}}}if(i<this.items.length&&j==-1){if(this.items[i].type!="ReadOnly"){this.activeEditor.positions=0}}var g=this._selection();if(g.length==0){if(g.start>0){var f=this._getLastEditableEditorIndex();if(f>=0){this._selectGroup(f)}}}},_getLastEditableEditorIndex:function(){var b=-1;for(i=0;i<this.editors.length;i++){if(this.items[i].type=="ReadOnly"){continue}if(this.items[i].type=="Day"&&this.items[i].format.length>2){continue}if(this.items[i].type=="FORMAT_AMPM"){continue}b=i}return b},_setSelection:function(d,b){if("selectionStart" in this.dateTimeInput[0]){this.dateTimeInput[0].focus();this.dateTimeInput[0].setSelectionRange(d,b)}else{var c=this.dateTimeInput[0].createTextRange();c.collapse(true);c.moveEnd("character",b);c.moveStart("character",d);c.select()}},_setSelectionStart:function(b){this._setSelection(b,b)},destroy:function(){this.host.removeClass("jqx-rc-all");this._removeHandlers();this.dateTimeInput.remove();this.host.remove()},refresh:function(){this._arrange()},_setOption:function(b,c){if(b==="value"){if(!this.value._equalDate(c.dateTime)){this.value=c;this._refreshValue()}}if(b=="maxDate"){this.calendar.maxDate=c}if(b=="minDate"){this.calendar.minDate=c}if(b=="showCalendarButton"){if(c){this.calendarButton.css("display","block")}else{this.calendarButton.css("display","none")}}if(b=="disabled"){this.dateTimeInput.attr("disabled",c)}if(b=="readonly"){this.readonly=c;this.dateTimeInput.css("readonly",c)}if(b=="textAlign"){this.dateTimeInput.css("text-align",c);this.textAlign=c}if(b=="width"){this.width=c;this.width=parseInt(this.width);this._arrange()}else{if(b=="height"){this.height=c;this.height=parseInt(this.height);this._arrange()}}},_refreshValue:function(){this._updateEditorsValue();this.updateValue();this._validateValue();this._updateText()}})})(jQuery);(function(a){a.jqx._jqxDateTimeInput.DateTimeFormatItem={};a.extend(a.jqx._jqxDateTimeInput.DateTimeFormatItem,{_create:function(d,c,b){this.format=d;this.type=c;this.culture=b;return this},_itemValue:function(){switch(this.format.length){case 1:return 9;case 2:return 99;case 3:default:return 999}},_maximumValue:function(){switch(this.format.length){case 1:return 9;case 2:return 99;case 3:default:return 999}},dateParser:function(b){if(b==null){return""}var c=a.global.format(b.dateTime,this.format.length==1?"%"+this.format:this.format,this.culture);return c},dateParserInEditMode:function(d,c){if(d==null){return""}var b=a.global.format(d.toString(),c.length==1?"%"+c:c,this.culture);return b},getDateTimeEditorByItemType:function(q){switch(this.type){case"FORMAT_AMPM":var h=a.jqx._jqxDateTimeInput.AmPmEditor._createAmPmEditor(this.format,q.hour/12,a.global.culture.calendar.AM[0],a.global.culture.calendar.PM[0],this);var o=a.extend({},h);return o;case"Character":return null;case"Day":var p=q.year;var n=q.month;var c;if(this.format.length==3){c=a.global.culture.calendar.days.namesAbbr}else{if(this.format.length>3){c=a.global.culture.calendar.days.names}else{c=null}}var e=q.day;if(c!=null){e=q.dayOfWeek+1}var d=a.jqx._jqxDateTimeInput.DateEditor._createDayEditor(q,q.day,1,q._daysInMonth(p,n),this.format.length==1?1:2,2,c,this);var o=a.extend({},d);return o;case"FORMAT_hh":var s=q.hour%12;if(s==0){s=12}var l=a.jqx._jqxDateTimeInput.NumberEditor._createNumberEditor(s,0,23,this.format.length==1?1:2,2,this);var o=a.extend({},l);return o;case"FORMAT_HH":var r=a.jqx._jqxDateTimeInput.NumberEditor._createNumberEditor(q.hour,0,23,this.format.length==1?1:2,2,this);var o=a.extend({},r);return o;case"Millisecond":var m=a.jqx._jqxDateTimeInput.NumberEditor._createNumberEditor(q.millisecond/this._itemValue(),0,this._maximumValue(),this.format.length,this.format.length,this);var o=a.extend({},m);return o;case"Minute":var g=a.jqx._jqxDateTimeInput.NumberEditor._createNumberEditor(q.minute,0,59,this.format.length==1?1:2,2,this);var o=a.extend({},g);return o;case"Month":var j;if(this.format.length==3){j=a.global.culture.calendar.months.namesAbbr}else{if(this.format.length>3){j=a.global.culture.calendar.months.names}else{j=null}}var b=a.jqx._jqxDateTimeInput.DateEditor._createMonthEditor(q.month,this.format.length==2?2:1,j,this);var o=a.extend({},b);return o;case"ReadOnly":return a.jqx._jqxDateTimeInput.DisabledEditor._create(this.format.length,q.day,this);case"Second":var f=a.jqx._jqxDateTimeInput.NumberEditor._createNumberEditor(q.second,0,59,this.format.length==1?1:2,2,this);var o=a.extend({},f);return o;case"Year":var k=a.jqx._jqxDateTimeInput.DateEditor._createYearEditor(q.year,this.format.length,this);var o=a.extend({},k);return o}return null},getDateTimeWithOffset:function(e,k){if(e==null||k==null){throw"Invalid arguments"}var h=k.hour;var d=k.minute;var j=k.second;var l=k.day();var c=k.month();var f=k.year();var m=k;var b=k;switch(this.type){case"FORMAT_AMPM":h=12*(e-h/12);break;case"Day":l=e-l;if(l!=e){if(e==29&&c==2){b=m;while(!DateTime._isLeapYear(b.year)){b=b._addYears(1)}b=b._addDays(e-b.day)}else{b=m._addMonths(1-m.month);b=b._addDays(e-m.day)}}break;case"FORMAT_hh":var g=e==12?0:e;m=m._addHours(g-(m.hour%12));break;case"FORMAT_HH":m=m._addHours(e-m.hour);break;case"Millisecond":m=m._addMilliseconds(e*this._itemValue()-m.millisecond);break;case"Minute":m=m._addMinutes(e-m.minute);break;case"Month":b=m._addMonths(e-m.month);if(e==2&&m.day==29&&m.day!=b.day){b=m;while(!m.IsLeapYear(b.year)){b=b._addYears(1)}b=b._addMonths(e-b.month)}m=b;break;case"ReadOnly":break;case"Second":m=m._addSeconds(e-m.second);break;case"Year":if(e==0){e=1}m=m._addYears(e-k.year);break}return m}})})(jQuery);(function(a){a.jqx._jqxDateTimeInput.DateEditor=a.extend(a.jqx._jqxDateTimeInput.DateEditor,{formatValueLength:0,handleYears:false,handleDays:false,handleMonths:false,positions:0,value:0,minEditPositions:0,maxEditPositions:0,minValue:0,maxValue:0,item:null,dateTimeFormatInfo:null,days:null,dateTimeMonths:null,lastDayInput:null,minPositions:function(){if(this.handleYears){if(this.formatValueLength==4){if(this.positions<=1){return 1}else{if(this.positions>=4){return 4}}return this.positions}else{return this.minEditPositions}}return this.minEditPositions},initializeFields:function(e,f,b,d,c){this.minValue=e;this.maxValue=f;this.minEditPositions=b;this.maxEditPositions=d;this.updateActiveEditor(e);this.item=c},_createYearEditor:function(d,c,b){a.jqx._jqxDateTimeInput.DateEditor=a.extend(true,{},this);this.initializeFields(c<=4?0:0,c<4?99:9999,(c==2)?2:1,c>3?4:2,b);this.initializeYearEditor(d,c,b.culture);this.handleYears=true;return this},initializeYearEditor:function(d,c,e){this.formatValueLength=c;this.dateTimeFormatInfo=e;var b=d;b=Math.min(b,9999);b=Math.max(b,1);b=this.formatValueLength<4?b%100:b;this.updateActiveEditor(b);this.value=b},updateActiveEditor:function(b){this.value=b;this.positions=0},_createDayEditor:function(h,b,f,g,j,d,c,e){a.jqx._jqxDateTimeInput.DateEditor=a.extend(true,{},this);this.initializeFields(f,g,1,d,e);this.currentValue=h;this.value=b;this.days=c;this.handleDays=true;return this},getDayOfWeek:function(b){if(typeof this.currentValue==a.jqx._jqxDateTimeInput.DateTime){this.currentValue.dayOfWeek()}return b},defaultTextValue:function(){var d=this.value;var e=this.minEditPositions;var b=e;var c=a.global.format(this.value,"d"+b,"");return c},textValue:function(){if(this.handleDays){if(this.days==null){return this.defaultTextValue()}else{var b=(this.value%7)+1;b=this.getDayOfWeek(b);return this.days[b]}}else{if(this.handleMonths){if(this.dateTimeMonths==null||this.value<1||this.value>12){return this.defaultTextValue()}else{return this.dateTimeMonths[this.value-1]}}}return this.defaultTextValue()},defaultInsertString:function(c){if(c==null){return this.deleteValue()}if(c.length==0){return this.deleteValue()}var g=c.substring(0,1);if(isNaN(g)){return}var e=true;var d;var b=1;var f=a.global.format(Number(this.value),"d"+this.maxEditPositions,this.culture);d=f;if(this.positions>=this.maxEditPositions){this.positions=0}d=d.substring(0,this.positions)+g+d.substring(this.positions+1);d=this.setValueByString(d,b);return true},setValueByString:function(d,b){d=this.fixValueString(d);var c=new Number(d);this.value=c;this.positions+=b;return d},fixValueString:function(b){if(b.length>this.maxEditPositions){b=b.substring(b.length-this.maxEditPositions)}return b},initializeValueString:function(c){var b;b="";if(this.hasDigits()){b=c}return b},deleteValue:function(){if(this.value==this.minValue&&this.hasDigits()==false){return false}this.updateActiveEditor(this.minValue);return true},hasDigits:function(){return this.positions>0},insert:function(b){if(this.handleDays){if(this.days!=null){var c=false;c=this.insertLongString(b,c);if(c){return c}c=this.insertShortString(b,c);if(c){return c}}if(this.value==1&&this.lastDayInput!=null&&this.lastDayInput.toString().length>0&&this.lastDayInput.toString()=="0"){this.value=0}this.lastDayInput=b;return this.defaultInsertString(b)}else{if(this.handleMonths){if(this.dateTimeMonths!=null){var c=false;c=this.insertLongString2(b,c);if(c){return c}c=this.insertShortString2(b,c);if(c){return c}}}}return this.defaultInsertString(b)},insertShortString:function(d,e){if(d.length==1){for(i=0;i<6;++i){var c=(this.value+i)%7+1;var b=this.days[c-1];if(b.substring(0,1)==d){this.updateActiveEditor(c);e=true;return e}}}return e},insertLongString:function(c,d){if(c.length>0){for(i=0;i<6;++i){var b=(this.value+i)%7+1;if(this.days[b-1]==c){this.updateActiveEditor(b);d=true;return d}}}return d},_createMonthEditor:function(d,c,b,e){a.jqx._jqxDateTimeInput.DateEditor=a.extend(true,{},this);this.initializeFields(1,12,c,2,e);this.dateTimeMonths=b;this.value=d;if(this.dateTimeMonths!=null&&this.dateTimeMonths[12]!=null&&this.dateTimeMonths[12].length>0){this.dateTimeMonths=null}this.handleMonths=true;return this},insertLongString2:function(b,c){if(b.length>0){for(i=0;i<11;++i){month=(this.value+i)%12+1;if(this.dateTimeMonths[month-1]==b){this.updateActiveEditor(month);c=true;return c}}}return c},insertShortString2:function(c,d){if(c.length==1){for(i=0;i<11;++i){var e=(this.value+i)%12+1;var b=this.dateTimeMonths[e-1];if(b.substring(0,1)==c){this.updateActiveEditor(e);d=true;return d}}}return d},correctMaximumValue:function(b){if(b>this.maxValue){b=this.minValue}return b},correctMinimumValue:function(b){if(b<this.minValue){b=this.maxValue}return b},increaseValue:function(e){var c=a.global.format(Number(this.value),"d"+this.maxEditPositions,this.culture);var f=c.toString()[this.positions];f=parseInt(f)+1;if(f>9){f=0}if(!e){var b=this.value+1;b=this.correctMaximumValue(b);this.updateActiveEditor(b);return true}var d=c.substring(0,this.positions)+f+c.substring(this.positions+1);if(d!=this.value||this.hasDigits()){this.updateActiveEditor(d);return true}else{return false}},decreaseValue:function(e){var c=a.global.format(Number(this.value),"d"+this.maxEditPositions,this.culture);var f=c.toString()[this.positions];f=parseInt(f)-1;if(f<0){f=9}if(!e){var b=this.value-1;b=this.correctMinimumValue(b);this.updateActiveEditor(b);return true}var d=c.substring(0,this.positions)+f+c.substring(this.positions+1);if(d!=this.value||this.hasDigits()){this.updateActiveEditor(d);return true}else{return false}},getDateTimeItem:function(){return this.item}})})(jQuery);(function(a){a.jqx._jqxDateTimeInput.NumberEditor={};a.extend(a.jqx._jqxDateTimeInput.NumberEditor,{formatValueLength:0,positions:0,value:0,minEditPositions:0,maxEditPositions:0,minValue:0,maxValue:0,item:null,minPositions:function(){if(this.handleYears){if(this.formatValueLength==4){if(this.positions<=1){return 1}else{if(this.positions>=4){return 4}}return this.positions}else{return this.minEditPositions}}return this.minEditPositions},_createNumberEditor:function(f,e,g,b,d,c){a.jqx._jqxDateTimeInput.NumberEditor=a.extend(true,{},this);this.initializeFields(e,g,b,d,c);return this},initializeFields:function(e,f,b,d,c){this.minValue=e;this.maxValue=f;this.minEditPositions=b;this.maxEditPositions=d;this.updateActiveEditor(e);this.item=c},updateActiveEditor:function(b){this.value=b;this.positions=0},getDayOfWeek:function(b){if(typeof this.currentValue==a.jqx._jqxDateTimeInput.DateTime){this.currentValue.dayOfWeek()}return b},textValue:function(){var d=this.value;var e=this.minEditPositions;var b=e;var c=a.global.format(this.value,"d"+b,"");return c},insert:function(c){if(c==null){return this.deleteValue()}if(c.length==0){return this.deleteValue()}var g=c.substring(0,1);if(isNaN(g)){return}var e=true;var d;var b=1;var f=a.global.format(Number(this.value),"d"+this.maxEditPositions,this.culture);d=f;if(this.positions>=this.maxEditPositions){this.positions=0}d=d.substring(0,this.positions)+g+d.substring(this.positions+1);d=this.setValueByString(d,b);return true},setValueByString:function(d,b){d=this.fixValueString(d);var c=new Number(d);this.value=c;this.positions+=b;return d},fixValueString:function(b){if(b.length>this.maxEditPositions){b=b.substring(b.length-this.maxEditPositions)}return b},initializeValueString:function(c){var b;b="";if(this.hasDigits()){b=c}return b},deleteValue:function(){if(this.value==this.minValue&&this.hasDigits()==false){return false}this.updateActiveEditor(this.minValue);return true},hasDigits:function(){return this.positions>0},correctMaximumValue:function(b){if(b>this.maxValue){b=this.minValue}return b},correctMinimumValue:function(b){if(b<this.minValue){b=this.maxValue}return b},increaseValue:function(e){var c=a.global.format(Number(this.value),"d"+this.maxEditPositions,this.culture);var f=c.toString()[this.positions];f=parseInt(f)+1;if(f>9){f=0}if(!e){var b=this.value+1;b=this.correctMaximumValue(b);this.updateActiveEditor(b);return true}var d=c.substring(0,this.positions)+f+c.substring(this.positions+1);if(d!=this.value||this.hasDigits()){this.updateActiveEditor(d);return true}else{return false}},decreaseValue:function(e){var c=a.global.format(Number(this.value),"d"+this.maxEditPositions,this.culture);var f=c.toString()[this.positions];f=parseInt(f)-1;if(f<0){f=9}if(!e){var b=this.value-1;b=this.correctMinimumValue(b);this.updateActiveEditor(b);return true}var d=c.substring(0,this.positions)+f+c.substring(this.positions+1);if(d!=this.value||this.hasDigits()){this.updateActiveEditor(d);return true}else{return false}},getDateTimeItem:function(){return this.item}})})(jQuery);(function(a){a.jqx._jqxDateTimeInput.DisabledEditor={};a.extend(a.jqx._jqxDateTimeInput.DisabledEditor,{_create:function(f,c,e,b,d){this.format=f;this.value=-1;this.item=d;return this},textValue:function(){return""},insert:function(b){return false},deleteValue:function(){return false},increaseValue:function(){return false},decreaseValue:function(){return false},getDateTimeItem:function(){return this.item}})})(jQuery);(function(a){a.jqx._jqxDateTimeInput.AmPmEditor={};a.extend(a.jqx._jqxDateTimeInput.AmPmEditor,{_createAmPmEditor:function(f,c,e,b,d){this.format=f;this.value=c;this.amString=e;this.pmString=b;this.item=d;if(e==b){this.amString="<"+e;this.pmString=">"+b}return this},textValue:function(){var b=this.amString;if(this.value!=0){b=this.pmString}if(this.format.length==1&&b.length>1){b=b.substring(0,1)}return b},insert:function(f){var d=f.toString();if(d.Length==0){return this.deleteValue()}var c=false;if(this.amString.Length>0&&this.pmString.Length>0){var g=amString[0];var b=d[0];var e=pmString[0];if(g.toString()==b.toString()){this.value=0;c=true}else{if(e.toString()==b.toString()){this.value=1;c=true}}}else{if(this.pmString.Length>0){this.value=1;c=true}else{if(this.amString.Length>0){this.value=0;c=true}}}return c},deleteValue:function(){var b=true;if(this.amString.Length==0&&this.pmString.Length!=0){if(this.value==0){return false}this.value=0}else{if(this.value==1){return false}this.value=1}return b},increaseValue:function(){this.value=1-this.value;return true},decreaseValue:function(){this.increaseValue();return true},getDateTimeItem:function(){return this.item}})})(jQuery);(function(a){a.jqx._jqxDateTimeInput.getDateTime=function(c){var b={dateTime:new Date(c),daysPer4Years:1461,daysPerYear:365,daysToMonth365:{0:0,1:31,2:59,3:90,4:120,5:151,6:181,7:212,8:243,9:273,10:304,11:334,12:365},daysToMonth366:{0:0,1:31,2:60,3:91,4:121,5:152,6:182,7:213,8:244,9:274,10:305,11:335,12:366},maxValue:3155378976000000000,millisPerDay:86400000,millisPerHour:3600000,millisPerMinute:60000,millisPerSecond:1000,minTicks:0,minValue:0,ticksPerDay:864000000000,ticksPerHour:36000000000,ticksPerMillisecond:10000,ticksPerMinute:600000000,ticksPerSecond:10000000,hour:c.getHours(),minute:c.getMinutes(),day:c.getDate(),second:c.getSeconds(),month:1+c.getMonth(),year:c.getFullYear(),millisecond:c.getMilliseconds(),dayOfWeek:c.getDay(),isWeekend:function(d){if(d==undefined||d==null){d=this.dateTime}var e=d.getDay()%6==0;return e},dayOfYear:function(e){if(e==undefined||e==null){e=this.dateTime}var d=new Date(e.getFullYear(),0,1);return Math.ceil((e-d)/86400000)},_setDay:function(d){if(d==undefined||d==null){d=0}this.dateTime.setDate(d);this.day=this.dateTime.getDate()},_setMonth:function(d){if(d==undefined||d==null){d=0}this.dateTime.setMonth(d-1);this.month=1+this.dateTime.getMonth()},_setYear:function(d){if(d==undefined||d==null){d=0}this.dateTime.setFullYear(d);this.year=this.dateTime.getFullYear()},_setHours:function(d){if(d==undefined||d==null){d=0}this.dateTime.setHours(d);this.hour=this.dateTime.getHours()},_setMinutes:function(d){if(d==undefined||d==null){d=0}this.dateTime.setMinutes(d);this.minute=this.dateTime.getMinutes()},_setSeconds:function(d){if(d==undefined||d==null){d=0}this.dateTime.setSeconds(d);this.seconds=this.dateTime.getSeconds()},_setMilliseconds:function(d){if(d==undefined||d==null){d=0}this.dateTime.setMilliseconds(d);this.millisecond=this.dateTime.getMilliseconds()},_addDays:function(e){var d=this.dateTime;d.setDate(d.getDate()+e);return d},_addWeeks:function(e){var d=this.dateTime;d.setDate(d.getDate()+7*e);return d},_addMonths:function(e){var d=this.dateTime;d.setMonth(d.getMonth()+e);return d},_addYears:function(e){var d=this.dateTime;d.setFullYear(d.getFullYear()+e);return d},_addHours:function(e){var d=this.dateTime;d.setHours(d.getHours()+e);return d},_addMinutes:function(e){var d=this.dateTime;d.setMinutes(d.getMinutes()+e);return d},_addSeconds:function(e){var d=this.dateTime;d.setSeconds(d.getSeconds()+e);return d},_addMilliseconds:function(e){var d=this.dateTime;d.setMilliseconds(d.getMilliseconds()+e);return d},_isLeapYear:function(d){if((d<1)||(d>9999)){throw"invalid year"}if((d%4)!=0){return false}if((d%100)==0){return((d%400)==0)}return true},_dateToTicks:function(f,h,e){if(((f>=1)&&(f<=9999))&&((h>=1)&&(h<=12))){var d=this._isLeapYear(f)?this.daysToMonth366:this.daysToMonth365;if((e>=1)&&(e<=(d[h]-d[h-1]))){var f=f-1;var g=((((((f*365)+(f/4))-(f/100))+(f/400))+d[h-1])+e)-1;return(g*864000000000)}}},_daysInMonth:function(e,f){if((f<1)||(f>12)){throw ("Invalid month.")}var d=this._isLeapYear(e)?this.daysToMonth366:this.daysToMonth365;return(d[f]-d[f-1])},_timeToTicks:function(d,g,e){var f=((d*3600)+(g*60))+e;return(f*10000000)},_equalDate:function(d){if(this.year==d.getFullYear()&&this.day==d.getDate()&&this.month==d.getMonth()+1){return true}return false}};return b}})(jQuery);