/* * * GrapeCity InputMan Library 1.0.0 * http://grapecity.com/ * * Copyright(c) GrapeCity, Inc. All rights reserved. * **/ var __extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},GCIM;(function(n){var t=function(t){function i(i,r){n.DateTimeInfo.UpdateCustomEra(),this._serverData=arguments[2],t.call(this,i,r,!0)}return __extends(i,t),i.prototype._beginInit=function(){t.prototype._beginInit.call(this),this._suspendLayout=!1,this.Data=this._createCalendarData()},i.prototype._createUIRender=function(){this.Render=this._createCalendarRender()},i.prototype._createUIProcess=function(){this.UIProcess=this._createCalendarUIProcess()},i.prototype._renderHtmlElement=function(){var t=this.Render.CreateCalendar();this._getContainer().appendChild(t),this.GetRealControlEffect()===n.ControlEffect.Ipad&&(this._getContainer().style.borderRadius="5px")},i.prototype._endInit=function(){this.SuspendLayout(),t.prototype._endInit.call(this);if(typeof this._serverData!="undefined")try{this._initWithServerDataInternal(this._serverData)}finally{this._onInitServerDataComplete()}this.ResumeLayout()},i.prototype._getComponentType=function(){return n.IMControlType.Calendar},i.prototype._getDefaultSize=function(){return{Width:this.Data.DefaultControlWidth(),Height:this.Data.DefaultControlWidth()}},i.prototype._createCalendarData=function(){return new n.CalendarData(this)},i.prototype._createCalendarRender=function(){return new n.CalendarRender(this)},i.prototype._createCalendarUIProcess=function(){return new n.CalendarUIProcess(this)},i.prototype._dispose=function(){t.prototype._dispose.call(this),this.Render.DetachDocumentEvent()},i.prototype.SetjQueryMobileTheme=function(n){this.Data.SetjQueryMobileTheme(n)},i.prototype.GetjQueryMobileTheme=function(){return this.Data.jQueryMobileTheme},i.prototype.SetEnableScrollAnimation=function(n){this.Data.SetEnableScrollAnimation(n)},i.prototype.GetEnableScrollAnimation=function(){return this.Data.EnableScrollAnimation},i.prototype.SetFocusColor=function(n){return this.Data.SetFocusColor(n),this},i.prototype.GetFocusColor=function(){return this.Data.FocusColor},i.prototype.SetFocusDate=function(n){return this.Data.SetFocusDate(n),this},i.prototype.GetFocusDate=function(){return this.Data.FocusDate},i.prototype.SetMaxDate=function(n){this.Data.SetMaxDate(n)},i.prototype.GetMaxDate=function(){return this.Data.MaxDate},i.prototype.SetMinDate=function(n){this.Data.SetMinDate(n)},i.prototype.GetMinDate=function(){return this.Data.MinDate},i.prototype.SetMaxSelectionCount=function(n){this.Data.SetMaxSelectionCount(n)},i.prototype.GetMaxSelectionCount=function(){return this.Data.MaxSelectionCount},i.prototype.SetSelectionMode=function(n){this.Data.SetSelectionMode(n)},i.prototype.GetSelectionMode=function(){return this.Data.GetSelectionMode()},i.prototype.SetAllowSelection=function(n){this.Data.SetAllowSelection(n)},i.prototype.GetAllowSelection=function(){return this.Data.GetAllowSelection()},i.prototype.SetSelectedDate=function(n){return this.Data.SetSelectedDate(n),this},i.prototype.GetSelectedDate=function(){return this.Data.SelectedDate},i.prototype.SetScrollRate=function(n){this.Data.SetScrollRate(n)},i.prototype.GetScrollRate=function(){return this.Data.ScrollRate},i.prototype.SetScrollTipAlign=function(n){this.Data.SetScrollTipAlign(n)},i.prototype.GetScrollTipAlign=function(){return this.Data.GetScrollTipAlign()},i.prototype.SetToolTip=function(n){this.Data.SetToolTip(n)},i.prototype.GetToolTip=function(){return this.Data.ToolTip},i.prototype.SetShowContextMenu=function(n){this.Data.SetShowContextMenu(n)},i.prototype.GetShowContextMenu=function(){return this.Data.ShowContextMenu},i.prototype.SetEnableTouchZoom=function(n){this.Data.SetEnableTouchZoom(n)},i.prototype.GetEnableTouchZoom=function(){return this.Data.EnableTouchZoom},i.prototype.SetEmptyRows=function(n){this.Data.SetEmptyRows(n)},i.prototype.GetEmptyRows=function(){return this.Data.GetEmptyRows()},i.prototype._setControlEffect=function(n){this.Data._setControlEffect(n)},i.prototype._getControlEffect=function(){return this.Data.ControlEffect.toString()},i.prototype.SetClientIDMode=function(n){this.Data.ClientIDMode=n},i.prototype.GetClientIDMode=function(){return this.Data.ClientIDMode},i.prototype.SetTabIndex=function(n){this.Data.SetTabIndex(n)},i.prototype.SetEnabled=function(n){return this.Data.SetEnabled(n),this},i.prototype.GetEnabled=function(){return this.Data.Enabled},i.prototype.SetEnableTheming=function(n){this.Data.EnableTheming=n},i.prototype.GetEnableTheming=function(){return this.Data.EnableTheming},i.prototype.SetFirstDayOfWeek=function(n){this.Data.SetFirstDayOfWeek(n)},i.prototype.GetFirstDayOfWeek=function(){return this.Data.GetFirstDayOfWeek()},i.prototype.SetFirstFiscalMonth=function(n){this.Data.SetFirstFiscalMonth(n)},i.prototype.GetFirstFiscalMonth=function(){return this.Data.GetFirstFiscalMonth()},i.prototype.SetFirstMonthInView=function(n){this.Data.SetFirstMonthInView(n)},i.prototype.GetFirstMonthInView=function(){return this.Data.GetFirstMonthInView()},i.prototype.SetYearMonthFormat=function(n){this.Data.SetYearMonthFormat(n)},i.prototype.GetYearMonthFormat=function(){return this.Data.YearMonthFormat},i.prototype.SetWeekTitleSelect=function(n){this.Data.SetWeekTitleSelect(n)},i.prototype.GetWeekTitleSelect=function(){return this.Data.WeekTitleSelect},i.prototype.SetWeekNumberSelect=function(n){this.Data.SetWeekNumberSelect(n)},i.prototype.GetWeekNumberSelect=function(){return this.Data.WeekNumberSelect},i.prototype.SetTodayMarkColor=function(n){this.Data.SetTodayMarkColor(n)},i.prototype.GetTodayMarkColor=function(){return this.Data.TodayMarkColor},i.prototype.SetSkinID=function(n){this.Data.SkinID=n},i.prototype.GetSkinID=function(){return this.Data.SkinID},i.prototype.SetTipInterval=function(n){this.Data.SetTipInterval(n)},i.prototype.GetTipInterval=function(){return this.Data.TipInterval},i.prototype.SetOverrideTipText=function(n){return this.Data.SetOverrideTipText(n),this},i.prototype.GetOverrideTipText=function(){return this.Data.OverrideTipText},i.prototype.SetNavigatorOrientation=function(n){this.Data.SetNavigatorOrientation(n)},i.prototype.GetNavigatorOrientation=function(){return this.Data.GetNavigatorOrientation()},i.prototype.SetHCellSpacing=function(n){this.Data.SetHCellSpacing(n)},i.prototype.GetHCellSpacing=function(){return this.Data.HCellSpacing},i.prototype.SetVCellSpacing=function(n){this.Data.SetVCellSpacing(n)},i.prototype.GetVCellSpacing=function(){return this.Data.VCellSpacing},i.prototype.SetHeaderFormat=function(n){this.Data.SetHeaderFormat(n)},i.prototype.GetHeaderFormat=function(){return this.Data.HeaderFormat},i.prototype.SetShowNavigator=function(n){this.Data.SetShowNavigator(n)},i.prototype.GetShowNavigator=function(){return this.Data.GetShowNavigator()},i.prototype.SetShowHeader=function(n){this.Data.SetShowHeader(n)},i.prototype.GetShowHeader=function(){return this.Data.ShowHeader},i.prototype.SetShowZoomButton=function(n){this.Data.SetShowZoomButton(n)},i.prototype.GetShowZoomButton=function(){return this.Data.ShowZoomButton},i.prototype.SetShowTodayMark=function(n){this.Data.SetShowTodayMark(n)},i.prototype.GetShowTodayMark=function(){return this.Data.ShowTodayMark},i.prototype.SetShowRokuyou=function(n){this.Data.SetShowRokuyou(n)},i.prototype.GetShowRokuyou=function(){return this.Data.GetShowRokuyou()},i.prototype.SetUseControlStyle=function(n){this.Data.SetUseControlStyle(n)},i.prototype.GetUseControlStyle=function(){return this.Data.UseControlStyle},i.prototype.SetShowScrollTip=function(n){this.Data.SetShowScrollTip(n)},i.prototype.GetShowScrollTip=function(){return this.Data.ShowScrollTip},i.prototype.SetShowToday=function(n){this.Data.SetShowToday(n)},i.prototype.GetShowToday=function(){return this.Data.ShowToday},i.prototype.SetShowWeekNumber=function(n){this.Data.SetShowWeekNumber(n)},i.prototype.GetShowWeekNumber=function(){return this.Data.ShowWeekNumber},i.prototype.SetShowTrailing=function(n){this.Data.SetShowTrailing(n)},i.prototype.GetShowTrailing=function(){return this.Data.ShowTrailing},i.prototype.SetCursor=function(n){return this.Data.SetCursor(n),this},i.prototype.GetCursor=function(){return this.Data.Cursor.toString()},i.prototype.SetCalendarType=function(n){return this.Data.SetCalendarType(n),this},i.prototype.GetCalendarType=function(){return this.Data.GetCalendarType()},i.prototype.SetCalendarYear=function(n){this.Data.SetCalendarYear(n)},i.prototype.GetCalendarYear=function(){return this.Data.GetCalendarYear()},i.prototype.SetBorderColor=function(n){return this.Data.SetBorderColor(n),this},i.prototype.GetBorderColor=function(){return this.Data.BorderColor},i.prototype.SetBorderStyle=function(n){return this.Data.SetBorderStyle(n),this},i.prototype.GetBorderStyle=function(){return this.Data.BorderStyle.toString()},i.prototype.GetBorderWidth=function(){return this.Data.BorderWidth},i.prototype._onBorderWidthChanged=function(n,t){this.Data.SetBorderWidth(t)},i.prototype.SetBackColor=function(n){return this.Data.SetBackColor(n),this},i.prototype.GetBackColor=function(){return this.Data.BackColor},i.prototype.SetBackgroundImageUrl=function(n){this.Data.SetBackgroundImageUrl(n)},i.prototype.GetBackgroundImageUrl=function(){return this.Data.BackgroundImage},i.prototype.SetTodayImageUrl=function(n){this.Data.SetTodayImageUrl(n)},i.prototype.GetTodayImageUrl=function(){return this.Data.TodayImage},i.prototype.SetWidth=function(n){this.Data.SetWidth(n)},i.prototype.GetWidth=function(){return this.Data.InnerWidth()},i.prototype.SetHeight=function(n){this.Data.SetHeight(n)},i.prototype.GetHeight=function(){return this.Data.InnerHeight()},i.prototype.SetVisible=function(n){return this.Data.SetVisible(n),this},i.prototype.GetVisible=function(){return this.Data.Visible},i.prototype.SetAutoSize=function(n){this.Data.SetAutoSize(n)},i.prototype.GetAutoSize=function(){return this.Data.AutoSize},i.prototype.SetHeaderHeight=function(n){this.Data.SetHeaderHeight(n)},i.prototype.GetHeaderHeight=function(){return this.Data.HeaderHeight},i.prototype.GetMonthMargins=function(){return this.Data.MonthMargins},i.prototype.SetMonthMargins=function(n,t,i,r){return this.Data.SetMonthMargins(n,t,i,r)},i.prototype.GetMonthPadding=function(){return this.Data.MonthPadding},i.prototype.SetMonthPadding=function(n,t){this.Data.SetMonthPadding(n,t)},i.prototype.GetCalendarDimensions=function(){return this.Data.CalendarDimensions},i.prototype.SetCalendarDimensions=function(n,t){this.Data.SetCalendarDimensions(n,t)},i.prototype.GetCalendarMargins=function(){return this.Data.CalendarMargins},i.prototype.SetCalendarMargins=function(n,t,i,r){return this.Data.SetCalendarMargins(n,t,i,r)},i.prototype.GetFontFamily=function(){return this.Data.Font.GetFontFamily()},i.prototype.SetFontFamily=function(n){this.Data.Font.SetFontFamily(n)},i.prototype.GetFontSize=function(){return this.Data.Font.GetFontSize()},i.prototype.SetFontSize=function(n){this.Data.Font.SetFontSize(n)},i.prototype.GetFontWeight=function(){return this.Data.Font.GetFontWeight()},i.prototype.SetFontWeight=function(n){this.Data.Font.SetFontWeight(n)},i.prototype.GetFontStyle=function(){return this.Data.Font.GetFontStyle()},i.prototype.SetFontStyle=function(n){this.Data.Font.SetFontStyle(n)},i.prototype.GetTextDecoration=function(){return this.Data.Font.GetTextDecoration()},i.prototype.SetTextDecoration=function(n){this.Data.Font.SetTextDecoration(n)},i.prototype.GetSelections=function(){for(var t=[],i=this.Data.Selections,n=0;n=f.Left&&i<=f.Left+e.offsetWidth&&r>=f.Top&&r<=f.Top+e.offsetHeight)return e}return null}for(o=0;o=f.Left&&i<=f.Left+e.offsetWidth&&r>=f.Top&&r<=f.Top+e.offsetHeight)return e}for(o=0;o=f.Left&&i<=f.Left+e.offsetWidth&&r>=f.Top&&r<=f.Top+e.offsetHeight)return e}for(o=0;o=f.Left&&i<=f.Left+e.offsetWidth&&r>=f.Top&&r<=f.Top+e.offsetHeight)return e}return null},t.GetTitleSelectCell=function(n,t,i){for(var f=[],e=n.CalendarSectionDom.SingleCalendarDom[t],u,r=0;r<6;r++)u=e.RowsDom[r][i].ContainerCell,u.getAttribute("CellType")=="CommonDay"&&f.push(u);return f},t.GetWeekNumberSelectCell=function(n,t,i){for(var u=[],f=n.CalendarSectionDom.SingleCalendarDom[t],r=0;r<7;r++)u[r]=f.RowsDom[i][r].ContainerCell;return u},t.GetEventClientX=function(n){var t=n.clientX;return n.touches&&n.touches.length>0&&(t=n.touches[0].clientX),t},t.GetEventClientY=function(n){var t=n.clientY;return n.touches&&n.touches.length>0&&(t=n.touches[0].clientY),t},t.GetThumbScrollingToolTipPosition=function(i,r,u){var nt=i.GetThumbScrollingTooltipText(),f=t.GetTooltipPosition(u),c=r._getPopupMonthZoom(),p=i.InnerWidth()*c,y=i.InnerHeight()*c,o=i.DefaultScrollBarWidth()*c,d=t.CreateTempDomElement(i,"ScrollBarToolTip"),e=n.Utility.MeasureText(nt,d);e.Width+=10,e.Height+=10;var w=n.Utility.GetDomElementPosition(r.CalendarSectionDom.OutterContainer),h=w.Left,s=w.Top,a=parseInt(h+i.BorderWidth,10),g=h+p/2-e.Width/2,v=h+p-e.Width,l=parseInt(s+i.BorderWidth,10),k=s+y/2-e.Height/2,b=parseInt((s+y-i.BorderWidth).toString(),10)-e.Height;if(i.NavigatorOrientation==n.NavigatorOrientation.Left||i.NavigatorOrientation==n.NavigatorOrientation.Right){f.Width=i.NavigatorOrientation==n.NavigatorOrientation.Left?a+o:v-o;switch(i.ScrollTipAlign){case n.ScrollTipAlign.TopLeft:f.Height=l;break;case n.ScrollTipAlign.BottomRight:f.Height=b;break;case n.ScrollTipAlign.Center:f.Height=k;break}}else if(i.NavigatorOrientation==n.NavigatorOrientation.Top||i.NavigatorOrientation==n.NavigatorOrientation.Bottom){f.Height=i.NavigatorOrientation==n.NavigatorOrientation.Top?l+o:b-e.Height;switch(i.ScrollTipAlign){case n.ScrollTipAlign.TopLeft:f.Width=a;break;case n.ScrollTipAlign.BottomRight:f.Width=v;break;case n.ScrollTipAlign.Center:f.Width=g;break}}return f},t.CreateTempDomElement=function(t,i){var r=null,e=n.Utility.CreateInnerDiv(),u,f;switch(i){case"Header":r=t.HeaderStyle;break;case"Today":r=t.LegendStyle;break;case"WeekNumber":r=t.WeekNumberStyle;break;case"Title":r=t.TitleStyle;break;case"Item":r=t.ItemStyle;break;case"ScrollBarToolTip":case"PopupMonth":e.className=t.HeaderPopupStyleName;break;default:break}return r==null?e:(u=r.IsDefaultFont()?t.Font:r,f=e.style,f.fontFamily=u.GetFontFamily(),f.fontSize=u.GetFontSize()==""?"":n.Utility.GetFontSizeUnitValue(u.GetFontSize())+"px",f.fontStyle=u.GetFontStyle(),f.fontWeight=u.GetFontWeight(),e.className=n.Utility.DefaultControlStyle,e)},t.SetItemInlineStyle=function(n,i){t.SetSelectionInlineStyle(n,i)},t.SetDefalutItemInlineStyle=function(n){var t=n.style;t.color="",t.border="none 1px black",t.fontWeight="",t.backgroundColor="window",t.backgroundImage="",t.backgroundPosition="center center"},t.SetSelectionInlineStyle=function(n,t){var i=n.style;i.color=t.style.color,i.border=t.style.border,i.fontWeight=t.style.fontWeight,i.backgroundColor=t.style.backgroundColor,i.backgroundImage=t.style.backgroundImage,i.backgroundPosition=t.style.backgroundPosition},t.SetDefaultSelectionInlineStyle=function(n,t){var i=n.style;i.color=t?"":"white",i.border="none 0px black",i.fontWeight="",i.backgroundColor="rgb(51, 153, 255)",i.backgroundImage="",i.backgroundPosition="center center"},t.ClearInlineStyle=function(n){var t=n.style;t.color="",t.border="",t.fontWeight="",t.backgroundColor="",t.backgroundImage="",t.backgroundPosition=""},t.GetMonthLineBeginDate=function(t,i,r){for(var e,f,h,l,c,a,s,o,u=0;u=0;u--){a=e.RowsDom[f][u].ContainerCell.getAttribute("CellType");if(r==a)return s=e.RowsDom[f][u].ContainerCell.getAttribute("CellValue"),o=n.DateTimeInfo.String2Date(s),o}else return s=e.RowsDom[f][2].ContainerCell.getAttribute("CellValue"),o=n.DateTimeInfo.String2Date(s),o}return null},t.GetMonthBeginDate=function(t,i,r){for(var f,s,o,v,a,e,l,h,c,u=0;u=0;u--)for(e=2;e>=0;e--){l=f.RowsDom[u][e].ContainerCell.getAttribute("CellType");if(r==l)return h=f.RowsDom[u][e].ContainerCell.getAttribute("CellValue"),c=n.DateTimeInfo.String2Date(h),c}}return null},t.GetDayLineBeginDate=function(t,i,r){for(var e,f,h,l,c,a,s,o,u=0;u=0;u--){a=e.RowsDom[f][u].ContainerCell.getAttribute("CellType");if(r==a)return s=e.RowsDom[f][u].ContainerCell.getAttribute("CellValue"),o=n.DateTimeInfo.String2Date(s),o}else return s=e.RowsDom[f][6].ContainerCell.getAttribute("CellValue"),o=n.DateTimeInfo.String2Date(s),o}return null},t.GetItemRokuyouDiv=function(n){if(n.childNodes.length>0){var t=n.childNodes[0];if(t.childNodes.length>1)return t.childNodes[1]}return null},t.GetDivContainer=function(n){return n.childNodes.length>0?n.childNodes[0]:null},t.GetTextNode=function(n){return n.childNodes.length>0?n.childNodes[0]:null},t.GetItemTextDiv=function(n){return n.childNodes.length>0?n.childNodes[0]:null},t.GetZoomRate=function(t){var i=4,r=2,u=.7,f=1.5;return n.Utility.IsIE9OrLater&&(i=2,u=.6),i=t.CalendarDimensions.Width!==1?0:i,r=t.CalendarDimensions.Height!==1?0:r,{WidthOffset:i,HeightOffset:r,WidthZoomRate:u,HeightZoomRate:f}},t.CalculateMonthPaddingAutoSize=function(t){var i=new n.Size(0,0);return t.CalendarDimensions.Width>1&&(i.Width+=(t.CalendarDimensions.Width-1)*t.MonthPadding.Width),t.CalendarDimensions.Height>1&&(i.Height+=(t.CalendarDimensions.Height-1)*t.MonthPadding.Height),i},t.CalculateMarginAutoSize=function(t){var i=new n.Size(0,0);return i.Width+=t.CalendarMargins.Left+t.CalendarMargins.Right,i.Width+=t.MonthMargins.Left+t.MonthMargins.Right,i.Height+=t.CalendarMargins.Top+t.CalendarMargins.Bottom,i.Height+=t.MonthMargins.Top+t.MonthMargins.Bottom,i},t.CalculateCellSpacingAutoSize=function(t){var i=new n.Size(0,0);return i.Width+=t.VCellSpacing*8,i.Height+=t.HCellSpacing*8,t.ShowWeekNumber&&(i.Width+=t.VCellSpacing*1),i},t.CalculateScrollbarAutoSize=function(t){var i=new n.Size(0,0),r=t.DefaultScrollBarWidth();return(t.ShowNavigator===n.CalendarNavigators.ScrollBar||t.ShowNavigator===n.CalendarNavigators.Buttons)&&(t.NavigatorOrientation===n.NavigatorOrientation.Left||t.NavigatorOrientation===n.NavigatorOrientation.Right?i.Width=r:i.Height=r),i},t.CalculateHeaderAutoSize=function(i){var r=new n.Size(0,0),o,f,u,e;return i.ShowHeader&&(o=t.CreateTempDomElement(i,"Header"),f=n.Utility.MeasureText(i.GetHeaderText(),o),r.Width=f.Width,r.Height=f.Height,i.ShowNavigator===n.CalendarNavigators.Outlook&&(r.Width+=2*i.DefaultOutlookArrowSize().Width,i.ShowZoomButton&&(r.Width+=2*i.DefaultOutlookZoomButtonSize().Width)),u=i.HeaderStyle.GetBorderStyle(),u!="none"&&u!=""&&(e=i.DefaultStyleBorderWidth(i.HeaderStyle),r.Height+=2*e,r.Width+=2*e)),r},t.CalculateItemSingleAutoSize=function(i){var u=new n.Size(0,0),f=t.GetZoomRate(i),e=t.CreateTempDomElement(i,"Item"),r=n.Utility.MeasureText("99",e);return r.Width=r.Width+r.Width*f.WidthZoomRate,r.Height=r.Height*f.HeightZoomRate,u.Width=r.Width,u.Height=r.Height,u},t.CalculateTitleSingleAutoSize=function(i){for(var e=new n.Size(0,0),h=t.GetZoomRate(i),o=t.CreateTempDomElement(i,"Title"),f=0,s,r,u=0;u<7;u++)s=n.Utility.MeasureText(i.GetWeekDay(u).GetDayName(),o),f=Math.max(s.Width,f);return r=n.Utility.MeasureText(n.DateTimeInfo.ShortWeekDays[0],o),r.Width=Math.max(f,r.Width)+r.Width*h.WidthZoomRate,r.Height=r.Height*h.HeightZoomRate,e.Width=r.Width,e.Height=r.Height,e},t.CalculateWeekNumberSingleAutoSize=function(i){var u=new n.Size(0,0);if(i.ShowWeekNumber){var e=t.GetZoomRate(i),f=t.CreateTempDomElement(i,"WeekNumber"),r=n.Utility.MeasureText("99",f);r.Width+=4,r.Height+=4,u.Width=r.Width,u.Height=r.Height}return u},t.CalculateTodayAutoSize=function(i){var r=new n.Size(0,0),o,u,f,e;return i.ShowToday&&(o=t.CreateTempDomElement(i,"Today"),u=n.Utility.MeasureText(i.GetTodayText(),o),r.Width=u.Width*1.08,r.Height=u.Height,i.ShowTodayMark&&(r.Width+=u.Height),f=i.LegendStyle.GetBorderStyle(),f!="none"&&f!=""&&(e=i.DefaultStyleBorderWidth(i.LegendStyle),r.Width+=2*e,r.Height+=2*e)),r},t.CalculateItemBorderSizeAutoSize=function(t){var r=new n.Size(0,0),u=t.ItemStyle.GetBorderStyle(),i;return u!=="none"&&u!==""&&(i=t.DefaultStyleBorderWidth(t.ItemStyle),t.HCellSpacing==0&&t.VCellSpacing==0?(r.Width+=8*i,r.Height+=7*i):(r.Width+=14*i,r.Height+=12*i)),r},t.CalculateTitleBorderSizeAutoSize=function(t){var r=new n.Size(0,0),u=t.TitleStyle.GetBorderStyle(),i;return u!=="none"&&u!==""&&(i=t.DefaultStyleBorderWidth(t.TitleStyle),r.Width+=t.HCellSpacing==0&&t.VCellSpacing==0?8*i:14*i,r.Height+=2*i),r},t.CalculateWeekNumberBorderSizeAutoSize=function(t){var u=new n.Size(0,0),r=t.WeekNumberStyle.GetBorderStyle(),i;return r!=="none"&&r!==""&&(i=t.DefaultStyleBorderWidth(t.WeekNumberStyle),u.Width+=2*i),u},t.UpdateAutoSize=function(i){var f,o,h,u,e,s,c;if(!i.AutoSize)return;var y=t.GetZoomRate(i),l=t.CalculateItemSingleAutoSize(i),a=t.CalculateItemSingleAutoSize(i),p=t.CalculateWeekNumberSingleAutoSize(i),b=Math.max(a.Width,l.Width),d=Math.max(a.Height,l.Height,p.Height),r=new n.Size(0,0);r.Width+=p.Width,r.Width+=b*7,r.Height+=d*7;var v=t.CalculateItemBorderSizeAutoSize(i),w=t.CalculateTitleBorderSizeAutoSize(i),k=t.CalculateWeekNumberBorderSizeAutoSize(i);r.Width+=Math.max(v.Width,w.Width),r.Width+=k.Width,r.Height+=v.Height,r.Height+=w.Height,f=t.CalculateHeaderAutoSize(i),r.Height+=f.Height,r.Width=Math.max(f.Width,r.Width),o=t.CalculateMarginAutoSize(i),r.Width+=o.Width,r.Height+=o.Height,i.ShowRokuyou===n.Rokuyou.None?r.Height=r.Width:(r.Width=Math.max(r.Width,r.Height),r.Height=r.Width),h=t.CalculateCellSpacingAutoSize(i),r.Width+=h.Width,r.Height+=h.Height,u=new n.Size(0,0),u.Width+=r.Width*i.CalendarDimensions.Width,u.Height+=r.Height*i.CalendarDimensions.Height,e=t.CalculateScrollbarAutoSize(i),u.Width+=e.Width,u.Height+=e.Height,s=t.CalculateMonthPaddingAutoSize(i),u.Width+=s.Width,u.Height+=s.Height,u.Width+=y.WidthOffset,u.Height+=y.HeightOffset,c=t.CalculateTodayAutoSize(i),u.Width=Math.max(u.Width,c.Width),u.Height+=c.Height,i.Width=Math.floor(u.Width),i.Height=Math.floor(u.Height)},t.UpdateScrollBarThumb=function(i,r){var u;if(i.ShowNavigator!=n.CalendarNavigators.ScrollBar)return;u=r.CalendarSectionDom.ScrollBarDom;if(u==null)return;var s=i.NavigatorOrientation==n.NavigatorOrientation.Top||i.NavigatorOrientation==n.NavigatorOrientation.Bottom,e=i.GetScrollBarSize(s),f=e.StartTrackButtonSize,o=e.EndTrackButtonSize;t.SetCellSize(u.StartTrackButtonDom,f.Width,f.Height),t.SetCellSize(u.EndTrackButtonDom,o.Width,o.Height)},t.UpdateScrollbarThumbImage=function(t,i,r,u){var f=i.CalendarSectionDom.ScrollBarDom;if(f==null)return;var c=t.NavigatorOrientation,l=c===n.NavigatorOrientation.Top||c===n.NavigatorOrientation.Bottom,e=l?"HScrollBar_":"VScrollBar_",h=n.Utility.CheckCssImageUrl(t.GetImagePath(e+"Thumb_Top",!1,r,u)),s=n.Utility.CheckCssImageUrl(t.GetImagePath(e+"Thumb_Middle",!1,r,u)),o=n.Utility.CheckCssImageUrl(t.GetImagePath(e+"Thumb_Bottom",!1,r,u));f.StartInnerThumbButtonDom.style.backgroundImage=h,f.MiddleInnerThumbButtonDom.style.backgroundImage=s,f.EndInnerThumbButtonDom.style.backgroundImage=o,n.Utility.CreateImageCache([h,s,o])},t.GetEventCurrentTarget=function(t){var i,r;if(n.Utility.IsIE8OrBelow){i=t.srcElement;while(i!=null){r=i.getAttribute("CellType");if(r!=null)return i;i=i.parentElement}return null}else return t.currentTarget},t.UpdateSubStyleRule=function(t,i,r,u){var o=i.GetForeColor(),f,e;typeof r!="undefined"&&typeof u!="undefined"&&(o=u.GetWeekDayForeColor(i,r)),f=t.style,f.color=o,f.backgroundColor=i.GetBackColor(),f.fontWeight=i.GetBold()?"bold":"",f.backgroundImage=n.Utility.CheckCssImageUrl(i.GetImageUrl()),f.backgroundPosition="center center",e=i.GetUnderLine()?"underline":"",f.textDecoration.indexOf("overline")!=-1&&(e+=e===""?"overline":" overline"),f.textDecoration.indexOf("line-through")!=-1&&(e+=e===""?"line-through":" line-through"),f.textDecoration.indexOf("blink")!=-1&&(e+=e===""?"blink":" blink"),f.textDecoration=e},t.UpdateStyleRule=function(t,i,r){var f=r.IsDefaultFont()?t.Font:r,e=r.GetBorderStyle()===""?"none":r.GetBorderStyle(),s=t.DefaultStyleBorderWidth(r)+"px",o=r.GetBorderColor()===""?"black":r.GetBorderColor(),u=i.style;u.color=t.Enabled?r.GetForeColor():"graytext",u.padding="0px",u.backgroundColor=r.GetBackColor(),u.borderStyle=e,u.borderWidth=s,u.borderColor=o,u.textAlign=r.GetTextHAlign(),u.verticalAlign=r.GetTextVAlign()===""?"middle":r.GetTextVAlign(),u.backgroundImage=n.Utility.CheckCssImageUrl(r.GetImageUrl()),u.backgroundPosition="center center",u.fontFamily=f.GetFontFamily(),u.fontSize=f.GetFontSize()===""?"":n.Utility.GetFontSizeUnitValue(f.GetFontSize())+"px",u.fontWeight=f.GetFontWeight(),u.fontStyle=f.GetFontStyle(),u.textDecoration=n.Utility.CheckMultipleStringEnum(n.TextDecoration,f.GetTextDecoration())},t.GetHolidayStyleRule=function(n,t){for(var i=0;i0&&(f=t.touches[0].pageX+10,u=t.touches[0].pageY+10),new n.Size(f,u)},t.GetHeaderPopupPosition=function(t,i,r,u){var s=document.documentElement.scrollLeft,e=document.documentElement.scrollTop,h,v,a,o,f;document.documentElement&&document.documentElement.scrollLeft?s=document.documentElement.scrollLeft:document.body&&document.body.scrollLeft&&(s=document.body.scrollLeft),document.documentElement&&document.documentElement.scrollTop?e=document.documentElement.scrollTop:document.body&&document.body.scrollTop&&(e=document.body.scrollTop),n.Utility.chrome&&(s=document.body.scrollLeft,e=document.body.scrollTop);var y=t.DefaultPopupMonthSize(),l=t._realPopupMonthWidth?t._realPopupMonthWidth:y.Width,c=r.srcElement||r.target;return c.id=t.Control._getId()+"_header",h=c.clientWidth,v=n.Utility.GetElementPosition(c),c.id="",n.Utility.IsTouchMouseDown&&(a=i._getPopupMonthZoom(),l=l*a,h=h*a),o=v.Left+h/2-l/2,f=r.clientY-u/2+e,r.touches&&r.touches.length>0&&(f=r.touches[0].pageY-u/2),o=o>s?o:s,f=f>e?f:e,new n.Size(o,f)},t.GetDateString=function(n,t){if(!n)return"";var i=typeof t!="undefined"?t:"-";return n.getFullYear()+i+(n.getMonth()+1)+i+n.getDate()+" "+n.getHours()+":"+n.getMinutes()+":"+n.getSeconds()},t.GetRokuyouText=function(t,i){var f=t.getFullYear()+"_"+t.getMonth()+"_"+t.getDate(),r=n.DateTimeInfo.GetRokuyou(t);return n.DateTimeInfo.GetRokuyouText(r&i)},t.GetThemeFolderName=function(t){switch(t.InnerControlEffect()){case n.ControlEffect.Windows8Theme:return"Win8";case n.ControlEffect.Edge:return"Edge";case n.ControlEffect.VistaTheme:return"Vista";case n.ControlEffect.Chrome:return"Chrome";case n.ControlEffect.Ipad:return"Ipad"}return"Normal"},t.GetWeekIndex=function(t,i,r,u,f){if(t<0||t>1e4||i<1||i>12||r<1||r>31)throw"date is invalidate";var c=new Date(t,0,1),e=c.getDay(),l=e>=u?e-u:7-u+e,h=n.DateTimeInfo.DayOfYear(t,i,r),o=h+l,s=o%7==0?o/7:f?1:o/7+1;return Math.floor(s)},t.GetDateWeekOrder=function(n){return Math.floor((n.getDate()-1)/7)},t.ResetCellDom=function(t){var f=t.ContainerCell,u,i,r;f.className="",f.removeAttribute("styleName"),f.style.border="",u=t.ContainerStyleDiv,u.className="",u.removeAttribute("styleName"),n.Utility.IsQuriksMode&&(i=t.ContentTable,i!=null&&(i.className="",i.style.color=""),r=t.ContentRokoyouContentTable,r!=null&&(r.className="",r.style.color=""))},t.ResetTodayDom=function(n){var r=n.TodayText,i=r.style,t;i.display="",i.fontFamily="",i.fontSize="",n.TodayMark.style.display="",n.TodayContainer.style.display="",n.TodayContainer.style.borderWidth="",t=n.TodayContentTable,t.className="",t.style.marginLeft="",t.style.marginRight="",t.removeAttribute("styleName")},t.ResetMonthCellDom=function(n){t.ResetCellDom(n),t.ClearInlineStyle(n.ContainerCell),t.ClearInlineStyle(n.ContainerStyleDiv),n.ContentCell.style.display="",n.ContentCell.style.textDecoration=""},t.CreateDayCellDomStyle=function(){return{ContentCell:{vAlign:"",className:"",style:{display:"",fontFamily:"",fontSize:"",textDecoration:""}},ContentTable:{className:"",color:""},ContainerCell:{styleName:"",className:"",holidayType:"",holidayName:"",style:{padding:"",border:"",fontWeight:"",color:"",backgroundColor:"",backgroundImage:"",backgroundPosition:""}},ContainerCellDiv:{className:"",style:{marginLeft:"",marginRight:""}},ContainerStyleDiv:{styleName:"",className:"",style:{padding:"",border:"",fontWeight:"",color:"",backgroundColor:"",backgroundImage:"",backgroundPosition:""}},ContentRokoyouContentTable:{className:"",style:{color:""}},ContentRokuyouDiv:{className:"",holidayName:"",style:{display:""}},ContentRokuyouCell:{style:{textDecoration:"",display:""}}}},t.SetDayCellDomStyle=function(t,i){var o=t.ContainerCell,e=o.style,f=i.ContainerCell.style,p,l,c,y;o.className=i.ContainerCell.className,o.setAttribute("holidayType",i.ContainerCell.holidayType),o.setAttribute("holidayName",i.ContainerCell.holidayName),o.setAttribute("styleName",i.ContainerCell.styleName),e.padding=f.padding,e.color=f.color,e.border=f.border,e.fontWeight=f.fontWeight,e.backgroundColor=f.backgroundColor,e.backgroundImage=f.backgroundImage,e.backgroundPosition=f.backgroundPosition;var k=t.ContainerCellDiv,w=k.style,b=i.ContainerCellDiv.style;k.className=i.ContainerCellDiv.className,w.marginLeft=b.marginLeft,w.marginRight=b.marginRight;var v=t.ContainerStyleDiv,r=v.style,u=i.ContainerStyleDiv.style;v.className=i.ContainerStyleDiv.className,v.setAttribute("styleName",i.ContainerStyleDiv.styleName),r.padding=u.padding,r.color=u.color,r.border=u.border,r.fontWeight=u.fontWeight,r.backgroundColor=u.backgroundColor,r.backgroundImage=u.backgroundImage,r.backgroundPosition=u.backgroundPosition,n.Utility.IsQuriksMode&&t.ContentTable!=null&&(p=t.ContentTable,p.className=i.ContentTable.className,p.style.color="black");var d=t.ContentDiv,s=t.ContentCell,h=s.style,a=i.ContentCell.style;s.className=i.ContentCell.className,s.setAttribute("vAlign",i.ContentCell.vAlign),h.display=a.display,h.fontFamily=a.fontFamily,h.fontSize=a.fontSize,l=t.ContentRokuyouDiv,l.className=i.ContentRokuyouDiv.className,l.style.display=i.ContentRokuyouDiv.style.display,c=t.ContentRokuyouCell,c.style.display=i.ContentRokuyouCell.style.display,n.Utility.IsQuriksMode&&t.ContentRokoyouContentTable!=null&&(y=t.ContentRokoyouContentTable,y.className=i.ContentRokoyouContentTable.className,y.style.color=i.ContentRokoyouContentTable.style.color),(n.Utility.chrome||n.Utility.safari||n.Utility.IsEdge)&&(d.style.textDecoration=i.ContentCell.style.textDecoration,c.style.textDecoration=i.ContentRokuyouCell.style.textDecoration)},t.ResetWeekNumberCellDom=function(i){t.ResetCellDom(i);var r=i.ContentCell.style;r.display="",r.fontFamily="",r.fontSize="",(n.Utility.chrome||n.Utility.safari||n.Utility.IsEdge)&&(r.textDecoration="")},t.ResetTitleCellDom=function(i){t.ResetCellDom(i);var u=i.ContainerCell.style,r=i.ContentCell.style;u.color="",u.backgroundColor="",r.display="",r.fontFamily="",r.fontSize="",(n.Utility.chrome||n.Utility.safari||n.Utility.IsEdge)&&(r.textDecoration="")},t.ResetHeaderDom=function(t){t.HeaderContainer.style.display="",t.HeaderContainer.style.borderWidth="",t.HeaderTextDiv.style.display="",t.InnerHeaderTextButton.style.fontFamily="",t.InnerHeaderTextButton.style.fontSize="",(n.Utility.chrome||n.Utility.safari||n.Utility.IsEdge)&&(t.InnerHeaderTextButton.style.textDecoration=""),n.Utility.IsQuriksMode&&(t.HeaderTextButtonContentTable.className="")},t.CreateTitleDom=function(t,i){if(i.ContainerStyleDiv==null){var f=n.Utility.CreateInnerDiv(),e=n.Utility.CreateInnerDiv(),u=n.Utility.CreateInnerTable(),s=n.Utility.CreateInnerTbody(),h=n.Utility.CreateInnerTableRow(),r=n.Utility.CreateInnerTableCell(t.CellStyleName),o=n.Utility.CreateInnerTextNode();i.ContainerCell.appendChild(f),f.appendChild(e),e.appendChild(u),u.appendChild(s),s.appendChild(h),h.appendChild(r),r.appendChild(o),r.style.padding="0px",r.style.whiteSpace="nowrap",i.ContainerStyleDiv=f,i.ContainerDiv=e,i.ContentCell=r,i.ContentTextNode=o,i.ContentTable=u}},t.CreateWeekNumberDom=function(t,i){if(i.ContainerStyleDiv==null){var f=n.Utility.CreateInnerDiv(),e=n.Utility.CreateInnerDiv(),u=n.Utility.CreateInnerTable(),s=n.Utility.CreateInnerTbody(),h=n.Utility.CreateInnerTableRow(),r=n.Utility.CreateInnerTableCell(t.CellStyleName),o=n.Utility.CreateInnerTextNode();i.ContainerCell.appendChild(f),f.appendChild(e),e.appendChild(u),u.appendChild(s),s.appendChild(h),h.appendChild(r),r.appendChild(o),r.style.padding="0px",r.style.whiteSpace="nowrap",i.ContainerStyleDiv=f,i.ContainerDiv=e,i.ContentCell=r,i.ContentTextNode=o,i.ContentTable=u}},t.CreateDayItemDom=function(t,i){if(i.ContainerStyleDiv==null){var c=n.Utility.CreateInnerDiv(),f=n.Utility.CreateInnerDiv(),e=n.Utility.CreateInnerDiv(),h=n.Utility.CreateInnerTable(),y=n.Utility.CreateInnerTbody(),p=n.Utility.CreateInnerTableRow(),r=n.Utility.CreateInnerTableCell(t.CellStyleName),w=n.Utility.CreateInnerTextNode(""),o=n.Utility.CreateInnerDiv(),s=n.Utility.CreateInnerTable(),v=n.Utility.CreateInnerTbody(),a=n.Utility.CreateInnerTableRow(),u=n.Utility.CreateInnerTableCell(t.CellStyleName),l=n.Utility.CreateInnerTextNode("");i.ContainerCell.appendChild(c),c.appendChild(f),f.appendChild(h),h.appendChild(y),y.appendChild(p),p.appendChild(r),r.appendChild(e),e.appendChild(w),e.appendChild(o),o.appendChild(s),s.appendChild(v),v.appendChild(a),a.appendChild(u),u.appendChild(l),r.style.padding="0px",r.style.whiteSpace="nowrap",u.style.padding="0px",u.style.whiteSpace="nowrap",f.style.overflow="",i.ContainerStyleDiv=c,i.ContainerCellDiv=f,i.ContentCell=r,i.ContentDiv=e,i.ContentTextNode=w,i.ContentRokuyouDiv=o,i.ContentRokuyouCell=u,i.ContentRokuyouTextNode=l,i.ContentTable=h,i.ContentRokoyouContentTable=s}},t.CreateZoomButtonImage=function(t,i){var r="",u;return r=t.GetEnablejQueryTheme()?n.Utility.IsIE8?t.GetImagePath(i,!0,!1,!1,"Normal"):t.GetImagePath(i,!0,!1,!1,"Chrome",".svg"):t.GetImagePath(i,!0),u=n.Utility.CreateInnerImage(r),u.style.verticalAlign="middle",u},t.CreateTodayCellImage=function(t){var r=t.GetTodayStyleImage(),i=n.Utility.CreateInnerImage(r);return i.style.width="16px",i.style.height="16px",i.style.position="absolute",i.style.top="2px",i.style.left="2px",i.style.zIndex="0",i},t.CreateNavigatorImage=function(t,i){var u=t.GetImagePath(i,!0),r;return t._useWhiteArrow&&t.ControlEffect===n.ControlEffect.Normal&&(i=i+"_Normal_White",u=n.Utility.BaseImageUrl+i+"_Normal"+t.Control._typeOfImage(".gif")),r=n.Utility.CreateInnerImage(u),r.style.verticalAlign="middle",r.style.display="",r},t.CreateNavigatorSpanElement=function(n){var t=document.createElement("span");return t.style.width="16px",t.style.height="16px",t.style.marginLeft="auto",t.style.marginRight="auto",t.className=n,t},t.CreateMonthItemDom=function(t,i){if(i.ContainerStyleDiv==null){var f=n.Utility.CreateInnerDiv(),e=n.Utility.CreateInnerDiv(),c=n.Utility.CreateInnerDiv(),u=n.Utility.CreateInnerTable(),h=n.Utility.CreateInnerTbody(),o=n.Utility.CreateInnerTableRow(),r=n.Utility.CreateInnerTableCell(t.CellStyleName),s=n.Utility.CreateInnerTextNode("");i.ContainerCell.appendChild(f),f.appendChild(e),e.appendChild(u),u.appendChild(h),h.appendChild(o),o.appendChild(r),r.appendChild(s),r.style.padding="0px",r.style.whiteSpace="nowrap",i.ContainerStyleDiv=f,i.ContainerCellDiv=e,i.ContentCell=r,i.ContentDiv=c,i.ContentTextNode=s,i.ContentTable=u}},t.GetNextMonthDate=function(t,i){var c=t.getFullYear(),o=t.getMonth(),h=t.getDate(),u=new Date(c,o,1);u.setMonth(o+i);var r=u.getFullYear(),e=u.getMonth(),f=h,s=n.DateTimeInfo.DaysInMonth(r,e+1);return f>s&&(f=s),r<100?t:new Date(r,e,f)},t.GetNextYearDate=function(t,i){var o=t.getFullYear(),c=t.getMonth(),h=t.getDate(),u=new Date(o,c,1);u.setFullYear(o+i);var r=u.getFullYear(),e=u.getMonth(),f=h,s=n.DateTimeInfo.DaysInMonth(r,e+1);return f>s&&(f=s),r<100?t:new Date(r,e,f)},t.GetMonthDifference=function(n,t){var i=0;return i=n==null&&t==null?0:n==null?-(t.getFullYear()*12+t.getMonth()+1):t==null?n.getFullYear()*12+n.getMonth()+1:(n.getFullYear()-t.getFullYear())*12+(n.getMonth()-t.getMonth())},t.GetFirstSelectCells=function(t){for(var r,u,i=0;i=t.MinDate&&i<=t.MaxDate},t.IsDayOfWeekInMonthSelected=function(t,i){var r=0;switch(t){case 0:r=n.WeekFlags.First;break;case 1:r=n.WeekFlags.Second;break;case 2:r=n.WeekFlags.Third;break;case 3:r=n.WeekFlags.Fourth;break;case 4:r=n.WeekFlags.Fifth;break;case 5:r=n.WeekFlags.Last;break;default:break}return(i&r)>0},t.IsMonthSelected=function(t,i){var r=0;switch(t){case 1:r=n.MonthFlags.January;break;case 2:r=n.MonthFlags.February;break;case 3:r=n.MonthFlags.March;break;case 4:r=n.MonthFlags.April;break;case 5:r=n.MonthFlags.May;break;case 6:r=n.MonthFlags.June;break;case 7:r=n.MonthFlags.July;break;case 8:r=n.MonthFlags.August;break;case 9:r=n.MonthFlags.September;break;case 10:r=n.MonthFlags.October;break;case 11:r=n.MonthFlags.November;break;case 12:r=n.MonthFlags.December;break;default:break}return(i&r)>0},t.CreateInnerDiv=function(t,i){var r=n.Utility.CreateElement("div");return n.Utility.chrome||n.Utility.safari||(r.style.overflow="hidden"),t&&(r.style.width=t+"px"),i&&(r.style.height=i+"px"),r},t.IsDayOfWeekSelected=function(t,i){var r=0;switch(t){case 0:r=n.DayOfWeek.Sunday;break;case 1:r=n.DayOfWeek.Monday;break;case 2:r=n.DayOfWeek.Tuesday;break;case 3:r=n.DayOfWeek.Wednesday;break;case 4:r=n.DayOfWeek.Thursday;break;case 5:r=n.DayOfWeek.Friday;break;case 6:r=n.DayOfWeek.Saturday;break;default:break}return(i&r)>0},t.IsShowImageAsContent=function(n){return!(n.GetImageAsBackground()||n.GetImageUrl()=="")},t}(),t;n.CalendarUtility=i,function(n){n[n.CalendarContainerStyle=1]="CalendarContainerStyle",n[n.ScrollBarThumb=2]="ScrollBarThumb",n[n.AutoSize=4]="AutoSize",n[n.Frame=8]="Frame",n[n.Data=16]="Data",n[n.TodayData=32]="TodayData",n[n.TodayStyle=64]="TodayStyle",n[n.HeaderData=128]="HeaderData",n[n.Style=256]="Style",n[n.StyleRule=512]="StyleRule",n[n.ControlStyle=1024]="ControlStyle",n[n.EventType=2048]="EventType",n[n.SelectionType=4096]="SelectionType",n[n.All=8191]="All"}(n.CalendarUpdateType||(n.CalendarUpdateType={})),t=n.CalendarUpdateType})(GCIM||(GCIM={}));var GCIM;(function(n){var t=function(){function t(n){this.IsClickDate=!1,this.IsAspWrapper=!1,this.Control=n,this.Init()}return t.prototype.Init=function(){this.InitConstValue(),this.InitInterface(),this.InitInternal(),this.InitPropertyDefaultValue()},t.prototype.InitInterface=function(){this.MinDate=new Date(100,0,1),this.MaxDate=new Date(9999,11,31,23,59,59),this.FocusDate=new Date(this.Today().valueOf()),this.InternalToday=new Date,this.UseInternalToday=!1,this.BackColor="",this.FocusColor=this.DefaultFocusColor(),this.BackgroundImage="",this.BorderColor="",this.BorderWidth="",this.BorderStyle="",this.Cursor="",this.Font=new n.Font,this.ControlEffect=n.ControlEffect.NotSet,this.HeaderHeight=0,this.EmptyRows=n.EmptyRows.StartEmpty,this.FirstDayOfWeek=n.DayOfWeek.NotSet,this.FirstFiscalMonth=n.Months.Default,this.FirstMonthInView=n.Months.Default,this.HeaderFormat="yyy\u5e74 MMMM",this.YearMonthFormat="yyy,MMMM",this.TodayImage="",this.TodayMarkColor="",this.ToolTip="",this.jQueryMobileTheme="",this.EnableScrollAnimation=!0,this.TabIndex=0,this.NavigatorOrientation=n.NavigatorOrientation.Right,this.ScrollRate=1,this.ScrollTipAlign=n.ScrollTipAlign.Default,this.ShowContextMenu=!0,this.EnableTouchZoom=!1,this.Width=this.DefaultControlWidth(),this.Height=this.DefaultControlWidth(),this.HCellSpacing=0,this.VCellSpacing=0,this.CalendarDimensions=new n.Size(1,1),this.MonthPadding=new n.Size(0),this.MonthMargins=new n.Margins(0,8,0,8),this.CalendarMargins=new n.Margins(0),this.ShowTrailing=!0,this.ShowHeader=!0,this.ShowScrollTip=!0,this.ShowToday=!1,this.ShowTodayMark=!0,this.ShowZoomButton=!1,this.ShowWeekNumber=!1,this.ShowRokuyou=n.Rokuyou.None,this.ShowNavigator=n.CalendarNavigators.Outlook,this.SkinID="",this.Visible=!0,this.Enabled=!0,this.AutoSize=!1,this.ClientIDMode="",this.EnableTheming=!0,this.WeekTitleSelect=!1,this.WeekNumberSelect=!1,this.MaxSelectionCount=14,this.TipInterval=500,this.OverrideTipText="",this.AllowSelection=n.AllowSelection.Anyday,this.SelectionMode=n.CalendarSelectionMode.One,this.CalendarYear=n.CalendarYear.Normal,this.CalendarType=n.CalendarType.MonthDay,this.UseControlStyle=!1,this.UseClassicEventBehavior=!1,this.ItemStyle=new n.Style(this),this.TitleStyle=new n.Style(this),this.ControlStyle=new n.Style(this),this.HeaderStyle=new n.Style(this),this.LegendStyle=new n.Style(this),this.WeekNumberStyle=new n.Style(this),this.TrailingStyle=new n.SubStyle(this),this.RokuyouStyle=new n.SubStyle(this),this.SelectionStyle=new n.SubStyle(this),this.SelectedDate=null,this.Selections=new n.SelectionsCollection(this),this.Weekdays=new n.WeekdaysStyle(this),this.HolidayStyles=new n.HolidayStyleCollection(this),this._activeHolidayStyle=[],this.UseTheme=!1,this.ColorScheme=n.ColorScheme.Normal},t.prototype.InitConstValue=function(){var t=this.Control._getId();this.CellStyleName=n.CalendarConstant.CONST_DEFAULT_CELL_STYLE,this.TrailingStyleName=t+"_Default_Calendar_Trailing_Style",this.RokuyouStyleName=t+"_Default_Calendar_Rokuyou_Style",this.SelectionStyleName=t+"_Default_Calendar_Selection_Style",this.TitleStyleName=t+"_Default_Calendar_Title_Style",this.ItemStyleName=t+"_Default_Calendar_Item_Style",this.HeaderStyleName=t+"_Default_Calendar_Header_Style",this.LegendStyleName=t+"_Default_Calendar_Legend_Style",this.WeekNumberStyleName=t+"_Default_Calendar_WeekNumber_Style",this.HolidayStyleMenuStyleName=t+"_Default_Calendar_HolidayStyleMenu_Style",this.TodayStyleName=t+"_Default_Calendar_Today_Style",this.CalendarContainerStyleName=t+"_Calendar_Container_Style",this.HeaderPopupStyleName=t+"_Default_Calendar_PopupMonth_Style",this.MondayStyleName=t+"_Calendar_WeekDay_Monday_Style",this.TuesdayStyleName=t+"_Calendar_WeekDay_Tuesday_Style",this.WednesdayStyleName=t+"_Calendar_WeekDay_Wednesday_Style",this.ThursdayStyleName=t+"_Calendar_WeekDay_Thursday_Style",this.FridayStyleName=t+"_Calendar_WeekDay_>Friday_Style",this.SaturdayStyleName=t+"_Calendar_WeekDay_Saturday_Style",this.SundayStyleName=t+"_Calendar_WeekDay_Sunday_Style",this.WeekStyleName=[],this.WeekStyleName[0]=t+"_Calendar_WeekDay_Sunday_Style",this.WeekStyleName[1]=t+"_Calendar_WeekDay_Monday_Style",this.WeekStyleName[2]=t+"_Calendar_WeekDay_Tuesday_Style",this.WeekStyleName[3]=t+"_Calendar_WeekDay_Wednesday_Style",this.WeekStyleName[4]=t+"_Calendar_WeekDay_Thursday_Style",this.WeekStyleName[5]=t+"_Calendar_WeekDay_Friday_Style",this.WeekStyleName[6]=t+"_Calendar_WeekDay_Saturday_Style",this.HolidayStyleName=t+"_Calendar_Holiday_Style_",this.DefaultTodayImagePath=n.Utility.BaseImageUrl+"Today"+n.Component._getImageExtends(".gif")},t.prototype.InitPropertyDefaultValue=function(){this.ControlStyle._borderStyle="none"},t.prototype.InitInternal=function(){this.Font.SetOwner(this),this._firstDateWeekOrdersCache="",this.SelectedDate=new Date(this.Today().valueOf()),this.InitStartDate()},t.prototype.SetTodayImageUrl=function(t){n.Utility.CheckString(t),this.TodayImage!==t&&(this.TodayImage=t,n.Utility.IsIE9OrLater&&this.Control.Render._clearTodayCellImage(),this.Control.UpdateControl(n.CalendarUpdateType.StyleRule),this.ShowTodayMark&&this.Control.UpdateControl(n.CalendarUpdateType.TodayData),this.Control.UpdateControl(n.CalendarUpdateType.TodayStyle))},t.prototype.SetCursor=function(t){n.Utility.CheckString(t),this.Cursor!==t&&(this.Cursor=t,this.Control.UpdateControl(n.CalendarUpdateType.ControlStyle))},t.prototype.SetVisible=function(t){t=n.Utility.CheckBool(t),this.Visible!==t&&(this.Visible=t,this.Control.Render.SetVisible(t),this.Visible&&this.Control.UpdateControl())},t.prototype.SetShowContextMenu=function(t){t=n.Utility.CheckBool(t),this.ShowContextMenu!==t&&(this.ShowContextMenu=t)},t.prototype.SetEnableTouchZoom=function(t){t=n.Utility.CheckBool(t),this.EnableTouchZoom!==t&&(this.EnableTouchZoom=t,this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.SetTabIndex=function(t){t=n.Utility.CheckInt(t,-1),t!=this.TabIndex&&(this.TabIndex=t,this.Control.UpdateControl(n.CalendarUpdateType.CalendarContainerStyle))},t.prototype.SetEnabled=function(t){t=n.Utility.CheckBool(t),this.Enabled!==t&&(this.Enabled=t,this.Control.UpdateControl())},t.prototype.SetAutoSize=function(t){t=n.Utility.CheckBool(t),this.AutoSize!==t&&(this.AutoSize=t,this.AutoSize?(this._oldWidth=this.Width,this._oldHeight=this.Height):(this.Width=this._oldWidth,this.Height=this._oldHeight),this.Control.UpdateControl())},t.prototype.SetUseControlStyle=function(t){t=n.Utility.CheckBool(t),this.UseControlStyle!==t&&(this.UseControlStyle=t,this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.SetWeekNumberSelect=function(t){t=n.Utility.CheckBool(t),this.WeekNumberSelect!==t&&(this.WeekNumberSelect=t)},t.prototype.SetWeekTitleSelect=function(t){t=n.Utility.CheckBool(t),this.WeekTitleSelect!==t&&(this.WeekTitleSelect=t)},t.prototype.SetShowHeader=function(t){t=n.Utility.CheckBool(t),this.ShowHeader!==t&&(this.ShowHeader=t,this.Control.UpdateControl())},t.prototype.SetShowZoomButton=function(t){t=n.Utility.CheckBool(t),this.ShowZoomButton!==t&&(this.ShowZoomButton=t,this.Control.UpdateControl())},t.prototype.SetShowTrailing=function(t){t=n.Utility.CheckBool(t),this.ShowTrailing!==t&&(this.ShowTrailing=t,this.Control.UpdateControl(n.CalendarUpdateType.Data),this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.SetShowToday=function(t){t=n.Utility.CheckBool(t),this.ShowToday!==t&&(this.ShowToday=t,this.Control.UpdateControl())},t.prototype.SetShowTodayMark=function(t){t=n.Utility.CheckBool(t),this.ShowTodayMark!==t&&(this.ShowTodayMark=t,this.ShowToday&&(this.Control.UpdateControl(n.CalendarUpdateType.AutoSize),this.Control.UpdateControl(n.CalendarUpdateType.Data)),this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.SetShowWeekNumber=function(t){t=n.Utility.CheckBool(t),this.ShowWeekNumber!==t&&(this.ShowWeekNumber=t,this.Control.UpdateControl())},t.prototype.SetShowScrollTip=function(t){t=n.Utility.CheckBool(t),this.ShowScrollTip!==t&&(this.ShowScrollTip=t)},t.prototype.SetWidth=function(t){if(this.AutoSize)return;t=n.Utility.CheckInt(t,0),this.Width!==t&&(this.Width=t,this.Control.UpdateControl())},t.prototype.SetHeight=function(t){if(this.AutoSize)return;t=n.Utility.CheckInt(t,0),this.Height!==t&&(this.Height=t,this.Control.UpdateControl())},t.prototype.SetHeaderHeight=function(t){t=n.Utility.CheckInt(t,0),this.HeaderHeight!==t&&(this.HeaderHeight=t,this.ShowHeader&&this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.SetEnableScrollAnimation=function(t){n.Utility.CheckBool(t),this.EnableScrollAnimation!==t&&(this.EnableScrollAnimation=t)},t.prototype.SetjQueryMobileTheme=function(t){n.Utility.CheckString(t),this.jQueryMobileTheme!==t&&(this.jQueryMobileTheme=t,this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.SetFocusColor=function(t){var t=n.Utility.CheckColor(t);this.FocusColor!==t&&(this.FocusColor=t,this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.SetBackColor=function(t){var t=n.Utility.CheckColor(t);this.BackColor!==t&&(this.BackColor=t,this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.SetBackgroundImageUrl=function(t){n.Utility.CheckString(t),this.BackgroundImage!==t&&(this.BackgroundImage=t,this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.SetBorderStyle=function(t){n.Utility.CheckString(t),this.BorderStyle!==t&&(this.BorderStyle=t,this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.SetBorderWidth=function(t){var i=t===""?"":n.Utility.CheckInt(t,0);this.BorderWidth!==i&&(this.BorderWidth=i,this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.SetBorderColor=function(t){n.Utility.CheckString(t),this.BorderColor!==t&&(this.BorderColor=t,this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.SetScrollRate=function(t){t=n.Utility.CheckInt(t,0),this.ScrollRate!==t&&(this.ScrollRate=t)},t.prototype.SetShowRokuyou=function(t){n.Utility.CheckString(t),t=t==""?"None":t;var i=n.Utility.EnumParser(t,n.Rokuyou);this.ShowRokuyou!==i&&(this.ShowRokuyou=i,this.CalendarType==n.CalendarType.MonthDay&&(this.Control.UpdateControl(n.CalendarUpdateType.Data),this.Control.UpdateControl(n.CalendarUpdateType.Style)))},t.prototype.GetShowRokuyou=function(){return n.Utility.EnumParser(this.ShowRokuyou,n.Rokuyou,!0).toLowerCase()},t.prototype.SetEmptyRows=function(t){n.Utility.CheckString(t);var i=n.Utility.EnumParser(t,n.EmptyRows);this.EmptyRows!==i&&(this.EmptyRows=i,this.CalendarType==n.CalendarType.MonthDay&&(this.Control.UpdateControl(n.CalendarUpdateType.Data),this.Control.UpdateControl(n.CalendarUpdateType.Style)))},t.prototype.GetEmptyRows=function(){return n.Utility.EnumParser(this.EmptyRows,n.EmptyRows)},t.prototype._setControlEffect=function(t){n.Utility.CheckString(t),this.ControlEffect!==t&&(this.ControlEffect=t.toString().toLowerCase(),this.Control.UpdateControl())},t.prototype._getControlEffect=function(){return this.ControlEffect},t.prototype.GetEnablejQueryTheme=function(){return this._getControlEffect()===n.ControlEffect.JQueryUI},t.prototype.SetEnablejQueryTheme=function(t){t?this._setControlEffect(n.ControlEffect.JQueryUI):this._setControlEffect(n.ControlEffect.NotSet)},t.prototype.SetCalendarYear=function(t){n.Utility.CheckString(t);var i=n.Utility.EnumParser(t,n.CalendarYear);this.CalendarYear!==i&&(this.CalendarYear=i,this._setStartDateInternal(this.FocusDate),this.Control.UpdateControl(n.CalendarUpdateType.Data),this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.GetCalendarYear=function(){return n.Utility.EnumParser(this.CalendarYear,n.CalendarYear)},t.prototype.SetCalendarType=function(t){n.Utility.CheckString(t),t=n.Utility.CheckEnum(n.CalendarType,t),this.CalendarType!==t&&(this.CalendarType=t,this._setStartDateInternal(this.FocusDate),this.Control.UpdateControl())},t.prototype.GetCalendarType=function(){return this.CalendarType},t.prototype.SetFirstMonthInView=function(t){n.Utility.CheckString(t);var i=n.Utility.EnumParser(t,n.Months);this.FirstMonthInView!==i&&(this.FirstMonthInView=i,this.CalendarType===n.CalendarType.MonthDay&&this.CalendarDimensions.Width*this.CalendarDimensions.Height==12&&(this._updateStartDate(),this.Control.UpdateControl(n.CalendarUpdateType.Data),this.Control.UpdateControl(n.CalendarUpdateType.Style)))},t.prototype.GetFirstMonthInView=function(){return n.Utility.EnumParser(this.FirstMonthInView,n.Months)},t.prototype.SetFirstDayOfWeek=function(t){n.Utility.CheckString(t),t=t==""?"notset":t;var i=n.Utility.EnumParser(t,n.DayOfWeek);this.FirstDayOfWeek!==i&&(this.FirstDayOfWeek=i,this.CalendarType===n.CalendarType.MonthDay&&(this.Control.UpdateControl(n.CalendarUpdateType.Data),this.Control.UpdateControl(n.CalendarUpdateType.Style)))},t.prototype.GetFirstDayOfWeek=function(){var t=n.Utility.EnumParser(this.FirstDayOfWeek,n.DayOfWeek);return t=="notset"?"":t},t.prototype.SetFirstFiscalMonth=function(t){n.Utility.CheckString(t);var i=n.Utility.EnumParser(t,n.Months);this.FirstFiscalMonth!==i&&(this.FirstFiscalMonth=i,this.CalendarYear===n.CalendarYear.Fiscal&&(this._setStartDateInternal(this.FocusDate),this.Control.UpdateControl(n.CalendarUpdateType.Data),this.Control.UpdateControl(n.CalendarUpdateType.Style)))},t.prototype.GetFirstFiscalMonth=function(){return n.Utility.EnumParser(this.FirstFiscalMonth,n.Months)},t.prototype.SetShowNavigator=function(t){n.Utility.CheckString(t);var i=n.Utility.EnumParser(t,n.CalendarNavigators);this.ShowNavigator!==i&&(this.ShowNavigator=i,this.Control.UpdateControl())},t.prototype.GetShowNavigator=function(){return n.Utility.EnumParser(this.ShowNavigator,n.CalendarNavigators)},t.prototype.SetNavigatorOrientation=function(t){n.Utility.CheckString(t);var i=n.Utility.EnumParser(t,n.NavigatorOrientation);this.NavigatorOrientation!==i&&(this.NavigatorOrientation=i,this.Control.UpdateControl())},t.prototype.GetNavigatorOrientation=function(){return n.Utility.EnumParser(this.NavigatorOrientation,n.NavigatorOrientation)},t.prototype.SetScrollTipAlign=function(t){n.Utility.CheckString(t);var i=n.Utility.EnumParser(t,n.ScrollTipAlign);this.ScrollTipAlign!==i&&(this.ScrollTipAlign=i)},t.prototype.GetScrollTipAlign=function(){return n.Utility.EnumParser(this.ScrollTipAlign,n.ScrollTipAlign)},t.prototype.SetToolTip=function(t){n.Utility.CheckString(t),this.ToolTip=t,this.Control.UpdateControl(n.CalendarUpdateType.ControlStyle)},t.prototype.SetSelectionMode=function(t){n.Utility.CheckString(t);var i=n.Utility.EnumParser(t,n.CalendarSelectionMode);this.SelectionMode!==i&&(this.SelectionMode=i,this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.GetSelectionMode=function(){return n.Utility.EnumParser(this.SelectionMode,n.CalendarSelectionMode)},t.prototype.SetAllowSelection=function(t){n.Utility.CheckString(t);var i=n.Utility.EnumParser(t,n.AllowSelection);this.AllowSelection!==i&&(this.AllowSelection=i,this.UpdateSelections(),this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype.GetAllowSelection=function(){return n.Utility.EnumParser(this.AllowSelection,n.AllowSelection)},t.prototype.SetMaxSelectionCount=function(t){var r,i;t=n.Utility.CheckInt(t,2);if(this.MaxSelectionCount!==t){this.MaxSelectionCount=t,r=this.Selections.length;if(r>t){for(i=0;ithis.MaxDate||tthis.MaxDate?this.MaxDate:t);if(!n.DateTimeInfo.Equal(this.SelectedDate,t)){if(t!=null){var i=this.GetTypeOfDay(t);if(!this.IsAllowSelection(i,t))return}this.SelectedDate=t,this.Control.UpdateControl(n.CalendarUpdateType.SelectionType),this.Control.FireEvent(this.Control._specialClientEvents.SelectedDateChanged)}},t.prototype.SetFocusDate=function(t){n.Utility.CheckDate(t);if(t>this.MaxDate||tt&&this._setFocusDateInternal(this.FocusDate),this.UpdateSelections(),this.Control.UpdateControl())},t.prototype.RealStyleBorderWidth=function(n){var i=0,t=n.GetBorderStyle();return t!="none"&&t!=""&&(i=this.DefaultStyleBorderWidth(n)),i},t.prototype.DefaultStyleBorderWidth=function(t){var i=t.GetBorderWidth();if(typeof i=="string")i=n.Utility.GetFontSizeUnitValue(i);else if(i==0)switch(t.GetBorderStyle()){case"double":i=3;break;case"groove":case"ridge":case"inset":case"outset":i=4;break;case"":i=0;break;default:i=1;break}return i},t.prototype.InnerControlEffect=function(){var t=this.ControlEffect;return(t===n.ControlEffect.NotSet||t===n.ControlEffect.JQueryUI)&&(t=n.Utility.GetClientControlEffect()),t},t.prototype.ToolTipControlEffect=function(){return this.GetEnablejQueryTheme()?n.ControlEffect.JQueryUI:this.InnerControlEffect()},t.prototype.InnerBorderWidth=function(){if(this.UseControlStyle){var t=this.DefaultStyleBorderWidth(this.ControlStyle);return n.Utility.IsPositiveInteger(t.toString())?t.toString()+"px":t.toString()}return this.BorderWidth!==""?this.BorderWidth+"px":this.InnerControlEffect()===n.ControlEffect.Normal?"2px":"1px"},t.prototype.InnerBorderStyle=function(){return this.UseControlStyle?this.ControlStyle.GetBorderStyle()==""?"solid":this.ControlStyle.GetBorderStyle():this.BorderStyle!=""?this.BorderStyle:this.InnerControlEffect()==n.ControlEffect.Normal?"inset":"solid"},t.prototype.InnerBorderColor=function(){if(this.UseControlStyle)return this.ControlStyle.GetBorderColor();if(this.BorderColor!=="")return this.BorderColor;switch(this.InnerControlEffect()){case n.ControlEffect.Windows8Theme:case n.ControlEffect.Edge:return"#707070";case n.ControlEffect.Chrome:return"#A9A9A9";case n.ControlEffect.Ipad:return"#4C4C4C"}return"buttonface"},t.prototype.InnerjQueryMobileTheme=function(){return this.jQueryMobileTheme==""?"a":this.jQueryMobileTheme},t.prototype.InnerWidth=function(){return this.Width==""||this.Width==0?this.DefaultControlWidth():this.Width},t.prototype.InnerHeight=function(){return this.Height==""||this.Height==0?this.DefaultControlWidth():this.Height},t.prototype.InnerCursor=function(){var n;return n=this.Cursor==""?"default":this.Cursor,n.toLowerCase()=="hand"&&(n="pointer"),n},t.prototype.InnerBackColor=function(){return this.UseControlStyle?this.ControlStyle.GetBackColor():this.BackColor},t.prototype.InnerBackgroundImage=function(){var t="";return this.BackgroundImage!=""&&(t=n.Utility.CheckCssImageUrl(this.BackgroundImage)),t},t.prototype.InnerRokuyouStyle=function(){var t={},i=this.RokuyouStyle,u=this.ItemStyle.IsDefaultFont()?this.Font:this.ItemStyle,f,r;return t.imageUrl=i.GetImageUrl(),t.foreColor=this.Enabled?i.GetForeColor():"graytext",t.backColor=i.GetBackColor(),t.imageUrl=i.GetImageUrl(),t.imageAsBackground=i.GetImageAsBackground(),t.fontFamily=u.GetFontFamily(),f=u.GetFontSize()===""?this.DefaultFontSize():u.GetFontSize(),t.fontSize=Math.floor(n.Utility.GetFontSizeUnitValue(f)*.5)+"px",t.fontStyle=u.GetFontStyle(),t.fontWeight=i.GetBold()?"bold":"",t.textDecoration=n.Utility.CheckMultipleStringEnum(n.TextDecoration,u.GetTextDecoration()),r=i.GetUnderLine()?"underline":"",t.textDecoration.indexOf("overline")!=-1&&(r+=r==""?"overline":" overline"),t.textDecoration.indexOf("line-through")!=-1&&(r+=r==""?"line-through":" line-through"),t.textDecoration=r,t},t.prototype.IsDefaultTodayStyle=function(){return this.IsDefaultItemStyle()&&this.TodayImage===""&&this.TodayMarkColor===""},t.prototype.IsDefaultCalendarContainerStyle=function(){return this.UseControlStyle||!this.Visible?!1:this.BorderColor!==""||this.BorderStyle!==""||this.BorderWidth!==""?!1:this.BackColor!==""||this.BackgroundImage!==""?!1:!0},t.prototype.IsDefaultTrailingStyle=function(){return this.TrailingStyle.IsDefaultSubStyle()&&this.IsDefaultItemStyle()},t.prototype.IsDefaultItemStyle=function(){return this.HCellSpacing!==0||this.VCellSpacing!==0||this.BackColor!==""?!1:this.ItemStyle.IsDefaultStyle()&&this.Font.IsDefaultFont()},t.prototype.IsDefaultSelectionStyle=function(){return this.SelectionStyle.IsDefaultSubStyle()&&this.IsDefaultItemStyle()},t.prototype.IsDefaultLegendStyle=function(){return this.LegendStyle.IsDefaultStyle()},t.prototype.IsDefaultHeaderStyle=function(){return this.HeaderStyle.IsDefaultStyle()&&this.Font.IsDefaultFont()},t.prototype.IsDefaultTitleStyle=function(){return this.HCellSpacing!==0||this.VCellSpacing!==0?!1:this.TitleStyle.IsDefaultStyle()&&this.Font.IsDefaultFont()},t.prototype.GetPopupHolidayStylesBackgroundColor=function(){if(this.GetEnablejQueryTheme())return"";var t=this.ControlEffect;return t===n.ControlEffect.NotSet&&(t=this.InnerControlEffect()),t===n.ControlEffect.VistaTheme?"rgb(240, 240, 240)":"menu"},t.prototype.GetTodayStyleBackgroundImage=function(){var t=this.TodayImage==""?this.DefaultTodayImagePath:this.TodayImage;return n.Utility.CheckCssImageUrl(t)},t.prototype.GetTodayStyleImage=function(){return this.TodayImage==""?this.DefaultTodayImagePath:this.TodayImage},t.prototype.GetCalendarContainerStyleName=function(){var t=n.Utility.DefaultControlStyle+" ";if(this.GetEnablejQueryTheme())t+="ui-widget-content ui-corner-all";else if(this.IsDefaultCalendarContainerStyle())switch(this.InnerControlEffect()){case n.ControlEffect.Windows8Theme:t+=n.CalendarConstant.CONST_DEFAULT_CONTAINER_STYLE_WIN8;break;case n.ControlEffect.Edge:t+=n.CalendarConstant.CONST_DEFAULT_CONTAINER_STYLE_EDGE;break;case n.ControlEffect.Chrome:t+=n.CalendarConstant.CONST_DEFAULT_CONTAINER_STYLE_CHROME;break;case n.ControlEffect.Ipad:t+=n.CalendarConstant.CONST_DEFAULT_CONTAINER_STYLE_IPAD;break;default:t+=n.CalendarConstant.CONST_DEFAULT_CONTAINER_STYLE}else t+=this.CalendarContainerStyleName;return t},t.prototype.GetItemStyleName=function(){var t=this.ItemStyleName;return this.IsDefaultItemStyle()&&(t=this.Enabled?n.CalendarConstant.CONST_DEFAULT_ITEM_STYLE:n.CalendarConstant.CONST_DEFAULT_DISABLE_ITEM_STYLE),this.GetEnablejQueryTheme()&&(t+=" "+this.GetItemStyleJqueryUIName()+" "+this.GetItemStyleJqueryMobileName()),t},t.prototype.GetTrailingStyleName=function(){var t=this.TrailingStyleName;return this.IsDefaultTrailingStyle()&&(t=this.Enabled?n.CalendarConstant.CONST_DEFAULT_TRAILING_STYLE:n.CalendarConstant.CONST_DEFAULT_DISABLE_TRAILING_STYLE),this.GetEnablejQueryTheme()&&(t+=" "+this.GetTrailingStyleJqueryUIName()+" "+this.GetTrailingStyleJqueryMobileName()),t},t.prototype.GetSelectionStyleName=function(){var t=this.SelectionStyleName;return this.IsDefaultSelectionStyle()&&(t=this.GetEnablejQueryTheme()?n.CalendarConstant.CONST_DEFAULT_JQUERY_SELECTION_STYLE:n.CalendarConstant.CONST_DEFAULT_SELECTION_STYLE),this.GetEnablejQueryTheme()&&(t+=" ui-widget-content ",t+=this.GetSelectionStyleJqueryUIName()+" "+this.GetItemStyleJqueryMobileName()),t},t.prototype.GetTodayStyleName=function(){return this.IsDefaultTodayStyle()?n.CalendarConstant.CONST_DEFAULT_TODAY_STYLE:this.TodayStyleName},t.prototype.GetLegendStyleName=function(){var n=this.LegendStyleName;return this.GetEnablejQueryTheme()&&(n+=" "+this.GetLegendStyleJqueryUIName()+" "+this.GetLegendStyleJqueryMobileName()),n},t.prototype.GetTitleStyleName=function(){var t=this.TitleStyleName;return this.IsDefaultTitleStyle()&&(t=this.Enabled?n.CalendarConstant.CONST_DEFAULT_TITLE_STYLE:n.CalendarConstant.CONST_DEFAULT_DISABLE_TITLE_STYLE),t},t.prototype.GetHeaderStyleName=function(){var t=this.HeaderStyleName;return this.IsDefaultHeaderStyle()&&(t=this.Enabled?n.CalendarConstant.CONST_DEFAULT_HEADER_STYLE:n.CalendarConstant.CONST_DEFAULT_DISABLE_HEADER_STYLE),this.GetEnablejQueryTheme()&&(t+=" "+this.GetHeaderStyleJqueryUIName()+" "+this.GetHeaderStyleJqueryMobileName()),t},t.prototype.GetLeftNavigatorJqueryUIClassName=function(){return"ui-icon ui-icon-circle-triangle-w"},t.prototype.GetRightNavigatorJqueryUIClassName=function(){return"ui-icon ui-icon-circle-triangle-e"},t.prototype.GetWeekNumberStyleName=function(){return this.WeekNumberStyleName},t.prototype.GetItemStyleJqueryUIName=function(){return"ui-state-default"},t.prototype.GetTrailingStyleJqueryUIName=function(){return n.Utility.IsIE8OrBelow?"ui-state-hover":"ui-state-default ui-priority-secondary"},t.prototype.GetSelectionStyleJqueryUIName=function(){return"ui-state-active"},t.prototype.GetLegendStyleJqueryUIName=function(){return"ui-widget-content"},t.prototype.GetSingleCalendarStyleJqueryUIName=function(){return this.GetEnablejQueryTheme()?"ui-widget-content":""},t.prototype.GetHeaderStyleJqueryUIName=function(){return"ui-widget-header"},t.prototype.GetTodayStyleJqueryUIName=function(){return"ui-state-default ui-state-highlight"},t.prototype.GetItemStyleJqueryMobileName=function(){return"ui-btn-up-"+this.InnerjQueryMobileTheme()},t.prototype.GetTrailingStyleJqueryMobileName=function(){return"ui-btn-hover-"+this.InnerjQueryMobileTheme()},t.prototype.GetSelectionStyleJqueryMobileName=function(){return"ui-btn-down-"+this.InnerjQueryMobileTheme()},t.prototype.GetLegendStyleJqueryMobileName=function(){return"ui-bar-"+this.InnerjQueryMobileTheme()},t.prototype.GetSingleCalendarStyleJqueryMobileName=function(){return"ui-overlay-"+this.InnerjQueryMobileTheme()},t.prototype.GetHeaderStyleJqueryMobileName=function(){return"ui-bar-"+this.InnerjQueryMobileTheme()},t.prototype.GetTodayStyleJqueryMobileName=function(){return"ui-state-default ui-state-highlight"+this.InnerjQueryMobileTheme()},t.prototype.GetHeaderPopClassName=function(){var n=this.HeaderPopupStyleName;return this.GetEnablejQueryTheme()&&(n+=" ui-widget-content"),n},t.prototype.GetHolidayPopClassName=function(){var n=this.HolidayStyleMenuStyleName;return this.GetEnablejQueryTheme()&&(n+=" ui-widget-content"),n},t.prototype.GetHeaderPopSelectionClassName=function(){return this.GetEnablejQueryTheme()?"ui-state-active":""},t.prototype.GetImagePath=function(t,i,r,u,f,e){var o="_Normal",h,c="",s,f;return r?o="_Pressed":u?o="_Hover":this.Enabled||i==!0||(o="_InActive"),s=typeof e=="undefined"?this.Control._typeOfImage(".gif"):e,f=typeof f=="undefined"?n.CalendarUtility.GetThemeFolderName(this):f,t.indexOf("Thumb")!==-1?(h=t.split("_"),c=h.pop(),n.Utility.BaseImageUrl+h.join("_")+"_"+f+"_"+c+o+s):n.Utility.BaseImageUrl+t+"_"+f+o+s},t.prototype.GetImagePressPath=function(t){var i,u="",r=this.Control._typeOfImage(".gif");return t.indexOf("Thumb")!==-1?(i=t.split("_"),u=i.pop(),n.Utility.BaseImageUrl+i.join("_")+"_"+n.CalendarUtility.GetThemeFolderName(this)+"_"+u+"_Pressed"+r):n.Utility.BaseImageUrl+t+"_"+n.CalendarUtility.GetThemeFolderName(this)+"_Pressed"+r},t.prototype.GetImageHoverPath=function(t){var i,u="",r=this.Control._typeOfImage(".gif");return t.indexOf("Thumb")!==-1?(i=t.split("_"),u=i.pop(),n.Utility.BaseImageUrl+i.join("_")+"_"+n.CalendarUtility.GetThemeFolderName(this)+"_"+u+"_Hover"+r):n.Utility.BaseImageUrl+t+"_"+n.CalendarUtility.GetThemeFolderName(this)+"_Hover"+r},t.prototype.GetCalendarWidthOffset=function(){return this.CalendarDimensions.Width===1?0:this.Width%this.CalendarDimensions.Width},t.prototype.UpdateTitleSelections=function(n,t,i,r,u){u||this.Selections._clearInternal(),n==i?this.UpdateRowColumnSelectionsForSingleCalendar(n,t,r,!0):this.UpdateRowColumnSelectionsForMultipleCalendar(n,t,i,r,!0)},t.prototype.AddSelectedDateBySelectedCells=function(t){for(var r,i=0;i=0?1:-1,o,f=Math.abs(f),e=i;f>=0;f--,e+=s)o=u?n.CalendarUtility.GetTitleSelectCell(this.Control.Render,t,e):n.CalendarUtility.GetWeekNumberSelectCell(this.Control.Render,t,e),this.AddSelectedDateBySelectedCells(o)},t.prototype.UpdateRowColumnSelectionsForMultipleCalendar=function(t,i,r,u,f){for(var h=f?7:6,c=r-t,o=c>=0?1:-1,l,a,c=Math.abs(c),s=0,e=t;c>=0;c--,e+=o)s+=e==t?o>0?h-i:i:e==r?o>0?u:h-u:h;for(l=t,e=i;s>=0;s--,e+=o)(e<0||e>=h)&&(l+=o,e=o>0?0:h-1),a=f?n.CalendarUtility.GetTitleSelectCell(this.Control.Render,l,e):n.CalendarUtility.GetWeekNumberSelectCell(this.Control.Render,l,e),this.AddSelectedDateBySelectedCells(a)},t.prototype.UpdateWeekNumberSelections=function(n,t,i,r,u){u||this.Selections._clearInternal(),n==i?this.UpdateRowColumnSelectionsForSingleCalendar(n,t,r,!1):this.UpdateRowColumnSelectionsForMultipleCalendar(n,t,i,r,!1)},t.prototype.UpdateDaySelections=function(t,i,r,u){var s=!0,l,h,c;t>i&&(l=t,t=i,i=l,s=!1);var y=i.getTime()-t.getTime(),p=Math.floor(y/864e5),e=new Date(t.valueOf()),o=new Date(i.valueOf());p>7&&r!=!0&&(h=n.CalendarUtility.GetDayLineBeginDate(this.Control.Render,t),c=n.CalendarUtility.GetDayLineEndDate(this.Control.Render,i),e=new Date(h.valueOf()),o=new Date(c.valueOf())),u||this.Selections._clearInternal();while(e<=o){var v=s?1:-1,f=s?e:o,a=new Date(f.valueOf());this.AddSelectedDate(a,!0),f.setDate(f.getDate()+v)}},t.prototype.UpdateMonthSelections=function(t,i){var f=i.getFullYear(),e=i.getMonth(),o=n.DateTimeInfo.DaysInMonth(f,e),r=new Date(t.valueOf()),s=new Date(f,e,o),u;this.Selections._clearInternal();while(r<=s)u=new Date(r.valueOf()),this.AddSelectedDate(u,!0),r.setDate(r.getDate()+1)},t.prototype.AddSelectedDate=function(n,t){if(this.Selections.length>=this.MaxSelectionCount)return;var i=this.GetTypeOfDay(n);this.IsDateSelected(n)||!this.IsAllowSelection(i,n)||nthis.MaxDate||(t==!0?this.Selections._addInternal(n):this.Selections.Add(n))},t.prototype.SetSelections=function(t,i){this.Selections._clearInternal();for(var r=0;r=this.MaxSelectionCount)return;this.AddSelectedDate(new Date(u,r,i))}},t.prototype.GetFirstMonthSelectionDate=function(t){for(var f=t.getFullYear(),e=t.getMonth(),o=n.DateTimeInfo.DaysInMonth(f,e+1),r,u,i=1;i<=o;i++){r=new Date(f,e,i),u=this.GetTypeOfDay(r);if(this.IsAllowSelection(u,r))return r}return t},t.prototype.RemoveSelectedMonth=function(t){for(var u=this.Selections.length,r=new n.SelectionsCollection,f=0,i=0;i1)&&(s[r]="")),r>0&&u.getMonth()!=f.getMonth()&&(!this.ShowTrailing||th&&(i|=n.WeekFlags.Last),r=this.GetWeekDay(o);if(r==null)return"";var f="",u="",e="";return(r._weekFlags&i)>0?(f=this.WeekStyleName[o],u=r.GetImageUrl(),e=r.GetImageAsBackground().toString(),f+","+u+","+e):""},t.prototype.GetWeekDay=function(n){var t=null;switch(n){case 0:t=this.Weekdays.GetSunday();break;case 1:t=this.Weekdays.GetMonday();break;case 2:t=this.Weekdays.GetTuesday();break;case 3:t=this.Weekdays.GetWednesday();break;case 4:t=this.Weekdays.GetThursday();break;case 5:t=this.Weekdays.GetFriday();break;case 6:t=this.Weekdays.GetSaturday();break;default:break}return t},t.prototype.StartDate=function(){return this._startDate==null?null:new Date(this._startDate.valueOf())},t.prototype.InitStartDate=function(){this._setStartDateInternal(this.FocusDate)},t.prototype._getDisplayDateRange=function(){var f={},i=this.CalendarDimensions.Width*this.CalendarDimensions.Height,t=this.StartDate(),u,r;return this.CalendarType==n.CalendarType.MonthDay?r=new Date(t.getFullYear(),t.getMonth()+i-1,n.DateTimeInfo.DaysInMonth(t.getFullYear(),t.getMonth()+i),23,59,59):this.CalendarYear==n.CalendarYear.Fiscal?(u=this.FirstFiscalMonth==n.Months.Default?n.Months.April:this.FirstFiscalMonth,r=new Date(t.getFullYear()+i,u-2,n.DateTimeInfo.DaysInMonth(t.getFullYear()+i,u-1),23,59,59)):r=new Date(t.getFullYear()+i-1,11,n.DateTimeInfo.DaysInMonth(t.getFullYear()+i-1,12),23,59,59),f.StartDate=new Date(t.valueOf()),f.EndDate=new Date(r.valueOf()),f},t.prototype._setStartDateInternal=function(t){var i=this._trimStartDateByMaxMinRange(t);return i=this._getAdjustedStartDate(i),n.DateTimeInfo.Equal(this._startDate,i,!1)?!1:(this._startDate=new Date(i.valueOf()),!0)},t.prototype._syncFocusDateInternal=function(){var i=this._getDisplayDateRange(),t=this.FocusDate,u,o,r,e,f;return t>=i.StartDate&&t<=i.EndDate?!1:(this.CalendarType==n.CalendarType.MonthDay?(u=0,ti.EndDate&&(u=n.CalendarUtility.GetMonthDifference(i.EndDate,t)),o=t.getMonth()+1+u,f=n.DateTimeInfo.SetDate(t.getFullYear(),o,t.getDate())):(r=0,ti.EndDate&&(r=i.EndDate.getFullYear()-t.getFullYear()),e=t.getFullYear()+r,f=n.DateTimeInfo.SetDate(e,t.getMonth()+1,t.getDate())),this._setFocusDateDirectInternal(f))},t.prototype._setFocusDateDirectInternal=function(t){return t>this.MaxDate?t=this.MaxDate:t=t.StartDate&&i<=t.EndDate?!1:this.CalendarType==n.CalendarType.MonthDay?(f=0,it.EndDate&&(f=n.CalendarUtility.GetMonthDifference(i,t.EndDate)),o=t.StartDate.getMonth()+1+f,r=n.DateTimeInfo.SetDate(t.StartDate.getFullYear(),o,t.StartDate.getDate()),this._setStartDateInternal(r)):this.CalendarYear===n.CalendarYear.Fiscal?this._setStartDateInternal(this.FocusDate):(u=0,it.EndDate&&(u=i.getFullYear()-t.EndDate.getFullYear()),e=t.StartDate.getFullYear()+u,r=n.DateTimeInfo.SetDate(e,t.StartDate.getMonth()+1,t.StartDate.getDate()),this._setStartDateInternal(r))},t.prototype._trimStartDateByMaxMinRange=function(t){t=new Date(t.valueOf());if(this.CalendarType==n.CalendarType.MonthDay)tthis.MaxDate&&(t=new Date(this.MaxDate.getFullYear(),this.MaxDate.getMonth(),1)),t.setDate(1);else{if(tthis.MaxDate&&(t=new Date(this.MaxDate.getFullYear(),this.MaxDate.getMonth(),1));t.setDate(1)}return t},t.prototype._getAdjustedStartDate=function(t){var r=this.CalendarDimensions.Width*this.CalendarDimensions.Height,f=-1,o,i;if(this.CalendarType==n.CalendarType.MonthDay)return o=new Date(t.getFullYear(),t.getMonth()+r-1,n.DateTimeInfo.DaysInMonth(t.getFullYear(),t.getMonth()+r),23,59,59),o>this.MaxDate&&(r!=12||this.FirstMonthInView==n.Months.Default)&&(t=new Date(this.MaxDate.getFullYear(),this.MaxDate.getMonth()-(r-1),1),tt.getMonth()+1&&(t=n.CalendarUtility.GetNextYearDate(t,-1)),new Date(t.getFullYear(),f-1,1));else{var s=new Date(t.getFullYear()+r-1,t.getMonth(),n.DateTimeInfo.DaysInMonth(t.getFullYear()+r-1,t.getMonth()+1),23,59,59),u=n.Months.Default+1,e=t.getFullYear();return this.CalendarYear==n.CalendarYear.Fiscal&&(u=this.FirstFiscalMonth==n.Months.Default?n.Months.April:this.FirstFiscalMonth),i=new Date(t.valueOf()),t.getMonth()+1this.MaxDate.getFullYear()&&(i=new Date(this.MaxDate.getFullYear()-r+1,this.MaxDate.getMonth(),1)),i=9?(t.getMonth()+1).toString():"0"+(t.getMonth()+1),i=t.getDate()>=10?t.getDate().toString():"0"+t.getDate();return n.Localization.GetString("ToolTip.Today")+" : "+t.getFullYear()+"/"+r+"/"+i},t.prototype.IsHeaderFocusDateInvalidate=function(t){var f=this.MinDate.getFullYear(),o=this.MinDate.getMonth(),u=this.MaxDate.getFullYear(),e=this.MaxDate.getMonth(),i=t.getFullYear(),r=t.getMonth();if(this.CalendarType==n.CalendarType.MonthDay){if(tthis.MaxDate)if(i!=u||r!=e)return!1}else{if(tthis.MaxDate)if(i!=u)return!1}return!0},t.prototype.GetHeaderText=function(t){var o=new n.HeaderFormat,f="",e,i,r,s,u;return t||(t=new Date(this.FocusDate.valueOf())),this.CalendarType==n.CalendarType.MonthDay?(n.DateTimeInfo.YearMonthEqual(t,n.DateTimeInfo.EraMin)&&(t=new Date(n.DateTimeInfo.EraMin.valueOf())),n.DateTimeInfo.YearMonthEqual(t,n.DateTimeInfo.EraMax)&&(t=new Date(n.DateTimeInfo.EraMax.valueOf()))):(t.getFullYear()==n.DateTimeInfo.EraMin.getFullYear()&&(t=new Date(n.DateTimeInfo.EraMin.valueOf())),t.getFullYear()==n.DateTimeInfo.EraMax.getFullYear()&&(t=new Date(n.DateTimeInfo.EraMax.valueOf()))),this.CalendarYear==n.CalendarYear.Fiscal&&(e=this.DefaultFirstFiscalMonth(),this.FirstFiscalMonth!=n.Months.Default&&(e=this.FirstFiscalMonth),i=t.getMonth(),i0&&(f=o.GetText(t,u[0],n.CalendarType.YearMonth,!1))),f},t.prototype.GetMonthText=function(t){var u=new n.HeaderFormat,i="",r=this.YearMonthFormat.split(",");return r.length>1&&(i=u.GetText(t,r[1],n.CalendarType.YearMonth,!0)),i},t.prototype.GetThumbScrollingTooltipText=function(t){t||(t=new Date(this.FocusDate.valueOf()));if(this.CalendarType==n.CalendarType.MonthDay)if(this.CalendarDimensions.Width*this.CalendarDimensions.Height==12)if(this.FirstMonthInView!=n.Months.Default){var u=t.getFullYear(),r=t.getDate(),i=this.FirstMonthInView-1;t=new Date(u,i,r)}return this.GetHeaderText(t)},t.prototype.GetScrollbarTooltipText=function(t){var i="",r;switch(t){case"ZoomIn":i=n.Localization.GetString("ToolTip.ZoomIn");break;case"ZoomOut":i=n.Localization.GetString("ToolTip.ZoomOut");break;case"LeftMost":r=this.CalendarType==n.CalendarType.MonthDay?"ToolTip.PreviousYear":"ToolTip.PreviousDecade",i=n.Localization.GetString(r);break;case"RightMost":r=this.CalendarType==n.CalendarType.MonthDay?"ToolTip.NextYear":"ToolTip.NextDecade",i=n.Localization.GetString(r);break;case"TodayButton":i=n.Localization.GetString("ToolTip.Today");break;default:break}return i},t.prototype._getScrollBarMoveOffset=function(t,i,r,u){var h=this.NavigatorOrientation==n.NavigatorOrientation.Top||this.NavigatorOrientation==n.NavigatorOrientation.Bottom,f=this.GetScrollBarSize(h),e,o,s;return h?(e=f.StartTrackButtonSize.Width+f.ThumbButtonSize.Width+f.EndTrackButtonSize.Width,o=r-t):(e=f.StartTrackButtonSize.Height+f.ThumbButtonSize.Height+f.EndTrackButtonSize.Height,o=u-i),s=o/e},t.prototype.UpdateStartDateByScrollBar=function(t,i,r,u,f){var a,v,k,y,b,c,l,o,p,e;if(this.ShowNavigator!=n.CalendarNavigators.ScrollBar)return!1;a=this._getScrollBarMoveOffset(i,r,u,f),v=this.StartDate();if(this.CalendarType==n.CalendarType.YearMonth){k=this.MaxDate.getFullYear()-this.MinDate.getFullYear(),y=Math.floor(a*k);if(y==0)return!1;o=new Date(t.valueOf()),o.setFullYear(o.getFullYear()+y);var h=this._setStartDateInternal(o),w=this._getDisplayDateRange(),s=this.FocusDate;return h&&this._isDateNotInRange(s,w)&&(b=this.StartDate().getFullYear()-v.getFullYear(),e=new Date(s.valueOf()),e=n.CalendarUtility.GetNextYearDate(e,b),this._setFocusDateDirectInternal(e)),h}else if(this.CalendarType==n.CalendarType.MonthDay){c=(this.MaxDate.getFullYear()-this.MinDate.getFullYear())*12,c=c+this.MaxDate.getMonth()-this.MinDate.getMonth(),l=Math.floor(a*c);if(l==0)return!1;o=new Date(t.valueOf()),o.setMonth(o.getMonth()+l);var h=this._setStartDateInternal(o),w=this._getDisplayDateRange(),s=this.FocusDate;return h&&this._isDateNotInRange(s,w)&&(p=n.CalendarUtility.GetMonthDifference(this.StartDate(),v),e=new Date(s.valueOf()),e=n.CalendarUtility.GetNextMonthDate(e,p),this._setFocusDateDirectInternal(e)),h}return!1},t.prototype._isDateInRange=function(n,t){return n>t.EndDate?!1:nf&&(i|=n.WeekFlags.Last),u=t.getDay(),r=0;r0)return!0}return!1},t.prototype.IsAllowSelection=function(t,i){if(this.AllowSelection==n.AllowSelection.Anyday)return!0;var r=this.IsDayInOverrideHolidayPolicy(i);if(this.AllowSelection==n.AllowSelection.Workday){if(t===""||t===n.DayType.Normal||t===n.DayType.ForceWorkday)return!r}else if(this.AllowSelection==n.AllowSelection.Holiday)if(r||t==n.DayType.OverriddenHoliday||t==n.DayType.Holiday||t==n.DayType.ForceHoliday||t=="dayOfWeekHoliday")return!0;return!1},t.prototype.ScrollSteps=function(t,i){var f,r,u;return i?t=this.CalendarType===n.CalendarType.MonthDay?t*12:t*120:(f=this.CalendarDimensions.Width*this.CalendarDimensions.Height,r=this.ScrollRate===0?f:this.ScrollRate,f===12&&this.FirstMonthInView!=n.Months.Default&&(r=12),u=n.CalendarUtility.GetMonthDifference(this.MaxDate,this.MinDate),r>u&&(r=u),t=this.CalendarType===n.CalendarType.MonthDay?t*r:t*r*12),t},t.prototype.IsAllCellSelected=function(t){for(var r,f,i,u=0;u=this.MinDate&&r<=this.MaxDate){for(f=!1,i=0;ithis.MaxDate)&&(this.SelectedDate=null));else{for(u=this.Selections.length,i=[],t=0;tu&&(u=s.Height+4)),i-=u,this.LegendStyle.GetBorderStyle()!="none"&&this.LegendStyle.GetBorderStyle()!=""&&(e=this.DefaultStyleBorderWidth(this.LegendStyle),h-=e*2,this.AutoSize?i-=e*2:u-=e*2),t.TodayAreaSize=new n.Size(h,u),o=n.Utility.IsIE8?u-4:u,t.TodayMarkImageSize=new n.Size(o,o),r-=this.MonthPadding.Width*(this.CalendarDimensions.Width-1),i-=this.MonthPadding.Height*(this.CalendarDimensions.Height-1),t.CalendarAreaSize=new n.Size(r,i),t.TodayMarkSize=new n.Size(this.ShowTodayMark?this.DefaultTodayHeight():0,t.TodayAreaSize.Height),t.TodayTextSize=new n.Size(r-t.TodayMarkSize.Width,t.TodayAreaSize.Height),t},t.prototype.GetSingleCalendarSize=function(){var t={},f=this.RealStyleBorderWidth(this.ItemStyle),c=this.DefaultStyleBorderWidth(this.TitleStyle),tt=this.DefaultStyleBorderWidth(this.HeaderStyle),h=this.DefaultStyleBorderWidth(this.WeekNumberStyle),vt=this.GetCalendarAreaSize().CalendarAreaSize,ut=Math.floor(vt.Width/this.CalendarDimensions.Width),rt=Math.floor(vt.Height/this.CalendarDimensions.Height),e,u,it,o,ht,ot,l,nt,ft,a,v,lt,s,ct,w,p,y,b,r,d,i,g;t.SingleCalendarContainerSize=new n.Size(ut,rt),t.SingleCalendarSize=new n.Size(ut,rt),e=ut,u=rt,t.BodyContainerSize=new n.Size(e,u),e=e-this.MonthMargins.Left-this.MonthMargins.Right,u=u-this.MonthMargins.Top-this.MonthMargins.Bottom,it=t.SingleCalendarSize.Width,o=0,this.ShowHeader&&(this.AutoSize?(nt=n.CalendarUtility.CreateTempDomElement(this,"Header"),ht=n.Utility.MeasureText(this.GetHeaderText(),nt),o=ht.Height>this.DefaultOutlookArrowSize().Height?ht.Height:this.DefaultOutlookArrowSize().Height):o=this.HeaderHeight==0?this.DefaultHeaderHeight():this.HeaderHeight),u-=o,this.ShowWeekNumber&&h>0&&(u-=5),ot=this.HeaderStyle.GetBorderStyle(),ot!="none"&&ot!=""&&(it-=tt*2,this.AutoSize?(u-=tt*2,t.BodyContainerSize.Height-=tt*2):o-=tt*2),t.BodyContainerSize.Height-=o,t.HeaderContainerSize=new n.Size(it,o),t.ArrowButtonSize=new n.Size(0,o),t.ZoomButtonSize=new n.Size(0,o),this.ShowNavigator==n.CalendarNavigators.Outlook&&(t.ArrowButtonSize.Width=this.DefaultOutlookArrowSize().Width,this.ShowZoomButton&&(t.ZoomButtonSize.Width=this.DefaultOutlookZoomButtonSize().Width)),t.HeaderTextSize=new n.Size(t.HeaderContainerSize.Width-(t.ArrowButtonSize.Width+t.ZoomButtonSize.Width)*2,o);if(this.CalendarType==n.CalendarType.MonthDay){e-=this.VCellSpacing*8,u-=this.HCellSpacing*8,l=this.ShowWeekNumber?this.DefaultWeekNumberWidth():0,this.ShowWeekNumber&&(e-=this.VCellSpacing,nt=n.CalendarUtility.CreateTempDomElement(this,"WeekNumber"),ft=n.Utility.MeasureText("99",nt),ft.Width>l&&(l=ft.Width+4)),e-=l,a=u,v=this.WeekNumberStyle.GetBorderStyle(),v!="none"&&v!=""&&(e-=2*h,a-=this.HCellSpacing==0&&this.VCellSpacing==0?8*h:14*h),t.WeekNumberSize=new n.Size(l,Math.floor(a/7)),lt=a-t.WeekNumberSize.Height*7,t.WeekNumberSizeOffset=new n.Size(0,lt),t.WeekNumberContainerSize=new n.Size(l,t.WeekNumberSize.Height),(this.HCellSpacing!=0||this.VCellSpacing!=0)&&v!="none"&&v!=""&&(t.WeekNumberContainerSize.Width+=2*h,t.WeekNumberContainerSize.Height+=2*h);var k=e,et=Math.floor(u/7),st=et,at=this.TitleStyle.GetBorderStyle();at!=="none"&&at!==""&&(k-=this.HCellSpacing==0&&this.VCellSpacing==0?8*c:14*c,this.AutoSize?et+=2*c:st-=2*c),s=Math.floor(k/7),ct=k-s*7,s=s>0?s:0,t.TitleSize=new n.Size(s,st),t.TitleSizeOffset=new n.Size(ct,0),t.TitleContainerSize=new n.Size(s,st),(this.HCellSpacing!=0||this.VCellSpacing!=0)&&this.TitleStyle.GetBorderStyle()!="none"&&this.TitleStyle.GetBorderStyle()!=""&&(t.TitleContainerSize.Width+=2*c,t.TitleContainerSize.Height+=2*c),w=e,p=u-et,this.HCellSpacing==0&&this.VCellSpacing==0?(w-=8*f,p-=7*f):(w-=14*f,p-=12*f),r=Math.floor(w/7),d=w-r*7,r=r>0?r:0,i=Math.floor(p/6),g=p-i*6,i=i>0?i:0,t.DaySize=new n.Size(r,i),t.DaySizeOffset=new n.Size(d,g),t.DayContainerSize=new n.Size(r,i),(this.HCellSpacing!=0||this.VCellSpacing!=0)&&(t.DayContainerSize.Width+=2*f,t.DayContainerSize.Height+=2*f)}else e-=this.VCellSpacing*4,u-=this.HCellSpacing*5,y=e,b=u,this.ItemStyle.GetBorderStyle()!="none"&&this.ItemStyle.GetBorderStyle()!=""&&(this.VCellSpacing==0&&this.HCellSpacing==0?(y-=f*4,b-=f*5):(y-=f*6,b-=f*8)),r=Math.floor(y/3),d=y-r*3,r=r>0?r:0,i=Math.floor(b/4),g=b-i*4,i=i>0?i:0,t.MonthSize=new n.Size(r,i),t.MonthSizeOffset=new n.Size(d,g),t.MonthContainerSize=new n.Size(r,i),(this.HCellSpacing!=0||this.VCellSpacing!=0)&&this.ItemStyle.GetBorderStyle()!="none"&&this.ItemStyle.GetBorderStyle()!=""&&(t.MonthContainerSize.Width+=2*f,t.MonthContainerSize.Height+=2*f);return t},t.prototype.GetButtonsSize=function(t){var r={},u=t?this.InnerWidth():this.InnerHeight(),i=this.DefaultScrollBarWidth(),f;return u-=t?this.CalendarMargins.Top+this.CalendarMargins.Bottom:this.CalendarMargins.Left+this.CalendarMargins.Right,f=u-4*i,this.ShowZoomButton&&(f-=2*i),r.ButtonsSize=t?new n.Size(u,i):new n.Size(i,u),r.ZoomButtonSize=new n.Size(i,i),r.ArrowButtonSize=new n.Size(i,i),r.PageViewButtonSize=new n.Size(i,i),r.TrackBarSize=t?new n.Size(f,i):new n.Size(i,f),r},t.prototype.GetScrollBarSize=function(t){var r={},u=14,f=t?this.InnerWidth():this.InnerHeight(),i=this.DefaultScrollBarWidth(),o,e,s;return f-=t?this.CalendarMargins.Left+this.CalendarMargins.Right:this.CalendarMargins.Top+this.CalendarMargins.Bottom,o=f-5*i-u,this.ShowZoomButton&&(o-=2*i),e=this.GetScrollBarFirstBlankSize(o),s=o-e,r.ScrollBarSize=t?new n.Size(f,i):new n.Size(i,f),r.ZoomButtonSize=new n.Size(i,i),r.ArrowButtonSize=new n.Size(i,i),r.PageViewButtonSize=new n.Size(i,i),r.TodayButtonSize=new n.Size(i,i),r.StartTrackButtonSize=t?new n.Size(e,i):new n.Size(i,e),r.EndTrackButtonSize=t?new n.Size(s,i):new n.Size(i,s),r.ThumbButtonSize=t?new n.Size(u,i):new n.Size(i,u),n.Utility.IPad||n.Utility.chrome?(r.StartInnerThumbButtonSize=t?new n.Size(0,i):new n.Size(i,0),r.EndInnerThumbButtonSize=t?new n.Size(0,i):new n.Size(i,0),r.MiddleInnerThumbButtonSize=t?new n.Size(u,i):new n.Size(i,u)):(r.StartInnerThumbButtonSize=t?new n.Size(3,i):new n.Size(i,3),r.EndInnerThumbButtonSize=t?new n.Size(3,i):new n.Size(i,3),r.MiddleInnerThumbButtonSize=t?new n.Size(u-6,i):new n.Size(i,u-6)),r},t.prototype.GetScrollBarFirstBlankSize=function(t){var u=50,f,r,i;return this.CalendarType==n.CalendarType.YearMonth?(f=this.MaxDate.getFullYear()-this.MinDate.getFullYear(),i=this.FocusDate.getFullYear()-this.MinDate.getFullYear(),u=Math.floor(t*i/f)):this.CalendarType==n.CalendarType.MonthDay&&(r=(this.MaxDate.getFullYear()-this.MinDate.getFullYear())*12,r=r+this.MaxDate.getMonth()-this.MinDate.getMonth(),i=(this.FocusDate.getFullYear()-this.MinDate.getFullYear())*12,i=i+this.FocusDate.getMonth()-this.MinDate.getMonth(),u=Math.floor(t*i/r)),u>0?u:0},t.prototype.GetDefaultItemContentHeight=function(n){return Math.floor(2*n/3)},t.prototype.GetDefaultRoyouContentHeight=function(n){return Math.floor(n/3)},t.prototype.DefaultStyleBackColor=function(){return"window"},t.prototype.DefaultTrailingStyleForeColor=function(){return"#959595"},t.prototype.DefaultHeaderStyleBackColor=function(){return this.InnerControlEffect()==n.ControlEffect.Normal?"buttonface":"#F0F0F0"},t.prototype.DefaultLegendStyleBackColor=function(){return"white"},t.prototype.DefaultFocusColor=function(){return n.Utility.IsIE7?"#D3D3D3":"lightgray"},t.prototype.DefaultSelectionStyleBackColor=function(){return n.Utility.HighlightColor},t.prototype.DefaultSelectionStyleForeColor=function(){return this.GetEnablejQueryTheme()?"":"white"},t.prototype.Today=function(){return this.UseInternalToday?this.InternalToday:n.Utility.GetCurrentDate()},t.prototype.DefaultMinDate=function(){return new Date(100,0,1)},t.prototype.DefaultMaxDate=function(){return new Date(9999,11,31,23,59,59)},t.prototype.DefaultPopupMonthSize=function(){return new n.Size(110,121)},t.prototype.DefaultScrollBarToolTipSize=function(){return new n.Size(40,30)},t.prototype.DefaultWeekNumberWidth=function(){return 20},t.prototype.DefaultTodayHeight=function(){return 20},t.prototype.DefaultTodayMarkHeight=function(){return 16},t.prototype.DefaultHeaderHeight=function(){return 22},t.prototype.DefaultOutlookArrowSize=function(){return new n.Size(21,21)},t.prototype.DefaultOutlookArrowImageSize=function(){return n.Utility.IsIE9?this.ControlEffect===n.ControlEffect.Normal?new n.Size(4,7):new n.Size(14,7):new n.Size(21,21)},t.prototype.DefaultOutlookZoomImageSize=function(){return n.Utility.IsIE9&&!this.GetEnablejQueryTheme()?new n.Size(14,9):new n.Size(21,21)},t.prototype.DefaultOutlookZoomButtonSize=function(){if(!n.Utility.IsIE8)switch(this.InnerControlEffect()){case n.ControlEffect.VistaTheme:case n.ControlEffect.Windows8Theme:case n.ControlEffect.Edge:case n.ControlEffect.Chrome:case n.ControlEffect.Ipad:return new n.Size(21,25)}return new n.Size(9,9)},t.prototype.DefaultFirstFiscalMonth=function(){return n.Months.April},t.prototype.DefaultFontName=function(){return"Arial"},t.prototype.DefaultFontSize=function(){return"10pt"},t.prototype.DefaultHeaderPopFontSize=function(){return"10pt"},t.prototype.DefaultHeaderPopBorderColor=function(){return this.GetEnablejQueryTheme()?"":n.Utility.chrome||n.Utility.IsIE9OrBelow?"#A9A9A9":"black"},t.prototype.DefaultHeaderPopBackground=function(){return this.GetEnablejQueryTheme()?"":"white"},t.prototype.DefaultHeaderPopSelectionForeColor=function(){return this.GetEnablejQueryTheme()||!n.Utility.IsIE8?"":"white"},t.prototype.DefaultHeaderPopSelectionBackground=function(){return this.GetEnablejQueryTheme()?"":n.Utility.HighlightColor},t.prototype.DefaultScrollBarWidth=function(){return n.Utility.IsEdge?14:17},t.prototype.DefaultControlWidth=function(){return 186},t.prototype.DefaultHeaderPopupItemHeight=function(){return n.Utility.IsIE9OrBelow?20:18},t.prototype.FontChanged=function(){this.Control.UpdateControl()},t.prototype.WeekDayChenged=function(t){switch(t){case"DayName":this.Control.UpdateControl(n.CalendarUpdateType.Data);break;case"SubStyle":case"ReflectToTitle":case"WeekFlags":this.Control.UpdateControl(n.CalendarUpdateType.Style);break;default:break}},t.prototype.StyleChanged=function(){this.Control.UpdateControl()},t.prototype.SubStyleChanged=function(){this.Control.UpdateControl(n.CalendarUpdateType.Style)},t.prototype.HolidayStyleCollectionChanged=function(){this.UpdateSelections(),this.Control.UpdateControl(n.CalendarUpdateType.Style)},t.prototype.HolidayCollectionChanged=function(){this.UpdateSelections(),this.Control.UpdateControl(n.CalendarUpdateType.Style)},t.prototype.HolidayPropertyChanged=function(){this.UpdateSelections(),this.Control.UpdateControl(n.CalendarUpdateType.Style)},t.prototype.HolidayNameChanged=function(){this.Control.UpdateControl(n.CalendarUpdateType.Style)},t.prototype.HolidayStylePropertyChanged=function(t,i){i==="IsActive"&&(t.GetIsActive()?this._addActiveHolidayStyle(t):this._removeActiveHolidayStyle(t)),this.UpdateSelections(),this.Control.UpdateControl(n.CalendarUpdateType.Style)},t.prototype.SelectionsChanging=function(n,t,i){this.Selections.lengthe&&(d+=1,k+=1),n.CalendarUtility.SetCellSize(o,k,rt),this.setElementsWidthHeight([r.ContainerStyleDiv,u,r.ContainerDiv],d,tt)}},r.prototype.UpdateTitleEvent=function(){for(var u=this.CalendarSectionDom.SingleCalendarDom,f,n,r,i=0;i0&&tf&&(s+=1,a+=1),e.DaySizeOffset.Height>u&&(o+=1,v+=1),h=Math.max(s-2,0),c=Math.max(o-2,0),n.CalendarUtility.SetCellSize(r.ContainerCell,a,v),n.CalendarUtility.SetCellSize(r.ContainerStyleDiv,s,o),this.setElementsWidthHeight([r.ContainerCellDiv,r.ContentCell],h,c),this.setElementsWidthHeight([r.ContentRokuyouDiv,r.ContentRokuyouCell],h,this.Data.GetDefaultRoyouContentHeight(c)),n.CalendarUtility.SetDayCellDomStyle(r,i),this.UpdateBorder(r,u,f)}},r.prototype.UpdateCommonDayStyle=function(t,i,r,u){var b=this.Data.ItemStyle,rt=this.Data.RokuyouStyle,et=this.Data.SelectionStyle,d=i.ContainerCell,s=i.ContentCell,o=i.ContainerStyleDiv,e,c,f,h,y;this.Data.VCellSpacing==0&&this.Data.HCellSpacing==0&&(o=i.ContainerCell);var p="",w="",nt="",g="",it="",tt="",l="",ft="",ut="",a=n.DateTimeInfo.String2Date(t.ContainerCell.getAttribute("CellValue")),ot=a.getDay(),v=this.Data.GetHolidaysStyleType(a);v!=""&&(e=v.toString().split(","),p=e[0]);if(v!=""&&p!="dayOfWeekHoliday")w=e[1],nt=e[2],g=e[3],it=e[4],tt=e[5],o.className=w,o.styleName=w,c=n.CalendarUtility.GetHolidayStyleRule(this,tt),c!=null&&(n.Utility.chrome||n.Utility.safari||n.Utility.IsEdge)&&(s.style.textDecoration=c.style.textDecoration);else{l=this.Data.GetWeekDayStyleName(a);if(l!=""){e=l.split(",");var k=e[0],ft=e[1],ut=e[2];o.className=k,o.styleName=k,c=n.CalendarUtility.GetWeekStyleRule(this,k),c!=null&&(n.Utility.chrome||n.Utility.safari||n.Utility.IsEdge)&&(s.style.textDecoration=c.style.textDecoration)}else o.className=this.Data.GetItemStyleName(),o.styleName=o.className,f=o.style,f.padding="",this.Data.IsDefaultItemStyle()?(f.color="",f.border="none 0px black",f.fontWeight="",f.backgroundColor="window",f.backgroundImage="",f.backgroundPosition="center center",(n.Utility.chrome||n.Utility.safari||n.Utility.IsEdge)&&(s.style.textDecoration="")):(h=this.ItemStyleRule.style,f.color=h.color,f.border=h.border,f.fontWeight=h.fontWeight,f.backgroundColor=h.backgroundColor,f.backgroundImage=h.backgroundImage,f.backgroundPosition=h.backgroundPosition,(n.Utility.chrome||n.Utility.safari||n.Utility.IsEdge)&&(s.style.textDecoration=h.textDecoration));n.Utility.IsQuriksMode&&(i.ContentTable.className=this.Data.CellStyleName+" "+o.className,i.ContentTable.styleName=i.ContentTable.className)}d.holidayName=nt,d.holidayType=p,s.vAlign=b.GetTextVAlign()==""?"middle":b.GetTextVAlign(),this.Data.IsDateSelected(a)?n.CalendarUtility.IsShowImageAsContent(et)&&(s.style.display="none"):v!=""&&p!="dayOfWeekHoliday"?it=="false"&&g!=""&&(s.style.display="none"):l!=""?ut=="false"&&ft!=""&&(s.style.display="none"):n.CalendarUtility.IsShowImageAsContent(b)&&(s.style.display="none"),n.CalendarUtility.IsShowImageAsContent(rt)&&(i.ContentRokuyouCell.style.display="none"),this.Data.ShowRokuyou!=n.Rokuyou.None?(i.ContentRokuyouDiv.className=this.Data.RokuyouStyleName,n.Utility.IsQuriksMode&&(y=i.ContentRokoyouContentTable,y.className=this.Data.CellStyleName+" "+this.Data.RokuyouStyleName,y.styleName=y.className)):i.ContentRokuyouDiv.style.display="none"},r.prototype.UpdateTrailingDayStyle=function(t,i,r,u){var c=this.Data.ItemStyle,y=this.Data.RokuyouStyle,p=this.Data.SelectionStyle,v=this.Data.TrailingStyle,a=this.Data.IsDefaultTrailingStyle(),w=i.ContainerCell,s=i.ContentCell,o=i.ContainerStyleDiv,l,f,e,h;this.Data.VCellSpacing==0&&this.Data.HCellSpacing==0&&(o=i.ContainerCell),l=n.DateTimeInfo.String2Date(t.ContainerCell.getAttribute("CellValue")),o.className=this.Data.GetTrailingStyleName(),o.styleName=o.className,f=o.style,f.padding="",a?(f.color="#959595",f.border="none 1px black",f.fontWeight="",f.backgroundColor="window",f.backgroundImage="",f.backgroundPosition="center center"):(e=this.TrailingStyleRule.style,f.color=e.color,f.border=e.border,f.fontWeight=e.fontWeight,f.backgroundColor=e.backgroundColor,f.backgroundImage=e.backgroundImage,f.backgroundPosition=e.backgroundPosition),s.vAlign=c.GetTextVAlign()==""?"middle":c.GetTextVAlign(),(n.Utility.chrome||n.Utility.safari||n.Utility.IsEdge)&&(s.style.textDecoration=a?"":this.TrailingStyleRule.style.textDecoration),this.Data.IsDateSelected(l)?n.CalendarUtility.IsShowImageAsContent(p)&&(s.style.display="none"):n.CalendarUtility.IsShowImageAsContent(v)&&(s.style.display="none"),n.CalendarUtility.IsShowImageAsContent(y)&&(i.ContentRokuyouCell.style.display="none"),this.Data.ShowRokuyou!=n.Rokuyou.None?(i.ContentRokuyouDiv.className=this.Data.RokuyouStyleName,n.Utility.IsQuriksMode&&(h=i.ContentRokoyouContentTable,h.className=this.Data.CellStyleName+" "+this.Data.GetTrailingStyleName()+" "+this.Data.RokuyouStyleName,h.styleName=h.className)):i.ContentRokuyouDiv.style.display="none",n.Utility.IsQuriksMode&&(i.ContentTable.className=this.Data.CellStyleName+" "+o.className,i.ContentTable.styleName=i.ContentTable.className)},r.prototype.UpdateEmptyDayStyle=function(t,i,r,u){var o=i.ContainerStyleDiv,f,e;this.Data.VCellSpacing==0&&this.Data.HCellSpacing==0&&(o=i.ContainerCell),o.className=this.Data.GetItemStyleName(),o.styleName=o.className,f=o.style,f.padding="",this.Data.IsDefaultItemStyle()?(f.color="",f.border="none 1px black",f.fontWeight="",f.backgroundColor="window",f.backgroundImage="",f.backgroundPosition="center center"):(e=this.ItemStyleRule.style,f.color=e.color,f.border=e.border,f.fontWeight=e.fontWeight,f.backgroundColor=e.backgroundColor,f.backgroundImage=e.backgroundImage,f.backgroundPosition=e.backgroundPosition),i.ContentRokuyouDiv.style.display="none",n.Utility.IsQuriksMode&&(i.ContentTable.className=this.Data.CellStyleName+" "+o.className)},r.prototype.UpdateDisableDayStyle=function(n,t,i,r){this.UpdateTrailingDayStyle(n,t,i,r)},r.prototype.UpdateMonthEvent=function(){for(var f=this.CalendarSectionDom.SingleCalendarDom,e,i,n,u,r=0;rc&&(o=c),f=new Date(a,s,o),p=!1,i=0;i<4;i++)for(r=0;r<3;r++){h=w.RowsDom[i][r],e=h.ContainerCell,this.UpdateCommonMonthData(h,f);var l=f.getFullYear()*12+f.getMonth(),y=this.Data.MinDate.getFullYear()*12+this.Data.MinDate.getMonth(),v=this.Data.MaxDate.getFullYear()*12+this.Data.MaxDate.getMonth();lv?e.setAttribute("CellType","DisableMonth"):e.setAttribute("CellType","CommonMonth"),e.setAttribute("id",this.Control._getId()+"_"+f.getFullYear()+"/"+(f.getMonth()+1)),e.setAttribute("CellValue",f.getFullYear()+"/"+(f.getMonth()+1)+"/"+f.getDate()),f=n.CalendarUtility.GetNextMonthDate(f,1)}},r.prototype.UpdateCommonMonthData=function(n,t){n.ContentTextNode.nodeValue=this.Data.GetMonthText(t)},r.prototype.UpdateYearStyle=function(t){for(var u=this.singleCalendarSizeCache==null?this.Data.GetSingleCalendarSize():this.singleCalendarSizeCache,w=this.CalendarSectionDom.SingleCalendarDom[t],k=this.Data.ItemStyle,p=this.Data.IsDefaultItemStyle(),r,s,l,y,f=0;f<4;f++)for(r=0;r<3;r++){var i=w.RowsDom[f][r],e=i.ContentCell,o=i.ContainerCell,b=i.ContainerCellDiv;n.CalendarUtility.ResetMonthCellDom(i),s=o.getAttribute("CellType"),s=="CommonMonth"?this.UpdateCommonMonthStyle(i):s=="DisableMonth"&&this.UpdateDisableMonthStyle(i),b.className="",o.style.padding="0px",e.className="",e.style.padding="0px",(n.Utility.chrome||n.Utility.safari||n.Utility.IsEdge)&&(e.style.textDecoration=p?"":this.ItemStyleRule.style.textDecoration);var v=u.MonthContainerSize.Width,h=u.MonthContainerSize.Height,c=u.MonthSize.Width,a=u.MonthSize.Height;u.MonthSizeOffset.Width>r&&(c+=1,v+=1),u.MonthSizeOffset.Height>f&&(a+=1,h+=1),l=Math.max(c-2,0),y=Math.max(a-2,0),this.setElementsWidthHeight([e,i.ContainerStyleDiv,i.ContainerCellDiv],l,y),n.CalendarUtility.SetCellSize(o,v,h),this.UpdateBorder(i,f,r)}},r.prototype.UpdateCommonMonthStyle=function(t){var e=n.DateTimeInfo.String2Date(t.ContainerCell.getAttribute("CellValue")),r=this.Data.ItemStyle,f=this.Data.SelectionStyle,i=t.ContainerStyleDiv,u;this.Data.VCellSpacing==0&&this.Data.HCellSpacing==0&&(i=t.ContainerCell),i.style.padding="",i.style.borderWidth="",i.className=this.Data.GetItemStyleName(),i.setAttribute("styleName",this.Data.GetItemStyleName()),this.Data.IsDefaultItemStyle()?n.CalendarUtility.SetDefalutItemInlineStyle(i):n.CalendarUtility.SetItemInlineStyle(i,this.ItemStyleRule),u=r.GetTextVAlign()==""?"middle":r.GetTextVAlign(),t.ContentCell.setAttribute("vAlign",u),this.Data.IsMonthSelected(e)?n.CalendarUtility.IsShowImageAsContent(f)&&(t.ContentCell.style.display="none"):n.CalendarUtility.IsShowImageAsContent(r)&&(t.ContentCell.style.display="none"),n.Utility.IsQuriksMode&&(t.ContentTable.className=this.Data.CellStyleName+" "+i.className,t.ContentTable.setAttribute("styleName",t.ContentTable.className))},r.prototype.UpdateDisableMonthStyle=function(t){t.ContainerStyleDiv.className=this.Data.TrailingStyleName,t.ContainerStyleDiv.setAttribute("styleName",this.Data.TrailingStyleName),n.Utility.IsQuriksMode&&(t.ContentTable.className=this.Data.CellStyleName+" "+t.ContainerStyleDiv.className)},r.prototype.UpdateYearEvent=function(){for(var f=this.CalendarSectionDom.SingleCalendarDom,e,i,n,u,r=0;r6)break;this.Data.IsHeaderFocusDateInvalidate(f)&&(s=this.Data.GetHeaderText(f),h=n.Utility.MeasureText(s,p),h.Width+20>c&&(c=h.Width+20),v=n.Utility.CreateInnerTextNode(s),u.Cells[e].style.display="",u.Cells[e].style.textAlign="center",u.Cells[e].style.borderStyle="none",u.Cells[e].innerHTML="",u.Cells[e].appendChild(v),u.Cells[e].setAttribute("HeaderIndex",t),u.Cells[e].setAttribute("CellType","PopupHeaderText"),u.Cells[e].setAttribute("CellValue",f.getFullYear()+"/"+(f.getMonth()+1)+"/"+f.getDate()),e++),this.Data.CalendarType==n.CalendarType.MonthDay?f.setMonth(f.getMonth()+1):f.setFullYear(f.getFullYear()+1)}this.Data._realPopupMonthWidth=c,y=u.PopupMonthContainer,y.setAttribute("RowCount",e)}},r.prototype.UpdateHeaderPopupStyle=function(t){var o=this.CalendarSectionDom.PopupMonthDom,u,i,c,e,h,f,s,r;if(o)for(u=o.PopupMonthContainer,i=u.style,u.className=this.Data.GetHeaderPopClassName(),c=this.Data.DefaultPopupMonthSize(),e=u.getAttribute("RowCount")*this.Data.DefaultHeaderPopupItemHeight(),i.width=this.Data._realPopupMonthWidth+"px",i.height=e+"px",i.lineHeight="100%",h=this._getPopupMonthZoom(),h==1?n.Utility.SetZoomStyle(u,""):(n.Utility.SetZoomStyle(u,h),e*=h),f=n.CalendarUtility.GetHeaderPopupPosition(this.Data,this,t,e),i.left=f.Width+"px",i.top=f.Height+"px",i.borderColor=this.Data.DefaultHeaderPopBorderColor(),o.currentTop=f.Height,o.currentBottom=f.Height+e,s=0;s<7;s++)r=o.Cells[s],r.style.width=this.Data._realPopupMonthWidth+"px",r.style.height=this.Data.DefaultHeaderPopupItemHeight()+"px",r.style.backgroundColor=this.Data.DefaultHeaderPopBackground(),n.Utility.IsQuriksMode&&(r.style.fontFamily=n.Utility.GetOSDefaultFontFamily(),r.style.fontSize=this.Data.DefaultHeaderPopFontSize())},r.prototype.UpdateHeaderPopupEvent=function(){var u=this.CalendarSectionDom.PopupMonthDom,f,i,r;if(u)for(f=u.PopupMonthTable,n.Utility.firefox?f.style.MozUserSelect="none":f.onselectstart=function(){return!1},i=0;i<7;i++)r=u.Cells[i],n.Utility.IsPad()?this.attachElementEvent(r,t.TouchStart):this.attachElementEvent(r,t.MouseUp|t.MouseOver|t.MouseOut)},r.prototype.IsHeaderPopupToStartOrEnd=function(t){var f=this.CalendarSectionDom.PopupMonthDom,i="",r;if(t>0)for(r=0;r<7;r++)f.Cells[r].style.display===""&&(i=f.Cells[r].getAttribute("CellValue"));else t<0&&(i=f.Cells[0].getAttribute("CellValue"));if(i!==null&&i!==""){var s=new Date(i),u=s.getFullYear(),h=s.getMonth(),e=this.Data.MinDate.getFullYear(),c=this.Data.MaxDate.getFullYear(),l=this.Data.MinDate.getMonth(),o=this.Data.MaxDate.getMonth();if(this.Data.CalendarType==n.CalendarType.YearMonth){if(t>0){if(u===c)return!0}else if(t<0)if(u===e)return!0}else if(t>0){if(u===o&&h===o)return!0}else if(t<0)if(u===e&&h===l)return!0}return!1},r.prototype.CreatePopupHolidayStylesMenu=function(n){return this.CreatePopupHolidayStylesMenuStyleRule(),this.CreatePopupHolidayStylesFrame(),this.UpdatePopupHolidayStylesData(),this.UpdatePopupHolidayStylesStyle(n),this.UpdatePopupHolidayStylesEvent(),this.CalendarSectionDom.HolidayStylesMenuDom.HolidayStylesMenuContainer},r.prototype.CreatePopupHolidayStylesMenuStyleRule=function(){if(this.HolidayStyleMenuStyleRule)return;var i=n.Utility.CreateClassStyle(this.Data.HolidayStyleMenuStyleName),t=i.style;t.position="absolute",t.visibility="visible",t.zIndex=1000001,t.cursor="default",t.padding="2px",t.backgroundColor="menu",t.boxShadow="3px 3px 3px 0px gray",t.fontFamily=n.Utility.GetOSDefaultFontFamily(),t.fontSize=this.Data.DefaultFontSize(),this.HolidayStyleMenuStyleRule=i},r.prototype.CreatePopupHolidayStylesFrame=function(){var u=this.Data.CellStyleName,y=this.Data.HolidayStyles,t={},i;t.Cells=[];var s=n.Utility.CreateInnerDiv(),o=n.Utility.CreateInnerTable(),v=n.Utility.CreateInnerTbody();for(o.appendChild(v),i=0;i300)this.onMouseDownHeaderText(t)}else this.onMouseDownHeaderText(t);else if(n.Utility.IsIE9OrBelow)this.onMouseDownHeaderText(t);break;case"CommonMonth":this.onMouseDownMonth(t);break;case"TrailingDay":case"CommonDay":case"DisableDay":this.onMouseDownDay(t);break;default:break}},t.prototype.onCellMouseUpHandler=function(t){n.Utility.IsPad()||this.CloseHeaderPopup(),n.Utility.IsTouchMouseDown||this.CloseHolidayStylesMenu();var r=n.CalendarUtility.GetEventCurrentTarget(t),i=r.getAttribute("CellType");if(n.Utility.GetMouseButton(t)!==n.MouseButton.Left&&i!="CalendarSectionArea")return;switch(i){case"OutlookLeftNavigator":this.onMouseUpOutlookLeftNavigator(t);break;case"OutlookRightNavigator":this.onMouseUpOutlookRightNavigator(t);break;case"LeftNavigator":this.onMouseUpLeftNavigator(t);break;case"RightNavigator":this.onMouseUpRightNavigator(t);break;case"LeftMost":case"LeftBlank":this.onMouseUpLeftMostNavigator(t);break;case"RightMost":case"RightBlank":this.onMouseUpRightMostNavigator(t);break;case"ZoomIn":case"ZoomOut":case"TodayButton":this.onMouseUpScrollBarCell(t);break;case"ThumbButton":this.onMouseUpThumb(t);break;case"Title":this.onMouseUpTitle(t);break;case"WeekNumber":this.onMouseUpWeekNumber(t);break;case"PopupHeaderText":this.onMouseUpHeaderText(t);break;case"CommonMonth":this.onMouseUpMonth(t);break;case"TrailingDay":case"CommonDay":case"DisableDay":this.onMouseUpDay(t);break;case"HolidayStylesMenu":this.onMouseUpHolidayStylesMenuCell(t);break;default:break}},t.prototype.onCellMouseEnterHandler=function(t){var r=n.CalendarUtility.GetEventCurrentTarget(t),i=r.getAttribute("CellType");switch(i){case"LeftNavigator":case"RightNavigator":case"ZoomIn":case"ZoomOut":case"LeftMost":case"RightMost":case"TodayButton":this.onMouseEnterScrollBarCell(t);break;case"CommonMonth":this.onMouseEnterMonth(t);break;case"CommonMonth":case"TrailingDay":case"CommonDay":case"DisableDay":this.onMouseEnterDay(t);break;case"Title":if(this.Data.WeekTitleSelect)this.onMouseEnterTitle(t);break;case"WeekNumber":if(this.Data.WeekNumberSelect)this.onMouseEnterWeekNumber(t);break;case"PopupHeaderText":this.onMouseEnterPopupHeaderText(t);break;case"HolidayStylesMenu":this.onMouseEnterHolidayStylesMenuCell(t);break;case"ThumbButton":this.onMouseEnterThumb(t);break;default:break}},t.prototype.onCellMouseLeaveHandler=function(t){var r=n.CalendarUtility.GetEventCurrentTarget(t),i;if(r===null)return;i=r.getAttribute("CellType");switch(i){case"OutterContainer":this.CloseHolidayNameTip(),this.CloseOverrideHolidayTip();break;case"OutlookLeftNavigator":case"OutlookRightNavigator":this.onMouseLeaveOutlookCell(t);break;case"LeftNavigator":case"RightNavigator":case"ZoomIn":case"ZoomOut":case"LeftMost":case"RightMost":case"LeftBlank":case"RightBlank":case"TodayButton":this.onMouseLeaveScrollBarCell(t);break;case"PopupHeaderText":this.onMouseLeavePopupHeaderText(t);break;case"HolidayStylesMenu":this.onMouseLeaveHolidayStylesMenuCell(t);break;case"ThumbButton":this.onMouseLeaveThumb(t);break;default:break}},t.prototype.onMouseWheelHandler=function(t){n.Utility.CancelBubble(t),n.Utility.PreventDefault(t);if(this.IsAnimationBusy())return;var r=t.wheelDelta>=0?this.Data.ScrollSteps(-1,t.ctrlKey):this.Data.ScrollSteps(1,t.ctrlKey),i=t.wheelDelta>=0?n.AnimationType.ScrollToBottom:n.AnimationType.ScrollToTop;this._initScrollAnimation(i),this.ScrollMonth(r)&&this._showAnimationInternal(i,this.domElement,this.domElementOld)},t.prototype.onDocumentTouchMoveHandler=function(n){this.onMouseMoveThumb(n)},t.prototype.onDocumentMouseMoveHandler=function(n){var f=n.srcElement||n.target,t;if(this.headerPopupMonthShown){var u=this.Render.CalendarSectionDom.PopupMonthDom,r=u.currentTop,i=u.currentBottom,e=n.clientY;n.clientY>i||n.clientYi?(this.headerPopupMonthOffset=1,t=n.clientY-i):(this.headerPopupMonthOffset=-1,t=r-n.clientY),this.headerPopupMonthDelay=t<30?300:t>=30&&t<50?200:t>=50&&t<100?100:50):(this.headerPopupMonthOffset=0,this.headerPopupMonthDelay=1500)}this.MouseMoveEvt=n;this.onMouseMoveThumb(n)},t.prototype.onDocumentTouchStartHandler=function(t){var i=this;if(n.Utility.IsPad())this.onDocumentMouseDownHandler(t);setTimeout(function(){i.CloseHolidayStylesMenu()},600)},t.prototype.onDocumentMouseDownHandler=function(t){var r=t.srcElement||t.target,u=this.Control.Render.isActive,i=this.Control.Render.CalendarSectionDom.OutterContainer;if(n.Control.GetEnableChromeThemeOutline())if(this.Control.GetRealControlEffect()===n.ControlEffect.Chrome&&(this.Control.Render.isActive===undefined||this.Control.Render.isActive!==i.contains(r))){if(n.DropDownCalendar&&this.Control instanceof n.DropDownCalendar){this._restoreFocusBorder();return}i.contains(r)===!0?this._setFocusBorder():this._restoreFocusBorder()}this.Control.Render.isActive=i.contains(r),u!=this.Control.Render.isActive&&this.Control.Render.UpdateSelectionStyle()},t.prototype.onDocumentMouseUpHandler=function(t){n.Utility.IsPad()||this.CloseHeaderPopup(),n.Utility.IsTouchMouseDown||this.CloseHolidayStylesMenu();var i=n.Utility.GetSrcElement(t);this.Render.CalendarSectionDom.OutterContainer.contains(i)||(this.Data.SelectionMode===n.CalendarSelectionMode.MultiRich&&(this.beginSelections===null||this.Data.Selections.EqualsTo(this.beginSelections)||this.Control.FireEvent(this.Control._specialClientEvents.SelectedDateChanged)),this.ClearMouseDragFlag());if(n.Utility.GetMouseButton(t)===n.MouseButton.Left)this.onMouseUpThumb(t)},t.prototype.onContextMenuHandler=function(n){this.onMouseRightUp(n)},t.prototype.onKeyDownHandler=function(t){if(this.headerPopupMonthShown)return;this.CloseAllPopup();switch(t.keyCode){case n.Key.Down:this.onPressDown(t);break;case n.Key.Up:this.onPressUp(t);break;case n.Key.Left:this.onPressLeft(t);break;case n.Key.Right:this.onPressRight(t);break;case n.Key.Home:this.onPressHome(t);break;case n.Key.End:this.onPressEnd(t);break;case n.Key.PageDown:this.onPressPageDown(t);break;case n.Key.PageUp:this.onPressPageUp(t);break;case n.Key.Space:this.onPressSpace(t);break;case n.Key.Return:this._onPressEnter(t);break}this._ExcuteShortcutAction(t),t.keyCode===n.Key.Tab?this.Control._realLoseFocus():n.Utility.PreventDefault(t)},t.prototype._ExcuteShortcutAction=function(n){var t=this.Control._getShortcutObj();t!=null&&(t._uiProcess.ProcessGcCalendarAction(this.Control,n),t._uiProcess.ProcessTriggerAll(this.Control,n))},t.prototype.onTouchStartHandler=function(t){var r=n.CalendarUtility.GetEventCurrentTarget(t),i=r.getAttribute("CellType");n.Utility.chrome&&(this._chromeTouchStartTime=new Date);switch(i){case"OutterContainer":this._touchType="",t.touches.length==1&&this.Data.SelectionMode!=n.CalendarSelectionMode.MultiRich&&(this.Data.ShowContextMenu?(this._touchStartTime=new Date,this._touchStartEvt=t):(this._touchStartTime=undefined,this._touchStartEvt=undefined),this._touchType="Animation",this._touchStartX[0]=t.touches[0].pageX,this._touchStartY[0]=t.touches[0].pageY,this._touchEndX[0]=t.touches[0].pageX,this._touchEndY[0]=t.touches[0].pageY),this.Data.EnableTouchZoom&&t.touches.length==2&&(this._touchType="TouchZoom",this._touchStartX[0]=t.touches[0].pageX,this._touchStartY[0]=t.touches[0].pageY,this._touchStartX[1]=t.touches[1].pageX,this._touchStartY[1]=t.touches[1].pageY,n.Utility.PreventDefault(t));break;case"HeaderText":this.onMouseDownHeaderText(t);break;case"PopupHeaderText":this.onMouseUpHeaderText(t);break;case"ThumbButton":this.onMouseDownThumb(t);break;case"CommonMonth":this.onMouseDownMonth(t);break;case"TrailingDay":case"CommonDay":case"DisableDay":this.onMouseDownDay(t);break;case"WeekNumber":if(this.Data.WeekNumberSelect)this.onMouseDownWeekNumber(t);break;case"Title":if(this.Data.WeekTitleSelect)this.onMouseDownTitle(t);break;default:break}},t.prototype.onTouchMoveHandler=function(t){var r=n.CalendarUtility.GetEventCurrentTarget(t),i=r.getAttribute("CellType");switch(i){case"OutterContainer":t.touches.length==1&&this.Data.SelectionMode!=n.CalendarSelectionMode.MultiRich&&(this._touchEndX[0]=t.touches[0].pageX,this._touchEndY[0]=t.touches[0].pageY,n.Utility.PreventDefault(t)),t.touches.length==2&&this.Data.EnableTouchZoom&&(this._touchEndX[0]=t.touches[0].pageX,this._touchEndY[0]=t.touches[0].pageY,this._touchEndX[1]=t.touches[1].pageX,this._touchEndY[1]=t.touches[1].pageY,n.Utility.PreventDefault(t));break;case"ThumbButton":this.onMouseMoveThumb(t);break;case"CommonMonth":this.onMouseEnterMonth(t);break;case"TrailingDay":case"CommonDay":case"DisableDay":this.onMouseEnterDay(t);break;case"WeekNumber":if(this.Data.WeekNumberSelect)this.onMouseEnterWeekNumber(t);break;case"Title":if(this.Data.WeekTitleSelect)this.onMouseEnterTitle(t);break;default:break}},t.prototype.onTouchEndHandler=function(t){var o=n.CalendarUtility.GetEventCurrentTarget(t),e=o.getAttribute("CellType"),r,u,i,f;switch(e){case"OutterContainer":if(this._touchType==="Animation"){r=null,this._touchStartTime!==undefined&&(this._touchEndTime=new Date,r=this._touchEndTime-this._touchStartTime,this._touchStartTime=undefined,this._touchEndTime=undefined),r!==null&&r<1e3&&this.Data.SelectionMode!=n.CalendarSelectionMode.MultiRich&&(f=n.Utility.GetAnimationTypeByTouch(this._touchStartX[0],this._touchEndX[0],this._touchStartY[0],this._touchEndY[0]),this._processTouchAnimation(f),this._touchStartX[0]=-1,this._touchStartY[0]=-1,this._touchEndX[0]=-1,this._touchEndY[0]=-1);if(this.Data.ShowContextMenu){if(r!==null&&r>1e3)this.onMouseRightUp(this._touchStartEvt);this._touchStartEvt=undefined}}else this._touchType==="TouchZoom"&&this.Data.EnableTouchZoom&&(u=n.Utility.GetTouchPathY(this._touchStartY[0],this._touchEndY[0]),i=n.Utility.GetTouchPathY(this._touchStartY[1],this._touchEndY[1]),u==="ToTop"?(i==="ToBottom"||i==="NotMove")&&this.onClickLeftZoom():u==="ToBottom"?(i==="ToTop"||i==="NotMove")&&this.onClickRightZoom():u==="NotMove"&&(i==="ToTop"?this.onClickLeftZoom():i==="ToBottom"&&this.onClickRightZoom()),this._touchStartX[0]=-1,this._touchStartY[0]=-1,this._touchStartX[1]=-1,this._touchStartY[1]=-1);break;case"ThumbButton":this.onMouseUpThumb(this._mouseUpThumbEvt);break;case"CommonMonth":this.onMouseUpMonth(t);break;case"TrailingDay":case"CommonDay":this.onMouseUpDay(t);f=n.Utility.GetAnimationTypeByTouch(this._touchStartX[0],this._touchEndX[0],this._touchStartY[0],this._touchEndY[0]);if(n.Utility.IsPad()&&f===null){if(e==="CommonDay")this.onClickCommonDay(t);else this.onClickTrailingDay(t);this.Control.SetFocus()}break;case"DisableDay":this.onMouseUpDay(t);break;case"WeekNumber":this.onMouseUpWeekNumber(t);break;case"Title":this.onMouseUpTitle(t);break;default:break}},t.prototype.onMSPointerDown=function(t){var r=n.CalendarUtility.GetEventCurrentTarget(t),i=r.getAttribute("CellType");switch(i){case"HeaderText":if(t.pointerType===t.MSPOINTER_TYPE_MOUSE||t.pointerType==="mouse")this.onMouseDownHeaderText(t);break;case"OutterContainer":(t.pointerType===t.MSPOINTER_TYPE_TOUCH||t.pointerType==="touch")&&(this._gestureEvent==null&&window.MSGesture&&(this._gestureEvent=new MSGesture),this._gestureEvent&&(this._gestureEvent.target=this.Control.Render.CalendarSectionDom.OutterContainer,this._gestureEvent.addPointer(t.pointerId)));break}t.stopPropagation()},t.prototype.onMSPointerMove=function(n){},t.prototype.onMSPointerUp=function(n){},t.prototype.onMSGestureHold=function(n){this.onMouseRightUp(n)},t.prototype.onMSGestureStart=function(n){this._maxVelocityX=0,this._maxVelocityY=0,this.Data.EnableTouchZoom&&(this._scaleFactor=1),n.stopPropagation()},t.prototype.onMSGestureChange=function(n){this._maxVelocityX=n.velocityX>0?Math.max(n.velocityX,this._maxVelocityX):Math.min(n.velocityX,this._maxVelocityX),this._maxVelocityY=n.velocityY>0?Math.max(n.velocityY,this._maxVelocityY):Math.min(n.velocityY,this._maxVelocityY),this.Data.EnableTouchZoom&&(this._scaleFactor+=n.scale-1),n.stopPropagation()},t.prototype.onMSGestureEnd=function(t){if(this.Data.SelectionMode!==n.CalendarSelectionMode.MultiRich){var i=null;Math.abs(this._maxVelocityX)>Math.abs(this._maxVelocityY)?this._maxVelocityX>.5?i=n.AnimationType.ScrollToLeft:this._maxVelocityX<-.5&&(i=n.AnimationType.ScrollToRight):this._maxVelocityY>.5?i=n.AnimationType.ScrollToTop:this._maxVelocityY<-.5&&(i=n.AnimationType.ScrollToBottom),this._processTouchAnimation(i)}this.Data.EnableTouchZoom&&(this._scaleFactor>1.1?this.onClickLeftZoom():this._scaleFactor<.9&&this.onClickRightZoom()),this._gestureEvent=null,this._scaleFactor=1,this._maxVelocityX=0,t.stopPropagation()},t.prototype._processTouchAnimation=function(t){var i,u,r;if(t!==null){i=0,u=this.Data.CalendarType===n.CalendarType.YearMonth;switch(t){case n.AnimationType.ScrollToLeft:i=-1*this.Data.ScrollRate;break;case n.AnimationType.ScrollToTop:i=this.Data.CalendarType===n.CalendarType.YearMonth?-10:-1*this.Data.ScrollRate,u=!0;break;case n.AnimationType.ScrollToRight:i=this.Data.ScrollRate;break;case n.AnimationType.ScrollToBottom:i=this.Data.CalendarType===n.CalendarType.YearMonth?10:this.Data.ScrollRate,u=!0;break}r=!1,this._initScrollAnimation(t),r=u?this.ScrollYear(i):this.ScrollMonth(i),r&&this._showAnimationInternal(t,this.domElement,this.domElementOld)}},t.prototype.onPressLeft=function(t){var i=new Date(this.Data.FocusDate.valueOf());this.Data.CalendarType==n.CalendarType.MonthDay?i.setDate(i.getDate()-1):i=n.CalendarUtility.GetNextMonthDate(i,-1),this._keyBoardMoveTo(i)},t.prototype.onPressUp=function(t){var i=new Date(this.Data.FocusDate.valueOf());this.Data.CalendarType==n.CalendarType.MonthDay?i.setDate(i.getDate()-7):i=n.CalendarUtility.GetNextMonthDate(i,-3),this._keyBoardMoveTo(i)},t.prototype.onPressPageUp=function(t){var i=new Date(this.Data.FocusDate.valueOf());i=this.Data.CalendarType==n.CalendarType.MonthDay?t!==undefined&&t!==null&&t.ctrlKey?n.CalendarUtility.GetNextYearDate(i,-1):n.CalendarUtility.GetNextMonthDate(i,-1):n.CalendarUtility.GetNextYearDate(i,-1),this._keyBoardMoveTo(i)},t.prototype.onPressRight=function(t){var i=new Date(this.Data.FocusDate.valueOf());this.Data.CalendarType==n.CalendarType.MonthDay?i.setDate(i.getDate()+1):i=n.CalendarUtility.GetNextMonthDate(i,1),this._keyBoardMoveTo(i)},t.prototype.onPressDown=function(t){var i=new Date(this.Data.FocusDate.valueOf());this.Data.CalendarType==n.CalendarType.MonthDay?i.setDate(i.getDate()+7):i=n.CalendarUtility.GetNextMonthDate(i,3),this._keyBoardMoveTo(i)},t.prototype.onPressPageDown=function(t){var i=new Date(this.Data.FocusDate.valueOf());i=this.Data.CalendarType==n.CalendarType.MonthDay?t!==undefined&&t!==null&&t.ctrlKey?n.CalendarUtility.GetNextYearDate(i,1):n.CalendarUtility.GetNextMonthDate(i,1):n.CalendarUtility.GetNextYearDate(i,1),this._keyBoardMoveTo(i)},t.prototype.onPressHome=function(t){var r=new Date(this.Data.FocusDate.valueOf()),i=null;this.Data.CalendarType==n.CalendarType.MonthDay?i=t.ctrlKey?new Date(r.getFullYear(),r.getMonth(),1):n.CalendarUtility.GetDayLineBeginDate(this.Render,r,"CommonDay"):this.Data.CalendarType==n.CalendarType.YearMonth&&(i=t.ctrlKey?n.CalendarUtility.GetMonthBeginDate(this.Render,r,"CommonMonth"):n.CalendarUtility.GetMonthLineBeginDate(this.Render,r,"CommonMonth")),ithis.Data.MaxDate&&(r=new Date(this.Data.MaxDate.valueOf())),this._keyBoardMoveTo(r)},t.prototype.onPressSpace=function(t){var r=new Date(this.Data.FocusDate.valueOf()),f=this.Control._getId()+"_"+r.getFullYear()+"/"+(r.getMonth()+1);this.Data.CalendarType==n.CalendarType.MonthDay&&(f=this.Control._getId()+"_"+r.getFullYear()+"_"+(r.getMonth()+1)+"_"+r.getDate());var e=document.getElementById(f),i=n.DateTimeInfo.String2Date(e.getAttribute("CellValue")),u=e.getAttribute("holidayType");this.Data.SelectionMode===n.CalendarSelectionMode.One?this.Data.CalendarType===n.CalendarType.MonthDay?this.Data.IsAllowSelection(u,i)&&this.Data._setSelectedDateInternal(i):this.Data._setSelectedDateInternal(i):(this.Data.CalendarType===n.CalendarType.MonthDay?this.Data.IsDateSelected(i)?this.Data.RemoveSelectedDate(i):this.Data.IsAllowSelection(u,i)&&this.Data.AddSelectedDate(i):(this.Data.IsMonthSelected(i)?this.Data.RemoveSelectedMonth(i):this.Data.AddSelectedMonth(i),this.Control.FireEvent(this.Control._specialClientEvents.SelectedDateChanged)),this.Control.UpdateControl(n.CalendarUpdateType.Style))},t.prototype._onPressEnter=function(n){this.onPressSpace(n)},t.prototype._keyBoardMoveTo=function(t){var i=this;this._initScrollAnimation(n.AnimationType.Fade);if(this.Data._setFocusDateInternal(t)){this.IsAnimationBusy()&&(this._ignoreAnimation=!0);if(this._ignoreAnimation){clearTimeout(this._ignoreAnimationTimer),this._ignoreAnimationTimer=setTimeout(function(){i._ignoreAnimation=!1},500);return}this._animation.Setting.FadeType=n.FadeType.FadeInOut,this._showAnimationInternal(n.AnimationType.Fade,this.domElement,this.domElementOld)}},t.prototype.onMouseDownMonth=function(t){if(this.Data.SelectionMode!=n.CalendarSelectionMode.MultiRich)return;var r=n.CalendarUtility.GetEventCurrentTarget(t),i=n.DateTimeInfo.String2Date(r.getAttribute("CellValue"));t.ctrlKey||this.Data.Selections._clearInternal(),this.mouseDown=!0,this.beginDate=i,this.beginSelections=this.Data.Selections.Clone()},t.prototype.onMouseUpMonth=function(t){var r,i,u;if(this.Data.SelectionMode!=n.CalendarSelectionMode.MultiRich||this.mouseDown==!1)return;r=n.CalendarUtility.GetEventCurrentTarget(t);if(t.changedTouches)if(t.changedTouches.length>0){r=n.CalendarUtility.GetDomElementByPosition(this.Render,t.changedTouches[0].clientX,t.changedTouches[0].clientY,!0);if(r===null)return;n.Utility.PreventDefault(t)}i=n.DateTimeInfo.String2Date(r.getAttribute("CellValue")),n.DateTimeInfo.Equal(this.beginDate,i)&&(this.Data._setFocusDateInternal(i),u=r.getAttribute("CellType"),u==="CommonMonth"&&(t.ctrlKey||this.Data.Selections._clearInternal(),this.Data.IsMonthSelected(i)?this.Data.RemoveSelectedMonth(i):this.Data.AddSelectedMonth(i)),this.Control.UpdateControl(n.CalendarUpdateType.Style),this._onFireClickDateEvent(),this.Data.IsClickDate=!0),this.beginSelections.EqualsTo(this.Data.Selections)||this.Control.FireEvent(this.Control._specialClientEvents.SelectedDateChanged),this.mouseDown=!1,this.beginDate=null,this.endDate=null,this.beginSelections=null},t.prototype._onFireClickDateEvent=function(){this.Control.FireEvent(this.Control._specialClientEvents.ClickDate)},t.prototype.onMouseEnterMonth=function(t){var r,i;if(this.Data.SelectionMode==n.CalendarSelectionMode.MultiRich&&this.mouseDown){r=n.CalendarUtility.GetEventCurrentTarget(t);if(t.touches)if(t.touches.length>0){r=n.CalendarUtility.GetDomElementByPosition(this.Render,t.touches[0].clientX,t.touches[0].clientY,!0);if(r===null)return;n.Utility.PreventDefault(t)}i=n.DateTimeInfo.String2Date(r.getAttribute("CellValue"));if(this.endDate==i)return;this.endDate=i,this.Data.FocusDate=new Date(i.valueOf()),this.Data.UpdateMonthSelections(this.beginDate,this.endDate),this.Control.FireEvent(this.Control._specialClientEvents.SelectedDateChanged),this.Control.UpdateControl(n.CalendarUpdateType.SelectionType)}},t.prototype.onClickCommonMonth=function(t){var u,i,r;if(this.Data.SelectionMode==n.CalendarSelectionMode.MultiRich)return;u=n.CalendarUtility.GetEventCurrentTarget(t),i=n.DateTimeInfo.String2Date(u.getAttribute("CellValue")),this.Data._setFocusDateInternal(new Date(i.valueOf())),this.Data.SelectionMode==n.CalendarSelectionMode.One?(r=this.Data.GetFirstMonthSelectionDate(i),this.Data._setSelectedDateInternal(r)):this.Data.SelectionMode==n.CalendarSelectionMode.MultiSimple&&(this.Data.IsMonthSelected(i)?this.Data.RemoveSelectedMonth(i):this.Data.AddSelectedMonth(i),this.Control.FireEvent(this.Control._specialClientEvents.SelectedDateChanged)),this.Control.UpdateControl(n.CalendarUpdateType.Style),this._onFireClickDateEvent(),this.Data.IsClickDate=!0,this._doAutoPostBack()},t.prototype.onMouseDownDay=function(t){var i,r;this.ignoreHolidayStyleMenu=!0;if(this.Data.SelectionMode!=n.CalendarSelectionMode.MultiRich)return;this.mouseDown=!0,i=n.CalendarUtility.GetEventCurrentTarget(t),this.beginDate=n.DateTimeInfo.String2Date(i.getAttribute("CellValue")),t.shiftKey||(this.shiftBeginDate=new Date(this.beginDate.valueOf())),this.beginSelections=this.Data.Selections.Clone(),r=i.getAttribute("holidayType"),t.ctrlKey||this.Data.IsAllowSelection(r,this.beginDate)&&this.Data.Selections._clearInternal()},t.prototype.onMouseUpDay=function(t){var r,i,f,u,o,e;this.ignoreHolidayStyleMenu=!1;if(this.Data.SelectionMode!=n.CalendarSelectionMode.MultiRich||this.mouseDown==!1)return;if(this.beginTitleIndex!=null||this.beginWeekNumberIndex!=null){this.ClearMouseDragFlag();return}r=n.CalendarUtility.GetEventCurrentTarget(t);if(t.changedTouches)if(t.changedTouches.length>0){r=n.CalendarUtility.GetDomElementByPosition(this.Render,t.changedTouches[0].clientX,t.changedTouches[0].clientY);if(r===null)return;n.Utility.PreventDefault(t)}i=n.DateTimeInfo.String2Date(r.getAttribute("CellValue")),f=r.getAttribute("holidayType"),this.shiftBeginCalendarIndex=r.getAttribute("CalendarIndex"),this.shiftBeginTitleIndex=r.getAttribute("TitleIndex"),this.shiftBeginWeekNumberIndex=r.getAttribute("WeekNumberIndex"),t.shiftKey?(this.shiftBeginDate==undefined&&(this.shiftBeginDate=new Date(i.valueOf())),this.shiftEndDate=i,u=r.getAttribute("CellType"),this.Data.IsAllowSelection(f,i)&&u!="TrailingDay"&&(this.Data.FocusDate=i,this.Control.FireEvent(this.Control._specialClientEvents.FocusDateChanged)),this._onFireClickDateEvent(),this.Data.IsClickDate=!0,this.Data.UpdateDaySelections(this.shiftBeginDate,this.shiftEndDate,!0),this.Control.FireEvent(this.Control._specialClientEvents.SelectedDateChanged),this.Control.UpdateControl(n.CalendarUpdateType.Style),this._doAutoPostBack()):(n.DateTimeInfo.Equal(this.beginDate,i)?(u=r.getAttribute("CellType"),t.ctrlKey?(u=="TrailingDay"||u=="CommonDay")&&(u=="CommonDay"&&(this.Data.FocusDate=i,this.Control.FireEvent(this.Control._specialClientEvents.FocusDateChanged)),this._onFireClickDateEvent(),this.Data.IsClickDate=!0,this.Data.IsAllowSelection(f,i)&&(this.Data.IsDateSelected(i)?this.Data.RemoveSelectedDate(i,!0):this.Data.AddSelectedDate(i,!0))):u=="TrailingDay"?(o=this.Data.CalendarDimensions.Width*this.Data.CalendarDimensions.Height,o>1&&i>this.Data.FocusDate?(e=new Date(i.valueOf()),e.setMonth(i.getMonth()-o+1),this.Data.FocusDate=e,this.Control.UpdateControl(n.CalendarUpdateType.Data),this.Control.UpdateControl(n.CalendarUpdateType.Style),this.Data._setFocusDateInternal(i)):this.Data._setFocusDateInternal(i),this._onFireClickDateEvent(),this.Data.IsClickDate=!0,this.Data.IsAllowSelection(f,i)&&(this.Data.Selections._clearInternal(),this.Data.AddSelectedDate(i,!0))):u=="CommonDay"&&(this.Data._setFocusDateInternal(i),this._onFireClickDateEvent(),this.Data.IsClickDate=!0,this.Data.Selections._clearInternal(),this.Data.IsAllowSelection(f,i)&&this.Data.AddSelectedDate(i,!0)),this.Control.UpdateControl(n.CalendarUpdateType.Style),this.Data.Selections.EqualsTo(this.beginSelections)||this.Control.FireEvent(this.Control._specialClientEvents.SelectedDateChanged)):this.Data.Selections.EqualsTo(this.beginSelections)||this.Control.FireEvent(this.Control._specialClientEvents.SelectedDateChanged),this._doAutoPostBack()),this.ClearMouseDragFlag()},t.prototype.onMouseEnterDay=function(t){var r=n.CalendarUtility.GetEventCurrentTarget(t),u,f,i,s,h,e,o;if(t.touches)if(t.touches.length>0){r=n.CalendarUtility.GetDomElementByPosition(this.Render,t.touches[0].clientX,t.touches[0].clientY);if(r===null)return;n.Utility.PreventDefault(t)}u=!0,this.Data.SelectionMode==n.CalendarSelectionMode.MultiRich&&this.mouseDown||(u=!1),(this.beginTitleIndex!=null||this.beginWeekNumberIndex!=null)&&(u=!1),f=n.DateTimeInfo.String2Date(r.getAttribute("CellValue")),this.endDate==f&&(u=!1),i=r.getAttribute("holidayType");if(u)this.endDate=f,s=r.getAttribute("CellType"),this.Data.IsAllowSelection(i,f)&&s!="TrailingDay"&&s!="DisableDay"&&(this.Data.FocusDate=f,this.Control.FireEvent(this.Control._specialClientEvents.FocusDateChanged)),this.Data.UpdateDaySelections(this.beginDate,this.endDate,!1,t.ctrlKey),this.Control.UpdateControl(n.CalendarUpdateType.Style);else{if(this.Data.InnerControlEffect()===n.ControlEffect.Ipad)return;this.CloseOverrideHolidayTip(),this.CloseHolidayNameTip(),i==n.DayType.OverriddenHoliday&&this.Data.OverrideTipText!=""&&this.Data.TipInterval!==0&&(h=this.Render.CreateOverrideHolidayTip(t),h.SetColorScheme(this.Data.ToolTipControlEffect()),h.Show(),this.overrideTipShown=!0),e=r.getAttribute("holidayName"),(i==n.DayType.Holiday||i==n.DayType.ForceHoliday||i==n.DayType.ForceWorkday)&&e!=""&&this.Data.TipInterval!==0&&(o=this.Render.CreateHolidayNameTip(e,t),o.SetColorScheme(this.Data.ToolTipControlEffect()),o.Show(),this.holidayNameTipShown=!0)}},t.prototype.onClickTrailingDay=function(t){var r;if(this.Data.SelectionMode==n.CalendarSelectionMode.MultiRich)return;var f=n.CalendarUtility.GetEventCurrentTarget(t),i=n.DateTimeInfo.String2Date(f.getAttribute("CellValue")),e=f.getAttribute("holidayType"),u=this.Data.CalendarDimensions.Width*this.Data.CalendarDimensions.Height;u>1&&i>this.Data.FocusDate&&(r=new Date(i.valueOf()),r.setMonth(i.getMonth()-u+1),this.Data.FocusDate=r,this.Control.UpdateControl(n.CalendarUpdateType.Data),this.Control.UpdateControl(n.CalendarUpdateType.Style)),this._initScrollAnimation(n.AnimationType.Fade),this.Data._setFocusDateInternal(i)&&(this._animation.Setting.FadeType=n.FadeType.FadeInOut,this._showAnimationInternal(n.AnimationType.Fade,this.domElement,this.domElementOld)),this._onFireClickDateEvent(),this.Data.IsClickDate=!0,this.Data.SelectionMode==n.CalendarSelectionMode.One?this.Data._setSelectedDateInternal(i):this.Data.SelectionMode==n.CalendarSelectionMode.MultiSimple&&this.Data.IsAllowSelection(e,i)&&(this.Data.IsDateSelected(i)?this.Data.RemoveSelectedDate(i):this.Data.AddSelectedDate(i)),this._doAutoPostBack()},t.prototype.onClickCommonDay=function(t){if(this.Data.SelectionMode==n.CalendarSelectionMode.MultiRich)return;var r=n.CalendarUtility.GetEventCurrentTarget(t),i=n.DateTimeInfo.String2Date(r.getAttribute("CellValue"));this.Data._setFocusDateInternal(i),this._onFireClickDateEvent(),this.Data.IsClickDate=!0,this.Data.SelectionMode===n.CalendarSelectionMode.One?this.Data._setSelectedDateInternal(i):this.Data.SelectionMode===n.CalendarSelectionMode.MultiSimple&&(this.Data.IsDateSelected(i)?this.Data.RemoveSelectedDate(i):this.Data.AddSelectedDate(i)),n.Utility.PreventDefault(t),this._doAutoPostBack()},t.prototype.onMouseDownWeekNumber=function(t){if(this.Data.SelectionMode!=n.CalendarSelectionMode.MultiRich)return;t.ctrlKey||this.Data.Selections._clearInternal();var i=n.CalendarUtility.GetEventCurrentTarget(t);this.mouseDown=!0,this.beginCalendarIndex=i.getAttribute("CalendarIndex"),this.beginWeekNumberIndex=i.getAttribute("CellValue"),t.shiftKey||(this.shiftBeginCalendarIndex=this.beginCalendarIndex,this.shiftBeginWeekNumberIndex=this.beginWeekNumberIndex)},t.prototype.onMouseUpWeekNumber=function(t){var o,h,e,c,r,a,u,f,i,s,l;if(this.Data.SelectionMode!=n.CalendarSelectionMode.MultiRich)return;if(this.beginWeekNumberIndex==null||!this.Data.WeekNumberSelect){this.ClearMouseDragFlag();return}o=n.CalendarUtility.GetEventCurrentTarget(t);if(t.changedTouches)if(t.changedTouches.length>0){o=n.CalendarUtility.GetDomElementByPosition(this.Render,t.changedTouches[0].clientX,t.changedTouches[0].clientY);if(o===null){this.ClearMouseDragFlag();return}n.Utility.PreventDefault(t)}this.endCalendarIndex=o.getAttribute("CalendarIndex"),this.endWeekNumberIndex=o.getAttribute("CellValue"),this.shiftEndCalendarIndex=this.endCalendarIndex,this.shiftEndWeekNumberIndex=this.endWeekNumberIndex;if(t.shiftKey){this.shiftBeginCalendarIndex==undefined&&(this.shiftBeginCalendarIndex=this.shiftEndCalendarIndex),this.shiftBeginWeekNumberIndex==undefined&&(this.shiftBeginWeekNumberIndex=this.shiftEndWeekNumberIndex),h=n.CalendarUtility.GetWeekNumberSelectCell(this.Render,parseFloat(this.shiftEndCalendarIndex),parseFloat(this.shiftEndWeekNumberIndex));if(h.length==0)return;e=o.getAttribute("holidayType"),i=n.DateTimeInfo.String2Date(o.getAttribute("CellValue")),this.Data.IsAllowSelection(e,i)&&(f=n.CalendarUtility.GetFirstSelectCells(h),f!=-1&&(c=n.DateTimeInfo.String2Date(h[f].getAttribute("CellValue")),cthis.Data.MaxDate||(this.Data.FocusDate=c,this.Control.FireEvent(this.Control._specialClientEvents.FocusDateChanged)))),this.Data.UpdateWeekNumberSelections(parseInt(this.shiftBeginCalendarIndex.toString(),10),parseInt(this.shiftBeginWeekNumberIndex.toString(),10),parseInt(this.shiftEndCalendarIndex.toString(),10),parseInt(this.shiftEndWeekNumberIndex.toString(),10)),this.Control.FireEvent(this.Control._specialClientEvents.SelectedDateChanged),this.Control.UpdateControl(n.CalendarUpdateType.Style)}else{if(this.beginCalendarIndex==this.endCalendarIndex&&this.beginWeekNumberIndex==this.endWeekNumberIndex){r=n.CalendarUtility.GetWeekNumberSelectCell(this.Render,parseFloat(this.beginCalendarIndex),parseFloat(this.beginWeekNumberIndex));if(r.length==0)return;if(t.ctrlKey)for(a=this.Data.IsAllCellSelected(r),u=0;u1&&i>this.Data.FocusDate?(i.setMonth(i.getMonth()-l+1),this.Data._setFocusDateInternal(i)):this.Data._setFocusDateInternal(i)):s=="CommonDay"&&this.Data._setFocusDateInternal(i))}this.Control.UpdateControl(n.CalendarUpdateType.Style)}this.Control.FireEvent(this.Control._specialClientEvents.SelectedDateChanged)}this.ClearMouseDragFlag()},t.prototype.onMouseEnterWeekNumber=function(t){var i,e,o,s,u,h,f,r;if(this.Data.SelectionMode!=n.CalendarSelectionMode.MultiRich||!this.mouseDown)return;if(this.beginWeekNumberIndex==null)return;i=n.CalendarUtility.GetEventCurrentTarget(t);if(t.touches)if(t.touches.length>0){i=n.CalendarUtility.GetDomElementByPosition(this.Render,t.touches[0].clientX,t.touches[0].clientY);if(i===null)return;n.Utility.PreventDefault(t)}e=i.getAttribute("CalendarIndex"),o=i.getAttribute("CellValue");if(this.endCalendarIndex==e&&this.endWeekNumberIndex==o)return;this.endCalendarIndex=e,this.endWeekNumberIndex=o,s=n.CalendarUtility.GetWeekNumberSelectCell(this.Render,parseFloat(this.beginCalendarIndex),parseFloat(this.beginWeekNumberIndex)),u=n.CalendarUtility.GetWeekNumberSelectCell(this.Render,parseFloat(this.endCalendarIndex),parseFloat(this.endWeekNumberIndex));if(s.length==0||u.length==0)return;h=i.getAttribute("holidayType"),this.Data.IsAllowSelection(h)&&(f=n.CalendarUtility.GetFirstSelectCells(u),f!=-1&&(r=n.DateTimeInfo.String2Date(u[f].getAttribute("CellValue")),rthis.Data.MaxDate||(this.Data.FocusDate=r,this.Control.FireEvent(this.Control._specialClientEvents.FocusDateChanged)))),this.Data.UpdateWeekNumberSelections(parseInt(this.beginCalendarIndex.toString(),10),parseInt(this.beginWeekNumberIndex.toString(),10),parseInt(this.endCalendarIndex.toString(),10),parseInt(this.endWeekNumberIndex.toString(),10),t.ctrlKey),this.Control.UpdateControl(n.CalendarUpdateType.Style)},t.prototype.onClickWeekNumber=function(t){var s,l,o,u,f,i,e;if(this.Data.SelectionMode==n.CalendarSelectionMode.MultiRich)return;var c=n.CalendarUtility.GetEventCurrentTarget(t),a=c.getAttribute("CalendarIndex"),v=c.getAttribute("CellValue"),h=c.getAttribute("holidayType"),r=n.CalendarUtility.GetWeekNumberSelectCell(this.Render,a,v);if(r.length==0)return;if(this.Data.SelectionMode==n.CalendarSelectionMode.One)u=n.CalendarUtility.GetFirstSelectCells(r),u!=-1&&(f=r[u].getAttribute("CellType"),i=n.DateTimeInfo.String2Date(r[u].getAttribute("CellValue")),f=="TrailingDay"?(e=this.Data.CalendarDimensions.Width*this.Data.CalendarDimensions.Height,e>1&&i>this.Data.FocusDate?(s=new Date(i.valueOf()),s.setMonth(s.getMonth()-e+1),this.Data._setFocusDateInternal(s,!0),this.Data.FocusDate=i,this.Control.UpdateControl(n.CalendarUpdateType.Style)):(this._initScrollAnimation(n.AnimationType.Fade),this.Data._setFocusDateInternal(i)&&(this._animation.Setting.FadeType=n.FadeType.FadeInOut,this._showAnimationInternal(n.AnimationType.Fade,this.domElement,this.domElementOld))),this.Data._setSelectedDateInternal(i)):f=="CommonDay"&&(h=r[u].getAttribute("holidayType"),this.Data.IsAllowSelection(h,i)&&(this.Data._setFocusDateInternal(i),this.Data._setSelectedDateInternal(i))));else if(this.Data.SelectionMode==n.CalendarSelectionMode.MultiSimple){for(l=this.Data.IsAllCellSelected(r),o=0;o1&&i>this.Data.FocusDate?(i.setMonth(i.getMonth()-e+1),this.Data._setFocusDateInternal(i)):this.Data._setFocusDateInternal(i)):f=="CommonDay"&&this.Data._setFocusDateInternal(i)),this.Control.FireEvent(this.Control._specialClientEvents.SelectedDateChanged),this.Control.UpdateControl(n.CalendarUpdateType.Style)}},t.prototype.onMouseDownTitle=function(t){if(this.Data.SelectionMode!=n.CalendarSelectionMode.MultiRich)return;t.ctrlKey||this.Data.Selections._clearInternal(),this.mouseDown=!0;var i=n.CalendarUtility.GetEventCurrentTarget(t);this.beginCalendarIndex=i.getAttribute("CalendarIndex"),this.beginTitleIndex=i.getAttribute("CellValue"),t.shiftKey||(this.shiftBeginCalendarIndex=this.beginCalendarIndex,this.shiftBeginTitleIndex=this.beginTitleIndex)},t.prototype.onMouseUpTitle=function(t){var e,i,o,f,u,r;if(this.Data.SelectionMode!=n.CalendarSelectionMode.MultiRich)return;if(!this.Data.WeekTitleSelect||this.beginTitleIndex==null){this.ClearMouseDragFlag();return}e=n.CalendarUtility.GetEventCurrentTarget(t);if(t.changedTouches)if(t.changedTouches.length>0){e=n.CalendarUtility.GetDomElementByPosition(this.Render,t.changedTouches[0].clientX,t.changedTouches[0].clientY);if(e===null)return;n.Utility.PreventDefault(t)}this.endCalendarIndex=e.getAttribute("CalendarIndex"),this.endTitleIndex=e.getAttribute("CellValue"),this.shiftEndCalendarIndex=this.endCalendarIndex,this.shiftEndTitleIndex=this.endTitleIndex;if(t.shiftKey){this.shiftBeginCalendarIndex==undefined&&(this.shiftBeginCalendarIndex=this.shiftEndCalendarIndex),this.shiftBeginTitleIndex==undefined&&(this.shiftBeginTitleIndex=this.shiftEndTitleIndex),i=n.CalendarUtility.GetTitleSelectCell(this.Render,parseFloat(this.shiftEndCalendarIndex),this.shiftEndTitleIndex);if(i.length==0)return;this.Data.UpdateTitleSelections(parseInt(this.shiftBeginCalendarIndex.toString(),10),parseInt(this.shiftBeginTitleIndex.toString(),10),parseInt(this.shiftEndCalendarIndex.toString(),10),parseInt(this.shiftEndTitleIndex.toString(),10)),this.Control.FireEvent(this.Control._specialClientEvents.SelectedDateChanged),f=i[0].getAttribute("holidayType"),r=n.DateTimeInfo.String2Date(i[0].getAttribute("CellValue")),this.Data.IsAllowSelection(f,r)&&(this.Data.FocusDate=r,this.Control.FireEvent(this.Control._specialClientEvents.FocusDateChanged)),this.Control.UpdateControl(n.CalendarUpdateType.Style)}else{if(this.beginCalendarIndex==this.endCalendarIndex&&this.beginTitleIndex==this.endTitleIndex){i=n.CalendarUtility.GetTitleSelectCell(this.Render,parseFloat(this.endCalendarIndex),this.endTitleIndex);if(i.length==0)return;if(t.ctrlKey)for(o=this.Data.IsAllCellSelected(i),u=0;u0){i=n.CalendarUtility.GetDomElementByPosition(this.Render,t.touches[0].clientX,t.touches[0].clientY);if(i===null)return;n.Utility.PreventDefault(t)}f=i.getAttribute("CalendarIndex"),e=i.getAttribute("CellValue");if(this.endCalendarIndex==f&&this.endTitleIndex==e)return;this.endCalendarIndex=f,this.endTitleIndex=e,r=n.CalendarUtility.GetTitleSelectCell(this.Render,parseFloat(this.endCalendarIndex),this.endTitleIndex);if(r.length==0)return;o=r[0].getAttribute("holidayType"),u=n.DateTimeInfo.String2Date(r[0].getAttribute("CellValue")),this.Data.IsAllowSelection(o,u)&&(this.Data.FocusDate=u,this.Control.FireEvent(this.Control._specialClientEvents.FocusDateChanged)),this.Data.UpdateTitleSelections(parseInt(this.beginCalendarIndex.toString(),10),parseInt(this.beginTitleIndex.toString(),10),parseInt(this.endCalendarIndex.toString(),10),parseInt(this.endTitleIndex.toString(),10),t.ctrlKey),this.Control.UpdateControl(n.CalendarUpdateType.SelectionType)},t.prototype.onClickTitle=function(t){var s,u;if(this.Data.SelectionMode==n.CalendarSelectionMode.MultiRich)return;var e=n.CalendarUtility.GetEventCurrentTarget(t),h=e.getAttribute("CellValue"),c=e.getAttribute("CalendarIndex"),i=n.CalendarUtility.GetTitleSelectCell(this.Render,c,h);if(i.length==0)return;if(this.Data.SelectionMode==n.CalendarSelectionMode.One){var l=i[0].getAttribute("CellType"),o=i[0].getAttribute("CellValue"),f=i[0].getAttribute("holidayType"),r=n.DateTimeInfo.String2Date(o);this.Data.IsAllowSelection(f,r)&&(this.Data._setFocusDateInternal(r),this.Data._setSelectedDateInternal(r))}else if(this.Data.SelectionMode==n.CalendarSelectionMode.MultiSimple){for(s=this.Data.IsAllCellSelected(i),u=0;u1&&(document.body.appendChild(i),this.headerPopupMonthOffset=0,this.headerPopupMonthDelay=1500,this.headerPopupMonthShown=!0,n.Utility.IsPad()||(this.headerPopupMonthTimer=setTimeout(function(){e.UpdateHeaderPopupData()},this.headerPopupMonthDelay)))},t.prototype.onMouseUpHeaderText=function(t){var r,u;if(this.IsAnimationBusy()||n.Utility.IsPad())return;var f=n.CalendarUtility.GetEventCurrentTarget(t),e=f.getAttribute("HeaderIndex"),o=f.getAttribute("CellValue"),i=n.DateTimeInfo.String2Date(o);this.Data.CalendarType==n.CalendarType.MonthDay?(i=n.CalendarUtility.GetNextMonthDate(i,-1*parseFloat(e)),r=this.Data.FocusDate.getDate(),u=n.DateTimeInfo.DaysInMonth(i.getFullYear(),i.getMonth()+1),rthis.Data.MaxDate?this.Data.MaxDate:t,this.Render.UpdateHeaderPopupData(u,t,this.headerPopupMonthOffset)}clearTimeout(this.headerPopupMonthTimer),this.headerPopupMonthTimer=setTimeout(function(){r.UpdateHeaderPopupData()},this.headerPopupMonthDelay)},t.prototype.onMouseRightUp=function(t){var r,i;if(this.ignoreHolidayStyleMenu&&!n.Utility.IsTouchMouseDown)return;if(this.headerPopupMonthShown)return;r=this.Data.HolidayStyles,this.Data.ShowContextMenu&&r.length>0&&!this._popupHolidayStylesMenuShown&&(i=this.Render.CreatePopupHolidayStylesMenu(t),document.body.appendChild(i),this._popupHolidayStylesMenuShown=!0,n.Utility.CancelBubble(t),this._onHolidayStylesMenuOpen())},t.prototype._onHolidayStylesMenuOpen=function(){},t.prototype.onMouseUpHolidayStylesMenuCell=function(t){var u=this.Render.CalendarSectionDom.HolidayStylesMenuDom,f=n.CalendarUtility.GetEventCurrentTarget(t),i=f.getAttribute("index"),r=u.Cells[i].StateCell.innerHTML!="";this.Data.HolidayStyles[i].SetIsActive(!r),this.CloseHolidayStylesMenu(),this.Control.UpdateControl(n.CalendarUpdateType.Style)},t.prototype.onMouseEnterHolidayStylesMenuCell=function(t){var i=n.CalendarUtility.GetEventCurrentTarget(t);this.SetHolidayStylesMenuHoverState(i)},t.prototype.onMouseLeaveHolidayStylesMenuCell=function(t){var i=n.CalendarUtility.GetEventCurrentTarget(t);n.CalendarUtility.ResetHolidayStylesMenuHoverState(i)},t.prototype.SetHolidayStylesMenuHoverState=function(t){var i=this.Data.ControlEffect;i==n.ControlEffect.NotSet&&(i=this.Data.InnerControlEffect());switch(i){case n.ControlEffect.VistaTheme:t.style.borderRadius="3px",t.style.borderColor="rgb(174, 207, 247)",t.style.backgroundColor="rgb(235, 240, 246)";break;case n.ControlEffect.Chrome:case n.ControlEffect.Ipad:case n.ControlEffect.Windows8Theme:case n.ControlEffect.Edge:t.style.backgroundColor="rgb(209, 226, 242)",t.style.borderColor="rgb(168, 216, 235)";break;case n.ControlEffect.JQueryUI:t.className="ui-state-hover",t.style.backgroundRepeat="repeat",t.style.borderColor="gray";break;default:t.style.borderColor="gray",t.style.backgroundColor=n.Utility.HighlightColor;break}},t.prototype._onHolidayStylesMenuClosed=function(){},t.prototype.onClickToday=function(){var t=this.Data.Today();tthis.Data.MaxDate||(this._initScrollAnimation(n.AnimationType.Fade),this.Data._setFocusDateInternal(t)&&(this._animation.Setting.FadeType=n.FadeType.FadeInOut,this._showAnimationInternal(n.AnimationType.Fade,this.domElement,this.domElementOld)),this.Data.SelectionMode==n.CalendarSelectionMode.One?this.Data._setSelectedDateInternal(t):this.Data.AddSelectedDate(t))},t.prototype.onClickOutlookLeftNavigator=function(t){var r=this,i;this.IsAnimationBusy()||(i=this.Data.ScrollSteps(-1,t.ctrlKey),this._initScrollAnimation(n.AnimationType.ScrollToLeft),this.ScrollMonth(i)&&this._showAnimationInternal(n.AnimationType.ScrollToLeft,this.domElement,this.domElementOld));if(n.Utility.IsPad()||this.Data.CalendarDimensions.Width*this.Data.CalendarDimensions.Height>1)return;this._evt.ctrlKey=t.ctrlKey,clearTimeout(this.OutlookLeftNavigatorTimer),this.OutlookLeftNavigatorTimer=setTimeout(function(){r.onClickOutlookLeftNavigator(r._evt)},this.Data.EnableScrollAnimation?0:100)},t.prototype.onMouseDownOutlookLeftNavigator=function(n){this.outlookLeftNavigatorMouseDown=!0;this.onClickOutlookLeftNavigator(n)},t.prototype.onMouseUpOutlookLeftNavigator=function(n){this.outlookLeftNavigatorMouseDown=!1,clearTimeout(this.OutlookLeftNavigatorTimer)},t.prototype.onClickOutlookRightNavigator=function(t){var r=this,i;this.IsAnimationBusy()||(i=this.Data.ScrollSteps(1,t.ctrlKey),this._initScrollAnimation(n.AnimationType.ScrollToRight),this.ScrollMonth(i)&&this._showAnimationInternal(n.AnimationType.ScrollToRight,this.domElement,this.domElementOld));if(n.Utility.IsPad()||this.Data.CalendarDimensions.Width*this.Data.CalendarDimensions.Height>1)return;this._evt.ctrlKey=t.ctrlKey,clearTimeout(this.OutlookRightNavigatorTimer),this.OutlookRightNavigatorTimer=setTimeout(function(){r.onClickOutlookRightNavigator(r._evt)},this.Data.EnableScrollAnimation?0:100)},t.prototype.onMouseDownOutlookRightNavigator=function(n){this.outlookRightNavigatorMouseDown=!0;this.onClickOutlookRightNavigator(n)},t.prototype.onMouseUpOutlookRightNavigator=function(n){this.outlookRightNavigatorMouseDown=!1,clearTimeout(this.OutlookRightNavigatorTimer)},t.prototype.onClickLeftZoom=function(){this.Data.CalendarType==n.CalendarType.YearMonth&&this.Data.SetCalendarType("MonthDay")},t.prototype.onClickRightZoom=function(){this.Data.CalendarType==n.CalendarType.MonthDay&&this.Data.SetCalendarType("YearMonth")},t.prototype.onMouseLeaveOutlookCell=function(n){if(this.outlookLeftNavigatorMouseDown==!0)this.onMouseUpOutlookLeftNavigator(n);if(this.outlookRightNavigatorMouseDown==!0)this.onMouseUpOutlookRightNavigator(n)},t.prototype.onClickLeftNavigator=function(t){var r=this.Data.ScrollSteps(-1,t.ctrlKey),i=n.AnimationType.ScrollToTop;(this.Data.NavigatorOrientation===n.NavigatorOrientation.Bottom||this.Data.NavigatorOrientation===n.NavigatorOrientation.Top)&&(i=n.AnimationType.ScrollToLeft),this._initScrollAnimation(i),this.ScrollMonth(r)&&this._showAnimationInternal(i,this.domElement,this.domElementOld)},t.prototype.onMouseDownLeftNavigator=function(n){this.leftNavigatorMouseDown=!0;this.onMouseDownScrollBarCell(n);this.onClickLeftNavigator(n);this.Data.EnableScrollAnimation&&(this.CloseScrollbarToolTip(),this.ClearNavigatorTimer(n))},t.prototype.onMouseUpLeftNavigator=function(n){this.leftNavigatorMouseDown=!1;this.onMouseUpScrollBarCell(n);clearTimeout(this.LeftNavigatorTimer)},t.prototype.onClickRightNavigator=function(t){var r=this.Data.ScrollSteps(1,t.ctrlKey),i=n.AnimationType.ScrollToBottom;(this.Data.NavigatorOrientation===n.NavigatorOrientation.Bottom||this.Data.NavigatorOrientation===n.NavigatorOrientation.Top)&&(i=n.AnimationType.ScrollToRight),this._initScrollAnimation(i),this.ScrollMonth(r)&&this._showAnimationInternal(i,this.domElement,this.domElementOld)},t.prototype.onMouseDownRightNavigator=function(n){this.rightNavigatorMouseDown=!0;this.onMouseDownScrollBarCell(n);this.onClickRightNavigator(n);this.Data.EnableScrollAnimation&&(this.CloseScrollbarToolTip(),this.ClearNavigatorTimer(n))},t.prototype.onMouseUpRightNavigator=function(n){this.rightNavigatorMouseDown=!1;this.onMouseUpScrollBarCell(n);clearTimeout(this.RightNavigatorTimer)},t.prototype.onClickLeftBlank=function(){var i=this.Data.CalendarType==n.CalendarType.MonthDay?-1:-10,t=n.AnimationType.ScrollToTop;(this.Data.NavigatorOrientation===n.NavigatorOrientation.Bottom||this.Data.NavigatorOrientation===n.NavigatorOrientation.Top)&&(t=n.AnimationType.ScrollToLeft),this._initScrollAnimation(t),this.ScrollYear(i)&&this._showAnimationInternal(t,this.domElement,this.domElementOld)},t.prototype.onClickRightBlank=function(){var i=this.Data.CalendarType==n.CalendarType.MonthDay?1:10,t=n.AnimationType.ScrollToBottom;(this.Data.NavigatorOrientation===n.NavigatorOrientation.Bottom||this.Data.NavigatorOrientation===n.NavigatorOrientation.Top)&&(t=n.AnimationType.ScrollToRight),this._initScrollAnimation(t),this.ScrollYear(i)&&this._showAnimationInternal(t,this.domElement,this.domElementOld)},t.prototype.onMouseDownLeftBlankNavigator=function(n){this.leftMostNavigatorMouseDown=!0;this.onMouseDownScrollBarCell(n);this.onClickLeftBlank()},t.prototype.onMouseDownRightBlankNavigator=function(n){this.rightMostNavigatorMouseDown=!0;this.onMouseDownScrollBarCell(n);this.onClickRightBlank()},t.prototype.onClickLeftMost=function(){this.onClickLeftBlank()},t.prototype.onMouseDownLeftMostNavigator=function(n){this.leftMostNavigatorMouseDown=!0;this.onMouseDownScrollBarCell(n);this.onClickLeftMost(),this.Data.EnableScrollAnimation&&(this.CloseScrollbarToolTip(),this.ClearNavigatorTimer(n))},t.prototype.onMouseUpLeftMostNavigator=function(n){this.leftMostNavigatorMouseDown=!1;this.onMouseUpScrollBarCell(n);clearTimeout(this.LeftMostNavigatorTimer)},t.prototype.onClickRightMost=function(){this.onClickRightBlank()},t.prototype.onMouseDownRightMostNavigator=function(n){this.rightMostNavigatorMouseDown=!0;this.onMouseDownScrollBarCell(n);this.onClickRightMost(),this.Data.EnableScrollAnimation&&(this.CloseScrollbarToolTip(),this.ClearNavigatorTimer(n))},t.prototype.onMouseUpRightMostNavigator=function(n){this.rightMostNavigatorMouseDown=!1;this.onMouseUpScrollBarCell(n);clearTimeout(this.RightMostNavigatorTimer)},t.prototype.onMouseEnterScrollBarCell=function(t){var r=n.CalendarUtility.GetEventCurrentTarget(t),o,f,u,e,i;n.Utility.IsPad()||this.IsAnimationBusy()||(o=r.getAttribute("CellType"),f=this.Data.GetScrollbarTooltipText(o),f!=""&&(u=this.Render.CreateScrollBarTooltip(t),u.SetColorScheme(this.Data.ToolTipControlEffect()),u.Show(),this.tooltipShown=!0)),e=this.Data.InnerControlEffect(),e===n.ControlEffect.Chrome&&(i=r.getAttribute("ImagePath"),r.childNodes.length>0&&i!==null&&(i=this.Data.GetImageHoverPath(i),r.childNodes[0].setAttribute("src",i),n.Utility.CreateImageCache(i)))},t.prototype.onMouseLeaveScrollBarCell=function(t){var r,u,i;this.CloseScrollbarToolTip(),this.ClearNavigatorTimer(t),r=n.CalendarUtility.GetEventCurrentTarget(t),u=this.Data.InnerControlEffect(),u===n.ControlEffect.Chrome&&(i=r.getAttribute("ImagePath"),r.childNodes.length>0&&i!==null&&(i=this.Data.GetImagePath(i),r.childNodes[0].setAttribute("src",i),n.Utility.CreateImageCache(i)))},t.prototype.onMouseDownScrollBarCell=function(t){var r=n.CalendarUtility.GetEventCurrentTarget(t),i=r.getAttribute("ImagePath");r.childNodes.length>0&&i!==null&&(i=this.Data.GetImagePressPath(i),r.childNodes[0].setAttribute("src",i),n.Utility.CreateImageCache(i,"img"))},t.prototype.onMouseUpScrollBarCell=function(t){var r=n.CalendarUtility.GetEventCurrentTarget(t),i=r.getAttribute("ImagePath");r.childNodes.length>0&&i!==null&&(i=this.Data.GetImagePath(i),r.childNodes[0].setAttribute("src",i),n.Utility.CreateImageCache(i,"img"))},t.prototype.onMouseEnterThumb=function(t){this.Data.InnerControlEffect()===n.ControlEffect.Chrome&&n.CalendarUtility.UpdateScrollbarThumbImage(this.Data,this.Render,!1,!0)},t.prototype.onMouseDownThumb=function(t){this.thumbMouseDown=!0,this._mouseDownThumb_StartDate=new Date(this.Data.StartDate().valueOf()),this._mouseDownThumb_FocusDate=new Date(this.Data.FocusDate.valueOf()),this._beginThumbX=n.CalendarUtility.GetEventClientX(t),this._beginThumbY=n.CalendarUtility.GetEventClientY(t),t.touches&&n.Utility.PreventDefault(t);if(this.Data.ShowScrollTip){var i=this.Render.CreateThumbScrollingToolTip(t);i.SetColorScheme(this.Data.ToolTipControlEffect()),i.Show()}this.Data.InnerControlEffect()!=n.ControlEffect.Normal&&n.CalendarUtility.UpdateScrollbarThumbImage(this.Data,this.Render,!0)},t.prototype.onMouseUpThumb=function(t){var r,i,u;n.Utility.IsPad()||this.CloseHeaderPopup();if(this.thumbMouseDown!=!0)return;this._endThumbX=n.CalendarUtility.GetEventClientX(t),this._endThumbY=n.CalendarUtility.GetEventClientY(t),t.touches&&n.Utility.PreventDefault(t),r=!n.DateTimeInfo.Equal(this._mouseDownThumb_StartDate,this.Data.StartDate()),i=!n.DateTimeInfo.Equal(this._mouseDownThumb_FocusDate,this.Data.FocusDate),this.Data.ShowScrollTip&&(u=this.Render.CreateThumbScrollingToolTipFrame(),u.Close()),this.thumbMouseDown=!1,this._mouseDownThumb_StartDate=null,this._mouseDownThumb_FocusDate=null,this._beginThumbX=-1,this._beginThumbY=-1,this._endThumbX=-1,this._endThumbY=-1,r?(this._initScrollAnimation(n.AnimationType.Fade),this.Control.UpdateControl(n.CalendarUpdateType.Data),this.Control.UpdateControl(n.CalendarUpdateType.Style),this._animation.Setting.FadeType=n.FadeType.FadeInOut,this._showAnimationInternal(n.AnimationType.Fade,this.domElement,this.domElementOld)):i&&this.Control.UpdateControl(n.CalendarUpdateType.Style),this.Data.InnerControlEffect()!=n.ControlEffect.Normal&&n.CalendarUtility.UpdateScrollbarThumbImage(this.Data,this.Render,!1),r&&this.Control.FireEvent(this.Control._specialClientEvents.Scrolled),i&&this.Control.FireEvent(this.Control._specialClientEvents.FocusDateChanged)},t.prototype.onMouseMoveThumb=function(t){if(this.thumbMouseDown!=!0)return;this._endThumbX=n.CalendarUtility.GetEventClientX(t),this._endThumbY=n.CalendarUtility.GetEventClientY(t),t.touches&&(this._mouseUpThumbEvt=t,n.Utility.PreventDefault(t)),this.Data.UpdateStartDateByScrollBar(this._mouseDownThumb_StartDate,this._beginThumbX,this._beginThumbY,this._endThumbX,this._endThumbY)&&(this.Render.UpdateThumbScrollingToolTipData(),n.CalendarUtility.UpdateScrollBarThumb(this.Data,this.Render))},t.prototype.onMouseLeaveThumb=function(t){this.Data.InnerControlEffect()===n.ControlEffect.Chrome&&n.CalendarUtility.UpdateScrollbarThumbImage(this.Data,this.Render,!1)},t.prototype.ScrollYear=function(t){var f=this.Data.StartDate(),i=n.CalendarUtility.GetNextYearDate(f,t),u=this.Data._setStartDateInternal(i),r=this.Data._syncFocusDateInternal();return ithis.Data.MaxDate&&(this.Data.FocusDate=this.Data.MaxDate),u?(this.Control.UpdateControl(n.CalendarUpdateType.Data),this.Control.UpdateControl(n.CalendarUpdateType.Style),this.Control.FireEvent(this.Control._specialClientEvents.Scrolled)):r&&this.Control.UpdateControl(n.CalendarUpdateType.Style),r&&this.Control.FireEvent(this.Control._specialClientEvents.FocusDateChanged),u},t.prototype.ScrollMonth=function(t){if(this.Data.CalendarType===n.CalendarType.YearMonth){var o=this.Data.FocusDate,f=n.CalendarUtility.GetNextMonthDate(o,t),i=this.Data._setFocusDateInternal(f);return this.Data.CalendarDimensions.Width*this.Data.CalendarDimensions.Height>1&&(this.Data._setStartDateInternal(f),this.Control.UpdateControl(n.CalendarUpdateType.Data),this.Control.UpdateControl(n.CalendarUpdateType.Style),i=!0),i}var e=this.Data.StartDate(),r=n.CalendarUtility.GetNextMonthDate(e,t),i=this.Data._setStartDateInternal(r),u=this.Data._syncFocusDateInternal();return rthis.Data.MaxDate&&(this.Data.FocusDate=this.Data.MaxDate),i?(this.Control.UpdateControl(n.CalendarUpdateType.Data),this.Control.UpdateControl(n.CalendarUpdateType.Style)):u&&this.Control.UpdateControl(n.CalendarUpdateType.Style),i&&this.Control.FireEvent(this.Control._specialClientEvents.Scrolled),u&&this.Control.FireEvent(this.Control._specialClientEvents.FocusDateChanged),i},t.prototype.CloseAllPopup=function(){this.CloseScrollbarToolTip(),this.CloseOverrideHolidayTip(),this.CloseHeaderPopup(),this.CloseHolidayNameTip(),this.CloseHolidayStylesMenu()},t.prototype.CloseHolidayNameTip=function(){if(this.holidayNameTipShown===!0){var n=this.Render.CreateHolidayNameTipFrame();n.Close(),this.holidayNameTipShown=!1}},t.prototype.CloseOverrideHolidayTip=function(){if(this.overrideTipShown===!0){var n=this.Render.CreateOverrideHolidayTipFrame();n.Close(),this.overrideTipShown=!1}},t.prototype.CloseScrollbarToolTip=function(){if(this.tooltipShown===!0){var n=this.Render.CreateScrollBarTooltipFrame();n.Close(),this.tooltipShown=!1}},t.prototype.CloseHeaderPopup=function(){if(this.headerPopupMonthShown){var n=this.Render.CreateHeaderPopupFrame();document.body.removeChild(n),this.headerPopupMonthShown=!1,this.headerPopupMonthOffset=0,this.headerPopupMonthDelay=1500,clearTimeout(this.headerPopupMonthTimer)}},t.prototype.CloseHolidayStylesMenu=function(){var i,r,t;if(this._popupHolidayStylesMenuShown){for(i=this.Render.CalendarSectionDom.HolidayStylesMenuDom,r=i.HolidayStylesMenuContainer,t=0;t0&&l!=u){for(h=this.CreateItem(l,e),o=0;o0&&a.indexOf(u)!=-1&&(s.push(new n.HeaderItem("Literal",f)),f="");if(a.indexOf(u)==-1)f+=u;else switch(u){case"y":case"M":case"g":case"e":e==0&&(l=u),e++;break;case"\\":v=!0;break;default:f+=u;break}}if(e>0)for(h=this.CreateItem(l,e),o=0;o0&&s.push(new n.HeaderItem("Literal",f));return s},t.prototype.CreateItem=function(t,i){var f=[],r,u;switch(t){case"y":for(u=0;u0&&f.push(new n.HeaderItem("Year","y",r));break;case"M":for(u=0;u0&&f.push(new n.HeaderItem("Month","M",r));break;case"g":for(u=0;u0&&f.push(new n.HeaderItem("Era","g",r));break;case"e":for(u=0;u0&&f.push(new n.HeaderItem("EraYear","e",r));break;default:}return f},t.prototype.GetText=function(t,i,r,u){var c=this.ParseString(i,r,u),e="",v,y,a=!1,f,s,l,o,h;if(c.length>0)for(s=0;s2?f.Length==3?n.DateTimeInfo.ShortMonthNames[h-1]:n.DateTimeInfo.MonthNames[h-1]:n.Utility.ToString(h,f.Length,"0");break;case"Year":e+=f.Length>2?f.Length==3?t.getFullYear():n.Utility.ToString(t.getFullYear(),4,"0"):n.Utility.ToString(t.getFullYear()%100,f.Length,"0");break;default:e+=f.Text;break}}return a?r==n.CalendarType.YearMonth?this.GetText(t,"yyy\u5e74",r,u):this.GetText(t,"yyy\u5e74 MMMM",r,u):e},t}();n.HeaderFormat=t})(GCIM||(GCIM={}));var GCIM;(function(n){var t=function(){function n(n,t,i){this.Type=n,this.Text=t,this.Length=i}return n}();n.HeaderItem=t})(GCIM||(GCIM={}));var __extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},GCIM;(function(n){var l=function(n){function t(t){n.call(this),this.Owner=null,t&&(this.Owner=t)}return __extends(t,n),t.prototype.OnItemAdded=function(n,t){var i=this.Owner;i!==null&&(i.HolidayStyleCollectionChanged(),n.SetOwner(i))},t.prototype.OnItemRemoved=function(n,t){var i=this.Owner;i!==null&&i.HolidayStyleCollectionChanged()},t}(n.CollectionBase),s,u,r,t,h,c,f,i,o,e;n.HolidayStyleCollection=l,s=function(){function t(t,i,r,f){this._isActive=!1,this._name="",this._subStyle=new n.SubStyle,this._holidays=new u,this.Owner=null,t!=undefined&&(this._name=t),this._id=this.GenerateUniqueID();switch(arguments.length){case 2:this._isActive=arguments[1];break;case 3:this.SetBackColor(arguments[1]),this.SetForeColor(arguments[2]);break;case 4:this._isActive=arguments[1],this.SetBackColor(arguments[2]),this.SetForeColor(arguments[3]);break;default:}}return t.prototype.GenerateUniqueID=function(){return t.TotalCount===undefined&&(t.TotalCount=-1),t.TotalCount++,"GcCanlendar_HolidayStyle"+t.TotalCount},t.prototype.SetOwner=function(n){this.Owner=n,this._subStyle.SetOwner(n),this._holidays.SetOwner(n)},t.prototype.GetID=function(){return this._id},t.prototype.GetName=function(){return this._name},t.prototype.SetName=function(n){this._name=n},t.prototype.GetHolidays=function(){return this._holidays},t.prototype.GetHolidaysCount=function(){return this.GetHolidays().GetCount()},t.prototype.GetHoliday=function(n){return this.GetHolidays().GetItem(n)},t.prototype.AddHoliday=function(n){this.GetHolidays().Add(n)},t.prototype.ClearHolidays=function(){this.GetHolidays().Clear()},t.prototype.GetHolidayIndex=function(n){return this.GetHolidays().IndexOf(n)},t.prototype.InsertHoliday=function(n,t){this.GetHolidays().Insert(n,t)},t.prototype.RemoveHoliday=function(n){this.GetHolidays().Remove(n)},t.prototype.RemoveHolidayAt=function(n){this.GetHolidays().RemoveAt(n)},t.prototype.SetBackColor=function(n){this._subStyle.SetBackColor(n)},t.prototype.GetBackColor=function(){return this._subStyle.GetBackColor()},t.prototype.SetForeColor=function(n){this._subStyle.SetForeColor(n)},t.prototype.GetForeColor=function(){return this._subStyle.GetForeColor()},t.prototype.SetImageUrl=function(n){this._subStyle.SetImageUrl(n)},t.prototype.GetImageUrl=function(){return this._subStyle.GetImageUrl()},t.prototype.SetImageAsBackground=function(n){this._subStyle.SetImageAsBackground(n)},t.prototype.GetImageAsBackground=function(){return this._subStyle.GetImageAsBackground()},t.prototype.SetBold=function(n){this._subStyle.SetBold(n)},t.prototype.GetBold=function(){return this._subStyle.GetBold()},t.prototype.SetUnderLine=function(n){this._subStyle.SetUnderLine(n)},t.prototype.GetUnderLine=function(){return this._subStyle.GetUnderLine()},t.prototype.GetIsActive=function(){return this._isActive},t.prototype.SetIsActive=function(t){t=n.Utility.CheckBool(t),this._isActive=t,this.Owner&&this.Owner.HolidayStylePropertyChanged(this,"IsActive")},t.prototype.SetOverride=function(t,i){t=n.Utility.CheckString(t);var r=this.GetHolidays().GetWeekdays();if(this.GetOverride(t)!==i){switch(t.toLowerCase()){case"sunday":r.GetSunday().SetOverride(i);break;case"monday":r.GetMonday().SetOverride(i);break;case"tuesday":r.GetTuesday().SetOverride(i);break;case"wednesday":r.GetWednesday().SetOverride(i);break;case"thursday":r.GetThursday().SetOverride(i);break;case"friday":r.GetFriday().SetOverride(i);break;case"saturday":r.GetSaturday().SetOverride(i);break;default:console.assert(!1,"invalid weekday")}this._isActive&&this.Owner&&this.Owner.HolidayStylePropertyChanged(this,"Override")}},t.prototype.GetOverride=function(t){t=n.Utility.CheckString(t);var i=this.GetHolidays().GetWeekdays();switch(t.toLowerCase()){case"sunday":return i.GetSunday().GetOverride();case"monday":return i.GetMonday().GetOverride();case"tuesday":return i.GetTuesday().GetOverride();case"wednesday":return i.GetWednesday().GetOverride();case"thursday":return i.GetThursday().GetOverride();case"friday":return i.GetFriday().GetOverride();case"saturday":return i.GetSaturday().GetOverride();default:console.assert(!1,"invalid weekday")}},t.prototype.SetWeekFlags=function(t,i){t=n.Utility.CheckString(t);var r=this.GetHolidays().GetWeekdays();if(this.GetWeekFlags(t)!==i){switch(t.toLowerCase()){case"sunday":r.GetSunday().SetWeekFlags(i);break;case"monday":r.GetMonday().SetWeekFlags(i);break;case"tuesday":r.GetTuesday().SetWeekFlags(i);break;case"wednesday":r.GetWednesday().SetWeekFlags(i);break;case"thursday":r.GetThursday().SetWeekFlags(i);break;case"friday":r.GetFriday().SetWeekFlags(i);break;case"saturday":r.GetSaturday().SetWeekFlags(i);break;default:console.assert(!1,"invalid weekday")}this._isActive&&this.Owner&&this.Owner.HolidayStylePropertyChanged(this,"WeekFlags")}},t.prototype.GetWeekFlags=function(t){t=n.Utility.CheckString(t);var i=this.GetHolidays().GetWeekdays();switch(t.toLowerCase()){case"sunday":return i.GetSunday().GetWeekFlags();case"monday":return i.GetMonday().GetWeekFlags();case"tuesday":return i.GetTuesday().GetWeekFlags();case"wednesday":return i.GetWednesday().GetWeekFlags();case"thursday":return i.GetThursday().GetWeekFlags();case"friday":return i.GetFriday().GetWeekFlags();case"saturday":return i.GetSaturday().GetWeekFlags();default:console.assert(!1,"invalid weekday")}},t.prototype.IsHoliday=function(n){return this.GetHolidays().IsHoliday(n)},t}(),n.HolidayStyle=s,u=function(t){function i(n){t.call(this),this.Owner=null,n&&(this.Owner=n),this._weekDays=new r}return __extends(i,t),i.prototype.GetWeekdays=function(){return this._weekDays},i.prototype.SetOwner=function(n){this.Owner=n;for(var t=0;t=0;t--){r=this[t].IsHoliday(n);if(r)return!0}if(this.GetWeekdays()!=null){i=this.GetWeekdays().GetWeekday(n.getDay());if(i.IsHoliday(n))return!0}return this.IsOverridden(n)?!0:!1},i.prototype.GetTypeOfDay=function(t){for(var r,u,i=this.length-1;i>=0;i--){r=this[i].TypeofDay(t);if(r!=n.DayType.Normal)return r}if(this.GetWeekdays()!=null){u=this.GetWeekdays().GetWeekday(t.getDay());if(u.IsHoliday(t))return"dayOfWeekHoliday"}return this.IsOverridden(t)?n.DayType.OverriddenHoliday:n.DayType.Normal},i.prototype.IsOverridden=function(t){var i=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1),f=this.GetWeekdays().GetWeekday(i.getDay()),s,r,o,e,u;if(f._override==n.HolidayOverride.NextDay&&f.IsHoliday(i))for(r=0;r=0;e--){u=this[e].TypeofDay(i);if(u==n.DayType.Holiday||u==n.DayType.ForceHoliday){o=!0;break}}f=this.GetWeekdays().GetWeekday(i.getDay());if(o)if(f._override==n.HolidayOverride.NextWorkDay&&f.IsHoliday(i))return!0;else continue;else if(f.IsHoliday(i))continue;else return!1}},i.prototype.OnItemPropertyChanged=function(){this.Owner&&this.Owner.HolidayPropertyChanged()},i.prototype.OnItemNameChanged=function(){this.Owner&&this.Owner.HolidayNameChanged()},i}(n.CollectionBase),n.HolidayCollection=u,r=function(){function n(){this._monday=new t,this._tuesday=new t,this._wednesday=new t,this._thursday=new t,this._friday=new t,this._saturday=new t,this._sunday=new t}return n.prototype.GetMonday=function(){return this._monday},n.prototype.GetTuesday=function(){return this._tuesday},n.prototype.GetWednesday=function(){return this._wednesday},n.prototype.GetThursday=function(){return this._thursday},n.prototype.GetFriday=function(){return this._friday},n.prototype.GetSaturday=function(){return this._saturday},n.prototype.GetSunday=function(){return this._sunday},n.prototype.GetWeekday=function(n){switch(n){case 0:return this._sunday;break;case 1:return this._monday;break;case 2:return this._tuesday;break;case 3:return this._wednesday;break;case 4:return this._thursday;break;case 5:return this._friday;break;case 6:return this._saturday;break}},n}(),n.WeekDays=r,t=function(){function t(){this._override=n.HolidayOverride.None,this._weekflags=n.WeekFlags.NotSet}return t.prototype.GetOverride=function(){return n.Utility.EnumParser(this._override,n.HolidayOverride)},t.prototype.SetOverride=function(t){this._override=n.Utility.EnumParser(t,n.HolidayOverride)},t.prototype.GetWeekFlags=function(){var t=n.Utility.EnumParser(this._weekflags,n.WeekFlags,!0);return t=="notset"?"":t},t.prototype.SetWeekFlags=function(t){t=t==""?"notset":t,this._weekflags=n.Utility.EnumParser(t,n.WeekFlags)},t.prototype.IsHoliday=function(t){var i=n.DateTimeInfo.GetWeekIndexByDate(t);return n.CalendarUtility.IsDayOfWeekSelected(i,this._weekflags)},t.prototype.GetIsEmpty=function(){return this._weekflags==n.WeekFlags.NotSet&&this._override==n.HolidayOverride.None},t}(),n.DayOfWeekHolidayPolicy=t,h=function(){function t(t,i,r,u,f){var c="",h=1,s=1,o=1,e=1;arguments.length===2&&(h=o=arguments[0],s=e=arguments[1]),arguments.length===3&&(c=arguments[0],h=o=arguments[1],s=e=arguments[2]),arguments.length===4&&(h=arguments[0],s=arguments[1],o=arguments[2],e=arguments[3]),arguments.length<5||(c=arguments[0],h=arguments[1],s=arguments[2],o=arguments[3],e=arguments[4]),this._name=n.Utility.CheckString(c),this._startMonth=n.Utility.CheckInt(h,1,12)-1,this._startDay=n.Utility.CheckInt(s,1,31),this._endMonth=n.Utility.CheckInt(o,1,12)-1,this._endDay=n.Utility.CheckInt(e,1,31),this.Owner=null}return t.prototype.GetIsYearly=function(){return!0},t.prototype.SetName=function(t){t=n.Utility.CheckString(t),this._name!==t&&(this._name=t,this.Owner&&this.Owner.OnItemNameChanged())},t.prototype.GetName=function(){return this._name},t.prototype.SetStartMonth=function(t){t=n.Utility.CheckInt(t,1,12),this._startMonth!==t-1&&(this._startMonth=t-1,this.Owner&&this.Owner.OnItemPropertyChanged())},t.prototype.GetStartMonth=function(){return this._startMonth+1},t.prototype.SetStartDay=function(t){t=n.Utility.CheckInt(t,1,31),this._startDay!==t&&(this._startDay=t,this.Owner&&this.Owner.OnItemPropertyChanged())},t.prototype.GetStartDay=function(){return this._startDay},t.prototype.SetEndMonth=function(t){t=n.Utility.CheckInt(t,1,12),this._endMonth!==t-1&&(this._endMonth=t-1,this.Owner&&this.Owner.OnItemPropertyChanged())},t.prototype.GetEndMonth=function(){return this._endMonth+1},t.prototype.SetEndDay=function(t){t=n.Utility.CheckInt(t,1,31),this._endDay!==t&&(this._endDay=t,this.Owner&&this.Owner.OnItemPropertyChanged())},t.prototype.GetEndDay=function(){return this._endDay},t.prototype.IsHoliday=function(t){var r=new Date(t.getFullYear(),this.GetStartMonth()-1,this.GetStartDay()),i=new Date(t.getFullYear(),this.GetEndMonth()-1,this.GetEndDay()),u;return r>i&&(u=r,r=i,i=u),n.DateTimeInfo.IsLeapYear(t.getFullYear())||this._endMonth==1&&this._endDay==29&&(i=new Date(t.getFullYear(),1,28)),t>=r&&t<=i},t.prototype.TypeofDay=function(t){return this.IsHoliday(t)?n.DayType.Holiday:n.DayType.Normal},t}(),n.Holiday=h,c=function(){function t(t,i,r){var e="",f=n.Utility.GetCurrentDate(),u=n.Utility.GetCurrentDate();this.Owner=null,arguments.length===1&&(f=u=arguments[0]),arguments.length===2&&(typeof arguments[0]=="string"||arguments[0]instanceof String?(e=arguments[0],f=u=arguments[1]):(f=arguments[0],u=arguments[1])),arguments.length<3||(e=arguments[0],f=arguments[1],u=arguments[2]),this._name=n.Utility.CheckString(e),(typeof f=="string"||f instanceof String)&&(f=n.DateTimeInfo.String2Date(f.toString())),n.Utility.CheckDate(f),this._start=f,(typeof u=="string"||u instanceof String)&&(u=n.DateTimeInfo.String2Date(u.toString())),n.Utility.CheckDate(u),this._end=u}return t.prototype.GetIsYearly=function(){return!1},t.prototype.SetName=function(t){t=n.Utility.CheckString(t),this._name!==t&&(this._name=t,this.Owner&&this.Owner.OnItemNameChanged())},t.prototype.GetName=function(){return this._name},t.prototype.SetStart=function(t){(typeof t=="string"||t instanceof String)&&(t=n.DateTimeInfo.String2Date(t)),n.Utility.CheckDate(t),n.DateTimeInfo.Equal(this._start,t)||(this._start=t,this.Owner&&this.Owner.OnItemPropertyChanged())},t.prototype.GetStart=function(){return this._start},t.prototype.SetEnd=function(t){(typeof t=="string"||t instanceof String)&&(t=n.DateTimeInfo.String2Date(t)),n.Utility.CheckDate(t),n.DateTimeInfo.Equal(this._end,t)||(this._end=t,this.Owner&&this.Owner.OnItemPropertyChanged())},t.prototype.GetEnd=function(){return this._end},t.prototype.IsHoliday=function(n){var i=this.GetStart(),t=this.GetEnd(),r;return i>t&&(r=i,i=t,t=r),n>=i&&n<=t},t.prototype.TypeofDay=function(t){return this.IsHoliday(t)?n.DayType.ForceHoliday:n.DayType.Normal},t}(),n.ForceHoliday=c,f=function(){function t(t,i,r){var e="",f=n.Utility.GetCurrentDate(),u=n.Utility.GetCurrentDate();this.Owner=null,arguments.length===1&&(f=u=arguments[0]),arguments.length===2&&(typeof arguments[0]=="string"||arguments[0]instanceof String?(e=arguments[0],f=u=arguments[1]):(f=arguments[0],u=arguments[1])),arguments.length<3||(e=arguments[0],f=arguments[1],u=arguments[2]),this._name=n.Utility.CheckString(e),(typeof f=="string"||f instanceof String)&&(f=n.DateTimeInfo.String2Date(f.toString())),n.Utility.CheckDate(f),this._start=f,(typeof u=="string"||u instanceof String)&&(u=n.DateTimeInfo.String2Date(u.toString())),n.Utility.CheckDate(u),this._end=u}return t.prototype.GetIsYearly=function(){return!1},t.prototype.SetName=function(t){t=n.Utility.CheckString(t),this._name!==t&&(this._name=t,this.Owner&&this.Owner.OnItemNameChanged())},t.prototype.GetName=function(){return this._name},t.prototype.SetStart=function(t){(typeof t=="string"||t instanceof String)&&(t=n.DateTimeInfo.String2Date(t)),n.Utility.CheckDate(t),n.DateTimeInfo.Equal(this._start,t)||(this._start=t,this.Owner&&this.Owner.OnItemPropertyChanged())},t.prototype.GetStart=function(){return this._start},t.prototype.SetEnd=function(t){(typeof t=="string"||t instanceof String)&&(t=n.DateTimeInfo.String2Date(t)),n.Utility.CheckDate(t),n.DateTimeInfo.Equal(this._end,t)||(this._end=t,this.Owner&&this.Owner.OnItemPropertyChanged())},t.prototype.GetEnd=function(){return this._end},t.prototype.IsHoliday=function(n){var i=this.GetStart(),t=this.GetEnd(),r;return i>t&&(r=i,i=t,t=r),n>=i&&n<=t},t.prototype.TypeofDay=function(t){return this.IsHoliday(t)?n.DayType.ForceWorkday:n.DayType.Normal},t}(),n.ForceWorkday=f,i=function(){function t(t,i,r,u){var s="",o=n.MonthFlags.NotSet,f=n.WeekFlags.NotSet,e=n.DayOfWeek.NotSet;this.Owner=null,arguments.length===3&&(o=arguments[0],f=arguments[1],e=arguments[2]),arguments.length<4||(s=arguments[0],o=arguments[1],f=arguments[2],e=arguments[3]),this._name=s,this._setMonthInternal(o),this._setDayOfWeekInMonthInternal(f),this._setDayOfWeekInternal(e)}return t.prototype.SetName=function(t){t=n.Utility.CheckString(t),this._name!==t&&(this._name=t,this.Owner&&this.Owner.OnItemNameChanged())},t.prototype.GetName=function(){return this._name},t.prototype._setMonthInternal=function(t){n.Utility.IsPositiveInteger(t)?this._month=t:(t=t==""?"notset":t,this._month=n.Utility.EnumParser(t,n.MonthFlags))},t.prototype.SetMonth=function(n){n=n==""?"notset":n,this.GetMonth()!==n&&(this._setMonthInternal(n),this.Owner&&this.Owner.OnItemPropertyChanged())},t.prototype.GetMonth=function(){var t=n.Utility.EnumParser(this._month,n.MonthFlags,!0);return t=="notset"?"":t},t.prototype._setDayOfWeekInMonthInternal=function(t){n.Utility.IsPositiveInteger(t)?this._dayOfWeekInMonth=t:(t=t==""?"notset":t,this._dayOfWeekInMonth=n.Utility.EnumParser(t,n.WeekFlags))},t.prototype.SetDayOfWeekInMonth=function(n){n=n==""?"notset":n,this.GetDayOfWeekInMonth()!==n&&(this._setDayOfWeekInMonthInternal(n),this.Owner&&this.Owner.OnItemPropertyChanged())},t.prototype.GetDayOfWeekInMonth=function(){var t=n.Utility.EnumParser(this._dayOfWeekInMonth,n.WeekFlags,!0);return t=="notset"?"":t},t.prototype._setDayOfWeekInternal=function(t){t=t==""?"notset":t,this._dayOfWeek=n.Utility.EnumParser(t,n.DayOfWeek)},t.prototype.SetDayOfWeek=function(n){n=n==""?"notset":n,this.GetDayOfWeek()!==n&&(this._setDayOfWeekInternal(n),this.Owner&&this.Owner.OnItemPropertyChanged())},t.prototype.GetDayOfWeek=function(){var t=n.Utility.EnumParser(this._dayOfWeek,n.DayOfWeek,!0);return t=="notset"?"":t},t.prototype.IsHoliday=function(t){var u=Math.floor((t.getDate()-1)/7),r=t.getDay(),i=t.getMonth()+1;return n.CalendarUtility.IsDayOfWeekInMonthSelected(u,this._dayOfWeekInMonth)&&n.CalendarUtility.IsDayOfWeekSelected(r,this._dayOfWeek)&&n.CalendarUtility.IsMonthSelected(i,this._month)?!0:!1},t.prototype.TypeofDay=function(t){return this.IsHoliday(t)?n.DayType.Holiday:n.DayType.Normal},t.prototype.GetIsYearly=function(){return!0},t}(),n.DayOfWeekHoliday=i,o=function(t){function i(i,r,u,f,e){t.call(this);var l="",c=(new Date).getFullYear(),h=n.MonthFlags.NotSet,s=n.WeekFlags.NotSet,o=n.DayOfWeek.NotSet;arguments.length===4&&(c=arguments[0],h=arguments[1],s=arguments[2],o=arguments[3]),arguments.length<5||(l=arguments[0],c=arguments[1],h=arguments[2],s=arguments[3],o=arguments[4]),this._name=l,this._year=c,this._setMonthInternal(h),this._setDayOfWeekInMonthInternal(s),this._setDayOfWeekInternal(o)}return __extends(i,t),i.prototype.GetIsYearly=function(){return!1},i.prototype.SetYear=function(t){t=n.Utility.CheckInt(t),this._year!==t&&(this._year=t,this.Owner&&this.Owner.OnItemPropertyChanged())},i.prototype.GetYear=function(){return this._year},i.prototype.IsHoliday=function(t){var u=Math.floor((t.getDate()-1)/7),f=t.getDay(),i=t.getFullYear(),r=t.getMonth()+1;return n.CalendarUtility.IsDayOfWeekInMonthSelected(u,this._dayOfWeekInMonth)&&n.CalendarUtility.IsDayOfWeekSelected(f,this._dayOfWeek)&&n.CalendarUtility.IsMonthSelected(r,this._month)&&i==this.GetYear()?!0:!1},i.prototype.TypeofDay=function(t){return this.IsHoliday(t)?n.DayType.ForceHoliday:n.DayType.Normal},i}(i),n.ForceDayOfWeekHoliday=o,e=function(t){function i(i,r,u,f,e){t.call(this);var l="",c=(new Date).getFullYear(),h=n.MonthFlags.NotSet,s=n.WeekFlags.NotSet,o=n.DayOfWeek.NotSet;arguments.length===4&&(c=arguments[0],h=arguments[1],s=arguments[2],o=arguments[3]),arguments.length<5||(l=arguments[0],c=arguments[1],h=arguments[2],s=arguments[3],o=arguments[4]),this._name=l,this._year=c,this._setMonthInternal(h),this._setDayOfWeekInMonthInternal(s),this._setDayOfWeekInternal(o)}return __extends(i,t),i.prototype.GetIsYearly=function(){return!1},i.prototype.SetYear=function(t){t=n.Utility.CheckInt(t),this._year!==t&&(this._year=t,this.Owner&&this.Owner.OnItemPropertyChanged())},i.prototype.GetYear=function(){return this._year},i.prototype.IsHoliday=function(t){var u=Math.floor((t.getDate()-1)/7),f=t.getDay(),i=t.getFullYear(),r=t.getMonth()+1;return n.CalendarUtility.IsDayOfWeekInMonthSelected(u,this._dayOfWeekInMonth)&&n.CalendarUtility.IsDayOfWeekSelected(f,this._dayOfWeek)&&n.CalendarUtility.IsMonthSelected(r,this._month)&&i==this.GetYear()?!0:!1},i.prototype.TypeofDay=function(t){return this.IsHoliday(t)?n.DayType.ForceWorkday:n.DayType.Normal},i}(i),n.ForceDayOfWeekWorkday=e})(GCIM||(GCIM={}));var __extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},GCIM;(function(n){var t=function(t){function i(n){t.call(this),this.Owner=null,n&&(this.Owner=n)}return __extends(i,t),i.prototype.EqualsTo=function(t){if(!(t instanceof i)||this.length!==t.length)return!1;for(var r=0;r