AdfRichUIPeer.createPeerClass(AdfRichUIPeer,"AdfDhtmlChooseDatePeer");AdfDhtmlChooseDatePeer.prototype.handleUpdateFromInputComponent=function(a,b,d){b==AdfDhtmlChooseDatePeer.SELECTED_DATE&&(null==d&&(d=this._getTodayDate(a,this.getDomElement())),this._queueGridRefresh(a,d.getMonth(),d.getFullYear()))};
AdfDhtmlChooseDatePeer.prototype.submitValueToInput=function(a,b){var d=this._getSelectedDateTime(a);null!=d&&AdfDhtmlInputChooseBindingUtils.updateInputComponentProperty(b,null,AdfUIValue.VALUE,d);AdfDhtmlInputChooseBindingUtils.returnToInputComponent(b,!0)};
AdfDhtmlChooseDatePeer.InitSubclass=function(){AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.CLICK_EVENT_TYPE,AdfUIInputEvent.KEY_DOWN_EVENT_TYPE,AdfValueChangeEvent.VALUE_CHANGE_TYPE);this._CHOOSE_MONTH_ID="mSel";this._YEAR_SPIN_ID="ys";this._NEXT_MONTH_ID="nm";this._PREV_MONTH_ID="pm";this._CAL_GRID_ID="cg";this._HOUR_SPIN_ID="hs";this._MIN_SPIN_ID="ms";this._SEC_SPIN_ID="ss";this._AMPM_ID="ap";this._TIMEZONE_ID="tz";this._TIMEZONE_DISPID_ID="tzDispId";this._CONTENT_ID="content";
this._INCREMENT_ID="increment";this._DECREMENT_ID="decrement";this._CURRDAY_ID_ATTR_NAME="data-afr-adfCDay";this._CURRMONTH_ID_ATTR_NAME="data-afr-adfCMonth";this._CURRYEAR_ID_ATTR_NAME="data-afr-adfCYear";this._DAY_ID_ATTR_NAME="data-afr-adfDay";this._SELECTED_DATE="data-afr-adfseld";this._SHOW_DATE="data-afr-adfshwd";this._TODAY_DATE="data-afr-adftdy";this._RANGE_START="data-afr-adfrs";this._RANGE_END="data-afr-adfre";this._ALLOW_TIME_SELECTION="data-afr-adfts";this._FIRST_DAY_OF_WEEK="data-afr-adffdow";
this._NUMBER_HOUR_DIGITS="data-afr-adfhh";this._NUMBER_MINUTE_DIGITS="data-afr-adfmm";this._NUMBER_SECOND_DIGITS="data-afr-adfss";this._SHOW_TIMEZONE="data-afr-adftz";this._SHOW_24_HOUR_FORMAT="data-afr-adf24";this._COUNT_ZERO_BASED="data-afr-adfcnt0";this._SHOW_AM_PM="data-afr-adfampm";this._SHOW_AM_PM_IN_2_ROWS="data-afr-adfampm2";this._CLIENT_TIME_ZONE="data-afr-adfctz";this._PARENT_ID="data-afr-par";this._LOCALE="data-afr-loc";this._IS_FETCH="data-afr-fetch";this._LEAD_ZERO="_adfLeadingZero";
this.THAI_BUDDHIST="th_TH";this._THAI_BUDDHIST_YEAR_OFFSET=543;this.SELECTED_DATE="selectedDate";this.TIMEZONE_SEL_DISPLAY="tzSelDisp";this.TIMEZONE_SEL_ID="tzSelId";this._SEL_DAY_CLASS="p_AFSelected";this._DISABLED_STYLE_CLASS="p_AFDisabled";this._MAX_CLIENT_RANGE_YEARS=6;this._DISABLED_DAYS_OF_WEEK_KEYS={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};this._DISABLED_MONTHS_KEYS={jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11}};
AdfDhtmlChooseDatePeer.prototype.InitDomElement=function(a,b){AdfDhtmlChooseDatePeer.superclass.InitDomElement.call(this,a,b);null!=a.getDisabledDays()&&(null==this._getClientRangeStartDate(a,b)&&null==this._getClientRangeEndDate(a,b))&&this._createOrUpdateClientStartAndEndRange(a,b,this._getShowDate(a,b));this.BindToComponent(a,this._renderChooseDateDom(a,b))};
AdfDhtmlChooseDatePeer.prototype.HandleComponentClick=function(a){var b=a.getNativeEventTarget(),d=a.getSource();a.isLeftButtonPressed()&&(this._isInCalendarGrid(b)?(a=this._getParentID(d,this.getDomElement())&&this._isInDialog(),this._selectDateInGrid(b,d,!a)):(a=AdfRichUIPeer.CreateSubId(d.getClientId(),AdfDhtmlChooseDatePeer._PREV_MONTH_ID),AdfDomUtils.isAncestorOrSelf(AdfAgent.AGENT.getElementById(a),b)?this._manipulateMonthValue(d,!1):(a=AdfRichUIPeer.CreateSubId(d.getClientId(),AdfDhtmlChooseDatePeer._NEXT_MONTH_ID),
AdfDomUtils.isAncestorOrSelf(AdfAgent.AGENT.getElementById(a),b)&&this._manipulateMonthValue(d,!0))))};
AdfDhtmlChooseDatePeer.prototype.HandleComponentKeyDown=function(a){var b=a.getNativeEvent(),d=AdfAgent.AGENT.getKeyCode(b),e=a.getSource(),f;if(!b.ctrlKey){b=a.getNativeEventTarget();switch(d){case AdfKeyStroke.ARROWUP_KEY:case AdfKeyStroke.ARROWDOWN_KEY:case AdfKeyStroke.ARROWRIGHT_KEY:case AdfKeyStroke.ARROWLEFT_KEY:this._isInCalendarGrid(b)&&(f=this._handleArrowKeys(d,b));break;case AdfKeyStroke.SPACE_KEY:if(this._isInCalendarGrid(b))f=!0,d=AdfRichUIPeer.CreateSubId(e.getClientId(),AdfDhtmlChooseDatePeer._HOUR_SPIN_ID),
AdfPage.PAGE.findComponent(d)&&(f=!1),this._selectDateInGrid(b,e,f),f=!0;else{d=AdfRichUIPeer.CreateSubId(e.getClientId(),AdfDhtmlChooseDatePeer._PREV_MONTH_ID);if(AdfDomUtils.isAncestorOrSelf(AdfAgent.AGENT.getElementById(d),b)){this._manipulateMonthValue(e,!1);return}d=AdfRichUIPeer.CreateSubId(e.getClientId(),AdfDhtmlChooseDatePeer._NEXT_MONTH_ID);if(AdfDomUtils.isAncestorOrSelf(AdfAgent.AGENT.getElementById(d),b)){this._manipulateMonthValue(e,!0);return}}break;case AdfKeyStroke.ENTER_KEY:this._isInCalendarGrid(b)&&
(this._selectDateInGrid(b,e,!0),f=!0)}if(f)return a.cancel(),!1}};AdfDhtmlChooseDatePeer.prototype.HandleComponentValueChange=function(a){var b=a.getSource().getClientId(),d=this.getComponent(),e=AdfRichUIPeer.CreateSubId(d.getClientId(),AdfDhtmlChooseDatePeer._CHOOSE_MONTH_ID);b==e?this._handleMonthChange(a):(d=AdfRichUIPeer.CreateSubId(d.getClientId(),AdfDhtmlChooseDatePeer._YEAR_SPIN_ID),b==d&&this._handleYearChange(a))};
AdfDhtmlChooseDatePeer.prototype.hardRefreshDOM=function(){var a=this.getComponent(),b=this.getDomElement();domNode=AdfAgent.AGENT.getElementById(a.getClientId());this.BindToComponent(a,this._renderChooseDateDom(a,b))};AdfDhtmlChooseDatePeer.prototype._getGridElement=function(){var a=this.getComponent(),a=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._CAL_GRID_ID);return AdfAgent.AGENT.getElementById(a)};
AdfDhtmlChooseDatePeer.prototype._getCurrentSelection=function(a){if(this.getDomElement().getAttribute(AdfDhtmlChooseDatePeer._CURRDAY_ID_ATTR_NAME)){var b=this._getGridElement().childNodes[0].childNodes;for(i=0;i<b.length;i++)if("TR"==AdfAgent.AGENT.getNodeName(b[i])){var d=b[i];for(j=0;j<d.childNodes.length;j++){var e=d.childNodes[j];if("TD"==AdfAgent.AGENT.getNodeName(e)&&AdfDomUtils.containsCSSClassName(e,AdfDhtmlChooseDatePeer._SEL_DAY_CLASS))return a&&AdfDomUtils.removeCSSClassName(e,AdfDhtmlChooseDatePeer._SEL_DAY_CLASS),
e}}}return null};
AdfDhtmlChooseDatePeer.prototype._handleArrowKeys=function(a,b){var d=null,e;switch(a){case AdfKeyStroke.ARROWUP_KEY:case AdfKeyStroke.ARROWDOWN_KEY:if(d=a==AdfKeyStroke.ARROWUP_KEY?AdfDomUtils.getPreviousElement(b.parentNode):AdfDomUtils.getNextElement(b.parentNode))e=AdfDomUtils.getElementPosition(b),d=AdfDomUtils.getChildElementByPosition(d,b.nodeType,e);break;case AdfKeyStroke.ARROWRIGHT_KEY:d=AdfDomUtils.getNextElement(b);!d&&null!=b.parentNode&&(e=AdfDomUtils.getNextElement(b.parentNode))&&(d=
AdfDomUtils.getFirstChildElement(e));break;case AdfKeyStroke.ARROWLEFT_KEY:d=AdfDomUtils.getPreviousElement(b),!d&&null!=b.parentNode&&(e=AdfDomUtils.getPreviousElement(b.parentNode))&&(d=AdfDomUtils.getLastChildElement(e))}return d&&this._isInCalendarGrid(d)?(b&&b.setAttribute("tabIndex","-1"),d.setAttribute("tabIndex","0"),AdfFocusUtils.focusElement(d),!0):!1};
AdfDhtmlChooseDatePeer.prototype._handleMonthChange=function(a){a=a.getSource();if(a._ignoreVCE)delete a._ignoreVCE;else{var b=a.getClientId(),b=b.substring(0,b.lastIndexOf("::")),b=AdfPage.PAGE.findComponent(b),d=b.getPeer();d.bind(b);var e=this._getShowDate(b,this.getDomElement());d._queueGridRefresh(b,parseInt(a.getValue()),e.getFullYear())}};
AdfDhtmlChooseDatePeer.prototype._handleYearChange=function(a){var b=a.getSource();if(b._ignoreVCE)delete b._ignoreVCE;else{a=b.getValue();var b=b.getClientId(),b=b.substring(0,b.lastIndexOf("::")),b=AdfPage.PAGE.findComponent(b),d=b.getPeer();d.bind(b);var e=this.getDomElement(),f=this._getShowDate(b,e);this._isThaiBuddistCalendar(b,e)&&(a-=AdfDhtmlChooseDatePeer._THAI_BUDDHIST_YEAR_OFFSET);d._queueGridRefresh(b,f.getMonth(),a)}};
AdfDhtmlChooseDatePeer.prototype._isInDialog=function(){return this.getComponent().getParent()instanceof AdfRichDialog};AdfDhtmlChooseDatePeer.prototype._isInCalendarGrid=function(a){return a&&"TD"==AdfAgent.AGENT.getNodeName(a)&&(a=parseInt(AdfAgent.AGENT.getTextContent(a)),!isNaN(a))?!0:!1};
AdfDhtmlChooseDatePeer.prototype._getSelectedDateTime=function(a){var b=this.getComponent(),d,e,f,g,h,k,l=this.getDomElement();if(l.getAttribute(AdfDhtmlChooseDatePeer._CURRMONTH_ID_ATTR_NAME))if(e=parseInt(l.getAttribute(AdfDhtmlChooseDatePeer._CURRMONTH_ID_ATTR_NAME)),f=parseInt(l.getAttribute(AdfDhtmlChooseDatePeer._CURRYEAR_ID_ATTR_NAME)),a)d=parseInt(AdfAgent.AGENT.getTextContent(a)),a.getAttribute(AdfDhtmlChooseDatePeer._DAY_ID_ATTR_NAME);else if(a=this._getCurrentSelection(!1))d=parseInt(AdfAgent.AGENT.getTextContent(a)),
a.getAttribute(AdfDhtmlChooseDatePeer._DAY_ID_ATTR_NAME);a=AdfRichUIPeer.CreateSubId(b.getClientId(),AdfDhtmlChooseDatePeer._HOUR_SPIN_ID);if(a=AdfPage.PAGE.findComponent(a))if(g=a.getValue(),h=AdfPage.PAGE.findComponent(AdfRichUIPeer.CreateSubId(b.getClientId(),AdfDhtmlChooseDatePeer._MIN_SPIN_ID)).getValue(),k=AdfPage.PAGE.findComponent(AdfRichUIPeer.CreateSubId(b.getClientId(),AdfDhtmlChooseDatePeer._SEC_SPIN_ID)).getValue(),a=AdfPage.PAGE.findComponent(AdfRichUIPeer.CreateSubId(b.getClientId(),
AdfDhtmlChooseDatePeer._AMPM_ID)))a=a.getValue(),12==g?"0"==a&&(g=0):"1"==a&&(g=+g+12);void 0!=f&&void 0!=e&&void 0!=d?(d=void 0!=g&&void 0!=h&&void 0!=k?new Date(f,e,d,g,h,k):new Date(f,e,d),d.setFullYear(f)):d=null;f=AdfRichUIPeer.CreateSubId(b.getClientId(),AdfDhtmlChooseDatePeer._TIMEZONE_ID);if(f=AdfPage.PAGE.findComponent(f))e=f.getPeer(),e.bind(f),e=e.getDomElement(),e=AdfDhtmlEditableValuePeer.getContentNode(f,e),f=e.value,e=AdfAgent.AGENT.getTextContent(e.options[e.selectedIndex]),AdfDhtmlInputChooseBindingUtils.updateInputComponentProperty(b,
null,AdfDhtmlChooseDatePeer.TIMEZONE_SEL_DISPLAY,e),AdfDhtmlInputChooseBindingUtils.updateInputComponentProperty(b,null,AdfDhtmlChooseDatePeer.TIMEZONE_SEL_ID,f);return d};
AdfDhtmlChooseDatePeer.prototype._manipulateMonthValue=function(a,b){var d=this.getDomElement(),e=this._getShowDate(a,d),f=e.getMonth(),e=e.getFullYear();b?f++:f--;var g=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._CHOOSE_MONTH_ID),g=AdfPage.PAGE.findComponent(g),h=0;0>f?(f+=12,h=-1):11<f&&(f-=12,h=1);if(h){var e=e+h,h=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._YEAR_SPIN_ID),h=AdfPage.PAGE.findComponent(h),k=h.getMaximum(),l=h.getMinimum();if(l&&e<l||k&&
e>k)return;h._ignoreVCE=!0;k=e;this._isThaiBuddistCalendar(a,d)&&(k+=AdfDhtmlChooseDatePeer._THAI_BUDDHIST_YEAR_OFFSET);h.setProperty("value",""+k)}g._ignoreVCE=!0;g.setProperty("value",""+(f+12)%12);this._queueGridRefresh(a,f,e)};
AdfDhtmlChooseDatePeer.prototype._queueGridRefresh=function(a,b,d){var e=AdfAgent.AGENT,f=this.getDomElement(),g=!1,h=new Date(this._getShowDate(a,this.getDomElement()).getTime());h.setDate(1);h.setMonth(b);h.setYear(d);this._setShowDate(a,f,h);b=this._getClientRangeStartDate(a,f);d=this._getClientRangeEndDate(a,f);if(null!=b&&null!=d&&(h<b||h>d))g=!0;if(g)this._queueAdfContentFetchEvent(a,h);else{g=e.getElementById(AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._CAL_GRID_ID));e.elementsRemoved(g);
day=e.getAttribute(f,AdfDhtmlChooseDatePeer._CURRDAY_ID_ATTR_NAME);b=e.getAttribute(f,AdfDhtmlChooseDatePeer._CURRMONTH_ID_ATTR_NAME);d=e.getAttribute(f,AdfDhtmlChooseDatePeer._CURRYEAR_ID_ATTR_NAME);var h=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._HOUR_SPIN_ID),k=AdfPage.PAGE.findComponent(h),l=h=0,m=0;if(k&&(h=k.getValue(),l=AdfPage.PAGE.findComponent(AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._MIN_SPIN_ID)).getValue(),m=AdfPage.PAGE.findComponent(AdfRichUIPeer.CreateSubId(a.getClientId(),
AdfDhtmlChooseDatePeer._SEC_SPIN_ID)).getValue(),k=AdfPage.PAGE.findComponent(AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._AMPM_ID))))k=k.getValue(),12==h?"0"==k&&(h=0):"1"==k&&(h=+h+12);a=this._buildCalendarDateMatrix(a,f,new Date(d,b,day,h,l,m));g.parentNode.replaceChild(a,g);e.elementsAdded(a)}};
AdfDhtmlChooseDatePeer.prototype._queueAdfContentFetchEvent=function(a,b){var d={};d.month=b.getMonth();d.year=b.getFullYear();var e=this.getDomElement();AdfAgent.AGENT.setAttribute(e,AdfDhtmlChooseDatePeer._IS_FETCH,"true");this._createOrUpdateClientStartAndEndRange(a,e,b);d=new AdfContentFetchEvent(a,AdfContentFetchEvent.FETCH_EVENT_TYPE,d);d.preventUserInput();d.queue()};
AdfDhtmlChooseDatePeer.prototype._createOrUpdateClientStartAndEndRange=function(a,b,d){d.setYear(d.getFullYear()-AdfDhtmlChooseDatePeer._MAX_CLIENT_RANGE_YEARS/2);d.setDate(1);this._setClientRangeStartDate(a,b,d);d.setYear(d.getFullYear()+AdfDhtmlChooseDatePeer._MAX_CLIENT_RANGE_YEARS);this._setClientRangeEndDate(a,b,d)};
AdfDhtmlChooseDatePeer.prototype._selectDateInGrid=function(a,b,d){AdfAssert.assert(null!=a);var e=b.getClientId(),f=this.getDomElement();if(!AdfDomUtils.containsCSSClassName(a,AdfDhtmlChooseDatePeer._DISABLED_STYLE_CLASS)){this._getCurrentSelection(!0);AdfDomUtils.addCSSClassName(a,AdfDhtmlChooseDatePeer._SEL_DAY_CLASS);var g=parseInt(AdfAgent.AGENT.getTextContent(a)),h=AdfPage.PAGE.findComponent(AdfRichUIPeer.CreateSubId(e,AdfDhtmlChooseDatePeer._CHOOSE_MONTH_ID)).getValue(),e=AdfPage.PAGE.findComponent(AdfRichUIPeer.CreateSubId(e,
AdfDhtmlChooseDatePeer._YEAR_SPIN_ID)).getValue(),e=this._isThaiBuddistCalendar(b,f)?e-AdfDhtmlChooseDatePeer._THAI_BUDDHIST_YEAR_OFFSET:e,k=a.getAttribute(AdfDhtmlChooseDatePeer._DAY_ID_ATTR_NAME);k&&(k==AdfDhtmlChooseDatePeer._PREV_MONTH_ID?(h--,-1==h&&(h=11,e--)):k==AdfDhtmlChooseDatePeer._NEXT_MONTH_ID&&(h++,12==h&&(h=0,e++)));f.setAttribute(AdfDhtmlChooseDatePeer._CURRDAY_ID_ATTR_NAME,g);f.setAttribute(AdfDhtmlChooseDatePeer._CURRMONTH_ID_ATTR_NAME,h);f.setAttribute(AdfDhtmlChooseDatePeer._CURRYEAR_ID_ATTR_NAME,
e);!0==d&&this.submitValueToInput(a,b)}};
AdfDhtmlChooseDatePeer.prototype._renderChooseDateDom=function(a,b){var d=AdfAgent.AGENT,e=AdfPage.PAGE.getLookAndFeel(),f=a.getClientId(),g=AdfAgent.AGENT.getElementById(f);this._childComponents=[];var h=d.getAttribute(b,AdfDhtmlChooseDatePeer._SELECTED_DATE),k=null!=h?AdfDhtmlChooseDatePeer._getISOStandardConverter().getAsObject(h):this._getTodayDate(a,b),h=this._getShowDate(a,b);if(null!=d.getAttribute(b,AdfDhtmlChooseDatePeer._IS_FETCH))return b.removeAttribute(AdfDhtmlChooseDatePeer._IS_FETCH),g=
d.getElementById(AdfRichUIPeer.CreateSubId(f,AdfDhtmlChooseDatePeer._CAL_GRID_ID)),k=this._buildCalendarDateMatrix(a,b,k),g.parentNode.replaceChild(k,g),d.elementsAdded(k),b;var l=this._getClientRangeStartDate(a,b),m=this._getClientRangeEndDate(a,b),n=!0;if(null!=a.getDisabledDays()&&null!=h&&(null!=l&&null!=m&&(h<l||h>m)||null==l&&null==m))this._queueAdfContentFetchEvent(a,h),n=!1;n&&b.removeAttribute(AdfDhtmlChooseDatePeer._SELECTED_DATE);e=this._createElementWithAttributes("table",{role:"group",
cellpadding:"0",cellspacing:"0",border:"0",summary:"","class":e.getStyleClass("af|chooseDate"),id:f,"data-afr-adfCDay":k.getDate(),"data-afr-adfCMonth":k.getMonth(),"data-afr-adfCYear":k.getFullYear()});l=b.attributes;for(f=0;f<l.length;f++)h=d.getAttribute(e,l[f].name),null==h&&d.setAttribute(e,l[f].name,d.getAttribute(b,l[f].name));h=this._createAndAppendElement("tbody",{},e);h.appendChild(this._buildHeaderDOM(a,b));h.appendChild(this._buildWallCalendarDOM(a,b,k));this._allowTimeSelection(a,b)&&
(h.appendChild(this._buildTimeSelectionDOM(a,b,k)),this._allowTimeZoneSelection(a,b)&&h.appendChild(this._buildTimeZoneSelectionDOM(a,b)));k=[AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._HOUR_SPIN_ID),AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._MIN_SPIN_ID),AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._SEC_SPIN_ID)];for(f in k)if(h=d.getElementById(k[f]))h.setAttribute(AdfDhtmlChooseDatePeer._LEAD_ZERO,!0),h=AdfRichUIPeer.CreateSubId(k[f],
AdfDhtmlChooseDatePeer._CONTENT_ID),h=AdfAgent.AGENT.getElementById(h),l=h.value,AdfAssert.assertString(l),l=parseFloat(l),isNaN(l)||9<l||(l="0"+l,"INPUT"==h.tagName?(h.value=l,h.title=l):AdfAgent.AGENT.setTextContent(h,l));d.elementsRemoved(g);g.parentNode.replaceChild(e,g);d.elementsAdded(e);AdfPage.PAGE.addComponents.apply(AdfPage.PAGE,this._childComponents);delete this._childComponents;return e};
AdfDhtmlChooseDatePeer.prototype._buildHeaderDOM=function(a,b){var d=AdfPage.PAGE.getLookAndFeel(),e=a.getClientId(),f=this._getLocaleSymbols(a,b).getMonths().slice(0,12),g=this._createElementWithAttributes("tr",{}),h=this._createAndAppendElement("td",{"class":d.getStyleClass("af|chooseDate::month-year-row"),align:"center",colspan:7},g),h=this._createAndAppendElement("table",{cellpadding:"0",cellspacing:"0",border:"0",summary:"",role:"presentation"},h),h=this._createAndAppendElement("tbody",{},h),
h=this._createAndAppendElement("tr",{},h),k=this._createAndAppendElement("td",{"class":d.getStyleClass("af|chooseDate::prev-month-arrow-cell")},h),l=d.getTranslatedString("af_chooseDate.TIP_PREVIOUS_MONTH");this._createAndAppendElement("a",{role:"button","aria-label":l,href:"#",onclick:"this.focus(); return false","class":d.getStyleClass("af|chooseDate::prev-month-arrow"),id:AdfRichUIPeer.CreateSubId(e,AdfDhtmlChooseDatePeer._PREV_MONTH_ID),title:l},k);for(var k=this._createAndAppendElement("td",
{},h),l=[],m=0;m<f.length;m++){var n={};n[m]=f[m];l.push(n)}f=this._getShowDate(a,b);l=this._buildSelectOneChoiceElement(AdfRichUIPeer.CreateSubId(e,AdfDhtmlChooseDatePeer._CHOOSE_MONTH_ID),d.getStyleClass("af|chooseDate::choice-list-content"),d.getTranslatedString("af_chooseDate.LABEL_SELECT_MONTH"),l,f.getMonth());k.appendChild(l);k=this._createAndAppendElement("td",{"class":d.getStyleClass("af|chooseDate::year-selector-cell")},h);f=f.getFullYear()+(this._isThaiBuddistCalendar(a,b)?AdfDhtmlChooseDatePeer._THAI_BUDDHIST_YEAR_OFFSET:
0);f=this._buildNumberSpinboxElement(AdfRichUIPeer.CreateSubId(e,AdfDhtmlChooseDatePeer._YEAR_SPIN_ID),f,1,9999,4,d.getTranslatedString("af_chooseDate.LABEL_SELECT_YEAR"));k.appendChild(f);h=this._createAndAppendElement("td",{"class":d.getStyleClass("af|chooseDate::next-month-arrow-cell")},h);f=d.getTranslatedString("af_chooseDate.TIP_NEXT_MONTH");this._createAndAppendElement("a",{role:"button","aria-label":f,href:"#",onclick:"this.focus();return false","class":d.getStyleClass("af|chooseDate::next-month-arrow"),
id:AdfRichUIPeer.CreateSubId(e,AdfDhtmlChooseDatePeer._NEXT_MONTH_ID),title:f},h);return g};AdfDhtmlChooseDatePeer.prototype._buildWallCalendarDOM=function(a,b,d){var e=this._createElementWithAttributes("tr",{});this._createAndAppendElement("td",{},e).appendChild(this._buildCalendarDateMatrix(a,b,d));return e};
AdfDhtmlChooseDatePeer.prototype._buildCalendarDateMatrix=function(a,b,d){var e=AdfPage.PAGE.getLookAndFeel(),f=a.getClientId(),g=this._getShowDate(a,b),h=g.getMonth(),g=g.getFullYear(),k=this._getLocaleSymbols(a,b).getMonths(),f=this._createElementWithAttributes("table",{role:"grid",cellpadding:"0",cellspacing:"0",border:"0",width:"100%","aria-label":k[h]+" "+(g+(this._isThaiBuddistCalendar(a,b)?AdfDhtmlChooseDatePeer._THAI_BUDDHIST_YEAR_OFFSET:0)),id:AdfRichUIPeer.CreateSubId(f,AdfDhtmlChooseDatePeer._CAL_GRID_ID),
"class":e.getStyleClass("af|chooseDate::calendar-grid"),"data-afr-par":this._getParentID(a,b)}),k=this._createAndAppendElement("tbody",{},f);k.appendChild(this._buildWallCalendarGridHeader(a,b));var l=(new Date(g,h,1)).getDay(),m=this._getDaysInMonth(g,h),n=(l-this._getFirstDayOfTheWeek(a,b)+7)%7,m=Math.ceil((n+m)/7),l={0:"p_AFFirst"};l[m-1]="p_AFLast";var n=new Date(g,h,1-n,0,0,0,0),p=n.getMonth(),q=n.getDate(),r,s;d.getFullYear()==g&&(q=s=d.getDate(),p=r=d.getMonth());for(d=0;d<m;d++)g=this._buildCalendarGridRow(a,
e.getStyleClass("af|chooseDate::days-row")+(l[d]?" "+l[d]:""),n,h,p,q,r,s,b),k.appendChild(g);return f};
AdfDhtmlChooseDatePeer.prototype._buildWallCalendarGridHeader=function(a,b){for(var d=AdfPage.PAGE.getLookAndFeel(),e=this._getLocaleSymbols(a,b),f=e.getWeekdays(),e=e.getShortWeekdays(),g=this._createElementWithAttributes("tr",{role:"row","class":d.getStyleClass("af|chooseDate::week-header-row")}),h=this._getFirstDayOfTheWeek(a,b),k=0;7>k;k++){var l=(h+k)%7;this._createAndAppendElement("th",{"class":d.getStyleClass("af|chooseDate::week-header-cell"),role:"columnheader",scope:"col","aria-label":f[l]},
g).textContent=e[l]}return g};
AdfDhtmlChooseDatePeer.prototype._buildCalendarGridRow=function(a,b,d,e,f,g,h,k,l){var m=AdfPage.PAGE.getLookAndFeel();l=this._getTodayDate(a,l);var m={"-1":m.getStyleClass("af|chooseDate::prev-month-day"),0:m.getStyleClass("af|chooseDate::regular-day"),1:m.getStyleClass("af|chooseDate::next-month-day")},n={"-1":AdfDhtmlChooseDatePeer._PREV_MONTH_ID,1:AdfDhtmlChooseDatePeer._NEXT_MONTH_ID};b=this._createElementWithAttributes("tr",{role:"row","class":b});for(var p=0;7>p;p++){var q=d.getDate(),r=d.getMonth(),
s=this._isDisabled(a,d),r=this._createAndAppendElement("td",{role:"gridcell","aria-disabled":s?!0:void 0,tabindex:r==f&&q==g?0:-1,"class":this._getDayStyle(a,m,d,e,l,h,k,s)},b),s=d.getMonth()-e;1<s?s=-1:-1>s&&(s=1);(s=n[s])&&r.setAttribute(AdfDhtmlChooseDatePeer._DAY_ID_ATTR_NAME,s);r.textContent=q;d.setDate(d.getDate()+1)}return b};
AdfDhtmlChooseDatePeer.prototype._buildTimeSelectionDOM=function(a,b,d){var e=AdfPage.PAGE.getLookAndFeel(),f=this._createElementWithAttributes("tr",{}),e=this._createAndAppendElement("td",{"class":e.getStyleClass("af|chooseDate::time-selectors-row")},f),e=this._createAndAppendElement("table",{cellpadding:"0",cellspacing:"0",border:"0",summary:"",role:"presentation"},e),e=this._createAndAppendElement("tbody",{},e),g=this._buildHHMMSSSelectionRow(a,b,d);e.appendChild(g);if(!this._is24HourFormat(a,
b)&&this._allowAMPMSelection(a,b)){var h=this._showAMPMInTwoRows(a,b);a=this._buildAMPMButtonsRow(a,b,d,h);h?e.appendChild(a):g.appendChild(a)}return f};
AdfDhtmlChooseDatePeer.prototype._buildHHMMSSSelectionRow=function(a,b,d){var e=AdfPage.PAGE.getLookAndFeel(),f=this._createElementWithAttributes("tr",{}),g=this._createAndAppendElement("td",{},f),h=this._is24HourFormat(a,b),k=this._isHourZeroBased(a,b),l=h?0:0+(k?0:1),k=h?23:11+(k?0:1),m=h?d.getHours():d.getHours()%12;!h&&0==m&&(m=12);h=this._buildNumberSpinboxElement(AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._HOUR_SPIN_ID),m,l,k,this._getHourDigitCount(a,b),e.getTranslatedString("af_chooseDate.LABEL_SELECT_HOURS"));
g.appendChild(h);this._createAndAppendElement("td",{"class":e.getStyleClass("af|chooseDate::time-separator")},f).textContent=":";g=this._createAndAppendElement("td",{},f);h=this._buildNumberSpinboxElement(AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._MIN_SPIN_ID),d.getMinutes(),0,59,this._getMinuteDigitCount(a,b),e.getTranslatedString("af_chooseDate.LABEL_SELECT_MINUTES"));g.appendChild(h);this._createAndAppendElement("td",{"class":e.getStyleClass("af|chooseDate::time-separator")},
f).textContent=":";g=this._createAndAppendElement("td",{},f);a=this._buildNumberSpinboxElement(AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._SEC_SPIN_ID),d.getSeconds(),0,59,this._getSecondDigitCount(a,b),e.getTranslatedString("af_chooseDate.LABEL_SELECT_SECONDS"));g.appendChild(a);return f};
AdfDhtmlChooseDatePeer.prototype._buildAMPMButtonsRow=function(a,b,d,e){b=AdfPage.PAGE.getLookAndFeel();var f;e?(e=this._createElementWithAttributes("tr",{}),f=this._createAndAppendElement("td",{colspan:"3"},e)):f=e=this._createElementWithAttributes("td",{});a=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlChooseDatePeer._AMPM_ID);f=this._createAndAppendElement("div",{id:a,"class":b.getStyleClass("af|chooseDate::ampm")},f);f=this._createAndAppendElement("div",{id:AdfRichUIPeer.CreateSubId(a,"content"),
name:a,"class":b.getStyleClass("af|chooseDate::ampm-content")},f);var g=this._createAndAppendElement("span",{"class":b.getStyleClass("af|chooseDate::ampm-content-input")},f);this._createAndAppendElement("input",{type:"radio",name:a,id:a+":_0",value:"0","class":b.getStyleClass("af|selectOneRadio::native-input"),accesskey:"",checked:12>d.getHours()?"":void 0,onclick:"this.focus()"},g).checked=12>d.getHours();this._createAndAppendElement("label",{"for":a+":_0","class":b.getStyleClass("af|chooseDate::ampm-item-text")},
f).textContent="AM";g=this._createAndAppendElement("span",{"class":b.getStyleClass("af|chooseDate::ampm-content-input")},f);this._createAndAppendElement("input",{type:"radio",name:a,id:a+":_1",value:"1","class":b.getStyleClass("af|selectOneRadio::native-input"),accesskey:"",checked:12<=d.getHours()?"":void 0,onclick:"this.focus()"},g).checked=12<=d.getHours();this._createAndAppendElement("label",{"for":a+":_1","class":b.getStyleClass("af|chooseDate::ampm-item-text")},f).textContent="PM";d=new AdfRichSelectOneRadio(a,
{simple:!0,layout:"horizontal"},1);this._childComponents.push(d);return e};
AdfDhtmlChooseDatePeer.prototype._buildTimeZoneSelectionDOM=function(a,b){var d=AdfPage.PAGE.getLookAndFeel(),e=this._getClientTimeZone(a,b),f=AdfPage.PAGE.findComponent(this._getParentID(a,b)).getTimeZoneList(),g=AdfDhtmlChooseDatePeer._getTimeZones(f,e),e=this._createElementWithAttributes("tr",{}),f=this._createAndAppendElement("td",{"class":d.getStyleClass("af|chooseDate::timezone-selectors-row"),colspan:"0"},e),h=this._getSelectedTimeZone(a,b),d=this._buildSelectOneChoiceElement(AdfRichUIPeer.CreateSubId(a.getClientId(),
AdfDhtmlChooseDatePeer._TIMEZONE_ID),d.getStyleClass("af|chooseDate::timezone-list-content"),d.getTranslatedString("af_chooseDate.LABEL_SELECT_TIMEZONE"),g,h);f.appendChild(d);return e};
AdfDhtmlChooseDatePeer.prototype._buildSelectOneChoiceElement=function(a,b,d,e,f){var g=AdfPage.PAGE.getLookAndFeel(),h=AdfRichUIPeer.CreateSubId(a,"content");e=this._buildSelectOneChoiceOptions(e,f);b={node:"span",id:a,"class":g.getStyleClass("af|chooseDate::choice-list"),children:[{node:"select",id:h,name:a,"class":b,title:e.title,children:e.optionsArray},{node:"label","for":h,"class":"p_OraHiddenLabel","text-content":d}]};a=new AdfRichSelectOneChoice(a,{simple:!0},1);this._childComponents.push(a);
return this._buildDomFromStructure(b)};AdfDhtmlChooseDatePeer.prototype._buildSelectOneChoiceOptions=function(a,b){for(var d={optionsArray:[],title:""},e=0;e<a.length;e++){var f=Object.keys(a[e])[0],g=a[e][f],h={node:"option",value:f};b==f&&(h.selected="",d.title=g);h.title=g;h["text-content"]=g;d.optionsArray[e]=h}return d};
AdfDhtmlChooseDatePeer.prototype._buildNumberSpinboxElement=function(a,b,d,e,f,g){var h=AdfPage.PAGE.getLookAndFeel(),k=AdfRichUIPeer.CreateSubId(a,AdfDhtmlChooseDatePeer._INCREMENT_ID),l=AdfRichUIPeer.CreateSubId(a,AdfDhtmlChooseDatePeer._DECREMENT_ID),m=AdfRichUIPeer.CreateSubId(a,"content"),n=new TrNumberConverter(null,"number",null,null,!1,!0,!1,null,null,null,null,null,f,null,null,null);b={node:"div",id:a,"class":h.getStyleClass("af|chooseDate::spinbox"),_adfinc:k,_adfdec:l,children:[{node:"table",
cellpadding:0,cellspacing:0,border:0,summary:"",role:"presentation",children:[{node:"tbody",children:[{node:"tr",children:[{node:"td",children:[{node:"input",id:m,name:a,style:"text-align: right;width:auto;","class":h.getStyleClass("af|chooseDate::spinbox-content"),size:f,autocomplete:"off",type:"text",value:n.getAsString(b),role:"spinbutton","aria-valuemax":e,"aria-valuemin":d,title:b},{node:"label","for":m,"class":"p_OraHiddenLabel","text-content":g}]},{node:"td",children:[{node:"div","class":h.getStyleClass("af|chooseDate::increment-cell"),
children:[{node:"a",role:"button",tabindex:"-1","class":h.getStyleClass("af|chooseDate::spinbox-incrementor-icon-style"),id:k,title:h.getTranslatedString("af_inputNumberSpinbox.TIP_INCREMENT")}]},{node:"div","class":h.getStyleClass("af|chooseDate::decrement-cell"),children:[{node:"a",role:"button",tabindex:"-1","class":h.getStyleClass("af|chooseDate::spinbox-decrementor-icon-style"),id:l,title:h.getTranslatedString("af_inputNumberSpinbox.TIP_DECREMENT")}]}]}]}]}]}]};a=new AdfRichInputNumberSpinbox(a,
{minimum:d,maximum:e,converter:n},1);this._childComponents.push(a);return this._buildDomFromStructure(b)};AdfDhtmlChooseDatePeer.prototype._buildDomFromStructure=function(a){var b=AdfAgent.AGENT,d=this._createElementWithAttributes(a.node,{}),e;for(e in a)switch(e){case "children":for(var f=a[e],g=0;g<f.length;g++)d.appendChild(this._buildDomFromStructure(f[g]));break;case "text-content":d.textContent=a[e];break;case "node":break;default:b.setAttribute(d,e,a[e])}return d};
AdfDhtmlChooseDatePeer.prototype._getDaysInMonth=function(a,b){return 32-(new Date(a,b,32)).getDate()};
AdfDhtmlChooseDatePeer.prototype._getDayStyle=function(a,b,d,e,f,g,h,k){a=AdfPage.PAGE.getLookAndFeel();var l="";d.getYear()==f.getYear()&&d.getMonth()==f.getMonth()&&d.getDate()==f.getDate()?l=a.getStyleClass("af|chooseDate::today"):(e=d.getMonth()-e,1<e?e=-1:-1>e&&(e=1),l=b[e]);k?l+=" "+AdfDhtmlChooseDatePeer._DISABLED_STYLE_CLASS:h&&(d.getMonth()==g&&d.getDate()==h)&&(l+=" "+AdfDhtmlChooseDatePeer._SEL_DAY_CLASS);return l};
AdfDhtmlChooseDatePeer.prototype._isDisabled=function(a,b){var d=AdfDhtmlChooseDatePeer._getISOStandardConverter(),e=this._resetTimePart(d.getAsObject(a.getMinValue()),!1);if(null!=e&&b<e)return!0;e=this._resetTimePart(d.getAsObject(a.getMaxValue()),!0);if(null!=e&&b>e)return!0;e=a.getDisabledMonths();if(null!=e)for(var e=Object.keys(e),f=0;f<e.length;f++)if(b.getMonth()==AdfDhtmlChooseDatePeer._DISABLED_MONTHS_KEYS[e[f]])return!0;e=a.getDisabledDaysOfWeek();if(null!=e){e=Object.keys(e);for(f=0;f<
e.length;f++)if(b.getDay()==AdfDhtmlChooseDatePeer._DISABLED_DAYS_OF_WEEK_KEYS[e[f]])return!0}e=a.getDisabledDays();if(null!=e)for(f=0;f<e.length;f++)if(b.getTime()==this._resetTimePart(d.getAsObject(e[f]),!1).getTime())return!0;return!1};AdfDhtmlChooseDatePeer.prototype._resetTimePart=function(a,b){null!=a&&(a.setHours(b?23:0),a.setMinutes(b?59:0),a.setSeconds(b?59:0),a.setMilliseconds(b?999:0));return a};
AdfDhtmlChooseDatePeer.prototype._createAndAppendElement=function(a,b,d){AdfAssert.assert(null!=d);a=this._createElementWithAttributes(a,b);d.appendChild(a);return a};AdfDhtmlChooseDatePeer.prototype._createElementWithAttributes=function(a,b){AdfAssert.assertNonEmptyString(a);var d=document.createElement(a);AdfDomUtils.writeAttributesToElement(d,b);return d};AdfDhtmlChooseDatePeer.prototype._getParentID=function(a,b){AdfAssert.assert(null!=b);return AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._PARENT_ID)};
AdfDhtmlChooseDatePeer.prototype._getShowDate=function(a,b){AdfAssert.assert(null!=b);var d=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._SHOW_DATE);return null!=d?AdfDhtmlChooseDatePeer._getISOStandardConverter().getAsObject(d):this._getTodayDate(a,b)};
AdfDhtmlChooseDatePeer.prototype._getTodayDate=function(a,b){AdfAssert.assert(null!=b);var d=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._TODAY_DATE);return null!=d?AdfDhtmlChooseDatePeer._getISOStandardConverter().getAsObject(d):new Date};AdfDhtmlChooseDatePeer.prototype._setShowDate=function(a,b,d){AdfAssert.assert(null!=b);AdfAgent.AGENT.setAttribute(b,AdfDhtmlChooseDatePeer._SHOW_DATE,AdfDhtmlChooseDatePeer._getISOStandardConverter().getAsString(d))};
AdfDhtmlChooseDatePeer.prototype._getClientRangeStartDate=function(a,b){AdfAssert.assert(null!=b);var d=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._RANGE_START);return null!=d?AdfDhtmlChooseDatePeer._getISOStandardConverter().getAsObject(d):null};AdfDhtmlChooseDatePeer.prototype._setClientRangeStartDate=function(a,b,d){AdfAssert.assert(null!=b);AdfAgent.AGENT.setAttribute(b,AdfDhtmlChooseDatePeer._RANGE_START,AdfDhtmlChooseDatePeer._getISOStandardConverter().getAsString(d))};
AdfDhtmlChooseDatePeer.prototype._getClientRangeEndDate=function(a,b){AdfAssert.assert(null!=b);var d=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._RANGE_END);return null!=d?AdfDhtmlChooseDatePeer._getISOStandardConverter().getAsObject(d):null};AdfDhtmlChooseDatePeer.prototype._setClientRangeEndDate=function(a,b,d){AdfAssert.assert(null!=b);AdfAgent.AGENT.setAttribute(b,AdfDhtmlChooseDatePeer._RANGE_END,AdfDhtmlChooseDatePeer._getISOStandardConverter().getAsString(d))};
AdfDhtmlChooseDatePeer.prototype._getFirstDayOfTheWeek=function(a,b){AdfAssert.assert(null!=b);var d=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._FIRST_DAY_OF_WEEK);return null!=d?parseInt(d)-1:0};AdfDhtmlChooseDatePeer.prototype._allowTimeSelection=function(a,b){AdfAssert.assert(null!=b);return null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._ALLOW_TIME_SELECTION)};
AdfDhtmlChooseDatePeer.prototype._getHourDigitCount=function(a,b){AdfAssert.assert(null!=b);var d=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._NUMBER_HOUR_DIGITS);return null!=d?parseInt(d):1};AdfDhtmlChooseDatePeer.prototype._is24HourFormat=function(a,b){AdfAssert.assert(null!=b);return null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._SHOW_24_HOUR_FORMAT)};
AdfDhtmlChooseDatePeer.prototype._allowAMPMSelection=function(a,b){AdfAssert.assert(null!=b);return null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._SHOW_AM_PM)};AdfDhtmlChooseDatePeer.prototype._showAMPMInTwoRows=function(a,b){AdfAssert.assert(null!=b);return null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._SHOW_AM_PM_IN_2_ROWS)};
AdfDhtmlChooseDatePeer.prototype._getMinuteDigitCount=function(a,b){AdfAssert.assert(null!=b);var d=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._NUMBER_MINUTE_DIGITS);return null!=d?parseInt(d):1};AdfDhtmlChooseDatePeer.prototype._getSecondDigitCount=function(a,b){AdfAssert.assert(null!=b);var d=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._NUMBER_SECOND_DIGITS);return null!=d?parseInt(d):1};
AdfDhtmlChooseDatePeer.prototype._allowTimeZoneSelection=function(a,b){AdfAssert.assert(null!=b);return null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._SHOW_TIMEZONE)};AdfDhtmlChooseDatePeer.prototype._isHourZeroBased=function(a,b){AdfAssert.assert(null!=b);return null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._COUNT_ZERO_BASED)};AdfDhtmlChooseDatePeer.prototype._getClientTimeZone=function(a,b){AdfAssert.assert(null!=b);return AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._CLIENT_TIME_ZONE)};
AdfDhtmlChooseDatePeer.prototype._getSelectedTimeZone=function(a,b){AdfAssert.assert(null!=b);var d=this._getParentID(a,b),d=AdfRichUIPeer.CreateSubId(d,AdfDhtmlChooseDatePeer._TIMEZONE_DISPID_ID);return AdfAgent.AGENT.getElementById(d).value};AdfDhtmlChooseDatePeer.prototype._isThaiBuddistCalendar=function(a,b){AdfAssert.assert(null!=b);return AdfAgent.AGENT.getAttribute(b,AdfDhtmlChooseDatePeer._LOCALE)==AdfDhtmlChooseDatePeer.THAI_BUDDHIST};
AdfDhtmlChooseDatePeer.prototype._getLocaleSymbols=function(a,b){var d=AdfPage.PAGE,e=null,f=this._getParentID(a,b);if(f&&(f=d.findComponent(f))&&f.getConverter)(f=f.getConverter())&&(e=f.getLocaleSymbols());e||(e=getLocaleSymbols(d.getLocaleContext().getLocale()));return e};
AdfDhtmlChooseDatePeer._getTimeZones=function(a,b){if(a){for(var d="",e=-1,f={},g=!1,h=AdfRichTimeZoneTranslations.getTimeZoneTranslations(),k=[],d=0;d<h.length;d++)k[d]=Object.keys(h[d])[0];b&&(-1!=a.indexOf(b)?g=!0:(d=h[k.indexOf(b)][b],e=AdfDhtmlChooseDatePeer._getMinutesFromTimeZoneValue(d),f[b]=d));for(var l=[],m=a.length+(b&&!g?1:0),n=0,d=0;d<m&&n<a.length;d++){var p={},q=a[n];n++;var r=k.indexOf(q);-1!=r&&(p[q]=h[r][q],b&&!g&&AdfDhtmlChooseDatePeer._getMinutesFromTimeZoneValue(p[q])>e&&(l[d]=
f,d++,g=!0),l[d]=p)}b&&!g&&(l[m-1]=f);return l}return AdfDhtmlChooseDatePeer._getDefaultTimeZones(b)};
AdfDhtmlChooseDatePeer._getDefaultTimeZones=function(a){var b=AdfRichTimeZoneTranslations.getTimeZoneTranslations(),d=!1,e=[];if(AdfDhtmlChooseDatePeer._CACHED_COMMON_TIMEZONES)e=AdfDhtmlChooseDatePeer._CACHED_COMMON_TIMEZONES;else{for(var f=0;f<b.length&&"true"==b[f].common;f++)delete b[f].common,e[f]=b[f],b[f][Object.keys(b[f])]==a&&(d=!0);AdfDhtmlChooseDatePeer._CACHED_COMMON_TIMEZONES=e}if(!a)return e;e=e.slice(0);if(!d){for(var g=-1,h,k,f=e.length-1;f<b.length;f++)if(Object.keys(b[f])[0]==a){h=
b[f][a];k=AdfDhtmlChooseDatePeer._getMinutesFromTimeZoneValue(h);break}for(f=0;f<e.length;f++){if(Object.keys(e[f])[0]==a){d=!0;break}if(AdfDhtmlChooseDatePeer._getMinutesFromTimeZoneValue(e[f][Object.keys(e[f])[0]])>k){g=f;break}}d||(-1==g&&(g=e.length),h&&(b={},b[a]=h,e.splice(g,0,b)))}return e};
AdfDhtmlChooseDatePeer._getMinutesFromTimeZoneValue=function(a){a=a.match("[+-][0-9]{2}:[0-9]{2}")[0];var b=parseInt(a.match("[0-9]{2}")),d=parseInt(a.match("(?![0-9]{2}:)[0-9]{2}"));return a=parseInt(a[0]+(60*b+d))};AdfDhtmlChooseDatePeer._getISOStandardConverter=function(){AdfDhtmlChooseDatePeer.ISO_STANDARD_CONVERTER||(AdfDhtmlChooseDatePeer.ISO_STANDARD_CONVERTER=new TrDateTimeConverter("yyyy-MM-dd HH:mm:ss",null,null,null,null));return AdfDhtmlChooseDatePeer.ISO_STANDARD_CONVERTER};