AdfRichUIPeer.createPeerClass(AdfRichUIPeer,"AdfDhtmlCalendarPeer",!1);
AdfDhtmlCalendarPeer.prototype.InitDomElement=function(a,b){AdfDhtmlCalendarPeer.superclass.InitDomElement.call(this,a,b);this._splitterid=a.getClientId()+AdfDhtmlCalendarPeer._NAMING_SEP+AdfDhtmlCalendarPeer._SPLITTER_COMPONENT_ID;if(AdfDomUtils.isInVisibleSubtree(b)){this._restoreScrollPosition(a,b);this._deferredFromInitDOM=!1;var d=AdfAgent.AGENT.getElementById(this._splitterid);if(d)d.style.top=d.parentNode.firstChild.offsetHeight+"px";else if(d=this._getProviderGridElement(a))d.children[1].style.top=
d.firstChild.offsetHeight+"px"}else this._deferredFromInitDOM=!0;this._nextZIndex=10;null!=a.getDropTarget()&&null==a.getDragSource()&&(d=new AdfCalendarDragSource(AdfDnDContext.ACTION_MOVE,AdfDnDContext.ACTION_MOVE),a.setDragSource(d));this._isBusy=!1;this._currentActivityId=null;AdfDhtmlCalendarPeer._initFlexListSizeBreakpoints();AdfDhtmlCalendarPeer._initProviderGroupingSizeBreakpoints()};
AdfDhtmlCalendarPeer.prototype.BindToComponent=function(a,b){AdfDhtmlCalendarPeer.superclass.BindToComponent.call(this,a,b);var d=AdfPage.PAGE,e=d.getLookAndFeel(),f=a.getClientId()+AdfDhtmlCalendarPeer._NAMING_SEP+AdfDhtmlCalendarPeer._DATE_RANGE_TOOLBAR_ITEM_ID;if(f=AdfAgent.AGENT.getElementById(f))e=e.getTranslatedString(AdfDhtmlCalendarPeer._CAL_CURRENT_ACTIVITY_DISPLAY_RANGE_ANNOUNCE_MSG,f.innerHTML),d.announceToAssistiveTechnology(e);if(a.getProperty(AdfDhtmlCalendarPeer._VIEW_KEY)==AdfDhtmlCalendarPeer._VIEW_WEEK){d=
a.getClientId();e=null;for(f=0;null==e&&7>f;f++)e=this._getAllDayActFocus(d,f,AdfDhtmlCalendarPeer._CAL_WEEK_FOCUS_FIRST_ALLDAY);e&&e.setAttribute("tabIndex","0")}};AdfDhtmlCalendarPeer.prototype.ComponentRemoved=function(a){this._saveScrollAndSplitterPosition(a);this._killCalendarActivityMouseTimeout();AdfDhtmlCalendarPeer.superclass.ComponentRemoved.call(this,a)};
AdfDhtmlCalendarPeer.InitSubclass=function(){AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.MOUSE_DOWN_EVENT_TYPE,AdfUIInputEvent.CLICK_EVENT_TYPE,AdfUIInputEvent.DOUBLE_CLICK_EVENT_TYPE,AdfActionEvent.ACTION_EVENT_TYPE,AdfUIInputEvent.KEY_UP_EVENT_TYPE,AdfUIInputEvent.KEY_DOWN_EVENT_TYPE,AdfComponentEvent.CONTEXT_MENU_EVENT_TYPE,AdfUIInputEvent.MOUSE_IN_EVENT_TYPE);this._CALENDAR_ACTIVITY_KEY="_adfAct";this._CALENDAR_ACTIVITY_ALL_DAY_KEY="_adfActAD";this._CALENDAR_ACTIVITY_DURATION_KEY=
"_adfActDu";this._CALENDAR_DAY_KEY="_adfDay";this._CALENDAR_DAY_CELL_KEY="_adfDyCl";this._CALENDAR_ACTIVE_DATE_KEY="_adfActive";this._CALENDAR_TIME_SLOT_KEY="_adfTm";this._RESIZE_TIME_INDICATOR_KEY="_adfRi";this._RESIZE_All_DAY_INDICATOR_KEY="_adfRiAD";this._KILL_HOVER_INDICATOR_KEY="_adfNoHov";this._ALL_DAY_DURATION_TEXT_KEY="_adDurtxt";this._ALL_DAY_HEADER_TEXT_KEY="_adHdtxt";this._HAS_CALENDAR_DAY_LINK="_adfcdl";this._TIME_ACTIVITY_COLUMN_KEY="_adfTmAtCm";this._SCROLL_DAY_KEY="scrDay";this._SCROLL_LIST_KEY=
"scrList";this._SCROLL_START_HOUR="stHr";this._ALL_DAY_CONTAINER_SUB_ID="allDayC";this._SPLITTER_COMPONENT_ID="_adfCalSp";this._DATE_RANGE_TOOLBAR_ITEM_ID="_adfCalDR";this._START_HOUR_SUBID_KEY="startHour";this._FACET_ID_ACTIVITY_HOVER="_adfIdAH";this._FACET_ID_ACTIVITY_DETAIL="_adfIdATL";this._FACET_ID_ACTIVITY_CONTEXT_MENU="_adfIdACM";this._FACET_ID_ACTIVITY_DELETE="_adfIdAD";this._FACET_ID_CREATE="_adfIdC";this._FACET_ID_CONTEXT_MENU="_adfIdCM";this._MONTH_MORE_LINK_TEXT="_adfCalMLT";this._VIEW_KEY=
"view";this._VIEW_DAY="day";this._VIEW_WEEK="week";this._VIEW_MONTH="month";this._VIEW_LIST="list";this._TIME_SLOTS_PER_HOUR="timeSlotsPerHour";this._SCROLL_DAY_HEIGHT="scrDayHeight";this._ALLDAY="ALLDAY";this._TIME="TIME";this._DURATION="DURATION";this._VIEW_BUTTON_ID_DAY="_adfCalDV";this._VIEW_BUTTON_ID_WEEK="_adfCalWV";this._VIEW_BUTTON_ID_MONTH="_adfCalMV";this._VIEW_BUTTON_ID_LIST="_adfCalLV";this._DATE_BUTTON_ID_TODAY="_adfCalTD";this._DATE_BUTTON_ID_PREVIOUS="_adfCalPD";this._DATE_BUTTON_ID_NEXT=
"_adfCalND";this._EVENT_TRIGGER_MOUSE="MOUSE";this._EVENT_TRIGGER_FOCUS="FOCUS";this._EVENT_TRIGGER_KEY="KEY";this._EVENT_TRIGGER_HOVER="HOVER";this._EVENT_TRIGGER_CONTEXT_MENU="CONTEXT_MENU";this._EVENT_BUTTON_NONE="NONE";this._EVENT_BUTTON_LEFT="LEFT";this._EVENT_BUTTON_MIDDLE="MIDDLE";this._EVENT_BUTTON_RIGHT="RIGHT";this._MONTH_GRID_ID="mg";this._MONTH_HEADER_ID="mh";this._CAL_MONTH_OVERFLOW_LINK="ol";this._CAL_MONTH_TIMED_ACTIVITY_WRAPPER="taw";this._CAL_MONTH_OVERFLOW_LINK_CLASS="af|calendar::month-overflow-link";
this._CAL_MONTH_OVERFLOW_LINK_WRAPPER_CLASS="af|calendar::month-overflow-link-wrapper";this._CAL_MONTH_NUM_OVERFLOW="no";this._CAL_MONTH_OVERFLOW_LINK_TEXT="af_calendar.LABEL_OVERFLOW";this._CAL_MONTH_OVERFLOW_LINK_LABEL="af_calendar.TIP_MORE_ACTIVITIES";this._CAL_CURRENT_ACTIVITY_DISPLAY_RANGE_ANNOUNCE_MSG="af_calendar.TIP_CURRENT_ACTIVITY_DISPLAY_RANGE_ANNOUNCE_MSG";this._MONTH_ROW_ID="_adfCalMR";this._CAL_PROVIDER_CONTAINER="af|calendar::provider-container";this._CALENDAR_WEEK_TIMED_ACTIVITIES_CELL_SUB_ID=
"tact";this._CALENDAR_WEEK_HEADER_SUB_ID="wh";this._CALENDAR_DAY_HEADER_SUB_ID="dh";this._DAY_HEADER_WRAPPER_SUB_ID="dhw";this._DAY_HEADER_PROVIDER_SUB_ID="dhp";this._WEEK_HEADER_SUB_ID="wh";this._WEEK_HEADER_WRAPPER_SUB_ID="whw";this._WEEK_HEADER_PROVIDER_SUB_ID="whp";this._CAL_WEEK_FOCUS_FIRST_ALLDAY=0;this._CAL_WEEK_FOCUS_LAST_ALLDAY=1;this._CAL_WEEK_FOCUS_PREV_ALLDAY=2;this._CAL_WEEK_FOCUS_NEXT_ALLDAY=3;this._CAL_ACT_COL_NUM="arc";this._CAL_ACT_ROW_NUM="arw";this._DROP_TARGET_CLASS="p_AFDropTarget";
this._DRAG_SOURCE_CLASS="p_AFDragSource";this._DRAG_END_CLASS="p_AFDragEnd";this._MOVEABLE_CLASS="p_AFMoveable";this._AUTOSCROLL_MARGIN=20;this._PADDING_AFTER_ALL_DAY_ACTIVITIES=15;this._NAMING_SEP=":";this._MONTH_VIEW_ALLDAY_HT="af|calendar-tr-month-all-day-activity-height";this._CAL_SIZE_STATE_PREFIX="p_AFCalendarSize";this._CAL_SIZE_SM_STATE=this._CAL_SIZE_STATE_PREFIX+"Sm";this._CAL_SIZE_MD_STATE=this._CAL_SIZE_STATE_PREFIX+"Md";this._CAL_SIZE_LG_STATE=this._CAL_SIZE_STATE_PREFIX+"Lg";this._CAL_SIZE_XL_STATE=
this._CAL_SIZE_STATE_PREFIX+"Xl";this._CAL_SIZE_STATE_LENGTH=this._CAL_SIZE_XL_STATE.length;this._CAL_SIZE_SM_SKIN_PROPERTY="af|calendar-tr-flexList-size-sm";this._CAL_SIZE_MD_SKIN_PROPERTY="af|calendar-tr-flexList-size-md";this._CAL_SIZE_LG_SKIN_PROPERTY="af|calendar-tr-flexList-size-lg";this._CAL_PROV_GRP_SIZE_SM_SKIN_PROPERTY="af|calendar-tr-provider-grouping-size-sm";this._CAL_PROV_GRP_SIZE_MD_SKIN_PROPERTY="af|calendar-tr-provider-grouping-size-md";this._CAL_PROV_GRP_SIZE_LG_SKIN_PROPERTY="af|calendar-tr-provider-grouping-size-lg";
this._CALENDAR_PROVIDER_GRID_SUB_ID="proGrid";this._CALENDAR_PROVIDER_CONTAINER_SUB_ID="prdrs";this._CALENDAR_PROVIDER_ID_EXPANDO="data-afr-pid"};
AdfDhtmlCalendarPeer.prototype.HandleComponentContextMenu=function(a){var b=a.getNativeEventTarget();if(b){var d=this.getDomElement(),e=this._getParentActivity(d,b);e&&d!=e?this._isBusyWithDifferentActivity(e)?a.cancel():this._handleActivityContextMenu(a,d,e,!1):(e=this._getComponentEventSource(a),this._queueCalendarEvent(e,a,d,b,null,0,AdfDhtmlCalendarPeer._EVENT_BUTTON_NONE,AdfDhtmlCalendarPeer._EVENT_TRIGGER_CONTEXT_MENU)&&this._showContextMenu(e,d,a,AdfDhtmlCalendarPeer._FACET_ID_CONTEXT_MENU))}};
AdfDhtmlCalendarPeer.prototype.HandleComponentMouseDown=function(a){var b=a.getNativeEventTarget(),d=AdfAgent.AGENT;delete this._eatMouseClick;var e=d.getAttribute(b,AdfDhtmlCalendarPeer._RESIZE_TIME_INDICATOR_KEY),b=d.getAttribute(b,AdfDhtmlCalendarPeer._RESIZE_All_DAY_INDICATOR_KEY);a.isLeftButtonPressed()&&(e||b)&&(this._hideActivityHoverPopup(),e?this._handleTimeResizeIndicatorMouseDown(a):this._handleAlldayResizeIndicatorMouseDown(a),a.cancel(),a.stopBubbling(),this._eatMouseClick=!0)};
AdfDhtmlCalendarPeer.prototype.HandleComponentMouseOver=function(a){var b=this.getDomElement(),d=this.getComponent(),e=a.getNativeEventTarget(),f=this._getParentActivity(b,e);this._changeCursorForMovableActivity(d,f);var g=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._FACET_ID_ACTIVITY_HOVER);if(g){var h=!1;1==e.nodeType&&"IMG"==e.tagName&&(h=!0);h||(h=this._getParentWithAttr(f,e,AdfDhtmlCalendarPeer._KILL_HOVER_INDICATOR_KEY));if(h)this._killCalendarActivityMouseTimeout();else if(f&&b!=f){var f=
f.id,h=this._calendarActivityMouseId,k=this._calendarActivityMouseTimeout;k&&h&&h!=f&&this._killCalendarActivityMouseTimeout();null!=k||this._resizedActivity||this._draggedActivity||(g=d.findComponent(g),null!=h&&h==f&&g.isPopupVisible()||(this._calendarActivityMouseId=f,d=d.getClientId(),b=null!=this._getParentWithAttr(b,e,AdfDhtmlCalendarPeer._TIME_ACTIVITY_COLUMN_KEY),a={componentId:d,activityRootId:f,mousePosition:{x:a.getPageX(),y:a.getPageY()},isInTimeRegion:b},this._calendarActivityMouseTimeout=
page.scheduleTimer(this,this._onMouseOverTimeout,a,1E3)))}else null!=this._calendarActivityMouseId&&this._killCalendarActivityMouseTimeout()}};AdfDhtmlCalendarPeer.prototype.HandleComponentClick=function(a){this._eatMouseClick||this._handleClickEvents(a,1)};AdfDhtmlCalendarPeer.prototype.HandleComponentDblClick=function(a){this._handleClickEvents(a,2)};
AdfDhtmlCalendarPeer.prototype.HandleComponentKeyDown=function(a){var b=a.getNativeEvent(),d=b.keyCode;if(AdfKeyStroke.ENTER_KEY==d||AdfKeyStroke.M_KEY==d){var e=this.getDomElement(),f=this.getComponent(),g=a.getNativeEventTarget(),h=this._getParentActivity(e,g);if(h&&e!=h)this._isBusyWithDifferentActivity(h)||(AdfKeyStroke.M_KEY==d&&b.ctrlKey&&b.altKey?this._handleActivityContextMenu(a,e,h,!0):AdfKeyStroke.ENTER_KEY==d&&(a=a.getKeyStroke(),this._queueCalendarActivityEvent(f,h,a,0,AdfDhtmlCalendarPeer._EVENT_BUTTON_NONE,
AdfDhtmlCalendarPeer._EVENT_TRIGGER_KEY),this._launchPopupFacet(f,AdfDhtmlCalendarPeer._FACET_ID_ACTIVITY_DETAIL)));else if(h=this._getDisplayChangeElement(e,g))this._hideActivityHoverPopup(),h=AdfAgent.AGENT.getAttribute(h,AdfDhtmlCalendarPeer._CALENDAR_DAY_KEY),AdfCalendarDisplayChangeEvent.queue(f,h,AdfDhtmlCalendarPeer._VIEW_DAY)}};
AdfDhtmlCalendarPeer.prototype.HandleComponentKeyUp=function(a){var b=this.getDomElement(),d=a.getNativeEventTarget(),e=this._getParentActivity(b,d),f=this.getComponent(),g=f.getProperty(AdfDhtmlCalendarPeer._VIEW_KEY),h=this.getComponent(),k=a.getKeyStroke(),l=a.getKeyCode(),m;if(this._isInProviderGroupingMode(f)&&this._isActivityGridContainerChild(f,d))if(null!=AdfAgent.AGENT.getAttribute(d,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_KEY))m=AdfAgent.AGENT.getAttribute(d.parentNode,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO);
else if(!e&&d.parentNode)for(e=d.parentNode,f=AdfRichUIPeer.CreateSubId(h.getClientId(),AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_CONTAINER_SUB_ID);f!=e.id&&!(m=AdfAgent.AGENT.getAttribute(e,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO));)e=e.parentNode;if(e&&b!=e){if(!this._isBusyWithDifferentActivity(e)&&AdfKeyStroke.ENTER_KEY!=l&&AdfKeyStroke.SHIFT_KEY!=l){if(AdfKeyStroke.TAB_KEY==l||AdfKeyStroke.ARROWDOWN_KEY==l||AdfKeyStroke.ARROWUP_KEY==l||AdfKeyStroke.ARROWRIGHT_KEY==l||AdfKeyStroke.ARROWLEFT_KEY==
l){if(g==AdfDhtmlCalendarPeer._VIEW_MONTH)return this._handleKeyUpForMonth(l,e,a);if(g==AdfDhtmlCalendarPeer._VIEW_WEEK)return this._handleKeyUpForWeek(l,e,a,m);if(g==AdfDhtmlCalendarPeer._VIEW_DAY)return this._handleKeyUpForDay(l,e,a,m);if(g==AdfDhtmlCalendarPeer._VIEW_LIST)return this._handleKeyUpForList(l,e,a)}this._queueCalendarActivityEvent(h,e,k,0,AdfDhtmlCalendarPeer._EVENT_BUTTON_NONE,AdfDhtmlCalendarPeer._EVENT_TRIGGER_KEY);AdfKeyStroke.DELETE_KEY==l&&this._launchPopupFacet(h,AdfDhtmlCalendarPeer._FACET_ID_ACTIVITY_DELETE)}}else if(null!=
AdfAgent.AGENT.getAttribute(d,AdfDhtmlCalendarPeer._CALENDAR_DAY_KEY))return g==AdfDhtmlCalendarPeer._VIEW_DAY?this._handleKeyUpForDay(l,d,m):g==AdfDhtmlCalendarPeer._VIEW_WEEK?this._handleKeyUpForWeek(l,d,m):g==AdfDhtmlCalendarPeer._VIEW_MONTH?this._handleKeyUpForMonth(l,d):g==AdfDhtmlCalendarPeer._VIEW_LIST?this._handleKeyUpForList(l,d):!1};
AdfDhtmlCalendarPeer.prototype.HandleComponentAction=function(a){var b=this.getComponent(),d=b.getClientId(),e=this._getComponentEventSource(a).getClientId();d+AdfDhtmlCalendarPeer._NAMING_SEP+AdfDhtmlCalendarPeer._VIEW_BUTTON_ID_DAY==e?this._actionToDisplayChange(a,b,AdfDhtmlCalendarPeer._VIEW_DAY):d+AdfDhtmlCalendarPeer._NAMING_SEP+AdfDhtmlCalendarPeer._VIEW_BUTTON_ID_WEEK==e?this._actionToDisplayChange(a,b,AdfDhtmlCalendarPeer._VIEW_WEEK):d+AdfDhtmlCalendarPeer._NAMING_SEP+AdfDhtmlCalendarPeer._VIEW_BUTTON_ID_MONTH==
e?this._actionToDisplayChange(a,b,AdfDhtmlCalendarPeer._VIEW_MONTH):d+AdfDhtmlCalendarPeer._NAMING_SEP+AdfDhtmlCalendarPeer._VIEW_BUTTON_ID_LIST==e?this._actionToDisplayChange(a,b,AdfDhtmlCalendarPeer._VIEW_LIST):d+AdfDhtmlCalendarPeer._NAMING_SEP+AdfDhtmlCalendarPeer._DATE_BUTTON_ID_TODAY==e?this._actionToDisplayChange(a,b,null,AdfCalendarDisplayChangeEvent.DATE_TODAY):d+AdfDhtmlCalendarPeer._NAMING_SEP+AdfDhtmlCalendarPeer._DATE_BUTTON_ID_NEXT==e?this._actionToDisplayChange(a,b,null,AdfCalendarDisplayChangeEvent.DATE_NEXT):
d+AdfDhtmlCalendarPeer._NAMING_SEP+AdfDhtmlCalendarPeer._DATE_BUTTON_ID_PREVIOUS==e&&this._actionToDisplayChange(a,b,null,AdfCalendarDisplayChangeEvent.DATE_PREVIOUS)};AdfDhtmlCalendarPeer.prototype.IsBusy=function(a){return this._isBusy};AdfDhtmlCalendarPeer.prototype.SetBusy=function(a){this._isBusy=a};AdfDhtmlCalendarPeer.prototype.handleMonthOverflowLinkClick=function(){return!1};
AdfDhtmlCalendarPeer.prototype.needsResizeNotify=function(){var a=this.getComponent().getProperty(AdfDhtmlCalendarPeer._VIEW_KEY);if(a==AdfDhtmlCalendarPeer._VIEW_MONTH||a==AdfDhtmlCalendarPeer._VIEW_DAY||a==AdfDhtmlCalendarPeer._VIEW_WEEK||a==AdfDhtmlCalendarPeer._VIEW_LIST)return!0};
AdfDhtmlCalendarPeer.prototype.resizeNotify=function(a,b,d,e,f){var g=this.getComponent().getProperty(AdfDhtmlCalendarPeer._VIEW_KEY);b!=e&&(g==AdfDhtmlCalendarPeer._VIEW_LIST?AdfDhtmlCalendarPeer._adjustViewSizeState(this.getDomElement(),e):!this._isInProviderGroupingMode(a)||g!=AdfDhtmlCalendarPeer._VIEW_WEEK&&g!=AdfDhtmlCalendarPeer._VIEW_DAY||AdfDhtmlCalendarPeer._adjustProviderGroupingViewSizeState(this.getDomElement(),e));this._normalizeProviderGroupDimensions(a);if(f!=d&&(g==AdfDhtmlCalendarPeer._VIEW_DAY||
g==AdfDhtmlCalendarPeer._VIEW_WEEK?(this._resizeTopRegion(d,f),this._resizeBottomRegion(d,f)):g==AdfDhtmlCalendarPeer._VIEW_MONTH&&this._resizeMonthGrid(d,f),this._deferredFromInitDOM))if(this._restoreScrollPosition(a,this.getDomElement()),this._deferredFromInitDOM=!1,b=AdfAgent.AGENT.getElementById(this._splitterid))b.style.top=b.parentNode.firstChild.offsetHeight+"px";else if(a=this._getProviderGridElement(a))a.children[1].style.top=a.firstChild.offsetHeight+"px"};
AdfDhtmlCalendarPeer.prototype.showActivityPopup=function(a,b,d){var e=this.getComponent();a=e.findComponent(a);e=e.getClientId();if(b=AdfAgent.AGENT.getElementById(e+"::"+b+"::"+d))d={},d[AdfDhtmlPopupHints.ALIGN_ELEMENT]=b,d[AdfRichPopup.HINT_ALIGN]=AdfRichPopup.ALIGN_AFTER_START,d[AdfDhtmlPopupHints.AUTODISMISS]=AdfDhtmlPopupHints.AUTODISMISS_MOUSEOUT,d[AdfDhtmlPopupHints.AUTODISMISS_MOUSEOUT_ID]=b,a.show(d)};
AdfDhtmlCalendarPeer.prototype.getActivityForEvent=function(a){if(this._resizedActivity)return null;var b=a.getNativeEventTarget(),d=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._RESIZE_TIME_INDICATOR_KEY);d||(d=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._RESIZE_All_DAY_INDICATOR_KEY));if(d)return null;d=this.getComponent();b=d.getProperty(AdfDhtmlCalendarPeer._VIEW_KEY);if(b==AdfDhtmlCalendarPeer._VIEW_LIST)return null;var e=a.getNativeEventTarget();a=this.getDomElement();var e=this._getParentActivity(a,
e),f=null!=e&&null!=AdfAgent.AGENT.getAttribute(e,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_DURATION_KEY),d=-1==d.getShowActivityTypes().indexOf(AdfDhtmlCalendarPeer._TIME);return b==AdfDhtmlCalendarPeer._VIEW_DAY&&f&&d?null:e&&a!=e?(b=this._getProviderAndActivityIdFromElement(e),d=null!=AdfAgent.AGENT.getAttribute(e,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_ALL_DAY_KEY),new AdfCalendarActivity(b.providerId,b.activityId,d)):null};
AdfDhtmlCalendarPeer.prototype.getDragNodeForActivity=function(a,b){var d=this.getComponent(),e=AdfAgent.AGENT;this._hideActivityHoverPopup();d=d.getClientId()+"::"+b.getProviderId()+"::"+b.getActivityId();(d=e.getElementById(d))||(d=this._getParentActivity(this.getDomElement(),a.getNativeEventTarget()));this._draggedActivity=d;var f=d.cloneNode(!0);e.copyStyle(d,f);e=f.style;e.left=e.top="0px";e.height=d.clientHeight+"px";var g=null,h=null;if(b.isAllDay())for(var g=f.getElementsByTagName("span"),
k=g.length,l=0;l<k;l++){var m=g[l];if(null!=m.getAttribute(AdfDhtmlCalendarPeer._ALL_DAY_DURATION_TEXT_KEY)){h=m;break}}null!=h?this._resizeDragNodeForAllDayActivity(d,e,g,h):e.width=d.clientWidth+"px";AdfDomUtils.addCSSClassName(d,AdfDhtmlCalendarPeer._DRAG_SOURCE_CLASS);return f};AdfDhtmlCalendarPeer.prototype.dragDropEnd=function(a,b){var d=this._draggedActivity;d&&(b==AdfDnDContext.ACTION_NONE&&AdfDomUtils.removeCSSClassName(d,AdfDhtmlCalendarPeer._DRAG_SOURCE_CLASS),this._draggedActivity=null)};
AdfDhtmlCalendarPeer.prototype.getDragOffsetForActivity=function(a,b){var d=AdfAgent.AGENT,e=this.getComponent().getClientId()+"::"+b.getProviderId()+"::"+b.getActivityId();(e=d.getElementById(e))||(e=this._getParentActivity(this.getDomElement(),a.getNativeEventTarget()));e=d.getElementPosition(e);d=d.getMousePosition(a.getNativeEvent());xOffset=d.x-e.x;yOffset=d.y-e.y;return{x:xOffset,y:yOffset}};
AdfDhtmlCalendarPeer.prototype.getDropSiteAndDataFromHints=function(a,b,d,e){AdfAssert.assertNumber(b);AdfAssert.assertNumber(d);AdfAssert.assert(null!=e);var f=e[AdfCalendarDropTarget.HINT_LAST_DROP_SITE],g=e[AdfCalendarDropTarget.HINT_LAST_DROP_SITE_DATA];if(f&&g){var h=g.bounds;AdfAssert.assertObject(h);if(b>=h.left&&d>=h.top&&b<=h.right&&d<=h.bottom){e[AdfCalendarDropTarget.HINT_DROP_SITE]=f;e[AdfCalendarDropTarget.HINT_DROP_SITE_DATA]=g;return}}this._getDropSiteAndData(a,b,d,e)};
AdfDhtmlCalendarPeer.prototype.showDragFeedback=function(a,b,d,e,f,g,h,k,l){f!=b&&(null!=f&&(AdfAssert.assertObject(g),AdfAssert.assertDomElement(g.domElement),AdfDomUtils.removeCSSClassName(g.domElement,AdfDhtmlCalendarPeer._DROP_TARGET_CLASS),g.siteDayCell&&AdfDomUtils.removeCSSClassName(g.siteDayCell,AdfDhtmlCalendarPeer._DROP_TARGET_CLASS)),null!=b&&(AdfAssert.assertObject(d),AdfAssert.assertDomElement(d.domElement),AdfDomUtils.addCSSClassName(d.domElement,AdfDhtmlCalendarPeer._DROP_TARGET_CLASS),
d.siteDayCell&&AdfDomUtils.addCSSClassName(d.siteDayCell,AdfDhtmlCalendarPeer._DROP_TARGET_CLASS)))};
AdfDhtmlCalendarPeer.prototype._normalizeProviderGroupDimensions=function(a){if(this._isInProviderGroupingMode(a)){for(var b=AdfAgent.AGENT,d=a.getClientId(),e=AdfRichUIPeer.CreateSubId(d,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_CONTAINER_SUB_ID),e=b.getElementById(e),f=AdfDomUtils.getChildElements(e),g=0,h={},k=0;k<f.length;k++){var l=f[k],m=b.getAttribute(l,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO);h[m]=Math.round(l.getBoundingClientRect().height);g=Math.max(g,Math.round(l.getBoundingClientRect().width))}providerHeaderSubid=
a.getView()==AdfDhtmlCalendarPeer._VIEW_DAY?AdfDhtmlCalendarPeer._DAY_HEADER_PROVIDER_SUB_ID:AdfDhtmlCalendarPeer._WEEK_HEADER_PROVIDER_SUB_ID;k=AdfRichUIPeer.CreateSubId(d,providerHeaderSubid);k=AdfAgent.AGENT.getElementById(k);g=Math.max(g,Math.round(k.getBoundingClientRect().width));k.style.width=g+"px";k=a.getView()==AdfDhtmlCalendarPeer._VIEW_DAY?AdfDhtmlCalendarPeer._CALENDAR_DAY_HEADER_SUB_ID:AdfDhtmlCalendarPeer._CALENDAR_WEEK_HEADER_SUB_ID;d=AdfRichUIPeer.CreateSubId(d,k);d=AdfAgent.AGENT.getElementById(d);
m=window.getComputedStyle(d);k=parseFloat(m.marginRight);m=parseFloat(m.marginLeft);d.style.width="calc(100% - "+(g+k+m)+"px)";a=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlCalendarPeer._CALENDAR_WEEK_TIMED_ACTIVITIES_CELL_SUB_ID);a=AdfAgent.AGENT.getElementById(a);(a=AdfDomUtils.getChildElementsByMatch(a,AdfDhtmlCalendarPeer._providerWrapperFilter,"div",null))||(a=[]);for(k=0;k<a.length;k++)d=a[k],m=b.getAttribute(d,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO),h[m]=Math.max(h[m],Math.round(d.getBoundingClientRect().height));
for(k=0;k<f.length;k++)l=f[k],m=b.getAttribute(l,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO),l.style.width=g+"px",l.style.height=h[m]+"px";e.style.width=g+"px";e.parentNode.style.width=g+"px";for(k=0;k<a.length;k++)d=a[k],m=b.getAttribute(d,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO),d.style.height=h[m]+"px"}};AdfDhtmlCalendarPeer._providerWrapperFilter=function(a,b){return a&&null!=AdfAgent.AGENT.getAttribute(a,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO)};
AdfDhtmlCalendarPeer.prototype._resizeDragNodeForAllDayActivity=function(a,b,d,e){var f=AdfAgent.AGENT;e.style.display="";for(var g=d.length,h=0;h<g;h++){var k=d[h];null!=f.getAttribute(k,AdfDhtmlCalendarPeer._ALL_DAY_HEADER_TEXT_KEY)||k===e||AdfDomUtils.isAncestor(k,e)||(k.style.display="none")}d=a.parentNode.childNodes;g=d.length;for(h=0;h<g;h++)if(a=d[h],null!=f.getAttribute(a,AdfDhtmlCalendarPeer._CALENDAR_DAY_CELL_KEY)){b.width=a.clientWidth+"px";break}};
AdfDhtmlCalendarPeer.prototype._getDropSiteAndData=function(a,b,d,e){var f=this.getComponent(),g=f.getProperty(AdfDhtmlCalendarPeer._VIEW_KEY),h=!1,f=AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(f.getClientId(),AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_GRID_SUB_ID));g!=AdfDhtmlCalendarPeer._VIEW_DAY||f?g==AdfDhtmlCalendarPeer._VIEW_WEEK?h=this._getDropSiteAndDataForWeekView(a,b,d,e,f?AdfDhtmlCalendarPeer._CALENDAR_WEEK_TIMED_ACTIVITIES_CELL_SUB_ID:AdfDhtmlCalendarPeer._ALL_DAY_CONTAINER_SUB_ID):
g==AdfDhtmlCalendarPeer._VIEW_MONTH&&(h=this._getDropSiteAndDataForMonthView(a,b,d,e)):h=this._getDropSiteAndDataForDayView(a,b,d,e);h||(e[AdfCalendarDropTarget.HINT_DROP_SITE]=null,e[AdfCalendarDropTarget.HINT_DROP_SITE_DATA]=null)};AdfDhtmlCalendarPeer.prototype._getDragSourceActivity=function(a,b,d){if(a=a.getTransferable())if(a=a.getTransferData(AdfDataFlavor.OBJECT_FLAVOR),null!=a)for(b=a.length,d=0;d<b;d++){var e=a[d];if(e instanceof AdfCalendarActivity)return e}return null};
AdfDhtmlCalendarPeer.prototype._getDropSiteAndDataForDayView=function(a,b,d,e){var f=AdfAgent.AGENT,g=this.getComponent();a=this._getDragSourceActivity(a,b,d);var h=!1;if(this._isAllDayRegionDisplayed()){var k=g.getClientId(),k=AdfRichUIPeer.CreateSubId(k,AdfDhtmlCalendarPeer._ALL_DAY_CONTAINER_SUB_ID),k=f.getElementById(k);AdfAssert.assertDomElement(k);f.pointInElementBounds(k,b,d)&&!a&&(h={},h.date=f.getAttribute(k,AdfDhtmlCalendarPeer._CALENDAR_DAY_CELL_KEY),-1!=g.getShowActivityTypes().indexOf(AdfDhtmlCalendarPeer._ALLDAY)?
h.timeType=AdfDhtmlCalendarPeer._ALLDAY:h.timeType=AdfDhtmlCalendarPeer._DURATION,e[AdfCalendarDropTarget.HINT_DROP_SITE]=h,dropSiteData={},dropSiteData.domElement=k,dropSiteData.bounds=f.getElementPageBounds(k),e[AdfCalendarDropTarget.HINT_DROP_SITE_DATA]=dropSiteData,h=!0)}h||a&&a.isAllDay()||(h=this._getDropSiteAndDataForTimedDayView(b,d,e));return h};
AdfDhtmlCalendarPeer.prototype._isAllDayRegionDisplayed=function(){var a=this.getComponent().getShowActivityTypes();return-1!=a.indexOf(AdfDhtmlCalendarPeer._ALLDAY)||-1!=a.indexOf(AdfDhtmlCalendarPeer._DURATION)&&-1!=a.indexOf(AdfDhtmlCalendarPeer._TIME)};
AdfDhtmlCalendarPeer.prototype._getDropSiteAndDataForTimedDayView=function(a,b,d){var e=AdfAgent.AGENT,f=null,g=this._getDateTimeGridContainer(),h=g.scrollTop,k=g.firstChild.rows[0].cells[1].firstChild,g=k.childNodes,l=g.length;if(e.pointInElementBounds(k,a,b))for(i=0;i<l;i++)if(k=g[i],f||(f=e.getAttribute(k,AdfDhtmlCalendarPeer._CALENDAR_DAY_CELL_KEY)),k.offsetTop+k.offsetHeight>h){var m=e.getAttribute(k,AdfDhtmlCalendarPeer._CALENDAR_TIME_SLOT_KEY);if(null!=m&&e.pointInElementBounds(k,a,b))return d[AdfCalendarDropTarget.HINT_DROP_SITE]=
this._getDropSiteForTimeSlot(f,m),a={},a.domElement=k,a.bounds=e.getElementPageBounds(k),d[AdfCalendarDropTarget.HINT_DROP_SITE_DATA]=a,!0}return!1};AdfDhtmlCalendarPeer.prototype._getDropSiteForTimeSlot=function(a,b){var d={},e=this._getTimeSlotsPerHour();d.date=a;d.hour=Math.round(b/e-.5);d.min=b%e*(60/e);-1!=this.getComponent().getShowActivityTypes().indexOf(AdfDhtmlCalendarPeer._TIME)?d.timeType=AdfDhtmlCalendarPeer._TIME:d.timeType=AdfDhtmlCalendarPeer._DURATION;return d};
AdfDhtmlCalendarPeer.prototype._getDropSiteAndDataForWeekView=function(a,b,d,e,f){var g=AdfAgent.AGENT,h=this.getComponent();a=this._getDragSourceActivity(a,b,d);var k=!1;this._isAllDayRegionDisplayed()&&(h=h.getClientId(),f=AdfRichUIPeer.CreateSubId(h,f),f=g.getElementById(f),AdfAssert.assertDomElement(f),!g.pointInElementBounds(f,b,d)||a&&!a.isAllDay()||(k=this._getDropSiteAndDataForAllDayWeekView(f,b,d,e)));k||a&&a.isAllDay()||(k=this._getDropSiteAndDataForTimedWeekView(b,d,e));return k};
AdfDhtmlCalendarPeer.prototype._getDropSiteAndDataForAllDayWeekView=function(a,b,d,e){var f=AdfAgent.AGENT,g=a.childNodes,h=g.length;for(i=0;i<h;i++){a=g[i];var k=f.getAttribute(a,AdfDhtmlCalendarPeer._CALENDAR_DAY_CELL_KEY);if(null!=k&&f.pointInElementBounds(a,b,d))return b=-1!=this.getComponent().getShowActivityTypes().indexOf(AdfDhtmlCalendarPeer._ALLDAY)?AdfDhtmlCalendarPeer._ALLDAY:AdfDhtmlCalendarPeer._DURATION,e[AdfCalendarDropTarget.HINT_DROP_SITE]={date:k,timeType:b},b={},b.domElement=a,
b.bounds=f.getElementPageBounds(a),e[AdfCalendarDropTarget.HINT_DROP_SITE_DATA]=b,!0}return!1};
AdfDhtmlCalendarPeer.prototype._getDropSiteAndDataForTimedWeekView=function(a,b,d){var e=AdfAgent.AGENT,f=this._getDateTimeGridContainer(),g=f.scrollTop,f=f.firstChild.rows[0].cells[1].firstChild;if(e.pointInElementBounds(f,a,b)){var h=f.childNodes,k=h.length,l=null,f=null;for(i=0;i<k;i++){var m=h[i],n=e.getAttribute(m,AdfDhtmlCalendarPeer._CALENDAR_DAY_CELL_KEY);if(null!=n&&m.offsetTop+m.offsetHeight>g&&e.pointInElementBounds(m,a,b)){l=n;f=m;break}}if(null!=l)for(i=0;i<k;i++)if(a=h[i],g=this._getTimeSlot(a),
null!=g&&(m=e.getElementPosition(a),b>m.y&&b<m.y+a.offsetHeight))return d[AdfCalendarDropTarget.HINT_DROP_SITE]=this._getDropSiteForTimeSlot(l,g),b={},b.domElement=a,b.siteDayCell=f,h=e.getElementPageBounds(a),e=e.getElementPageBounds(f),b.bounds={top:h.top,left:e.left,bottom:h.bottom,right:e.right},d[AdfCalendarDropTarget.HINT_DROP_SITE_DATA]=b,!0}return!1};
AdfDhtmlCalendarPeer.prototype._getTimeSlot=function(a){return AdfAgent.AGENT.getElementById(AdfRichUIPeer.CreateSubId(this.getComponent().getClientId(),AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_GRID_SUB_ID))?0:AdfAgent.AGENT.getAttribute(a,AdfDhtmlCalendarPeer._CALENDAR_TIME_SLOT_KEY)};
AdfDhtmlCalendarPeer.prototype._getDropSiteAndDataForMonthView=function(a,b,d,e){a=AdfAgent.AGENT;var f=!1,g=this.getComponent().getClientId(),g=AdfRichUIPeer.CreateSubId(g,AdfDhtmlCalendarPeer._MONTH_GRID_ID);if((g=AdfAgent.AGENT.getElementById(g))&&a.pointInElementBounds(g,b,d))for(var h=g.childNodes,k=h.length,l=null,m=0;m<k&&!l;m++){var n=h[m];if(a.pointInElementBounds(g,b,d))for(var q=n.childNodes,r=q.length,t=0;t<r;t++){var n=q[t],u=a.getAttribute(n,AdfDhtmlCalendarPeer._CALENDAR_DAY_CELL_KEY);
if(null!=u&&a.pointInElementBounds(n,b,d)){l={};l.date=u;l.timeType="UNKNOWN";e[AdfCalendarDropTarget.HINT_DROP_SITE]=l;f={};f.domElement=n;f.bounds=a.getElementPageBounds(n);e[AdfCalendarDropTarget.HINT_DROP_SITE_DATA]=f;f=!0;break}}}return f};AdfDhtmlCalendarPeer.prototype._getProviderGridElement=function(a){a=a.getClientId();a=AdfRichUIPeer.CreateSubId(a,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_GRID_SUB_ID);return AdfAgent.AGENT.getElementById(a)};
AdfDhtmlCalendarPeer.prototype._isInProviderGroupingMode=function(a){return null!=this._getProviderGridElement(a)};AdfDhtmlCalendarPeer.prototype._isActivityGridContainerChild=function(a,b){for(var d=a.getClientId(),e=AdfRichUIPeer.CreateSubId(d,AdfDhtmlCalendarPeer._SCROLL_DAY_KEY),f=this.getDomElement();b&&b.id!=d&&b!=f;){if(b.id==e)return!0;b=b.parentNode}return!1};
AdfDhtmlCalendarPeer.prototype._actionToDisplayChange=function(a,b,d,e){this._hideActivityHoverPopup();a.cancel();a.stopBubbling();AdfCalendarDisplayChangeEvent.queue(b,e,d)};
AdfDhtmlCalendarPeer.prototype._calculateMonthGridCapacity=function(a,b){var d={},e=AdfPage.PAGE.getLookAndFeel().getSkinProperty(AdfDhtmlCalendarPeer._MONTH_VIEW_ALLDAY_HT);d.activityHt=null!=e?parseFloat(e):0<a.clientHeight?a.clientHeight:b.dayHeaderHt;d.spacerHt=1.1;var e=AdfAgent.AGENT,f=e.getComputedStyle(a),g=e.getStyleProperty(f,"margin-bottom");null==g&&(g=e.getStyleProperty(f,"marginBottom"));if(null!=g){var h=g.lastIndexOf("px");-1!=h?d.spacerHt=parseFloat(g.substring(0,h)):(h=g.lastIndexOf("em"),
-1!=h&&(g=g.substring(0,h),d.spacerHt=parseFloat(g)*b._EMToPxRatio))}d.overflowHt=d.activityHt;g=e.getStyleProperty(f,"font-size");null==g&&(g=e.getStyleProperty(f,"fontSize"));null!=g&&(h=g.lastIndexOf("px"),-1!=h&&(d.overflowHt=parseFloat(g.substring(0,h))));b.activityInfo=d;b.maxNumActivities=Math.floor((b.dayCellHt-(b.dayHeaderHt+d.spacerHt))/(d.spacerHt+d.activityHt))};
AdfDhtmlCalendarPeer.prototype._calculateMonthGridInfo=function(a,b){var d={},e=AdfPage.PAGE.getLocaleContext().isRightToLeft();if(null!=a){for(var f=a.childNodes[0].childNodes,g=f.length,h=0;h<g;h++){var k=AdfAgent.AGENT.getAttribute(f[h],AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_KEY),l=AdfAgent.AGENT.getAttribute(f[h],AdfDhtmlCalendarPeer._CAL_MONTH_TIMED_ACTIVITY_WRAPPER),m=AdfAgent.AGENT.getAttribute(f[h],AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK);if(!(k||l||m)){f=f[h];g=f.childNodes[0];d.dayCellHt=
f.clientHeight;d.dayHeaderHt=g.clientHeight;break}}f=a.style.top;f=parseFloat(f.substring(0,f.lastIndexOf("em")));d._EMToPxRatio=a.offsetTop/f}if(null!=b){f=b.childNodes.length;d.numDaysInWeek=f;g={};h=Array(f);for(k=0;k<f;k++)l=e?b.childNodes[k].style.right:b.childNodes[k].style.left,g[l]=k,h[k]=parseFloat(l);d.percentToIndexMap=g;d.percentArray=h;d.cellWidth=h[1]-h[0]}return d};
AdfDhtmlCalendarPeer.prototype._createOverflowLinkForMonthGrid=function(a,b,d,e){var f=AdfPage.PAGE.getLookAndFeel(),g=AdfAgent.AGENT,h=document.createElement("div");AdfDomUtils.addCSSClassName(h,f.getStyleClass(AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK_WRAPPER_CLASS));g.setAttribute(h,AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK,AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK);g.setAttribute(h,AdfDhtmlCalendarPeer._CAL_MONTH_NUM_OVERFLOW,b);g.setAttribute(h,AdfDhtmlCalendarPeer._CAL_ACT_ROW_NUM,
e.maxNumActivities);d=this._getDayCellAttrValue(a,d);g.setAttribute(h,AdfDhtmlCalendarPeer._CALENDAR_DAY_KEY,d);d=document.createElement("a");AdfDomUtils.addCSSClassName(d,f.getStyleClass(AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK_CLASS));d.href="#";d.onclick=this.handleMonthOverflowLinkClick;d.tabIndex=-1;a=AdfRichUIPeer.CreateSubId(a.getClientId(),AdfDhtmlCalendarPeer._MONTH_GRID_ID);a=AdfAgent.AGENT.getElementById(a);a=AdfAgent.AGENT.getAttribute(a,AdfDhtmlCalendarPeer._MONTH_MORE_LINK_TEXT);
a=null!=a?TrFastMessageFormatUtils.format(a,b):f.getTranslatedString(AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK_TEXT,b);d.innerHTML=a;h.appendChild(d);g.setAttribute(h,"role","link");b=f.getTranslatedString(AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK_LABEL,b);g.setAttribute(h,"aria-label",b);h.tabIndex=-1;return h};
AdfDhtmlCalendarPeer.prototype._getActivityInfo=function(a,b){if(null==a)return null;var d={};d.startDay=this._getDayIndexOfGridElem(b,a);var e;e=AdfAgent.AGENT.getAttribute(a,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_ALL_DAY_KEY)?a.style.width:a.parentNode.style.width;e=parseFloat(e.substring(0,e.lastIndexOf("%")));d.activityLength=b.numDaysInWeek;for(var f=0;f<b.numDaysInWeek;f++)if(e<=b.percentArray[f]){d.activityLength=f;break}return d};
AdfDhtmlCalendarPeer.prototype._getActivityLinkInList=function(a){var b=AdfAgent.AGENT;for(a=AdfDomUtils.getFirstChildElement(a);null!=a;){var d=AdfDomUtils.getFirstChildElement(a);if(null!=d&&null!=b.getAttribute(d,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_KEY))return d;a=AdfDomUtils.getNextElement(a)}};
AdfDhtmlCalendarPeer.prototype._getListRowWithDayLink=function(a,b){for(var d=AdfAgent.AGENT,e=b?AdfDomUtils.getNextElement(a):AdfDomUtils.getPreviousElement(a);null!=e;){if(null!=d.getAttribute(e,AdfDhtmlCalendarPeer._HAS_CALENDAR_DAY_LINK))return e;e=b?AdfDomUtils.getNextElement(e):AdfDomUtils.getPreviousElement(e)}};AdfDhtmlCalendarPeer.prototype._getDisplayChangeElement=function(a,b){return this._getParentWithAttr(a,b,AdfDhtmlCalendarPeer._CALENDAR_DAY_KEY)};
AdfDhtmlCalendarPeer.prototype._getActiveDayFromDom=function(a){a=AdfRichUIPeer.getDomElementForComponent(a);return AdfAgent.AGENT.getAttribute(a,AdfDhtmlCalendarPeer._CALENDAR_ACTIVE_DATE_KEY)};AdfDhtmlCalendarPeer.prototype._getParentActivity=function(a,b){return this._getParentWithAttr(a,b,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_KEY)};
AdfDhtmlCalendarPeer.prototype._getDayCellAttrValue=function(a,b){var d=this._getValueWithAttr(a,b,AdfDhtmlCalendarPeer._CALENDAR_DAY_CELL_KEY);return null==d?null:d};
AdfDhtmlCalendarPeer.prototype._getAllDayActFocus=function(a,b,d){a=AdfRichUIPeer.CreateSubId(a,AdfDhtmlCalendarPeer._ALL_DAY_CONTAINER_SUB_ID);a=AdfAgent.AGENT.getElementById(a);if(!a)return null;a=AdfDomUtils.getFirstChildElement(a);for(var e=d==AdfDhtmlCalendarPeer._CAL_WEEK_FOCUS_FIRST_ALLDAY?99999:-1,f=null;null!=a&&null!=AdfAgent.AGENT.getAttribute(a,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_KEY);){var g=AdfAgent.AGENT.getAttribute(a,AdfDhtmlCalendarPeer._CAL_ACT_COL_NUM);if(g==b)g=parseInt(AdfAgent.AGENT.getAttribute(a,
AdfDhtmlCalendarPeer._CAL_ACT_ROW_NUM)),d==AdfDhtmlCalendarPeer._CAL_WEEK_FOCUS_FIRST_ALLDAY?g<e&&(e=g,f=a):g>e&&(e=g,f=a);else if(g>b)break;a=AdfDomUtils.getNextElement(a)}return f};
AdfDhtmlCalendarPeer.prototype._getAdjacentAllDayActToFocus=function(a,b,d){a=AdfRichUIPeer.CreateSubId(a,AdfDhtmlCalendarPeer._ALL_DAY_CONTAINER_SUB_ID);var e=AdfAgent.AGENT.getElementById(a);if(!e)return null;a=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CAL_ACT_ROW_NUM);b=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CAL_ACT_COL_NUM);for(var e=AdfDomUtils.getFirstChildElement(e),f=d==AdfDhtmlCalendarPeer._CAL_WEEK_FOCUS_NEXT_ALLDAY?99999:-1,g=null;null!=e&&null!=AdfAgent.AGENT.getAttribute(e,
AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_KEY);){var h=AdfAgent.AGENT.getAttribute(e,AdfDhtmlCalendarPeer._CAL_ACT_COL_NUM);if(h==b)h=parseInt(AdfAgent.AGENT.getAttribute(e,AdfDhtmlCalendarPeer._CAL_ACT_ROW_NUM)),d==AdfDhtmlCalendarPeer._CAL_WEEK_FOCUS_NEXT_ALLDAY?h>a&&h<f&&(f=h,g=e):h<a&&h>f&&(f=h,g=e);else if(h>b)break;e=AdfDomUtils.getNextElement(e)}return g};
AdfDhtmlCalendarPeer.prototype._getDayFocusInWeek=function(a,b){var d=AdfRichUIPeer.CreateSubId(a,AdfDhtmlCalendarPeer._CALENDAR_WEEK_HEADER_SUB_ID),d=AdfAgent.AGENT.getElementById(d);return 0>b||b>=d.childNodes.length?null:AdfDomUtils.getFirstChildElement(d.childNodes[b])};
AdfDhtmlCalendarPeer.prototype._getTimedActFocusInHourGrid=function(a,b,d){a=AdfRichUIPeer.CreateSubId(a,AdfDhtmlCalendarPeer._CALENDAR_WEEK_TIMED_ACTIVITIES_CELL_SUB_ID);a=AdfAgent.AGENT.getElementById(a);if(!a)return null;a=AdfDomUtils.getFirstChildElement(a);do{if(null==a)break;var e=AdfAgent.AGENT.getAttribute(a,AdfDhtmlCalendarPeer._CAL_ACT_COL_NUM);if(null==e||e<b)a=AdfDomUtils.getNextElement(a);else if(d&&e>=b){for(e=0;e<a.childNodes[0].children.length;e++){var f=a.childNodes[0].childNodes[e];
if(AdfAgent.AGENT.getAttribute(f,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO)==d&&f.hasChildNodes())return f.firstElementChild}a=AdfDomUtils.getNextElement(a)}else{a=e==b?a.childNodes[0].childNodes[0]:null;break}}while(1);return a};AdfDhtmlCalendarPeer.prototype._getDayFocusInMonthWeek=function(a,b,d){if(null!=a){a=AdfDomUtils.getLastChildElement(a);b=d.numDaysInWeek-1-b;for(d=0;d<b;d++)a=AdfDomUtils.getPreviousElement(a);if(null!=a)return a.childNodes[0].childNodes[0]}return null};
AdfDhtmlCalendarPeer.prototype._getTimeSlotAttrValue=function(a,b){var d=this._getValueWithAttr(a,b,AdfDhtmlCalendarPeer._CALENDAR_TIME_SLOT_KEY);return null==d?null:d};AdfDhtmlCalendarPeer.prototype._getTimeSlotsPerHour=function(){return this.getComponent().getProperty(AdfDhtmlCalendarPeer._TIME_SLOTS_PER_HOUR)};AdfDhtmlCalendarPeer.prototype._getParentWithAttr=function(a,b,d){for(;b&&b!=a;){if(1==b.nodeType&&AdfAgent.AGENT.getAttribute(b,d))return b;b=b.parentNode}return null};
AdfDhtmlCalendarPeer.prototype._getNextMonthElement=function(a,b){var d=b?AdfDomUtils.getNextElement(a):AdfDomUtils.getPreviousElement(a);null==d&&null!=AdfAgent.AGENT.getAttribute(a.parentNode,AdfDhtmlCalendarPeer._CAL_MONTH_TIMED_ACTIVITY_WRAPPER)&&(d=b?AdfDomUtils.getNextElement(a.parentNode):AdfDomUtils.getPreviousElement(a.parentNode));null!=d&&null!=AdfAgent.AGENT.getAttribute(d,AdfDhtmlCalendarPeer._CAL_MONTH_TIMED_ACTIVITY_WRAPPER)&&(d=b?AdfDomUtils.getFirstChildElement(d):AdfDomUtils.getLastChildElement(d));
return d};AdfDhtmlCalendarPeer.prototype._getOverflowLink=function(a){var b=a;AdfAgent.AGENT.getAttribute(a.parentNode,AdfDhtmlCalendarPeer._CAL_MONTH_TIMED_ACTIVITY_WRAPPER)&&(b=a.parentNode);for(;null!=(b=AdfDomUtils.getNextElement(b));)if(null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK))return b;return null};
AdfDhtmlCalendarPeer.prototype._getDayIndexOfGridElem=function(a,b){for(var d=AdfPage.PAGE.getLocaleContext().isRightToLeft(),e=b,f;;){f=AdfAgent.AGENT.getAttribute(e,AdfDhtmlCalendarPeer._CAL_ACT_COL_NUM);if(null!=f)break;if(null!=a&&(f=d?e.style.right:e.style.left,0<f.length)){f=a.percentToIndexMap[f];break}e=e.parentNode}return parseInt(f)};
AdfDhtmlCalendarPeer.prototype._getValueWithAttr=function(a,b,d){for(var e;b&&b!=a;){1==b.nodeType&&(e=AdfAgent.AGENT.getAttribute(b,d));if(1==b.nodeType&&e)return e;b=b.parentNode}return null};
AdfDhtmlCalendarPeer.prototype._handleKeyUpForDay=function(a,b,d,e){var f=this.getComponent(),g=f.getClientId(),h,k=null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_KEY),l=!1,m=AdfPage.PAGE.getLocaleContext().isRightToLeft();if(k){k=null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_ALL_DAY_KEY);if(AdfKeyStroke.ARROWDOWN_KEY==a)if(h=AdfDomUtils.getNextElement(b),null==h&&k)h=this._getTimedActFocusInHourGrid(g,0),l=!0;else{if(null==h&&this._isInProviderGroupingMode(f))for(var k=
AdfAgent.AGENT,g=AdfRichUIPeer.CreateSubId(g,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_CONTAINER_SUB_ID),g=k.getElementById(g),g=AdfDomUtils.getChildElements(g),n=0;n<g.length;n++){var q=g[n],r=k.getAttribute(q,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO);if(r==e){(q=AdfDomUtils.getNextElement(q))&&(h=q.childNodes[0]);break}}}else if(AdfKeyStroke.ARROWUP_KEY==a&&(h=AdfDomUtils.getPreviousElement(b),null==h&&!k&&(k=AdfRichUIPeer.CreateSubId(g,AdfDhtmlCalendarPeer._ALL_DAY_CONTAINER_SUB_ID),k=
AdfAgent.AGENT.getElementById(k))&&(h=AdfDomUtils.getLastChildElement(k),l=!0),null==h&&this._isInProviderGroupingMode(f)))for(k=AdfAgent.AGENT,g=AdfRichUIPeer.CreateSubId(g,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_CONTAINER_SUB_ID),g=k.getElementById(g),g=AdfDomUtils.getChildElements(g),n=0;n<g.length;n++)if(q=g[n],r=k.getAttribute(q,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO),r==e){(q=AdfDomUtils.getPreviousElement(q))&&(h=q.childNodes[0]);break}if((AdfKeyStroke.ARROWLEFT_KEY==a&&!m||AdfKeyStroke.ARROWRIGHT_KEY==
a&&m)&&this._isInProviderGroupingMode(f))for(k=AdfAgent.AGENT,g=f.getClientId(),g=AdfRichUIPeer.CreateSubId(g,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_CONTAINER_SUB_ID),g=k.getElementById(g),g=AdfDomUtils.getChildElements(g),n=0;n<g.length;n++)q=g[n],r=k.getAttribute(q,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO),r==e&&(h=q.childNodes[0])}else this._isInProviderGroupingMode(f)&&(AdfKeyStroke.ARROWLEFT_KEY==a&&m||AdfKeyStroke.ARROWRIGHT_KEY==a&&!m)&&(h=this._getTimedActFocusInHourGrid(g,0,e));
return h?(this._switchfocusAndMarkActiveDescendant(b,h,d,l),!0):!1};
AdfDhtmlCalendarPeer.prototype._handleKeyUpForList=function(a,b,d){var e=null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_KEY),f=AdfAgent.AGENT,g,h=b.parentNode.parentNode;if(e)if(AdfKeyStroke.ARROWDOWN_KEY==a||AdfKeyStroke.ARROWUP_KEY==a)h=(a=AdfKeyStroke.ARROWDOWN_KEY==a)?AdfDomUtils.getNextElement(h):AdfDomUtils.getPreviousElement(h),null!=h&&1==h.childNodes.length&&(h=a?AdfDomUtils.getNextElement(h):AdfDomUtils.getPreviousElement(h)),null!=h&&(g=this._getActivityLinkInList(h));
else{if(AdfKeyStroke.ARROWLEFT_KEY==a||AdfKeyStroke.ARROWRIGHT_KEY==a)e=AdfPage.PAGE.getLocaleContext().isRightToLeft(),!e&&AdfKeyStroke.ARROWRIGHT_KEY==a||e&&AdfKeyStroke.ARROWLEFT_KEY==a?(h=this._getListRowWithDayLink(h,!0),null!=h&&(g=AdfDomUtils.getFirstChildElement(h),g=AdfDomUtils.getFirstChildElement(AdfDomUtils.getNextElement(g)),null==g&&(g=this._getActivityLinkInList(h)))):(null==f.getAttribute(h,AdfDhtmlCalendarPeer._HAS_CALENDAR_DAY_LINK)&&(h=this._getListRowWithDayLink(h,!1)),g=AdfDomUtils.getChildElements(h)[1],
g=AdfDomUtils.getFirstChildElement(g),null==g&&(h=AdfDomUtils.getPreviousElement(h),null!=h&&(h=AdfDomUtils.getPreviousElement(h),g=this._getActivityLinkInList(h))))}else null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CALENDAR_DAY_KEY)&&(AdfKeyStroke.ARROWDOWN_KEY==a||AdfKeyStroke.ARROWUP_KEY==a?(h=this._getListRowWithDayLink(h,AdfKeyStroke.ARROWDOWN_KEY==a),null!=h&&(h=AdfDomUtils.getChildElements(h)[1],g=AdfDomUtils.getFirstChildElement(h))):AdfKeyStroke.ARROWRIGHT_KEY==a?(g=AdfDomUtils.getNextElement(AdfDomUtils.getNextElement(b.parentNode)),
null!=g&&(g=AdfDomUtils.getFirstChildElement(g))):AdfKeyStroke.ARROWLEFT_KEY==a&&(h=AdfDomUtils.getPreviousElement(h),null!=h&&(h=AdfDomUtils.getPreviousElement(h),g=this._getActivityLinkInList(h))));return g?(this._switchfocusAndMarkActiveDescendant(b,g,d),!0):!1};
AdfDhtmlCalendarPeer.prototype._handleKeyUpForMonth=function(a,b,d){var e=AdfPage.PAGE.getLocaleContext().isRightToLeft(),f=this.getComponent().getClientId(),g,h=null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_KEY),k=null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK),l=null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CALENDAR_DAY_KEY),f=AdfRichUIPeer.CreateSubId(f,AdfDhtmlCalendarPeer._MONTH_HEADER_ID),f=AdfAgent.AGENT.getElementById(f),
f=this._calculateMonthGridInfo(null,f),m=this._getDayIndexOfGridElem(f,b);if(h||k){var n=null!=AdfAgent.AGENT.getAttribute(b.parentNode,AdfDhtmlCalendarPeer._CAL_MONTH_TIMED_ACTIVITY_WRAPPER);if(AdfKeyStroke.ARROWDOWN_KEY==a)k?(g=AdfDomUtils.getNextElement(b.parentNode),g=this._getDayFocusInMonthWeek(g,m,f)):(g=this._getNextMonthElement(b,!0),null!=g&&(a=this._getDayIndexOfGridElem(f,g),a!=m?g=null:"none"==g.style.display&&(g=this._getOverflowLink(g))),null==g&&(g=AdfDomUtils.getNextElement(n?b.parentNode.parentNode:
b.parentNode),g=this._getDayFocusInMonthWeek(g,m,f)));else if(AdfKeyStroke.ARROWUP_KEY==a){a=!1;for(e=b;!a;){g=this._getNextMonthElement(e,!1);if(null==g)break;if("none"==g.style.display)e=g;else if(a=this._getDayIndexOfGridElem(f,g),a==m)a=!0;else{g=null;break}}null==g&&(g=this._getDayFocusInMonthWeek(n?b.parentNode.parentNode:b.parentNode,m,f))}else if(AdfKeyStroke.ARROWLEFT_KEY==a||AdfKeyStroke.ARROWRIGHT_KEY==a){e=AdfKeyStroke.ARROWLEFT_KEY==a&&e||AdfKeyStroke.ARROWRIGHT_KEY==a&&!e;m=this._getDayIndexOfGridElem(f,
b);k=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CAL_ACT_ROW_NUM);h=!1;for(a=b;!h;){g=this._getNextMonthElement(a,e);if(null==g)break;if("none"!=g.style.display&&(a=this._getDayIndexOfGridElem(f,g),a!=m))if(a=Math.abs(a-m),1==a){a=AdfAgent.AGENT.getAttribute(g,AdfDhtmlCalendarPeer._CAL_ACT_ROW_NUM);if(null==a){g=null;break}k==a&&(h=!0)}else if(1<a){g=null;break}a=g}null==g&&(m=e?m+1:m-1,0<=m&&m<f.numDaysInWeek&&(g=this._getDayFocusInMonthWeek(n?b.parentNode.parentNode:b.parentNode,m,f)))}}else if(l)if(AdfKeyStroke.ARROWLEFT_KEY==
a||AdfKeyStroke.ARROWRIGHT_KEY==a)m=(n=AdfKeyStroke.ARROWLEFT_KEY==a&&e||AdfKeyStroke.ARROWRIGHT_KEY==a&&!e)?m+1:m-1,0<=m&&m<f.numDaysInWeek?(g=n?AdfDomUtils.getNextElement(b.parentNode.parentNode):AdfDomUtils.getPreviousElement(b.parentNode.parentNode),g=AdfDomUtils.getFirstChildElement(g),g=AdfDomUtils.getFirstChildElement(g)):(m=m==f.numDaysInWeek&&n?AdfDomUtils.getNextElement(b.parentNode.parentNode.parentNode):AdfDomUtils.getPreviousElement(b.parentNode.parentNode.parentNode),null!=m&&(g=this._getDayFocusInMonthWeek(m,
n?0:f.numDaysInWeek-1,f)));else if(AdfKeyStroke.ARROWUP_KEY==a){if(e=AdfDomUtils.getPreviousElement(b.parentNode.parentNode.parentNode),null!=e){if(e.childNodes.length!=f.numDaysInWeek){g=AdfDomUtils.getFirstChildElement(e);null!=AdfAgent.AGENT.getAttribute(g,AdfDhtmlCalendarPeer._CAL_MONTH_TIMED_ACTIVITY_WRAPPER)&&(g=AdfDomUtils.getFirstChildElement(g));do{if(null==g)break;if(null==AdfAgent.AGENT.getAttribute(g,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_KEY)&&null==AdfAgent.AGENT.getAttribute(g,AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK))break;
a=this._getDayIndexOfGridElem(f,g);if(a==m)"none"!=g.style.display&&(n=g);else if(a>m)break;g=this._getNextMonthElement(g,!0)}while(1)}g=null!=n?n:this._getDayFocusInMonthWeek(e,m,f)}}else if(AdfKeyStroke.ARROWDOWN_KEY==a){n=b.parentNode.parentNode.parentNode;if(n.childNodes.length!=f.numDaysInWeek){g=AdfDomUtils.getFirstChildElement(n);null!=AdfAgent.AGENT.getAttribute(g,AdfDhtmlCalendarPeer._CAL_MONTH_TIMED_ACTIVITY_WRAPPER)&&(g=AdfDomUtils.getFirstChildElement(g));do{if(null==g)break;if(null==
AdfAgent.AGENT.getAttribute(g,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_KEY)&&null==AdfAgent.AGENT.getAttribute(g,AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK)){g=null;break}a=this._getDayIndexOfGridElem(f,g);if(a==m)break;else if(a>m){g=null;break}g=this._getNextMonthElement(g,!0)}while(1)}null==g&&(n=AdfDomUtils.getNextElement(n),null!=n&&(g=this._getDayFocusInMonthWeek(n,m,f)))}return g?(this._switchfocusAndMarkActiveDescendant(b,g,d),!0):!1};
AdfDhtmlCalendarPeer.prototype._handleKeyUpForWeek=function(a,b,d,e){var f=AdfPage.PAGE.getLocaleContext().isRightToLeft(),g=this.getComponent(),h=g.getClientId(),k,l,m=null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_KEY),n=AdfRichUIPeer.CreateSubId(h,AdfDhtmlCalendarPeer._CALENDAR_WEEK_HEADER_SUB_ID),q=AdfAgent.AGENT.getElementById(n),r=this._calculateMonthGridInfo(null,q),t=this._getDayIndexOfGridElem(r,b),q=!1;if(m)if(m=null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_ALL_DAY_KEY),
AdfKeyStroke.ARROWDOWN_KEY==a){l=m?this._getAdjacentAllDayActToFocus(h,b,AdfDhtmlCalendarPeer._CAL_WEEK_FOCUS_NEXT_ALLDAY):AdfDomUtils.getNextElement(b);m&&null==l&&(l=this._getTimedActFocusInHourGrid(h,t),null!=l&&(q=!0));if(null==l&&this._isInProviderGroupingMode(g))for(r=AdfAgent.AGENT,h=g.getClientId(),g=AdfRichUIPeer.CreateSubId(h,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_CONTAINER_SUB_ID),g=r.getElementById(g),g=AdfDomUtils.getChildElements(g),a=0;a<g.length;a++){var f=g[a],u=r.getAttribute(f,
AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO);if(u==e){(f=AdfDomUtils.getNextElement(f))&&(l=f.childNodes[0]);break}}null==l&&(l=this._getDayFocusInWeek(h,t))}else if(AdfKeyStroke.ARROWUP_KEY==a){l=m?this._getAdjacentAllDayActToFocus(h,b,AdfDhtmlCalendarPeer._CAL_WEEK_FOCUS_PREV_ALLDAY):AdfDomUtils.getPreviousElement(b);m||null!=l||(l=this._getAllDayActFocus(h,t,this._CAL_WEEK_FOCUS_LAST_ALLDAY),null!=l&&(q=!0));if(null==l&&this._isInProviderGroupingMode(g))for(r=AdfAgent.AGENT,h=g.getClientId(),
g=AdfRichUIPeer.CreateSubId(h,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_CONTAINER_SUB_ID),g=r.getElementById(g),g=AdfDomUtils.getChildElements(g),a=0;a<g.length;a++)if(f=g[a],u=r.getAttribute(f,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO),u==e){(f=AdfDomUtils.getPreviousElement(f))&&(l=f.childNodes[0]);break}null==l&&(l=this._getDayFocusInWeek(h,t))}else{if(AdfKeyStroke.ARROWRIGHT_KEY==a||AdfKeyStroke.ARROWLEFT_KEY==a){l=(n=AdfKeyStroke.ARROWRIGHT_KEY==a&&!f||AdfKeyStroke.ARROWLEFT_KEY==a&&f)?
AdfDomUtils.getNextElement(b):AdfDomUtils.getPreviousElement(b);if(m)for(u=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CAL_ACT_ROW_NUM);null!=l;){k=this._getDayIndexOfGridElem(r,l);k=Math.abs(k-t);if(1==k){k=AdfAgent.AGENT.getAttribute(l,AdfDhtmlCalendarPeer._CAL_ACT_ROW_NUM);if(null==k){l=null;break}if(u==k)break}else if(1<k){l=null;break}l=n?AdfDomUtils.getNextElement(l):AdfDomUtils.getPreviousElement(l)}else l=this._getTimedActFocusInHourGrid(h,n?t+1:t-1,e);if((AdfKeyStroke.ARROWLEFT_KEY==
a&&!f||AdfKeyStroke.ARROWRIGHT_KEY==a&&f)&&l==b&&this._isInProviderGroupingMode(g))for(r=AdfAgent.AGENT,h=g.getClientId(),g=AdfRichUIPeer.CreateSubId(h,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_CONTAINER_SUB_ID),g=r.getElementById(g),g=AdfDomUtils.getChildElements(g),a=0;a<g.length;a++)f=g[a],u=r.getAttribute(f,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO),u==e&&(l=f.childNodes[0]);null==l&&(l=this._getDayFocusInWeek(h,n?t+1:t-1),m||(q=!0))}}else if(b.parentNode.parentNode.id==n)if(AdfKeyStroke.ARROWDOWN_KEY==
a)l=this._getAllDayActFocus(h,t,AdfDhtmlCalendarPeer._CAL_WEEK_FOCUS_FIRST_ALLDAY),null==l&&(l=this._getTimedActFocusInHourGrid(h,t),this._isInProviderGroupingMode(g)&&l&&(l=l.firstElementChild));else{if(AdfKeyStroke.ARROWLEFT_KEY==a||AdfKeyStroke.ARROWRIGHT_KEY==a)h=(e=AdfKeyStroke.ARROWLEFT_KEY==a&&f||AdfKeyStroke.ARROWRIGHT_KEY==a&&!f)?t+1:t-1,0<=h&&h<r.numDaysInWeek&&(l=e?AdfDomUtils.getNextElement(b.parentNode):AdfDomUtils.getPreviousElement(b.parentNode),l=AdfDomUtils.getFirstChildElement(l))}else this._isInProviderGroupingMode(g)&&
(AdfKeyStroke.ARROWLEFT_KEY==a&&f||AdfKeyStroke.ARROWRIGHT_KEY==a&&!f)&&(l=this._getTimedActFocusInHourGrid(h,0,e));return l?(this._switchfocusAndMarkActiveDescendant(b,l,d,q),!0):!1};AdfDhtmlCalendarPeer.prototype._hideMonthGridActivity=function(a,b,d){a.style._display=a.style.display;a.style.display="none";a=this._getActivityInfo(a,b);for(b=0;b<a.activityLength;b++){var e=d[a.startDay+b];d[a.startDay+b]=++e}};
AdfDhtmlCalendarPeer.prototype._isActivityDraggableAcrossDays=function(a){return this.getComponent().getView()==AdfDhtmlCalendarPeer._VIEW_WEEK?null==AdfAgent.AGENT.getAttribute(a,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_DURATION_KEY):!1};
AdfDhtmlCalendarPeer.prototype._restoreScrollPosition=function(a,b){var d=a.getClientId(),e=AdfAgent.AGENT,f=a.getProperty(AdfDhtmlCalendarPeer._VIEW_KEY),g=null,h=null;if(f!=AdfDhtmlCalendarPeer._VIEW_MONTH){if(f==AdfDhtmlCalendarPeer._VIEW_LIST)g=AdfDhtmlCalendarPeer._SCROLL_LIST_KEY;else if(f==AdfDhtmlCalendarPeer._VIEW_DAY||f==AdfDhtmlCalendarPeer._VIEW_WEEK)g=AdfDhtmlCalendarPeer._SCROLL_DAY_KEY,h=this._getPageProperty(a,AdfDhtmlCalendarPeer._SCROLL_DAY_HEIGHT),this._setPageProperty(a,AdfDhtmlCalendarPeer._SCROLL_DAY_HEIGHT,
null);f=this._getPageProperty(a,g);this._setPageProperty(a,g,null);if(null!=f){if(g=AdfRichUIPeer.CreateSubId(d,g),g=e.getElementById(g)){var k=this._getPageProperty(a,AdfDhtmlCalendarPeer._CALENDAR_ACTIVE_DATE_KEY),l=this._getActiveDayFromDom(a);this._setPageProperty(a,AdfDhtmlCalendarPeer._CALENDAR_ACTIVE_DATE_KEY,null);l===k?(h&&(f=g.scrollHeight*f/h),g.scrollTop=f):this._scrollToStartHour(d,e)}}else this._scrollToStartHour(d,e)}};
AdfDhtmlCalendarPeer.prototype._saveScrollAndSplitterPosition=function(a){var b=a.getClientId(),d=AdfAgent.AGENT,e=a.getProperty(AdfDhtmlCalendarPeer._VIEW_KEY),f=null;if(e!=AdfDhtmlCalendarPeer._VIEW_MONTH){if(e==AdfDhtmlCalendarPeer._VIEW_LIST)f=AdfDhtmlCalendarPeer._SCROLL_LIST_KEY;else if(e==AdfDhtmlCalendarPeer._VIEW_DAY||e==AdfDhtmlCalendarPeer._VIEW_WEEK)f=AdfDhtmlCalendarPeer._SCROLL_DAY_KEY;b=AdfRichUIPeer.CreateSubId(b,f);if(d=d.getElementById(b))b=this._getActiveDayFromDom(a),this._setPageProperty(a,
AdfDhtmlCalendarPeer._CALENDAR_ACTIVE_DATE_KEY,b),AdfDomUtils.isInVisibleSubtree(d)&&(this._setPageProperty(a,f,d.scrollTop),e!=AdfDhtmlCalendarPeer._VIEW_DAY&&e!=AdfDhtmlCalendarPeer._VIEW_WEEK||this._setPageProperty(a,AdfDhtmlCalendarPeer._SCROLL_DAY_HEIGHT,d.scrollHeight))}};
AdfDhtmlCalendarPeer.prototype._scrollToStartHour=function(a,b){var d=AdfRichUIPeer.CreateSubId(a,AdfDhtmlCalendarPeer._START_HOUR_SUBID_KEY),d=b.getElementById(d),e=AdfRichUIPeer.CreateSubId(a,AdfDhtmlCalendarPeer._SCROLL_DAY_KEY);(e=b.getElementById(e))&&d&&b.scrollToPos(e,null,d.offsetTop)};AdfDhtmlCalendarPeer.prototype._getPageProperty=function(a,b){var d=a.getClientId(),e;(d=AdfPage.PAGE.getPageProperty(d))&&(e=d[b]);return e};
AdfDhtmlCalendarPeer.prototype._setPageProperty=function(a,b,d){a=a.getClientId();var e=AdfPage.PAGE,f=e.getPageProperty(a);f||(f={},e.setPageProperty(a,f));f[b]=d};
AdfDhtmlCalendarPeer.prototype._setTimeActDragInfo=function(a,b){var d=AdfAgent.AGENT;this._resizedActivity=a;this._resizedActivityContainer=a.firstChild.firstChild;this._resizedActivityInitHeight=b;this._resizedActivityInitWidth=this._resizedActivityContainer.clientWidth;this._parentDay=a.parentNode.parentNode;this._parentDayLeftBoundary=d.getElementLeft(this._parentDay);this._parentDayRightBoundary=this._parentDayLeftBoundary+this._parentDay.offsetWidth;this._activityLeftBoundary=d.getElementLeft(this._resizedActivity);
this._activityRightBoundary=this._activityLeftBoundary+this._resizedActivityInitWidth};AdfDhtmlCalendarPeer.prototype._showMonthGridActivity=function(a,b,d){a.style.display=a.style._display||"";a=this._getActivityInfo(a,b);for(b=0;b<a.activityLength;b++){var e=d[a.startDay+b];d[a.startDay+b]=--e}};AdfDhtmlCalendarPeer.prototype._isPopupVisible=function(a,b){var d=AdfAgent.AGENT.getAttribute(this.getDomElement(),b);return d?a.findComponent(d).isPopupVisible():!1};
AdfDhtmlCalendarPeer.prototype._launchPopupFacet=function(a,b){var d=AdfAgent.AGENT.getAttribute(this.getDomElement(),b);if(d){var d=a.findComponent(d),e={};e[AdfRichPopup.HINT_LAUNCH_ID]=a.getClientId();d.show(e)}};
AdfDhtmlCalendarPeer.prototype._onMouseOverTimeout=function(a){delete this._calendarActivityMouseTimeout;var b=a.componentId,d=this.getComponent().getClientId(),e=a.activityRootId,f=a.isInTimeRegion,g=AdfAgent.AGENT,h=AdfPage.PAGE.findComponent(b),e=g.getElementById(e);if(h&&e&&!this._isBusyWithDifferentActivity(e)){this.bind(h);var k=this._isPopupVisible(h,AdfDhtmlCalendarPeer._FACET_ID_ACTIVITY_DETAIL),l=this._isPopupVisible(h,AdfDhtmlCalendarPeer._FACET_ID_ACTIVITY_DELETE),m=this._isPopupVisible(h,
AdfDhtmlCalendarPeer._FACET_ID_ACTIVITY_CONTEXT_MENU);!(k||l||m)&&(this._queueCalendarActivityEvent(h,e,null,0,AdfDhtmlCalendarPeer._EVENT_BUTTON_NONE,AdfDhtmlCalendarPeer._EVENT_TRIGGER_HOVER),k=AdfRichUIPeer.getDomElementForComponent(h),k=AdfAgent.AGENT.getAttribute(k,AdfDhtmlCalendarPeer._FACET_ID_ACTIVITY_HOVER))&&(h=h.findComponent(k),k={},k[AdfRichPopup.HINT_LAUNCH_ID]=b,k[AdfDhtmlPopupHints.AUTODISMISS]=AdfDhtmlPopupHints.AUTODISMISS_MOUSEOUT,k[AdfDhtmlPopupHints.AUTODISMISS_MOUSEOUT_ID]=e.id,
f?(b=g.getElementPageBounds(e),d=AdfRichUIPeer.CreateSubId(d,AdfDhtmlCalendarPeer._SCROLL_DAY_KEY),g=g.getElementPageBounds(g.getElementById(d)),b.top<g.top?(a=a.mousePosition,k[AdfDhtmlPopupHints.MOUSEPOSITION]={x:a.x,y:a.y}):k[AdfDhtmlPopupHints.ALIGN_ELEMENT]=e):k[AdfDhtmlPopupHints.ALIGN_ELEMENT]=e,h.show(k))}};AdfDhtmlCalendarPeer.prototype._killCalendarActivityMouseTimeout=function(){this._calendarActivityMouseTimeout&&(AdfPage.PAGE.cancelTimer(this._calendarActivityMouseTimeout),delete this._calendarActivityMouseTimeout)};
AdfDhtmlCalendarPeer.prototype._queueCalendarActivityEvent=function(a,b,d,e,f,g){g!=AdfDhtmlCalendarPeer._EVENT_TRIGGER_HOVER&&this._hideActivityHoverPopup();var h=this._getProviderAndActivityIdFromElement(b),k=h.providerId,h=h.activityId;AdfFocusUtils.focusElement(b);this._setCurrentActivityId(h);AdfCalendarActivityEvent.queue(a,k,h,d,e,f,g)};
AdfDhtmlCalendarPeer.prototype._resizeTopRegion=function(a,b){var d=AdfPage.PAGE,e=this.getComponent();if("auto"==e.getSplitterPosition()){var f=e.getClientId();this._splitterComponent=d.findComponent(this._splitterid);var e=AdfAgent.AGENT,f=AdfRichUIPeer.CreateSubId(f,AdfDhtmlCalendarPeer._ALL_DAY_CONTAINER_SUB_ID),g=e.getElementById(f);if(g){var h=e.getElementById(this._splitterid),f=Math.floor(.4*h.offsetHeight);if(null==this._EMToPxRatio){var k=h.parentNode;this._EMToPxRatio=parseFloat(k.style.top)/
k.offsetTop}k=AdfDhtmlCalendarPeer._PADDING_AFTER_ALL_DAY_ACTIVITIES;if(g=AdfDomUtils.getChildElements(g)){var l=g.length,m=0,n=0;if(1==this._splitterComponent.getCollapsed()){var q=AdfDomUtils.getFirstChildElement(h);q.style.visibility="hidden";q.style.display=""}for(h=0;h<l;h++){var r=g[h];if("true"==e.getAttribute(r,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_KEY)){var t=r.offsetTop;t>m&&(m=t);0==n&&(n=r.offsetHeight)}}1==this._splitterComponent.getCollapsed()&&(q.style.display="none",q.style.visibility=
"");k+=m+n}q=Math.min(f,k);e.getPlatform()==AdfAgent.GECKO_PLATFORM&&(q=Math.max(36,q));this._splitterComponent.getSplitterPosition()!=q&&d.scheduleTimer(this,this._setSplitterPositionCallback,q,0)}}};
AdfDhtmlCalendarPeer.prototype._resizeBottomRegion=function(a,b){if(-1==this.getComponent().getShowActivityTypes().indexOf(AdfDhtmlCalendarPeer._TIME)){var d=this._getDateTimeGridContainer();if(d)for(var e=AdfDomUtils.getChildElementByAttributeValue(d,AdfDhtmlCalendarPeer._TIME_ACTIVITY_COLUMN_KEY,"true","div"),d=e.scrollHeight,e=e.childNodes,f=0;f<e.length;f++){var g=e[f];null==g.getAttribute(AdfDhtmlCalendarPeer._CALENDAR_TIME_SLOT_KEY)&&(g.style.minHeight=d+"px",g.style.height="100%")}}};
AdfDhtmlCalendarPeer.prototype._setSplitterPositionCallback=function(a){this._splitterComponent.setProperty(AdfRichPanelSplitter.SPLITTER_POSITION,a,!1,AdfUIComponent.PROPAGATE_LOCALLY)};AdfDhtmlCalendarPeer.prototype._setCurrentActivityId=function(a){this._currentActivityId=a};AdfDhtmlCalendarPeer.prototype._isBusyWithDifferentActivity=function(a){a=this._getProviderAndActivityIdFromElement(a).activityId;return null==this._currentActivityId||a===this._currentActivityId?!1:this.IsBusy()};
AdfDhtmlCalendarPeer.prototype._resizeMonthGrid=function(a,b){var d=AdfPage.PAGE.getLocaleContext().isRightToLeft(),e=null==a||b<a,f=this.getComponent(),g=f.getClientId(),h=AdfRichUIPeer.CreateSubId(g,AdfDhtmlCalendarPeer._MONTH_GRID_ID),k=AdfAgent.AGENT.getElementById(h);if(k)for(var h=k.childNodes,l=h.length,g=AdfRichUIPeer.CreateSubId(g,AdfDhtmlCalendarPeer._MONTH_HEADER_ID),g=AdfAgent.AGENT.getElementById(g),k=this._calculateMonthGridInfo(k,g),g=0;g<l;g++){for(var m=Array(k.numDaysInWeek),n=Array(k.numDaysInWeek),
q=Array(k.numDaysInWeek),r=Array(k.numDaysInWeek),t=Array(k.numDaysInWeek),u=Array(k.numDaysInWeek),v=0;v<k.numDaysInWeek;v++)u[v]=0;for(var w=h[g],y=w.childNodes,z=y.length,B=Array(k.numDaysInWeek),C=0;C<k.numDaysInWeek;C++)B[C]=0;for(C=0;C<y.length;C++){var A=parseInt(AdfAgent.AGENT.getAttribute(y[C],AdfDhtmlCalendarPeer._CAL_ACT_COL_NUM));if(!isNaN(A)){var v=AdfAgent.AGENT.getAttribute(y[C],AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_ALL_DAY_KEY),E=AdfAgent.AGENT.getAttribute(y[C],AdfDhtmlCalendarPeer._CAL_MONTH_TIMED_ACTIVITY_WRAPPER);
if(v)for(var F=this._getActivityInfo(y[C],k),A=0;A<F.activityLength;A++)B[F.startDay+A]++;else if(E)for(var D=y[C],v=0;v<D.children.length;v++)for(F=this._getActivityInfo(D.children[v],k),A=0;A<F.activityLength;A++)B[F.startDay+A]++}}for(A=0;A<z;A++){v=AdfAgent.AGENT.getAttribute(y[A],AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_ALL_DAY_KEY);E=AdfAgent.AGENT.getAttribute(y[A],AdfDhtmlCalendarPeer._CAL_MONTH_TIMED_ACTIVITY_WRAPPER);C=AdfAgent.AGENT.getAttribute(y[A],AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK);
F=this._getDayIndexOfGridElem(k,y[A]);if(v)D=y[A],null==k.activityInfo&&this._calculateMonthGridCapacity(D,k);else if(E)D=y[A].childNodes[0],null==k.activityInfo&&this._calculateMonthGridCapacity(D,k);else if(C){D=AdfAgent.AGENT.getAttribute(y[A],AdfDhtmlCalendarPeer._CAL_MONTH_NUM_OVERFLOW);t[F]=D;w.removeChild(y[A]);A--;z--;continue}else m[F]=y[A];if(v||E||C)if(e){var J,C=k.dayCellHt-(k.dayHeaderHt+k.activityInfo.spacerHt);if(v){if(D=y[A],v=parseInt(AdfAgent.AGENT.getAttribute(D,AdfDhtmlCalendarPeer._CAL_ACT_ROW_NUM)),
E=parseInt(AdfAgent.AGENT.getAttribute(D,AdfDhtmlCalendarPeer._CAL_ACT_COL_NUM)),J=B[E],E=(v+1)*k.activityInfo.activityHt,v>=k.maxNumActivities||1<J&&E+k.activityInfo.overflowHt>=C)"none"!=D.style.display&&this._hideMonthGridActivity(D,k,u),null==n[F]&&(n[F]=D),null==q[F]&&(q[F]=D)}else if(E){D=y[A];E=parseInt(AdfAgent.AGENT.getAttribute(D,AdfDhtmlCalendarPeer._CAL_ACT_COL_NUM));J=B[E];for(var G=D.childNodes.length,H=0,K=0;K<G;K++){var L=D.childNodes[K],v=parseInt(AdfAgent.AGENT.getAttribute(L,AdfDhtmlCalendarPeer._CAL_ACT_ROW_NUM)),
E=(v+1)*k.activityInfo.activityHt;if(v>=k.maxNumActivities||1<J&&E+k.activityInfo.overflowHt>=C)"none"!=L.style.display&&this._hideMonthGridActivity(L,k,u),H++,null==q[F]&&(q[F]=L)}if(null==n[F])if(H==G)n[F]=D;else if(0<H){for(D=AdfDomUtils.getNextElement(D);null!=AdfAgent.AGENT.getAttribute(D,AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK);)D=AdfDomUtils.getNextElement(D);n[F]=D}}}else if(C=k.dayCellHt-(k.dayHeaderHt+k.activityInfo.spacerHt),v)D=y[A],v=parseInt(AdfAgent.AGENT.getAttribute(D,AdfDhtmlCalendarPeer._CAL_ACT_ROW_NUM)),
parseInt(AdfAgent.AGENT.getAttribute(D,AdfDhtmlCalendarPeer._CAL_ACT_COL_NUM)),E=(v+1)*k.activityInfo.activityHt,v<k.maxNumActivities&&E+k.activityInfo.overflowHt<C?"none"==D.style.display&&this._showMonthGridActivity(D,k,u):(null==n[F]&&(n[F]=D),null==q[F]&&(q[F]=D));else if(E){D=y[A];J=0;parseInt(AdfAgent.AGENT.getAttribute(D,AdfDhtmlCalendarPeer._CAL_ACT_COL_NUM));G=D.childNodes.length;for(H=0;H<G;H++)K=D.childNodes[H],v=parseInt(AdfAgent.AGENT.getAttribute(K,AdfDhtmlCalendarPeer._CAL_ACT_ROW_NUM)),
E=(v+1)*k.activityInfo.activityHt,v<k.maxNumActivities&&E+k.activityInfo.overflowHt<C?"none"==K.style.display&&this._showMonthGridActivity(K,k,u):(null==q[F]&&(q[F]=K),J++);if(null==n[F])if(J==G)n[F]=D;else if(0<J){for(D=AdfDomUtils.getNextElement(D);null!=AdfAgent.AGENT.getAttribute(D,AdfDhtmlCalendarPeer._CAL_MONTH_OVERFLOW_LINK);)D=AdfDomUtils.getNextElement(D);n[F]=D}}}for(y=0;y<k.numDaysInWeek;y++)if(z=n[y],B=(parseInt(t[y])||0)+(parseInt(u[y])||0),0<B){A=null!=q[y];F=this._getActivityInfo(q[y],
k);for(D=0;A&&D<F.activityLength;D++)1<(parseInt(t[y+D])||0)+(parseInt(u[y+D])||0)&&(A=!1);if(1==A&&AdfAgent.AGENT.getAttribute(q[y],AdfDhtmlCalendarPeer._CAL_ACT_ROW_NUM)<k.maxNumActivities)for(q[y].style.display=q[y].style._display||"",z=0;z<F.activityLength;z++)--u[y+z];else{if(null==z)for(A=y-1;0<=A;A--)if(null!=r[A]){z=AdfDomUtils.getNextElement(r[A]);break}B=this._createOverflowLinkForMonthGrid(f,B,m[y],k);d?B.style.right=m[y].style.right:B.style.left=m[y].style.left;B.style.top=k.dayCellHt-
k.activityInfo.overflowHt-k.activityInfo.spacerHt+"px";B.style.width=m[y].style.width;w.insertBefore(B,z);r[y]=B}}}};AdfDhtmlCalendarPeer.prototype._showContextMenu=function(a,b,d,e,f){if(b=AdfAgent.AGENT.getAttribute(b,e))this._killCalendarActivityMouseTimeout(),this.showContextMenu(d.getNativeEvent(),b,a,f,null,a.getClientId()),d.cancel()};
AdfDhtmlCalendarPeer.prototype._handleActivityContextMenu=function(a,b,d,e){var f=this._getComponentEventSource(a);this._queueCalendarActivityEvent(f,d,null,0,AdfDhtmlCalendarPeer._EVENT_BUTTON_NONE,AdfDhtmlCalendarPeer._EVENT_TRIGGER_CONTEXT_MENU);var g=null;e&&(g=d);this._showContextMenu(f,b,a,AdfDhtmlCalendarPeer._FACET_ID_ACTIVITY_CONTEXT_MENU,g)};
AdfDhtmlCalendarPeer.prototype._handleClickEvents=function(a,b){var d=a.getNativeEventTarget();if(a.isLeftButtonPressed()&&d){var e=this._getComponentEventSource(a),f=this.getDomElement(),g=this._getDisplayChangeElement(f,d);g?(this._hideActivityHoverPopup(),d=AdfAgent.AGENT.getAttribute(g,AdfDhtmlCalendarPeer._CALENDAR_DAY_KEY),AdfCalendarDisplayChangeEvent.queue(e,d,AdfDhtmlCalendarPeer._VIEW_DAY)):(g=this._getParentActivity(f,d))&&f!=g?this._isBusyWithDifferentActivity(g)||(this._queueCalendarActivityEvent(e,
g,null,b,AdfDhtmlCalendarPeer._EVENT_BUTTON_LEFT,AdfDhtmlCalendarPeer._EVENT_TRIGGER_MOUSE),this._launchPopupFacet(e,AdfDhtmlCalendarPeer._FACET_ID_ACTIVITY_DETAIL)):this._queueCalendarEvent(e,a,f,d,null,b,AdfDhtmlCalendarPeer._EVENT_BUTTON_LEFT,AdfDhtmlCalendarPeer._EVENT_TRIGGER_MOUSE)&&this._launchPopupFacet(e,AdfDhtmlCalendarPeer._FACET_ID_CREATE)}};
AdfDhtmlCalendarPeer.prototype._queueCalendarEvent=function(a,b,d,e,f,g,h,k){var l=this._getDayCellAttrValue(d,e),m=this._getTimeSlotAttrValue(d,e),n=e.parentNode,q=AdfAgent.AGENT.getElementPosition(n);if(null==m&&null!=this._getParentWithAttr(d,e,AdfDhtmlCalendarPeer._TIME_ACTIVITY_COLUMN_KEY))var r=AdfAgent.AGENT.getMousePosition(b.getNativeEvent()),m=r.y,r=24*this._getTimeSlotsPerHour(),m=Math.round(Math.max(m-q.y,0)/(n.offsetHeight/r)-.5);n==d&&(l=AdfAgent.AGENT.getAttribute(n,AdfDhtmlCalendarPeer._CALENDAR_ACTIVE_DATE_KEY));
if(null==l)for(r=AdfAgent.AGENT.getMousePosition(b.getNativeEvent()),b=Math.max(r.x-q.x,0)/(n.offsetWidth/7),b=Math.round(b-.5),6<b&&(b=6),n=n.childNodes,q=null,r=0;r<n.length;r++){var t=n[r];1==t.nodeType&&(q=AdfAgent.AGENT.getAttribute(t,AdfDhtmlCalendarPeer._CALENDAR_DAY_CELL_KEY));if(q&&r==b){l=q;break}}return null!=l&&void 0!=l?(b=n=null,null!=m&&(b=this._getTimeSlotsPerHour(),n=Math.round(m/b-.5),b=m%b*(60/b)),this._hideActivityHoverPopup(),m=null,this._isInProviderGroupingMode(a)&&(m=AdfDomUtils.getParentWithAttr(d,
e,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO)),AdfCalendarEvent.queue(a,l,n,b,f,g,h,k,m?AdfAgent.AGENT.getAttribute(m,AdfDhtmlCalendarPeer._CALENDAR_PROVIDER_ID_EXPANDO):null),!0):!1};
AdfDhtmlCalendarPeer.prototype._handleTimeResizeIndicatorMouseDown=function(a){var b=a.getNativeEventTarget();a=a.getNativeEvent();var d=AdfAgent.AGENT,e=this.getComponent(),f=this.getDomElement();d.disableUserSelect(f);var g=this._getParentActivity(f,b);this._resizedActivity=g;var h=g.firstChild.firstChild;this._resizedActivityInitHeight=h.clientHeight;this._resizedActivityInitWidth=h.clientWidth;this._resizedActivityInitHeightInEM=parseFloat(h.style.height);this._EMToPxRatio=this._resizedActivityInitHeightInEM/
this._resizedActivityInitHeight;this._resizeStartY=a.clientY;this._resizeStartX=a.clientX;h.style.height=this._resizedActivityInitHeight+"px";h._newHeight=this._resizedActivityInitHeight;var k=this._dayGridCellRowsContainer;if(!k){k=this._getParentWithAttr(f,g,AdfDhtmlCalendarPeer._TIME_ACTIVITY_COLUMN_KEY);AdfAssert.assertDomElement(k);this._dayGridCellRowsContainer=k;-1==e.getShowActivityTypes().indexOf(AdfDhtmlCalendarPeer._TIME)&&e.getShowActivityTypes().indexOf(AdfDhtmlCalendarPeer._DURATION);
e=k.childNodes;for(f=0;f<e.length;f++)if(k=e[f],null!=d.getAttribute(k,AdfDhtmlCalendarPeer._CALENDAR_TIME_SLOT_KEY)){this._minIncrementSize=k.clientHeight;break}this._dateTimeGridContainer=this._getDateTimeGridContainer()}this._isActivityDraggableAcrossDays(g)&&(this._setTimeActDragInfo(g,h.clientHeight),this._gridTop=d.getElementTop(this._dateTimeGridContainer),this._gridLeftBoundary=d.getElementLeft(this._dateTimeGridContainer),this._gridRightBoundary=d.getElementLeft(this._dateTimeGridContainer)+
this._dateTimeGridContainer.clientWidth,this._deltaDays=0);this._scrollTopBeforeDrag=this._dateTimeGridContainer.scrollTop;this._resizedActivityContainer=h;g.style.zIndex=++this._nextZIndex;this._activityResizeDragCallback||(this._activityResizeDragCallback=this.createCallback(this._handleTimeActivityResizeDrag),this._activityResizeDropCallback=this.createCallback(this._handleTimeActivityResizeDrop),this._activityResizeAbortCallback=this.createCallback(this._handleTimeActivityResizeAbort));AdfPage.PAGE.startDrag(a,
this._activityResizeDragCallback,this._activityResizeDropCallback,this._activityResizeAbortCallback);b.style.cursor="default";this._activityResizeIndicator=b};
AdfDhtmlCalendarPeer.prototype._handleAlldayResizeIndicatorMouseDown=function(a){var b=a.getNativeEventTarget(),d=a.getNativeEvent(),e=AdfAgent.AGENT,f=this.getDomElement();e.disableUserSelect(f);var g=this._getParentActivity(f,b);this._resizedActivity=g;this._resizedActivityInitWidthInPercent=g.style.width;this._resizedActivityInitOffsetLeft=g.offsetLeft;this._resizeStartX=d.clientX;var h=this._getParentWithAttr(f,g,AdfDhtmlCalendarPeer._MONTH_ROW_ID);h&&(this._initMonthRowTop=e.getElementTop(h),
this._monthRowHeight=h.clientHeight,this._deltaWeeks=0);f=this._alldayContainer;f||(f=this._getComponentEventSource(a),"month"==f.getView()?f=h:(f=AdfRichUIPeer.CreateSubId(f.getClientId(),AdfDhtmlCalendarPeer._ALL_DAY_CONTAINER_SUB_ID),f=e.getElementById(f)));AdfAssert.assertDomElement(f);this._alldayContainer=f;a=Math.ceil(.005*f.clientWidth);var h=f.clientWidth,e=e.getElementLeft(f),k=AdfPage.PAGE.getLocaleContext().isRightToLeft(),f=f.clientWidth/7,l=this._getActivityX(g,k);this._minX=this._getMinX(k,
l,f,a);this._maxX=k?e+a:e+h-a;this._alldayContainerX=e;this._dayWidth=f;this._activityX=l;this._activityEndPadding=a;AdfDomUtils.addCSSClassName(g,AdfDhtmlCalendarPeer._DRAG_END_CLASS);g.style.zIndex=++this._nextZIndex;this._alldayActivityResizeDragCallback||(this._alldayActivityResizeDragCallback=this.createCallback(this._handleAlldayActivityResizeDrag),this._alldayActivityResizeDropCallback=this.createCallback(this._handleAlldayActivityResizeDrop),this._alldayActivityResizeAbortCallback=this.createCallback(this._handleAlldayActivityResizeAbort));
AdfPage.PAGE.startDrag(d,this._alldayActivityResizeDragCallback,this._alldayActivityResizeDropCallback,this._alldayActivityResizeAbortCallback);b.style.cursor="default";this._activityResizeIndicator=b};AdfDhtmlCalendarPeer.prototype._getActivityX=function(a,b){var d=AdfAgent.AGENT;return b?d.getElementLeft(a)+resizedActivity.clientWidth:d.getElementLeft(a)};AdfDhtmlCalendarPeer.prototype._getMinX=function(a,b,d,e){return a?b-d+e:b+d-e};
AdfDhtmlCalendarPeer.prototype._getClientActivityId=function(a,b,d){a=this.getComponent().getClientId()+"::"+a+"::"+b;null!=d&&(a=a+"::"+d);return a};
AdfDhtmlCalendarPeer.prototype._handleTimeActivityResizeDrag=function(a,b,d){d=this._resizedActivity;var e=d.offsetTop;b=this._resizedActivityContainer;var f=this._resizedActivityInitHeight,g=this._dayGridCellRowsContainer,h=this._minIncrementSize;this._autoscrollCalendarIfNecessary(a);var k=a.clientY;if(this._isActivityDraggableAcrossDays(d)){var l=AdfPage.PAGE.getLocaleContext().isRightToLeft(),m=AdfAgent.AGENT,n=a.clientX;if(n>=this._parentDayLeftBoundary&&n<=this._parentDayRightBoundary)d.style.width=
Math.max(this._resizedActivityInitWidth,l?this._activityRightBoundary-n:n-this._activityLeftBoundary)+"px";else{var q=m.getElementPageBounds(this._parentDay);a=this._getProviderAndActivityIdFromElement(d);var r=a.suffix;if(!l&&n<q.left||l&&n>q.right)null!=r&&0<r.length&&(0<r?r--:r=null,a=this._getClientActivityId(a.providerId,a.activityId,r),a=m.getElementById(a))&&(this._deltaDays--,d.parentNode.removeChild(d),b=a.firstChild.firstChild,null!=b._initHeight?(this._setTimeActDragInfo(a,b._initHeight),
this._resizeStartY=b._resizeStartY):(this._setTimeActDragInfo(a,h),this._resizeStartY=m.getElementTop(a)+h,b.style.height=h+"px",f=h));else if(!l&&n>q.right&&n<this._gridRightBoundary||l&&n<q.left&&n>this._gridLeftBoundary){b._initHeight=this._resizedActivityInitHeight;l=g.scrollHeight-e;b._newHeight=l;b.style.height=l+"px";b._resizeStartY=this._resizeStartY;l=d.cloneNode(!0);r?r++:r=0;l.id=this._getClientActivityId(a.providerId,a.activityId,r);b=l.style;b.zIndex=++this._nextZIndex;b.top=0;b.left=
0;for(b=AdfDomUtils.getNextElement(d.parentNode.parentNode);null!=b;){if(null!=m.getAttribute(b,"arc")){b.firstChild.appendChild(l);break}b=AdfDomUtils.getNextElement(b)}m.elementsAdded(l);b=l.firstChild.firstChild;this._setTimeActDragInfo(l,0);this._deltaDays++;this._resizeStartY=this._gridTop-this._dateTimeGridContainer.scrollTop}}}k-=this._resizeStartY;k+=this._dateTimeGridContainer.scrollTop-this._scrollTopBeforeDrag;k=Math.ceil(k/h)*h;f+k>=h&&e+f+k<=g.offsetHeight?(d=f+k,b.style.height=d+"px",
b._newHeight=d):e+f+k>g.offsetHeight&&(d=null!=AdfAgent.AGENT.getAttribute(d,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_DURATION_KEY)?f+k:g.offsetHeight-e-2,b.style.height=d+"px",b._newHeight=d)};
AdfDhtmlCalendarPeer.prototype._handleAlldayActivityResizeDrag=function(a,b,d){b=this._resizedActivity;var e=this._alldayContainer;d=this._dayWidth;var f=this._activityEndPadding,g=this._maxX,h=this._minX,k=this._activityX,l=AdfPage.PAGE.getLocaleContext().isRightToLeft(),m=0,n=a.clientX;l?(n<g?n=g:n>h&&(n=h),m=k-n):(n>g?n=g:n<h&&(n=h),m=n-k);this._resizeNewX=n;b.style.width=m+"px";if(g=this._initMonthRowTop)if(a=a.clientY,a>g+this._monthRowHeight){if(g=AdfDomUtils.getNextElement(e)){this._deltaWeeks+=
1;a=AdfAgent.AGENT;var h=b.cloneNode(!0),m=this._getProviderAndActivityIdFromElement(b),q=m.suffix;q||(q=0);52==q?q=1:q++;h.id=this._getClientActivityId(m.providerId,m.activityId,q);a.copyStyle(b,h);m=h.style;m.zIndex=++this._nextZIndex;g.appendChild(h);a.elementsAdded(g);l?(e=k-this._alldayContainerX+f,b.style.width=e+"px",m.right=".25%",k=this._getActivityX(h,l),m.width=k-n+"px"):(m.left=".25%",k=this._getActivityX(h,l),m.width=n-k+"px",e=e.clientWidth-b.offsetLeft-f,b.style.width=e+"px");this._minX=
this._getMinX(l,k,d,f);this._activityX=k;this._alldayContainer=g;this._resizedActivity=h;this._initMonthRowTop=a.getElementTop(g)}}else a<g&&(a=AdfAgent.AGENT,m=this._getProviderAndActivityIdFromElement(b),q=m.suffix,null!=q&&(q--,k=this._getClientActivityId(m.providerId,m.activityId,q),g=a.getElementById(k),g||0!=q||(k=this._getClientActivityId(m.providerId,m.activityId,null),g=a.getElementById(k),g||(k=this._getClientActivityId(m.providerId,m.activityId,52),g=a.getElementById(k))),g&&AdfDomUtils.isVisible(g)&&
(--this._deltaWeeks,h=0,k=this._getActivityX(g,l),h=l?k-n:n-k,this._minX=this._getMinX(l,k,d,f),g.width=h+"px",e.removeChild(b),b=AdfDomUtils.getPreviousElement(e),this._activityX=k,this._alldayContainer=b,this._resizedActivity=g,this._initMonthRowTop=a.getElementTop(b))))};AdfDhtmlCalendarPeer.prototype._getDateTimeGridContainer=function(){var a=this.getComponent().getClientId(),a=AdfRichUIPeer.CreateSubId(a,AdfDhtmlCalendarPeer._SCROLL_DAY_KEY);return AdfAgent.AGENT.getElementById(a)};
AdfDhtmlCalendarPeer.prototype._autoscrollCalendarIfNecessary=function(a){var b=AdfAgent.AGENT,d=this._dateTimeGridContainer;d.scrollHeight>d.offsetHeight&&(a=b.getMousePosition(a),b=b.getElementPosition(d),b=Math.max(a.y-b.y,0),a=b>d.offsetHeight-AdfDhtmlCalendarPeer._AUTOSCROLL_MARGIN,b<AdfDhtmlCalendarPeer._AUTOSCROLL_MARGIN||a)&&(b=d.scrollTop+(a?this._minIncrementSize:-this._minIncrementSize),0<=b&&b<d.scrollHeight&&(d.scrollTop=b))};
AdfDhtmlCalendarPeer.prototype._handleTimeActivityResizeDrop=function(a){var b=AdfAgent.AGENT,d=this._resizedActivity,e=0,f=0,g=this._resizedActivityContainer,h=g._newHeight,f=(h-this._resizedActivityInitHeight)/this._minIncrementSize,k=this._getTimeSlotsPerHour(),e=0<f?Math.floor(f/k):Math.ceil(f/k),l=60/k,f=Math.round(f%k*l),h=h*this._EMToPxRatio;if(this._isActivityDraggableAcrossDays(d)&&!(0>this._deltaDays))if(0==this._deltaDays)d.style.width=this._resizedActivityInitWidth+"px";else{for(var e=
e+24*(this._deltaDays-1),m=d.parentNode.parentNode;0<this._deltaDays;)m=AdfDomUtils.getPreviousElement(m),null!=m&&null!=AdfAgent.AGENT.getAttribute(m,"arc")&&this._deltaDays--;if(null!=m)for(var n=this._getProviderAndActivityIdFromElement(d),m=m.firstChild.firstChild;null!=m;){var q=this._getProviderAndActivityIdFromElement(m);if(q.providerId==n.providerId&&q.activityId==n.activityId){n=(m.firstChild.firstChild._newHeight-m.firstChild.firstChild._initHeight)/this._minIncrementSize;e+=0<n?Math.floor(n/
k):Math.ceil(n/k);f+=Math.round(n%k*l);break}m=AdfDomUtils.getNextElement(m)}}this._doTimeActivityResizeCleanup(g,h);if(null!=b.getAttribute(d,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_DURATION_KEY))var r=this._getDayCellAttrValue(this.getDomElement(),d);this._queueCalendarActivityDurationChangeEvent(d,e,f,r);b.eatEvent(a)};
AdfDhtmlCalendarPeer.prototype._handleAlldayActivityResizeDrop=function(a){var b=AdfAgent.AGENT,d=this._resizedActivity,e=0,f=AdfPage.PAGE.getLocaleContext().isRightToLeft(),g=this._dayWidth,e=Math.ceil((this._resizeNewX-this._alldayContainerX)/g),h=0;f?(h=this._resizeStartX+g/2,g=Math.ceil((h-this._alldayContainerX)/g),h=g-e):(h=this._resizeStartX-g/2,g=Math.ceil((h-this._alldayContainerX)/g),h=e-g);e=0;this._initMonthRowTop&&(e=this._deltaWeeks);e=24*h+168*e;0==e&&(d.style.width=this._resizedActivityInitWidthInPercent);
this._doAlldayActivityResizeCleanup(d);this._queueCalendarActivityDurationChangeEvent(d,e,0);b.eatEvent(a)};AdfDhtmlCalendarPeer.prototype._queueCalendarActivityDurationChangeEvent=function(a,b,d,e){if(0!=b||0!=d){this._hideActivityHoverPopup();var f=this._getProviderAndActivityIdFromElement(a);a=f.providerId;f=f.activityId;this._setCurrentActivityId(f);AdfCalendarActivityDurationChangeEvent.queue(this.getComponent(),a,f,b,d,e)}};
AdfDhtmlCalendarPeer.prototype._handleTimeActivityResizeAbort=function(){this._doTimeActivityResizeCleanup(this._resizedActivityContainer,this._resizedActivityInitHeightInEM)};AdfDhtmlCalendarPeer.prototype._handleAlldayActivityResizeAbort=function(){var a=this._resizedActivity;a.style.width=this._resizedActivityInitWidthInPercent;this._doAlldayActivityResizeCleanup(a)};AdfDhtmlCalendarPeer.prototype._doTimeActivityResizeCleanup=function(a,b){a.style.height=b+"em";this._doActivityResizeCleanup(a)};
AdfDhtmlCalendarPeer.prototype._doAlldayActivityResizeCleanup=function(a){AdfDomUtils.removeCSSClassName(a,AdfDhtmlCalendarPeer._DRAG_END_CLASS);this._doActivityResizeCleanup(a)};AdfDhtmlCalendarPeer.prototype._doActivityResizeCleanup=function(a){this._alldayContainer=this._resizedActivity=null;AdfAgent.AGENT.enableUserSelect(this.getDomElement());AdfAssert.assertDomElement(this._activityResizeIndicator);this._activityResizeIndicator.style.cursor="";this._activityResizeIndicator=null};
AdfDhtmlCalendarPeer.prototype._changeCursorForMovableActivity=function(a,b){if(b&&null!=a.getDragSource()&&!this._resizedActivity){var d=a.getProperty(AdfDhtmlCalendarPeer._VIEW_KEY);if(d!=AdfDhtmlCalendarPeer._VIEW_LIST){var e=null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_ALL_DAY_KEY),f=null!=AdfAgent.AGENT.getAttribute(b,AdfDhtmlCalendarPeer._CALENDAR_ACTIVITY_DURATION_KEY),g=-1==a.getShowActivityTypes().indexOf(AdfDhtmlCalendarPeer._TIME);f&&g&&d==AdfDhtmlCalendarPeer._VIEW_DAY||
e&&d==AdfDhtmlCalendarPeer._VIEW_DAY||AdfDomUtils.containsCSSClassName(b,AdfDhtmlCalendarPeer._MOVEABLE_CLASS)||AdfDomUtils.addCSSClassName(b,AdfDhtmlCalendarPeer._MOVEABLE_CLASS)}}};AdfDhtmlCalendarPeer.prototype._hideActivityHoverPopup=function(){this._killCalendarActivityMouseTimeout();var a=AdfAgent.AGENT.getAttribute(this.getDomElement(),AdfDhtmlCalendarPeer._FACET_ID_ACTIVITY_HOVER);a&&this.getComponent().findComponent(a).hide()};
AdfDhtmlCalendarPeer.prototype._getProviderAndActivityIdFromElement=function(a){a=a.id.split("::");var b="",d="",e="",f=a.length;3<=f&&(b=a[1],d=a[2],3<f&&(e=a[3]));return{providerId:b,activityId:d,suffix:e}};AdfDhtmlCalendarPeer.prototype._getComponentEventSource=function(a){var b=this.getComponent();a=a.getSource();return a.getClientId()==this._splitterid?b:a};
AdfDhtmlCalendarPeer._initFlexListSizeBreakpoints=function(){var a=AdfPage.PAGE.getLookAndFeel(),b=a.getSkinProperty(AdfDhtmlCalendarPeer._CAL_SIZE_SM_SKIN_PROPERTY);void 0===AdfDhtmlCalendarPeer._CAL_SIZE_BREAKPOINTS&&void 0!=b&&(AdfDhtmlCalendarPeer._CAL_SIZE_BREAKPOINTS=[],AdfDhtmlCalendarPeer._CAL_SIZE_BREAKPOINTS[0]=b,AdfDhtmlCalendarPeer._CAL_SIZE_BREAKPOINTS[1]=a.getSkinProperty(AdfDhtmlCalendarPeer._CAL_SIZE_MD_SKIN_PROPERTY),AdfDhtmlCalendarPeer._CAL_SIZE_BREAKPOINTS[2]=a.getSkinProperty(AdfDhtmlCalendarPeer._CAL_SIZE_LG_SKIN_PROPERTY))};
AdfDhtmlCalendarPeer._initProviderGroupingSizeBreakpoints=function(){var a=AdfPage.PAGE.getLookAndFeel(),b=a.getSkinProperty(AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_SM_SKIN_PROPERTY);void 0===AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_BREAKPOINTS&&void 0!=b&&(AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_BREAKPOINTS=[],AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_BREAKPOINTS[0]=b,AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_BREAKPOINTS[1]=a.getSkinProperty(AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_MD_SKIN_PROPERTY),AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_BREAKPOINTS[2]=
a.getSkinProperty(AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_LG_SKIN_PROPERTY))};AdfDhtmlCalendarPeer._addViewSizeStyleClass=function(a,b){var d=a.className;if(-1==d.indexOf(b)){var e=d.indexOf(AdfDhtmlCalendarPeer._CAL_SIZE_STATE_PREFIX);-1!=e&&(d=d.substring(e,AdfDhtmlCalendarPeer._CAL_SIZE_STATE_LENGTH),AdfDomUtils.removeCSSClassName(a,d));AdfDomUtils.addCSSClassName(a,b)}};
AdfDhtmlCalendarPeer._adjustViewSizeState=function(a,b){if(AdfDhtmlCalendarPeer._CAL_SIZE_BREAKPOINTS){var d=AdfDhtmlCalendarPeer._CAL_SIZE_MD_STATE;void 0!==AdfDhtmlCalendarPeer._CAL_SIZE_BREAKPOINTS&&(b<AdfDhtmlCalendarPeer._CAL_SIZE_BREAKPOINTS[0]?d=AdfDhtmlCalendarPeer._CAL_SIZE_SM_STATE:b>=AdfDhtmlCalendarPeer._CAL_SIZE_BREAKPOINTS[0]&&b<AdfDhtmlCalendarPeer._CAL_SIZE_BREAKPOINTS[1]?d=AdfDhtmlCalendarPeer._CAL_SIZE_MD_STATE:b>=AdfDhtmlCalendarPeer._CAL_SIZE_BREAKPOINTS[1]&&b<AdfDhtmlCalendarPeer._CAL_SIZE_BREAKPOINTS[2]?
d=AdfDhtmlCalendarPeer._CAL_SIZE_LG_STATE:b>=AdfDhtmlCalendarPeer._CAL_SIZE_BREAKPOINTS[2]&&(d=AdfDhtmlCalendarPeer._CAL_SIZE_XL_STATE));AdfDhtmlCalendarPeer._addViewSizeStyleClass(a,d)}};
AdfDhtmlCalendarPeer._adjustProviderGroupingViewSizeState=function(a,b){var d=AdfDhtmlCalendarPeer._CAL_SIZE_MD_STATE;void 0!==AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_BREAKPOINTS&&(b<AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_BREAKPOINTS[0]?d=AdfDhtmlCalendarPeer._CAL_SIZE_SM_STATE:b>=AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_BREAKPOINTS[0]&&b<AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_BREAKPOINTS[1]?d=AdfDhtmlCalendarPeer._CAL_SIZE_MD_STATE:b>=AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_BREAKPOINTS[1]&&b<AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_BREAKPOINTS[2]?
d=AdfDhtmlCalendarPeer._CAL_SIZE_LG_STATE:b>=AdfDhtmlCalendarPeer._CAL_PROV_GRP_SIZE_BREAKPOINTS[2]&&(d=AdfDhtmlCalendarPeer._CAL_SIZE_XL_STATE));AdfDhtmlCalendarPeer._addViewSizeStyleClass(a,d)};AdfDhtmlCalendarPeer.prototype._switchfocusAndMarkActiveDescendant=function(a,b,d,e){AdfAssert.assertDomElement(a);AdfAssert.assertDomElement(b);AdfFocusUtils.focusElement(b);a.setAttribute("tabIndex",e?"0":"-1");b.setAttribute("tabIndex","0");d&&(d.cancel(),d.stopBubbling())};