 SchedulerMenuItemId=_aspxCreateClass(null,{});SchedulerMenuItemId.Custom="Custom";SchedulerMenuItemId.OpenAppointment="OpenAppointment";SchedulerMenuItemId.PrintAppointment="PrintAppointment";SchedulerMenuItemId.DeleteAppointment="DeleteAppointment";SchedulerMenuItemId.EditSeries="EditSeries";SchedulerMenuItemId.NewAppointment="NewAppointment";SchedulerMenuItemId.NewAllDayEvent="NewAllDayEvent";SchedulerMenuItemId.NewRecurringAppointment="NewRecurringAppointment";SchedulerMenuItemId.NewRecurringEvent="NewRecurringEvent";SchedulerMenuItemId.GotoThisDay="GotoThisDay";SchedulerMenuItemId.GotoToday="GotoToday";SchedulerMenuItemId.GotoDate="GotoDate";SchedulerMenuItemId.OtherSettings="OtherSettings";SchedulerMenuItemId.CustomizeCurrentView="CustomizeCurrentView";SchedulerMenuItemId.CustomizeTimeRuler="CustomizeTimeRuler";SchedulerMenuItemId.AppointmentDragMove="AppointmentDragMove";SchedulerMenuItemId.AppointmentDragCopy="AppointmentDragCopy";SchedulerMenuItemId.AppointmentDragCancel="AppointmentDragCancel";SchedulerMenuItemId.StatusSubMenu="StatusSubMenu";SchedulerMenuItemId.LabelSubMenu="LabelSubMenu";SchedulerMenuItemId.RulerMenu="RulerMenu";SchedulerMenuItemId.AppointmentMenu="AppointmentMenu";SchedulerMenuItemId.DefaultMenu="DefaultMenu";SchedulerMenuItemId.AppointmentDragMenu="AppointmentDragMenu";SchedulerMenuItemId.RestoreOccurrence="RestoreOccurrence";SchedulerMenuItemId.SwitchViewMenu="SwitchViewMenu";SchedulerMenuItemId.SwitchToDayView="SwitchToDayView";SchedulerMenuItemId.SwitchToWorkWeekView="SwitchToWorkWeekView";SchedulerMenuItemId.SwitchToWeekView="SwitchToWeekView";SchedulerMenuItemId.SwitchToMonthView="SwitchToMonthView";SchedulerMenuItemId.SwitchToTimelineView="SwitchToTimelineView";SchedulerMenuItemId.TimeScaleEnable="TimeScaleEnable";SchedulerMenuItemId.TimeScaleVisible="TimeScaleVisible";ASPxRelativeCoordinatesCalculatorBase=_aspxCreateClass(null,{constructor:function(parentElement){this.parentElement=parentElement;this.calculatedElements=new Array();this.innerParentElement=this.GetInnerParentElement();this.CreateLayers();this.SetInnerParentElementPosition();},GetInnerParentElement:function(){return this.parentElement;},SetInnerParentElementPosition:function(){},CreateLayers:function(){this.selectionLayer=this.CreateLayer();this.appointmentLayer=this.CreateLayer();this.navButtonLayer=this.CreateLayer();this.moreButtonLayer=this.CreateLayer();this.navButtonsOnCustomLayer=new Array();},CreateLayer:function(){var result=document.createElement(__aspxIE?'SPAN':'DIV');this.innerParentElement.appendChild(result);return result;},RemoveLayers:function(){this.innerParentElement.removeChild(this.selectionLayer);this.innerParentElement.removeChild(this.appointmentLayer);this.innerParentElement.removeChild(this.navButtonLayer);this.innerParentElement.removeChild(this.moreButtonLayer);var count=this.navButtonsOnCustomLayer.length;for(var i=0;i<count;i++)_aspxRemoveElement(this.navButtonsOnCustomLayer[i]);this.navButtonsOnCustomLayer=new Array();},CalcRelativeElementLeft:function(element){if(!_aspxIsExists(element.absoluteCellLeft)){element.absoluteCellLeft=_aspxGetAbsoluteX(element)-_aspxGetAbsoluteX(this.innerParentElement);this.AddToCalculatedElements(element);}return element.absoluteCellLeft;},CalcRelativeElementRight:function(element){if(!_aspxIsExists(element.absoluteCellRight)){element.absoluteCellRight=this.CalcRelativeElementLeft(element)+element.offsetWidth;this.AddToCalculatedElements(element);}return element.absoluteCellRight;},CalcRelativeElementTop:function(element){if(!_aspxIsExists(element.absoluteCellTop)){element.absoluteCellTop=_aspxGetAbsoluteY(element)-_aspxGetAbsoluteY(this.innerParentElement);this.AddToCalculatedElements(element);}return element.absoluteCellTop;},CalcRelativeElementBottom:function(element){if(!_aspxIsExists(element.absoluteCellBottom)){element.absoluteCellBottom=this.CalcRelativeElementTop(element)+element.offsetHeight;;this.AddToCalculatedElements(element);}return element.absoluteCellBottom;},CalcRelativeContainerBounds:function(viewInfo,container){if(!_aspxIsExists(container.isCalculated)||!container.isCalculated){var firstCell=viewInfo.GetCell(container.containerIndex,0);var lastCell=viewInfo.GetCell(container.containerIndex,container.cellCount-1);var left=this.CalcRelativeElementLeft(firstCell);var dxtop=this.CalcRelativeElementTop(firstCell);var right=this.CalcRelativeElementRight(lastCell);var bottom=this.CalcRelativeElementBottom(lastCell);var bounds=new Object();bounds.left=left;bounds.top=dxtop;bounds.width=right-left;bounds.height=bottom-dxtop;container.bounds=bounds;this.AddToCalculatedElements(container);}return container.bounds;},AddToCalculatedElements:function(element){if(!_aspxIsExists(element.isCalculated)||!element.isCalculated){element.isCalculated=true;_aspxArrayPush(this.calculatedElements,element);}},Clear:function(){var count=this.calculatedElements.length;for(i=0;i<count;i++){var element=this.calculatedElements[i];if(!_aspxIsExists(element.bounds)){element.isCalculated=false;element.absoluteCellLeft=null;element.absoluteCellRight=null;element.absoluteCellTop=null;element.absoluteCellBottom=null;}else{element.isCalculated=false;}if(_aspxIsExists(element.hasMoreButton))element.hasMoreButton=false;}
this.ClearMoreButtonLayer();this.SetInnerParentElementPosition();_aspxArrayClear(this.calculatedElements);},ClearMoreButtonLayer:function(){this.moreButtonLayer.innerHTML="";},AppendChild:function(child){this.parentElement.appendChild(child);},RemoveChild:function(child){this.parentElement.removeChild(child);},AppendChildToLayer:function(child,layer){layer.appendChild(child);},AppendChildToNavButtonLayer:function(child,layer){if(!_aspxIsExists(layer))layer=this.navButtonLayer;if(_aspxGetParentNode(child)!=layer){if(layer!=this.navButtonLayer)_aspxArrayPush(this.navButtonsOnCustomLayer,child);layer.appendChild(child);}},AppendChildToAppointmentLayer:function(child){this.appointmentLayer.appendChild(child);},AppendChildToMoreButtonLayer:function(child){this.moreButtonLayer.appendChild(child);},AfterCalculateAppointments:function(appointmentCalculator){},CalcCellHeight:function(cell){return cell.offsetHeight;}});ASPxRelativeCoordinatesCalculator=_aspxCreateClass(ASPxRelativeCoordinatesCalculatorBase,{constructor:function(parentElement){this.constructor.prototype.constructor.call(this,parentElement);}});ASPxSchedulerHitTestResult=_aspxCreateClass(null,{constructor:function(cell,selectionDiv,appointmentDiv,resizeDiv,smartTag){this.cell=cell;this.selectionDiv=selectionDiv;this.appointmentDiv=appointmentDiv;this.resizeDiv=resizeDiv;this.smartTag=smartTag;}});ASPxRelativeCoordinatesCalculatorWithScrolling=_aspxCreateClass(ASPxRelativeCoordinatesCalculatorBase,{constructor:function(parentElement,viewInfo,scrollableContainer){this.viewInfo=viewInfo;this.scrollableContainer=scrollableContainer;this.constructor.prototype.constructor.call(this,parentElement);this.bottomAppointmentIndent=2;},GetInnerParentElement:function(){return this.scrollableContainer;},SetInnerParentElementPosition:function(){var containerCount=this.viewInfo.cellContainers.length;var cellCount=this.viewInfo.cellContainers[containerCount-1].cellCount;var startCell=this.viewInfo.GetCell(0,0);var endCell=this.viewInfo.GetCell(containerCount-1,cellCount-1);if(!_aspxIsExists(startCell)||!_aspxIsExists(endCell))return;var parentLeft=_aspxGetAbsoluteX(startCell)-_aspxGetAbsoluteX(this.parentElement);var parentRight=_aspxGetAbsoluteX(endCell)-_aspxGetAbsoluteX(this.parentElement)+endCell.offsetWidth;var parentTop=_aspxGetAbsoluteY(startCell)-_aspxGetAbsoluteY(this.parentElement);var parentBottom=_aspxGetAbsoluteY(endCell)-_aspxGetAbsoluteY(this.parentElement)+endCell.offsetHeight;this.innerParentElement.style.left=parentLeft+"px";this.innerParentElement.style.top=parentTop+"px";this.innerParentElement.style.width=parentRight-parentLeft+"px";this.innerParentElement.style.height=parentBottom-parentTop+"px";if(!__aspxOpera&&!__aspxOpera9){var scrollWidth=this.innerParentElement.offsetWidth-this.innerParentElement.clientWidth;this.innerParentElement.style.width=this.innerParentElement.offsetWidth+scrollWidth+"px";}},CalcCellHeight:function(cell){return this.innerParentElement.scrollHeight;},AfterCalculateAppointments:function(appointmentCalculator){var startCell=this.viewInfo.GetCell(0,0);if(_aspxIsExists(this.viewInfo.scheduler.privateAllDayAreaHeight))this.innerParentElement.style.height=this.viewInfo.scheduler.privateAllDayAreaHeight;else if(_aspxIsExists(appointmentCalculator.maxBottom)&&appointmentCalculator.maxBottom>0){this.innerParentElement.style.height="";startCell.style.height="";var newHeight=Math.max(appointmentCalculator.maxBottom+this.bottomAppointmentIndent,startCell.offsetHeight);this.innerParentElement.style.height=newHeight+"px";}if(_aspxIsExists(startCell)){var borderHeight=startCell.offsetHeight-startCell.clientHeight;startCell.style.height=this.scrollableContainer.offsetHeight-borderHeight+"px";}if(__aspxOpera||__aspxOpera9){var scrollWidth=this.innerParentElement.offsetWidth-this.innerParentElement.clientWidth;this.innerParentElement.style.width=this.innerParentElement.offsetWidth+scrollWidth+"px";}}});function OnSchedulerWindowResizingStub(){ASPxControlResizeManager.OnWindowResizing();}
ASPxControlResizeManager={GetControlCollection:function(){if(!_aspxIsExists(this.controls)){this.controls=new Array();_aspxAttachEventToElement(window,"resize",new Function("OnSchedulerWindowResizingStub();"));this.resizeTimerId=window.setTimeout("ASPxControlResizeManager.CheckResize();",1000);}return this.controls;},Add:function(control){if(!_aspxIsExists(control.GetCurrentSize))return;control.lastCheckedSize=control.GetCurrentSize();_aspxArrayPush(this.GetControlCollection(),control);},Remove:function(control){_aspxArrayRemove(this.GetControlCollection(),control);},Clear:function(){this.controls=null;window.clearTimeout(this.resizeTimerId);},CheckResize:function(){window.clearTimeout(this.resizeTimerId);var collection=this.GetControlCollection();var count=collection.length;var hasLiveElements=false;for(var i=count-1;i>=0;i--){var control=collection[i];var size=control.GetCurrentSize();if(size==null){this.Remove(control);continue;}
var lastCheckedSize=control.lastCheckedSize;if(lastCheckedSize[0]!=size[0]){control.lastCheckedSize=size;control.OnWindowResized();}
hasLiveElements=true;}if(hasLiveElements)this.resizeTimerId=window.setTimeout("ASPxControlResizeManager.CheckResize();",1000);else this.Clear();},OnWindowResizing:function(){window.clearTimeout(this.resizeTimerId);this.resizeTimerId=window.setTimeout("ASPxControlResizeManager.CheckResize();",250);}};ASPxClientScheduler=_aspxCreateClass(ASPxClientControl,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.cellIdRegExp=/DXCnt(([hv])(\d+))_(\d+)/;this.ActiveViewChanging=new ASPxClientEvent();this.ActiveViewChanged=new ASPxClientEvent();this.SelectionChanged=new ASPxClientEvent();this.VisibleIntervalChanged=new ASPxClientEvent();this.AppointmentsSelectionChanged=new ASPxClientEvent();this.isInsideBeginInit=false;this.isReadyForCallbacks=false;this.changedBlocks=null;this.activeFormType=ASPxSchedulerFormType.None;this.aptFormVisibility=ASPxSchedulerFormVisibility.None;this.gotoDateFormVisibility=ASPxSchedulerFormVisibility.None;this.recurrentAppointmentDeleteFormVisibility=ASPxSchedulerFormVisibility.None;this.allowMultipleCallbacks=false;this.privateAllowAppointmentMultiSelect=true;this.contextMenuHandlers=[];this.prevCallbackResults=new Object();this.funcCallbacks=new Array();},_constDXAppointment:function(){return "_AptDiv";},_constDXSchedulerContentCell:function(){return "DXCnt";},_constDXSelectionDiv:function(){return "selectionDiv";},_constDXAppointmentAdorner:function(){return "aptAdornerDiv";},_constEmptyResource:function(){return "null";},Initialize:function(){this.constructor.prototype.Initialize.call(this);this.EndInit();},BeginInit:function(){if(_aspxIsExists(this.onCallback))this.onCallback();this.isInsideBeginInit=true;ASPxControlResizeManager.Remove(this);this.deferredSetScrollPosition=null;this.syncColumnCount=-1;this.appointmentSelection=new ASPxAppointmentSelection(this);this.appointmentSelection.BeginUpdate();this.selection=null;this.navButtonAnchors=new Array();this.navButtons=new Array();this.appointments=new Object();this.timelineHeaderLevels=new Array();this.privateAllDayAreaHeight=null;this.privateShowMoreButtonsOnEachColumn=false;this.RecreateViewInfo();this.privateRaiseActiveViewTypeChanged=false;this.privateRaiseVisibleIntervalChanged=false;},RecreateViewInfo:function(){var usePrevContainer=this.changedBlocks&&!this.changedBlocks.ContainerBlockChanged;var usePrevNavButtons=this.changedBlocks&&!this.changedBlocks.NavButtonsBlockChanged;if(!usePrevNavButtons)this.navButtonsCache=new Object();if(usePrevContainer){this.horizontalViewInfo.parent.RemoveLayers();this.verticalViewInfo.parent.RemoveLayers();this.ResetCellsAbsolutePosition();}if(this.horizontalViewInfo)this.horizontalViewInfo.Dispose();if(this.verticalViewInfo)this.verticalViewInfo.Dispose();this.horizontalViewInfo=new ASPxClientHorizontalSchedulerViewInfo(this,this.horizontalViewInfo,usePrevContainer);this.verticalViewInfo=new ASPxClientVerticalSchedulerViewInfo(this,this.verticalViewInfo,usePrevContainer);},EndInit:function(){this.SubscribeEvents();this.isInsideBeginInit=false;this.resourceNavigatorRow=this.GetChild("_resourceNavigatorRow");this.innerContentElement=_aspxGetElementById(this.name+"_containerBlock_content");this.containerTable=_aspxGetElementById(this.name+"_containerBlock_containerTable");this.containerCell=_aspxGetElementById(this.name+"_containerBlock_innerContent");this.selectionDiv=_aspxGetElementById(this.name+"_commonControlsBlock_selectionDiv");this.smartTagDiv=_aspxGetElementById(this.name+"_commonControlsBlock_selectionSmartTagDiv_mainDiv");this.topResizeDiv=_aspxGetElementById(this.name+"_commonControlsBlock_topResizeControlDiv");this.bottomResizeDiv=_aspxGetElementById(this.name+"_commonControlsBlock_bottomResizeControlDiv");this.leftResizeDiv=_aspxGetElementById(this.name+"_commonControlsBlock_leftResizeControlDiv");this.rightResizeDiv=_aspxGetElementById(this.name+"_commonControlsBlock_rightResizeControlDiv");this.aptAdorner=_aspxGetElementById(this.name+"_commonControlsBlock_aptAdornerDiv");if(_aspxIsExists(this.smartTagDiv))this.smartTagDiv.aspxParentControl=this;this.appointmentSmartTagDiv=_aspxGetElementById(this.name+"_commonControlsBlock_appointmentSmartTagDiv_mainDiv");if(_aspxIsExists(this.appointmentSmartTagDiv))this.appointmentSmartTagDiv.aspxParentControl=this;this.mainDiv=_aspxGetElementById(this.name);this.ObtainCellTables();this.PrepareSchedulerViewInfos();this.appointmentSelection.Prepare();if(_aspxIsExists(this.innerContentElement)){this.RecalcLayout();this.ShowCellSelection();if(_aspxIsExists(this.deferredSetScrollPosition))this.SetScrollPosition(this.deferredSetScrollPosition);ASPxControlResizeManager.Add(this);this.EnableResize();}
this.appointmentSelection.EndUpdate();ASPxRelatedControlManager.Unshade(this);this.RaiseClientEvents();this.isReadyForCallbacks=true;},AddContextMenuEvent:function(elementId,handlerFunc){_aspxArrayPush(this.contextMenuHandlers,[elementId,handlerFunc]);},SubscribeEvents:function(){var count=this.contextMenuHandlers.length;for(var i=0;i<count;i++){var current=this.contextMenuHandlers[i];var element=_aspxGetElementById(current[0]);if(_aspxIsExists(element)){element.oncontextmenu=new Function("event",current[1]);}}},RaiseClientEvents:function(){if(_aspxIsExists(this.RaiseActiveViewChanged)&&this.privateRaiseActiveViewTypeChanged)this.RaiseActiveViewChanged();if(_aspxIsExists(this.RaiseVisibleIntervalChanged)&&this.privateRaiseVisibleIntervalChanged)this.RaiseVisibleIntervalChanged();},GetCurrentSize:function(){if(this.mainDiv&&this.mainDiv.parentElement)return[this.innerContentElement.clientWidth,this.innerContentElement.clientHeight];else return null;},GetToolTipControl:function(){return aspxGetControlCollection().Get(this.name+"_commonControlsBlock_toolTipControl");},PrivateSetActiveViewType:function(newViewType){var activeViewType=this.GetActiveViewType();if(activeViewType==newViewType)return;this.privateActiveViewType=newViewType;this.privateRaiseActiveViewTypeChanged=true;},PrivateSetAllDayAreaHeight:function(height){this.privateAllDayAreaHeight=height;},PrivateSetGroupType:function(newGroupType){this.privateGroupType=newGroupType;},PrivateSetAppointmentHeight:function(height){this.privateAppointmentHeight=parseInt(height);},BeginAppointmentResizeAtLeft:function(appointmentViewInfo){var appointmentDiv=appointmentViewInfo.contentDiv;if(_aspxIsExists(appointmentDiv))new ASPxResizeHelper(this,appointmentDiv,aspxAppointmentResizeLeft);},BeginAppointmentResizeAtRight:function(appointmentViewInfo){var appointmentDiv=appointmentViewInfo.contentDiv;if(_aspxIsExists(appointmentDiv))new ASPxResizeHelper(this,appointmentDiv,aspxAppointmentResizeRight);},BeginAppointmentResizeAtTop:function(appointmentViewInfo){var appointmentDiv=appointmentViewInfo.contentDiv;if(_aspxIsExists(appointmentDiv))new ASPxResizeHelper(this,appointmentDiv,aspxAppointmentResizeTop);},BeginAppointmentResizeAtBottom:function(appointmentViewInfo){var appointmentDiv=appointmentViewInfo.contentDiv;if(_aspxIsExists(appointmentDiv))new ASPxResizeHelper(this,appointmentDiv,aspxAppointmentResizeBottom);},ObtainCellTables:function(){this.horzTable=this.GetContainerElementById("horzContainerTable");if(!_aspxIsExists(this.horzTable))this.horzTable=this.GetContainerElementById("content");this.vertTable=this.GetContainerElementById("vertTable");if(!_aspxIsExists(this.vertTable))this.vertTable=this.GetContainerElementById("content");},GetIsDayBasedView:function(){return this.privateActiveViewType==ASPxSchedulerViewType.Day||this.privateActiveViewType==ASPxSchedulerViewType.WorkWeek;},PrepareSchedulerViewInfos:function(){this.horizontalViewInfo.Initialize(this.horzTable);this.verticalViewInfo.Initialize(this.vertTable);var horizontalContainer=this.GetContainerElementById("horizontalContainer");var dayBasedView=this.GetIsDayBasedView();if(!_aspxIsExists(horizontalContainer))this.horizontalParent=new ASPxRelativeCoordinatesCalculator(this.containerCell);else{var scrollableContainer=this.GetContainerElementById("scrollableContainer");if(_aspxIsExists(scrollableContainer))this.horizontalParent=new ASPxRelativeCoordinatesCalculatorWithScrolling(horizontalContainer,this.horizontalViewInfo,scrollableContainer);else this.horizontalParent=new ASPxRelativeCoordinatesCalculator(horizontalContainer);}
this.horizontalViewInfo.Prepare(this.horizontalParent);var verticalContainer=this.GetContainerElementById("verticalContainer");if(!_aspxIsExists(verticalContainer))this.verticalParent=new ASPxRelativeCoordinatesCalculator(this.containerCell);else{this.verticalParent=new ASPxRelativeCoordinatesCalculator(verticalContainer);}
this.verticalViewInfo.Prepare(this.verticalParent);},EnableResize:function(){this.processResize=true;},DisableResize:function(){this.processResize=false;},IsResizeEnabled:function(){return _aspxIsExists(this.processResize)&&this.processResize;},OnWindowResized:function(){if(this.isInsideBeginInit||!this.IsResizeEnabled())return;this.DisableResize();this.ResetSyncSlaveCellsWidth();this.ResetCellsAbsolutePosition();this.RecalcLayout();this.ShowCellSelection();this.AlignNavigationButtons();this.appointmentSelection.RecalcSelection();this.EnableResize();},ResetCellsAbsolutePosition:function(){this.verticalViewInfo.parent.Clear();this.horizontalViewInfo.parent.Clear();},FormatHeadersContentOptimally:function(){this.FormatHeadersContentOptimallyCore(this.datesForFormatsWithoutYearLocations,this.datesForFormatsWithoutYear,this.formatsWithoutYear,ASPxSchedulerMeasurer.SetOptimalHeadersContent);this.FormatHeadersContentOptimallyCore(this.datesForFormatsWithoutYearAndWeekDayLocations,this.datesForFormatsWithoutYearAndWeekDay,this.formatsWithoutYearAndWeekDay,ASPxSchedulerMeasurer.SetOptimalHeadersContent);this.FormatHeadersContentOptimallyCore(this.datesForFormatsNewYearLocations,this.datesForFormatsNewYear,this.formatsNewYear,ASPxSchedulerMeasurer.SetOptimalHeadersContent);this.FormatHeadersContentOptimallyCore(this.daysForDayOfWeekFormatsLocations,this.daysForDayOfWeekFormats,null,ASPxSchedulerMeasurer.SetOptimalDayOfWeekHeadersContent);this.FormatHeadersContentOptimallyCore(this.datesForDayNumberFormatLocations,this.datesForDayNumberFormat,null,ASPxSchedulerMeasurer.SetOptimalDayNumberHeaderContent);},ClearDatesForFormats:function(){delete this.datesForFormatsWithoutYearLocations;delete this.datesForFormatsWithoutYearAndWeekDayLocations;delete this.datesForFormatsNewYearLocations;delete this.daysForDayOfWeekFormatsLocations;delete this.datesForDayNumberFormatLocations;},FormatHeadersContentOptimallyCore:function(headerLocations,dates,formats,delegate){if(_aspxIsExists(headerLocations)){var headers=this.GetHeadersByLocation(headerLocations);if(headers.length>0&&_aspxIsExists(dates))delegate.call(ASPxSchedulerMeasurer,headers,dates,formats);}},GetHeadersByLocation:function(locations){var count=locations.length;var headers=[];for(var i=0;i<count;i++){var location=locations[i];var rowIndex=location[0];var cellIndex=location[1];var header=this.horzTable.rows[rowIndex].cells[cellIndex];_aspxArrayPush(headers,header);}return headers;},AlignNavigationButtons:function(){var count=this.navButtons.length;for(var i=0;i<count;i++)this.AlignNavigationButton(this.navButtons[i]);},AlignNavigationButton:function(navBtn){var div=this.GetNavButtonElementById(navBtn.divId);if(!_aspxIsExists(div))return;var leftTopAnchor=this.navButtonAnchors[navBtn.resourceId+"_Left"];var rightBottomAnchor=this.navButtonAnchors[navBtn.resourceId+"_Right"];if(!_aspxIsExists(leftTopAnchor)||!_aspxIsExists(rightBottomAnchor))return;var leftTopAnchorCell=this.vertTable.rows[leftTopAnchor[0]].cells[leftTopAnchor[1]];var rightBottomAnchorCell=this.vertTable.rows[rightBottomAnchor[0]].cells[rightBottomAnchor[1]];;if(!_aspxIsExists(leftTopAnchorCell)||!_aspxIsExists(rightBottomAnchorCell))return;var dxtop;var bottom;var parent;var verticalContainer=this.GetContainerElementById("verticalContainer");var navButtonLayer=null;var navButtonParent=this.containerCell;if(_aspxIsExists(verticalContainer)){navButtonLayer=_aspxGetParentNode(_aspxGetParentNode(verticalContainer));parent=this.verticalParent;dxtop=_aspxGetAbsoluteY(navButtonLayer)-_aspxGetAbsoluteY(navButtonParent);bottom=dxtop+navButtonLayer.offsetHeight;}else{parent=this.horizontalParent;dxtop=parent.CalcRelativeElementTop(leftTopAnchorCell);bottom=parent.CalcRelativeElementBottom(rightBottomAnchorCell);}
parent.AppendChildToNavButtonLayer(div,navButtonLayer);var left=parent.CalcRelativeElementLeft(leftTopAnchorCell)+2;if(navBtn.anchorType=="Left")div.style.left=left+"px";else{var right=parent.CalcRelativeElementRight(rightBottomAnchorCell)-2;div.style.left=right-div.offsetWidth+"px";}
div.style.top=(dxtop+bottom-div.offsetHeight)/2+"px";_aspxSetElementDisplay(div,true);},RecalcLayout:function(){this.HideAppointments();if(_aspxIsExists(document.recalc))document.recalc(true);this.SyncDayViewHeadersWithColumns();this.FormatHeadersContentOptimally();this.horizontalViewInfo.parent.Clear();if(this.HasVerticalResourceHeaderColumn())this.LayoutVerticalResourceHeaderColumn();var timeLineHeaderCalculator=new ASPxClientTimelineHeaderLayoutCalculator(this);timeLineHeaderCalculator.CalculateLayout(this.timelineHeaderLevels);this.LayoutAppointments();this.AlignNavigationButtons();},HasVerticalResourceHeaderColumn:function(){var activeView=this.GetActiveViewType();var activeGroup=this.GetGroupType();if(activeView=="Timeline"&&activeGroup!=ASPxSchedulerGroupType.None)return true;if((activeView=="Week"||activeView=="Month")&&activeGroup==ASPxSchedulerGroupType.Date)return true;return false;},LayoutVerticalResourceHeaderColumn:function(){var table=this.GetContainerElementById("content");var cells=table.tBodies[0].rows[0].cells;var leftCell=cells[0];var rightCell=cells[cells.length-1];if(table==null||leftCell==null||rightCell==null)return;if(_aspxIsExists(leftCell.correctedWidth))return;var saveRightCellStyleWidth=rightCell.style.width;if(!this.IsVerticalResourceHeaderColumnWidthAssignedByUser())rightCell.style.width="100%";_aspxChangeTableLayout(table,"auto");leftCell.correctedWidth=leftCell.offsetWidth;rightCell.style.width=saveRightCellStyleWidth;_aspxChangeTableLayout(table,"fixed");_aspxSetTableCellOffsetWidth(leftCell,leftCell.correctedWidth);},IsVerticalResourceHeaderColumnWidthAssignedByUser:function(){if(this.MeasureVRHLocation==null)return false;var cell=_aspxGetItemByLocation(this.horzTable,this.MeasureVRHLocation);this.MeasureVRHLocation=null;var style=_aspxGetCurrentStyle(cell);if(style.width=="")return false;return true;},LayoutAppointments:function(){var horizontalCalculator=this.CreateHorizontalAppointmentsCalculator();horizontalCalculator.CalculateLayout(this.horizontalViewInfo.appointmentViewInfos);this.horizontalViewInfo.parent.AfterCalculateAppointments(horizontalCalculator);var verticalCalculator=this.CreateVerticalAppointmentsCalculator();verticalCalculator.CalculateLayout(this.verticalViewInfo.appointmentViewInfos);this.verticalViewInfo.parent.AfterCalculateAppointments(verticalCalculator);if(this.GetIsDayBasedView())this.verticalViewInfo.ShowMoreButton();},HideAppointments:function(){this.horizontalViewInfo.HideAppointments();this.verticalViewInfo.HideAppointments();},CreateVerticalAppointmentsCalculator:function(){return new ASPxClientVerticalAppointmentLayoutCalculator(this.verticalViewInfo,this.verticalParent);},CreateHorizontalAppointmentsCalculator:function(){var activeView=this.GetActiveViewType();if(activeView==ASPxSchedulerViewType.Day||activeView==ASPxSchedulerViewType.WorkWeek)return new ASPxClientHorizontalAppointmentLayoutCalculatorInfinityHeight(this.horizontalViewInfo);else return new ASPxClientHorizontalAppointmentLayoutCalculator(this.horizontalViewInfo);},SyncDayViewHeadersWithColumns:function(){if(this.syncColumnCount<=0)return;var masterRow=this.vertTable.rows[this.syncMasterRowIndex];var slaveRow=this.horzTable.rows[this.syncSlaveRowIndex];masterRow.style.display="";for(var i=this.syncColumnCount-1;i>=0;i--){slaveRow.cells[i].style.width=masterRow.cells[i].offsetWidth+"px";slaveRow.cells[i].style.height="0";_aspxRefreshTableCell(slaveRow.cells[i]);}
var cell=slaveRow.cells[this.syncColumnCount];cell.style.width=this.CalcVerticalScrollbarWidth()+"px";cell.style.height="0";_aspxRefreshTableCell(slaveRow.cells[this.syncColumnCount]);masterRow.style.display="none";},ResetSyncSlaveCellsWidth:function(){if(this.syncColumnCount<0)return;var slaveRow=this.horzTable.rows[this.syncSlaveRowIndex];for(var i=this.syncColumnCount;i>=0;i--)slaveRow.cells[i].style.width="1px";},SetSyncCells:function(syncColumnCount,syncMasterRowIndex,syncSlaveRowIndex){this.syncColumnCount=syncColumnCount;this.syncMasterRowIndex=syncMasterRowIndex;this.syncSlaveRowIndex=syncSlaveRowIndex;},CalcVerticalScrollbarWidth:function(){var vsc=this.GetContainerElementById("verticalScrollContainer");if(_aspxIsExists(vsc)){var clientWidth=vsc.clientWidth;if(!_aspxIsExists(clientWidth))return 0;else return vsc.offsetWidth-clientWidth;}else return 0;},CalculateLayout:function(){this.RecalcLayout();this.EnableResize();},GetPositionX:function(element){return _aspxGetAbsoluteX(element)-_aspxGetAbsoluteX(this.innerContentElement);},GetPositionY:function(element){return _aspxGetAbsoluteY(element)-_aspxGetAbsoluteY(this.innerContentElement);},GetBlockElementId:function(blockId,innerId){return this.name+"_"+blockId+"_"+innerId;},GetElementById:function(id){return _aspxGetElementById(this.name+"_"+id);},GetContainerElementById:function(id){return _aspxGetElementById(this.name+"_containerBlock_"+id);},GetNavButtonElementById:function(id){var div=this.navButtonsCache[id];if(!_aspxIsExists(div)){div=_aspxGetElementById(this.name+"_navButtonsBlock_"+id);this.navButtonsCache[id]=div;}return div;},GetAppointmentBlockElementById:function(id){return _aspxGetElementById(this.name+"_aptsBlock_"+id);},GetMainTable:function(){return this.innerContentElement;},GetCellInterval:function(cell){var interval=cell.interval;if(_aspxIsExists(interval))return interval;else{this.InitializeCell(cell);return cell.interval;}},GetCellStartTime:function(cell){return this.GetCellInterval(cell).start;},GetCellDuration:function(cell){return this.GetCellInterval(cell).duration;},GetCellEndTime:function(cell){return this.GetCellInterval(cell).end;},GetCellResource:function(cell){var resource=cell.resource;if(_aspxIsExists(resource))return resource;else{this.InitializeCell(cell);return cell.resource;}},GetCellLeft:function(cell){if(!_aspxIsExists(cell.absoluteCellLeft))cell.absoluteCellLeft=this.GetPositionX(cell);return cell.absoluteCellLeft;},GetCellTop:function(cell){if(!_aspxIsExists(cell.absoluteCellTop))cell.absoluteCellTop=this.GetPositionY(cell);return cell.absoluteCellTop;},GetCellRight:function(cell){if(!_aspxIsExists(cell.absoluteCellRight))cell.absoluteCellRight=this.GetCellLeft(cell)+cell.offsetWidth;return cell.absoluteCellRight;},GetCellBottom:function(cell){if(!_aspxIsExists(cell.absoluteCellBottom))cell.absoluteCellBottom=this.GetCellTop(cell)+cell.offsetHeight;return cell.absoluteCellBottom;},AppendChild:function(child){this.mainDiv.appendChild(child);},RemoveChild:function(child){this.mainDiv.removeChild(child);},CancelFormChangesAndClose:function(visibility,callbackName){if(visibility==ASPxSchedulerFormVisibility.FillControlArea){this.RaiseCallback(callbackName);}else{var statusInfoManager=this.statusInfoManager;if(_aspxIsExists(statusInfoManager))statusInfoManager.Clear();this.HideCurrentPopupContainer();this.SaveActiveFormTypeState(ASPxSchedulerFormType.None);}},SaveActiveFormTypeState:function(formType){this.activeFormType=formType;var element=this.GetStateElement("FRMTYPE");if(_aspxIsExists(element))element.value=formType;},SaveCurrentPopupContainer:function(popupId){this.HideCurrentPopupContainer();this.currentPopupContainer=aspxGetControlCollection().Get(this.name+"_formBlock_"+popupId);},HideCurrentPopupContainer:function(){if(_aspxIsExists(this.currentPopupContainer)){this.currentPopupContainer.CloseUp.ClearHandlers();this.currentPopupContainer.Hide();var mainElement=this.currentPopupContainer.GetWindowElement(-1);var parentNode=_aspxGetParentNode(mainElement);if(_aspxIsExists(parentNode))parentNode.removeChild(mainElement);this.currentPopupContainer=null;this.RestoreNavButtons();}},HideNavButtons:function(){this.hidedNavButtonDivs=new Array();var count=this.navButtons.length;for(var i=0;i<count;i++){var div=this.GetNavButtonElementById(this.navButtons[i].divId);if(!_aspxIsExists(div))return;_aspxSetElementVisibility(div,false);_aspxArrayPush(this.hidedNavButtonDivs,div);}},RestoreNavButtons:function(){if(!this.hidedNavButtonDivs)return;var count=this.hidedNavButtonDivs.length;for(var i=0;i<count;i++)_aspxSetElementVisibility(this.hidedNavButtonDivs[i],true);this.hidedNavButtonDivs=null;},ShowFormPopupWindow:function(popupId){if(_aspxIsExists(this.currentPopupContainer)){var width=_aspxGetDocumentClientWidth();var height=_aspxGetDocumentClientHeight();var pcwElement=this.currentPopupContainer.GetWindowElement(-1);this.currentPopupContainer.SetWindowDisplay(-1,true);var popupWidth=pcwElement.offsetWidth;var popupHeight=pcwElement.offsetHeight;this.currentPopupContainer.SetWindowDisplay(-1,false);var xOffset=_aspxGetDocumentScrollLeft();var yOffset=_aspxGetDocumentScrollTop();this.currentPopupContainer.ShowAtPos(xOffset+((width-popupWidth)>>1),yOffset+((height-popupHeight)>>1));}},ShowInplacePopupWindow:function(inplaceEditorPopupId,aptId){this.HideNavButtons();if(_aspxIsExists(this.currentPopupContainer)){var aptViewInfo;if(_aspxIsExists(this.verticalViewInfo)){aptViewInfo=this.verticalViewInfo.FindViewInfosByAppointmentId(aptId);}if(!_aspxIsExists(aptViewInfo)||(aptViewInfo.length<=0)){if(_aspxIsExists(this.horizontalViewInfo)){aptViewInfo=this.horizontalViewInfo.FindViewInfosByAppointmentId(aptId);}}if(!_aspxIsExists(aptViewInfo)||(aptViewInfo.length<=0))return;var contentDiv=aptViewInfo[0].contentDiv;if(!_aspxIsExists(contentDiv))return;this.currentPopupContainer.SetSize(Math.max(200,contentDiv.offsetWidth),0);var div=this.currentPopupContainer.GetWindowElement(-1);if(!aptViewInfo[0].IsHorizontal()){var parentNode=_aspxGetParentNode(contentDiv);if(!_aspxIsExists(parentNode))return;parentNode.appendChild(div);this.currentPopupContainer.ShowAtPos(0,0);this.ShowInplaceEditorCore(div,aptViewInfo[0]);}else{this.currentPopupContainer.ShowAtPos(_aspxGetAbsoluteX(contentDiv),_aspxGetAbsoluteY(contentDiv));}}},ShowInplaceEditorCore:function(inplaceEditorElement,appointmentViewInfo){var contentDiv=appointmentViewInfo.contentDiv;var divLeft=contentDiv.offsetLeft;var divTop=contentDiv.offsetTop;if(appointmentViewInfo.IsHorizontal()){this.currentPopupContainer.OnDrag(-1,divLeft,divTop);return;}
var scrollContainer=this.GetContainerElementById("verticalScrollContainer");if(!_aspxIsExists(scrollContainer)){this.currentPopupContainer.OnDrag(-1,divLeft,divTop);return;}if(inplaceEditorElement.offsetWidth+divLeft>scrollContainer.clientWidth)divLeft=scrollContainer.clientWidth-inplaceEditorElement.offsetWidth;if(inplaceEditorElement.offsetHeight+divTop>scrollContainer.scrollHeight)divTop=scrollContainer.scrollHeight-inplaceEditorElement.offsetHeight;this.currentPopupContainer.OnDrag(-1,divLeft,divTop);if(inplaceEditorElement.offsetTop<scrollContainer.scrollTop||inplaceEditorElement.offsetHeight>scrollContainer.offsetHeight){scrollContainer.scrollTop=Math.max(inplaceEditorElement.offsetTop,0);this.EnsureInplaceEditorPositionVisible(inplaceEditorElement);return;}
var bottom=inplaceEditorElement.offsetTop+inplaceEditorElement.offsetHeight;var scrollBottom=scrollContainer.scrollTop+scrollContainer.offsetHeight;if(bottom>scrollBottom){var newScrollTop=scrollContainer.scrollTop+bottom-scrollBottom;scrollContainer.scrollTop=Math.max(newScrollTop,0);this.EnsureInplaceEditorPositionVisible(inplaceEditorElement);return;}
this.EnsureInplaceEditorPositionVisible(inplaceEditorElement);},EnsureInplaceEditorPositionVisible:function(inplaceEditorElement){var htmlParent=inplaceEditorElement.offsetParent;while(_aspxIsExists(htmlParent)&&htmlParent.tagName!="HTML")htmlParent=_aspxGetParentNode(htmlParent);if(!_aspxIsExists(htmlParent))return;var posY=_aspxGetAbsolutePositionY(inplaceEditorElement);if(htmlParent.scrollTop>posY)inplaceEditorElement.scrollIntoView(true);else if(htmlParent.scrollTop+htmlParent.offsetHeight<posY+inplaceEditorElement.offsetHeight)inplaceEditorElement.scrollIntoView(false);},ShowCellSelection:function(){if(_aspxIsExists(this.selection)){var dayBasedView=this.GetIsDayBasedView();var selectionVisible=this.appointmentSelection.selectedAppointmentIds.length==0;this.horizontalViewInfo.ShowCellSelection(this.selection.interval,this.selection.resource,!dayBasedView,selectionVisible);this.verticalViewInfo.ShowCellSelection(this.selection.interval,this.selection.resource,true,selectionVisible);}},OnAppointmentSelectionChanged:function(selectedAppointmentIds){this.SaveAppointmentSelectionState();this.ShowCellSelection();if(_aspxIsExists(this.RaiseAppointmentsSelectionChanged))this.RaiseAppointmentsSelectionChanged(selectedAppointmentIds);},SetFormsInitState:function(activeFormType,aptFormVisibility,gotoDateFormVisibility,recurrentAppointmentDeleteFormVisibility){this.activeFormType=activeFormType;this.aptFormVisibility=aptFormVisibility;this.gotoDateFormVisibility=gotoDateFormVisibility;this.recurrentAppointmentDeleteFormVisibility=recurrentAppointmentDeleteFormVisibility;},SetSelection:function(start,duration,resourceId,firstSelectionStart,firstSelectionDuration){var firstSelectedInterval=new ASPxClientTimeInterval(firstSelectionStart,firstSelectionDuration);var selectedInterval=new ASPxClientTimeInterval(start,duration);if(!_aspxIsExists(this.selection)||!this.selection.interval.Equals(selectedInterval)||!this.selection.firstSelectedInterval.Equals(firstSelectedInterval)||this.selection.resource!=resourceId)this.SetSelectionCore(new ASPxSchedulerSelection(selectedInterval,resourceId,firstSelectedInterval));},SetSelectionCore:function(newSelection){this.selection=newSelection;this.SaveSelectionState();if(!this.isInsideBeginInit&&this.isInitialized)this.ShowCellSelection();},SetSelectionInterval:function(newInterval){this.selection.interval=newInterval;this.SaveSelectionState();this.ShowCellSelection();},SetSelectedAppointmentIds:function(appointmentIds){var count=appointmentIds.length;this.appointmentSelection.BeginUpdate();for(var i=0;i<count;i++)this.appointmentSelection.AddAppointmentToSelection(appointmentIds[i]);this.appointmentSelection.EndUpdate();},GetResourceString:function(resource){return resource!=null?resource:this._constEmptyResource;},GetStateElement:function(name){return this.GetChild("_stateBlock_"+name);},SaveSelectionState:function(){var resourceString=this.GetResourceString(this.selection.resource);var result=this.selection.interval.ToString()+","+this.selection.firstSelectedInterval.ToString()+","+resourceString;var element=this.GetStateElement("SEL");if(_aspxIsExists(element))element.value=result;this.RaiseSelectionChanged();},SaveAppointmentSelectionState:function(){var selectedAppointmentsIds=this.appointmentSelection.selectedAppointmentIds;var count=selectedAppointmentsIds.length;var result="";for(var i=0;i<count;i++)result+=selectedAppointmentsIds[i]+",";var element=this.GetStateElement("APTSEL");if(_aspxIsExists(element))element.value=result;},AddNavigationButton:function(divId,resourceId,anchorType){var btn=new ASPxNavigationButton(divId,resourceId,anchorType);_aspxArrayPush(this.navButtons,btn);},AddAppointment:function(aptId,start,duration,resources,flagStr,appointmentType,labelId,statusId){var flags=new ASPxClientAppointmentFlags();flags.allowDelete=flagStr.charAt(0)=="1";flags.allowEdit=flagStr.charAt(1)=="1";flags.allowResize=flagStr.charAt(2)=="1";flags.allowCopy=flagStr.charAt(3)=="1";flags.allowDrag=flagStr.charAt(4)=="1";flags.allowDragBetweenResources=flagStr.charAt(5)=="1";flags.allowInplaceEditor=flagStr.charAt(6)=="1";flags.allowConflicts=flagStr.charAt(7)=="1";var interval=new ASPxClientTimeInterval(start,duration);this.appointments[aptId]=new ASPxClientAppointment(interval,resources,flags,aptId,appointmentType,statusId,labelId);},InitializeAppointmentDivCache:function(){if(this.changedBlocks&&!this.changedBlocks.AppointmentsBlockChanged)return;if(_aspxIsExists(this.appointmentDivCache)){for(var divId in this.appointmentDivCache){var div=this.appointmentDivCache[divId];_aspxRemoveElement(div);}}
this.appointmentDivCache=new Object();var aptsBlock=this.GetAppointmentBlockElementById("innerContent");if(_aspxIsExists(aptsBlock)){var children=aptsBlock.childNodes;var count=children.length;for(var i=0;i<count;i++){var child=children[i];if(_aspxIsExists(child.tagName)&&child.tagName.toUpperCase()=="DIV"){this.appointmentDivCache[child.id]=child;}}}},GetAppointmentDivById:function(divId){return this.appointmentDivCache[this.name+"_aptsBlock_"+divId];},GetAppointmentFlags:function(aptId){return this.GetAppointment(aptId).flags;},GetAppointment:function(aptId){return this.appointments[aptId];},GetAppointmentInterval:function(aptId){return this.appointments[aptId].interval;},GetAppointmentResources:function(aptId){return this.appointments[aptId].resources;},AddAnchor:function(rowIndex,cellIndex,anchorId){this.navButtonAnchors[anchorId]=[rowIndex,cellIndex];},AddHorizontalAppointment:function(firstCellIndex,lastCellIndex,startTime,duration,topRelativeIndent,bottomRelativeIndent,divId,appointmentId,statusBackDivId,statusForeDivId,statusStartOffset,statusEndOffset,hasLeftBorder,hasRightBorder){var result1=this.cellIdRegExp.exec(firstCellIndex);if(!_aspxIsExists(result1)||result1.length==0)return;var containerIndex=parseInt(result1[3]);var cellIndex1=parseInt(result1[4]);var result2=this.cellIdRegExp.exec(lastCellIndex);if(!_aspxIsExists(result2)||result2.length==0)return;var cellIndex2=parseInt(result2[4]);var apt=new ASPxClientHorizontalAppointmentViewInfo(this.horizontalViewInfo,containerIndex,cellIndex1,cellIndex2,startTime,duration,topRelativeIndent,bottomRelativeIndent,divId,appointmentId,hasLeftBorder,hasRightBorder,statusBackDivId,statusForeDivId,statusStartOffset,statusEndOffset);this.horizontalViewInfo.AddViewInfo(apt);},AddVerticalAppointment:function(firstCellIndex,lastCellIndex,startTime,duration,topRelativeIndent,bottomRelativeIndent,divId,appointmentId,statusBackDivId,statusForeDivId,statusStartOffset,statusEndOffset,startHorizontalIndex,endHorizontalIndex,maxIndexInGroup,hasTopBorder,hasBottomBorder){var result1=this.cellIdRegExp.exec(firstCellIndex);if(!_aspxIsExists(result1)||result1.length==0)return;var containerIndex=parseInt(result1[3]);var cellIndex1=parseInt(result1[4]);var result2=this.cellIdRegExp.exec(lastCellIndex);if(!_aspxIsExists(result2)||result2.length==0)return;var cellIndex2=parseInt(result2[4]);var viewInfo=new ASPxClientVerticalAppointmentViewInfo(this.verticalViewInfo,containerIndex,cellIndex1,cellIndex2,startTime,duration,divId,startHorizontalIndex,endHorizontalIndex+1,maxIndexInGroup+1,topRelativeIndent,bottomRelativeIndent,appointmentId,hasTopBorder,hasBottomBorder,statusBackDivId,statusForeDivId,statusStartOffset,statusEndOffset);this.verticalViewInfo.AddViewInfo(viewInfo);},AddHorizontalContainer:function(containerIndex,cellCount,containerStartTime,cellsDurations,resource,cellsLocations){this.horizontalViewInfo.AddCellContainer(containerIndex,cellCount,containerStartTime,cellsDurations,resource,cellsLocations);},AddVerticalContainer:function(containerIndex,cellCount,containerStartTime,cellsDurations,resource,cellsLocations){this.verticalViewInfo.AddCellContainer(containerIndex,cellCount,containerStartTime,cellsDurations,resource,cellsLocations);},AddTimelineHeader:function(levelIndex,cellLocation,offset,baseCellLocation){if(this.timelineHeaderLevels.length==levelIndex)this.timelineHeaderLevels[levelIndex]=new ASPxClientTimelineHeaderLevelViewInfo();this.timelineHeaderLevels[levelIndex].Add(cellLocation,offset,baseCellLocation);},ShowInplaceEditor:function(){this.RaiseCallback("INPLACESHOW|");},MainDivMouseDown:function(e){var hitTestResult=this.CalcHitTest(e);if(_aspxIsExists(hitTestResult.appointmentDiv)){var appointmentViewInfo=hitTestResult.appointmentDiv.appointmentViewInfo;var appointmentId=appointmentViewInfo.appointmentId;var appointmentClickHandler=null;if(_aspxGetShiftKey(e))this.appointmentSelection.AddAppointmentToSelection(appointmentId);else if(_aspxGetCtrlKey(e))this.appointmentSelection.ChangeAppointmentSelection(appointmentId);else{if(_aspxGetIsLeftButtonPressed(e)){var appointmentDiv=hitTestResult.appointmentDiv;if(_aspxIsExists(appointmentDiv.appointmentViewInfo.adornerDiv))appointmentClickHandler=this.OnActivateInplaceEditor;}
this.appointmentSelection.SelectSingleAppointment(appointmentId);}if(!_aspxIsExists(hitTestResult.resizeDiv)&&_aspxIsExists(hitTestResult.cell)){new ASPxClientAppointmentDragHelper(this,hitTestResult.appointmentDiv,hitTestResult.cell,e,appointmentClickHandler,this);}return true;}if(!_aspxIsExists(hitTestResult.cell))return false;if(_aspxIsExists(hitTestResult.selectionDiv)&&_aspxGetIsRightButtonPressed(e))return true;if(this.CanSelect(e)){this.appointmentSelection.ClearSelection();new ASPxClientSchedulerSelectionHelper(this,hitTestResult.cell,_aspxGetShiftKey(e));}},CanSelect:function(e){var eventSource=_aspxGetEventSource(e);if(!_aspxIsExists(eventSource))return false;var id=eventSource.id;return id.indexOf("containerBlock_DXCnt")>=0||id.indexOf("commonControlsBlock_selectionDiv")>=0||id.indexOf("containerBlock_scrollableContainer")>=0;},OnActivateInplaceEditor:function(e){if(this.appointmentSelection.selectedAppointmentIds.length!=1)return;var hitTestResult=this.CalcHitTest(e);var aptDiv=hitTestResult.appointmentDiv;if(_aspxIsExists(aptDiv)){var aptFlags=this.GetAppointmentFlags(aptDiv.appointmentId);if(aptFlags!=null&&aptFlags.allowInplaceEditor)this.ShowInplaceEditor();}},LookupCellByMousePosition:function(viewInfo,e,containerIndex,firstCellIndex,lastCellIndex){var x=_aspxGetEventX(e)-_aspxGetAbsoluteX(viewInfo.parent.innerParentElement);var y=_aspxGetEventY(e)-_aspxGetAbsoluteY(viewInfo.parent.innerParentElement);return viewInfo.FindCellByPosition(containerIndex,firstCellIndex,lastCellIndex,x,y);},GetCellContainer:function(cell){var container=cell.container;if(_aspxIsExists(container))return container;InitializeCell(cell);return cell.container;},GetSmartTag:function(source){while(source!=null){if(_aspxIsExists(source.isSmartTag)&&source.isSmartTag)return source;source=_aspxGetParentNode(source);}return null;},CalcHitTest:function(e){var eventSource=_aspxGetEventSource(e);if(!_aspxIsExists(eventSource))return new HitTestResult(null,null,null);var appointmentElement=_aspxGetParentByPartialId(eventSource,this._constDXAppointment());var appointmentDiv=appointmentElement;if(_aspxIsExists(appointmentElement)&&_aspxIsExists(appointmentElement.appointmentDiv))appointmentDiv=appointmentElement.appointmentDiv;var smartTag=this.GetSmartTag(eventSource);if(!_aspxIsExists(appointmentDiv)){var aptAdornerDiv=_aspxGetParentByPartialId(eventSource,this._constDXAppointmentAdorner());if(_aspxIsExists(aptAdornerDiv))appointmentDiv=aptAdornerDiv.appointmentDiv;}else{if(!_aspxIsExists(appointmentDiv.appointmentViewInfo))appointmentDiv=null;}
var resizeDiv=null;if(_aspxIsExists(appointmentDiv))resizeDiv=_aspxGetParentByPartialId(eventSource,"ResizeControlDiv",appointmentDiv);var selectionDiv=_aspxGetParentByPartialId(eventSource,this._constDXSelectionDiv());var cell=_aspxGetParentByPartialId(eventSource,this._constDXSchedulerContentCell());if(!_aspxIsExists(cell)){var containerIndex=null;var firstCellIndex=null;var lastCellIndex=null;if(_aspxIsExists(appointmentDiv)){var viewInfo=appointmentDiv.appointmentViewInfo;containerIndex=viewInfo.containerIndex;firstCellIndex=viewInfo.visibleFirstCellIndex;lastCellIndex=viewInfo.visibleLastCellIndex;}else{if(_aspxIsExists(selectionDiv)){containerIndex=selectionDiv.container.index;firstCellIndex=0;lastCellIndex=selectionDiv.container.cellCount-1;}}
cell=this.LookupCellByMousePosition(this.horizontalViewInfo,e,containerIndex,firstCellIndex,lastCellIndex);if(!_aspxIsExists(cell))cell=this.LookupCellByMousePosition(this.verticalViewInfo,e,containerIndex,firstCellIndex,lastCellIndex);}return new ASPxSchedulerHitTestResult(cell,selectionDiv,appointmentDiv,resizeDiv,smartTag);},InitializeCell:function(cell){var result=this.cellIdRegExp.exec(cell.id);if(!_aspxIsExists(result)||result.length==0)return;var horizontalContainer=(result[2]=="h");var containerIndex=parseInt(result[3]);var cellIndex=parseInt(result[4]);if(horizontalContainer)this.horizontalViewInfo.InitializeCell(cell,containerIndex,cellIndex);else this.verticalViewInfo.InitializeCell(cell,containerIndex,cellIndex);},CanCreateCallback:function(){return this.constructor.prototype.CanCreateCallback.call(this)&&this.isReadyForCallbacks;},GetCallbackHandler:function(index){if(index<0||index>=this.funcCallbacks.length)return null;var result=this.funcCallbacks[index];this.funcCallbacks[index]=null;return result;},RegisterCallbackHandler:function(onCallback){var count=this.funcCallbacks.length;for(var i=0;i<count;i++){if(this.funcCallbacks[i]==null){this.funcCallbacks[i]=onCallback;return i;}}
this.funcCallbacks.push(onCallback);return this.funcCallbacks.length-1;},RaiseFuncCallback:function(callbackName,args,onCalback){if(!_aspxIsExists(args)||args=="")return;var id=this.RegisterCallbackHandler(onCalback);this.allowMultipleCallbacks=true;this.CreateCallback(callbackName+id.toString()+","+args);this.allowMultipleCallbacks=false;},RaiseCallback:function(args){_aspxSchedulerSmartTagHelper.HideActiveSmartTag();this.SaveScrollPositionState();if(_aspxIsExists(this.callBack)){if(!this.CanCreateCallback())return;ASPxRelatedControlManager.Shade(this);var statusInfoManager=this.statusInfoManager;if(_aspxIsExists(statusInfoManager))statusInfoManager.Clear();this.CreateCallback(args);this.isReadyForCallbacks=false;}else{ASPxControlResizeManager.Clear();aspxGetControlCollection().elements[this.name]=null;this.SendPostBack(args);}},SaveScrollPositionState:function(){var elementsId=["verticalScrollContainer","scrollableContainer"];var result="";var count=elementsId.length;for(var i=0;i<count;i++){var id=elementsId[i];var element=this.GetContainerElementById(id);if(!_aspxIsExists(element))continue;var scrollLeft=element.scrollLeft;var scrollTop=element.scrollTop;if(result.length>0)result+=",";result+="[\""+id+"\","+scrollLeft+","+scrollTop+"]";}
var element=this.GetStateElement("SCROLL");if(_aspxIsExists(element))element.value="["+result+"]";},SetScrollPosition:function(positions){if(this.isInsideBeginInit){this.deferredSetScrollPosition=positions;return;}
var count=positions.length;for(var i=0;i<count;i++){var scrollPos=positions[i];var element=this.GetContainerElementById(scrollPos[0]);if(!_aspxIsExists(element))continue;element.scrollLeft=scrollPos[1];element.scrollTop=scrollPos[2];}},PerformCallbackHandler:function(index,res){var handler=this.GetCallbackHandler(index);if(handler!=null)handler(res);},OnFuncCallback:function(result){eval(result);},OnCallback:function(result){if(result.indexOf("FB|")==0){_aspxSetTimeout("aspxSchedulerFuncCallback(\""+this.name+"\", \""+escape(result.substr(3))+"\");",0);this.isReadyForCallbacks=true;return;}
this.changedBlocks=new Object();if(typeof aspxGetDropDownCollection!="undefined"){aspxGetDropDownCollection().focusedControlName="";aspxGetDropDownCollection().droppedControlName="";}
_aspxClearSelection();this.HideCurrentPopupContainer();var element=this.GetMainElement();if(element!=null){this.DisableResize();ASPxRelatedControlManager.ParseResult(result);}},OnCallbackError:function(result){if(_aspxIsExists(this.onCallbackError))this.onCallbackError();_aspxClearSelection();ASPxRelatedControlManager.Unshade(this);this.isReadyForCallbacks=true;if(!this.NotifyCallbackError(result))alert("CALLBACK ERROR: "+result);},OnCallbackGeneralError:function(result){var length=result.length;this.OnCallbackError(length+",0|"+result);},ProcessCallbackResult:function(id,html,params){if(!this.changedBlocks.ContainerBlockChanged&&this.GetBlockElementId("containerBlock","innerContent")==id){this.changedBlocks.ContainerBlockChanged=true;this.RemoveContainerBlockChilds();}if(this.GetBlockElementId("formBlock","innerContent")==id){if(params=="#UsePrevResult"){html=this.prevCallbackResults.formBlock;params="";}else{this.prevCallbackResults.formBlock=html;}}
ASPxRelatedControlManager.ProcessCallbackResultDefault(id,html,params);if(!this.changedBlocks.AppointmentsBlockChanged&&this.GetBlockElementId("aptsBlock","innerContent")==id)this.changedBlocks.AppointmentsBlockChanged=true;if(!this.changedBlocks.NavButtonsBlockChanged&&this.GetBlockElementId("navButtonsBlock","innerContent")==id)this.changedBlocks.NavButtonsBlockChanged=true;},RemoveContainerBlockChilds:function(){this.ClearCache(this.navButtonsCache,false);this.ClearCache(this.appointmentDivCache,true);},ClearCache:function(cache,alwaysCheckParent){var parent=null;for(var divId in cache){var div=cache[divId];if(!parent||alwaysCheckParent)parent=_aspxGetParentNode(div);if(_aspxIsExists(parent)&&_aspxIsExists(parent.tagName))parent.removeChild(div);}},NotifyCallbackError:function(msg){var statusInfoManager=this.statusInfoManager;if(_aspxIsExists(statusInfoManager)){statusInfoManager.ShowExceptionInfo(msg);return true;}else return false;},SetErrorInfoRowVisibility:function(cell,visible){var row=cell.parentNode;if(_aspxIsExists(row)&&row.tagName=="TR")_aspxSetElementDisplay(row,visible);},ShowResourceNavigatorRow:function(visible){if(_aspxIsExists(this.resourceNavigatorRow)){_aspxSetElementDisplay(this.resourceNavigatorRow,visible);}},SetCheckSums:function(checkSums){var element=this.GetStateElement("CHECKSUMS");if(_aspxIsExists(element))element.value=checkSums;},KeyDown:function(e){return;var selectionHelper=this.GetSelectionHelper(_aspxGetShiftKey(e));if(aspxIsLeftKey(e)){selectionHelper.OnLeftKeyDown();}else if(aspxIsRightKey(e)){selectionHelper.OnRightKeyDown();}else if(aspxIsUpKey(e)){selectionHelper.OnTopKeyDown();}else if(aspxIsDownKey(e)){selectionHelper.OnBottomKeyDown();}},FindViewInfosByAppointmentId:function(appointmentId){var result=this.horizontalViewInfo.FindViewInfosByAppointmentId(appointmentId);return result.concat(this.verticalViewInfo.FindViewInfosByAppointmentId(appointmentId));},GetSelectionHelper:function(shiftPressed){if(shiftPressed)return new ASPxExtendSelectionHelper(this);else return new ASPxMoveSelectionHelper(this);},NavBtnClick:function(startTime,duration,resourceId){this.RaiseCallback("NVBTN|"+_aspxDateTimeToMilliseconds(startTime)+","+duration+","+resourceId);},ShowMenu:function(e,menu){if(this.activeFormType!=ASPxSchedulerFormType.None)return;menu.ShowInternal(e);e.returnValue=false;e.cancelBubble=true;},ShowViewMenu:function(sender,e){if(this.activeFormType!=ASPxSchedulerFormType.None)return;var menu=aspxGetControlCollection().Get(this.name+"_viewMenuBlock_SMVIEW");if(!_aspxIsExists(menu))return "";this.UpdateViewMenuItems(menu);this.ShowMenu(e,menu);},UpdateViewMenuItems:function(menu){this.UpdateSwitchViewSubMenu(menu);var viewType=this.GetActiveViewType();if(viewType==ASPxSchedulerViewType.Timeline){this.UpdateEnabledScalesSubMenu(menu);this.UpdateVisibleScalesSubMenu(menu);}else if(viewType==ASPxSchedulerViewType.Day||viewType==ASPxSchedulerViewType.WorkWeek)this.UpdateTimeSlotMenuItems(menu);var canShowAptForm=this.aptFormVisibility!=ASPxSchedulerFormVisibility.None;this.SetMenuItemVisibility(menu,SchedulerMenuItemId.NewAppointment,canShowAptForm);this.SetMenuItemVisibility(menu,SchedulerMenuItemId.NewAllDayEvent,canShowAptForm);this.SetMenuItemVisibility(menu,SchedulerMenuItemId.NewRecurringAppointment,canShowAptForm);this.SetMenuItemVisibility(menu,SchedulerMenuItemId.NewRecurringEvent,canShowAptForm);this.SetMenuItemVisibility(menu,SchedulerMenuItemId.GotoDate,this.gotoDateFormVisibility!=ASPxSchedulerFormVisibility.None);},SetMenuItemVisibility:function(menu,itemName,visible){var item=menu.GetItemByName(itemName);if(_aspxIsExists(item))item.SetVisible(visible);},UpdateSwitchViewSubMenu:function(menu){var subMenu=menu.GetItemByName(SchedulerMenuItemId.SwitchViewMenu);if(!_aspxIsExists(subMenu))return;var itemId=this.GetCurrentViewMenuId();var item=subMenu.GetItemByName(itemId);if(!_aspxIsExists(item))return;item.SetChecked(true);},UpdateEnabledScalesSubMenu:function(menu){var subMenu=menu.GetItemByName(SchedulerMenuItemId.TimeScaleEnable);if(!_aspxIsExists(subMenu))return;var count=subMenu.GetItemCount();for(var i=0;i<count;i++)subMenu.GetItem(i).SetChecked(this.enabledTimeScalesInfo[i]!=0);},UpdateVisibleScalesSubMenu:function(menu){var subMenu=menu.GetItemByName(SchedulerMenuItemId.TimeScaleVisible);if(!_aspxIsExists(subMenu))return;var count=subMenu.GetItemCount();for(var i=0;i<count;i++){var item=subMenu.GetItem(i);if(this.enabledTimeScalesInfo[i]!=0){item.SetEnabled(true);item.SetChecked(this.visibleTimeScalesInfo[i]!=0);}else{item.SetEnabled(false);item.SetChecked(false);}}},UpdateTimeSlotMenuItems:function(menu){var item=menu.GetItemByName(this.currentTimeScaleMenuItemName);if(!_aspxIsExists(item))return;item.SetChecked(true);},SetTimelineScalesInfo:function(enabledScales,visibleScales){this.enabledTimeScalesInfo=enabledScales;this.visibleTimeScalesInfo=visibleScales;},SetCurrentTimeScaleMenuItemName:function(name){this.currentTimeScaleMenuItemName=name;},GetCurrentViewMenuId:function(){switch(this.GetActiveViewType()){default:case ASPxSchedulerViewType.Day:return SchedulerMenuItemId.SwitchToDayView;case ASPxSchedulerViewType.WorkWeek:return SchedulerMenuItemId.SwitchToWorkWeekView;case ASPxSchedulerViewType.Week:return SchedulerMenuItemId.SwitchToWeekView;case ASPxSchedulerViewType.Month:return SchedulerMenuItemId.SwitchToMonthView;case ASPxSchedulerViewType.Timeline:return SchedulerMenuItemId.SwitchToTimelineView;}},OnViewMenuClick:function(itemName){if(this.IsClientAPIEnabled()){if(this.HandleViewMenuClickAtClientSide(itemName))return;}
this.HandleViewMenuClickAtServerSide(itemName);},IsClientAPIEnabled:function(){return _aspxIsExists(this.SetActiveViewType);},HandleViewMenuClickAtClientSide:function(itemName){switch(itemName){case SchedulerMenuItemId.SwitchToDayView:this.SetActiveViewType(ASPxSchedulerViewType.Day);return true;case SchedulerMenuItemId.SwitchToWorkWeekView:this.SetActiveViewType(ASPxSchedulerViewType.WorkWeek);return true;case SchedulerMenuItemId.SwitchToWeekView:this.SetActiveViewType(ASPxSchedulerViewType.Week);return true;case SchedulerMenuItemId.SwitchToMonthView:this.SetActiveViewType(ASPxSchedulerViewType.Month);return true;case SchedulerMenuItemId.SwitchToTimelineView:this.SetActiveViewType(ASPxSchedulerViewType.Timeline);return true;default:return false;}},HandleViewMenuClickAtServerSide:function(menuItemName){this.RaiseCallback("MNUVIEW|"+menuItemName);},OnAppointmentSmartTagClick:function(sender,e){var dataObject=null;while(sender!=null){var dataObject=sender.dataObject;if(_aspxIsExists(dataObject))break;sender=_aspxGetParentNode(sender);}if(!_aspxIsExists(dataObject))return;var appointmentId=dataObject.appointmentId;if(!this.appointmentSelection.IsAppointmentSelected(appointmentId))this.appointmentSelection.SelectSingleAppointment(appointmentId);sender.appointmentViewInfo=dataObject;if(this.appointmentSelection.IsAppointmentSelected(appointmentId))this.ShowAptMenu(sender,e);},ShowAptMenu:function(sender,e){var menu=aspxGetControlCollection().Get(this.name+"_aptMenuBlock_SMAPT");if(!_aspxIsExists(menu))return "";if(!this.UpdateAppointmentMenuItems(sender,menu))return "";this.ShowMenu(e,menu);},UpdateAppointmentMenuItems:function(sender,menu){if(!_aspxIsExists(sender.appointmentViewInfo))return;var apt=this.GetAppointment(sender.appointmentViewInfo.appointmentId);if(apt==null)return;var aptFlags=apt.flags;if(aptFlags==null)return;var canShowForm=this.aptFormVisibility!=ASPxSchedulerFormVisibility.None;var openAppointmentVisible=canShowForm&&aptFlags.allowEdit;var deleteAppointmentVisible=aptFlags.allowDelete;var labelSubMenuVisible=aptFlags.allowEdit;var statusSubMenuVisible=aptFlags.allowEdit;this.SetMenuItemVisibility(menu,SchedulerMenuItemId.OpenAppointment,openAppointmentVisible);this.SetMenuItemVisibility(menu,SchedulerMenuItemId.DeleteAppointment,deleteAppointmentVisible);this.SetMenuItemVisibility(menu,SchedulerMenuItemId.LabelSubMenu,labelSubMenuVisible);this.SetMenuItemVisibility(menu,SchedulerMenuItemId.StatusSubMenu,statusSubMenuVisible);if(aptFlags.allowEdit){this.UpdateAptSubMenu(menu,SchedulerMenuItemId.LabelSubMenu,apt.labelIndex);this.UpdateAptSubMenu(menu,SchedulerMenuItemId.StatusSubMenu,apt.statusIndex);}
var aptType=apt.appointmentType;var isRecurring=aptType!=ASPxAppointmentType.Normal;var editSeriesVisible=canShowForm&&aptFlags.allowEdit&&isRecurring;this.SetMenuItemVisibility(menu,SchedulerMenuItemId.EditSeries,editSeriesVisible);var isException=(aptType==ASPxAppointmentType.ChangedOccurrence||aptType==ASPxAppointmentType.DeletedOccurrence);var restoreOccurrenceVisible=aptFlags.allowEdit&&isException;this.SetMenuItemVisibility(menu,SchedulerMenuItemId.RestoreOccurrence,restoreOccurrenceVisible);var count=menu.GetItemCount();for(var i=0;i<count;i++){if(menu.GetItemVisible(i))return true;}return false;},UpdateAptSubMenu:function(menu,subMenuName,subMenuItemIndex){var subMenu=menu.GetItemByName(subMenuName);if(!_aspxIsExists(subMenu))return;var item=subMenu.GetItem(subMenuItemIndex);if(_aspxIsExists(item))item.SetChecked(true);},OnAptMenuClick:function(itemName){this.HandleAptMenuClickAtServerSide(itemName);},HandleAptMenuClickAtServerSide:function(itemName){this.RaiseCallback("MNUAPT|"+itemName);}});ASPxClientTimeInterval=_aspxCreateClass(null,{constructor:function(start,duration){this.start=start;this.duration=duration;this.end=_aspxDateIncrease(start,duration);},ToString:function(){return _aspxDateTimeToMilliseconds(this.start)+","+this.duration;},GetStart:function(){return this.start;},GetDuration:function(){return this.duration;},GetEnd:function(){return this.end;},SetStart:function(newStartTime){this.duration-=newStartTime-this.start;this.start=newStartTime;},SetDuration:function(newDuration){this.duration=newDuration;this.end=_aspxDateIncrease(start,duration);},SetEnd:function(newEndTime){this.duration+=newEndTime-this.end;this.end=newEndTime;},Equals:function(interval){if(_aspxIsExists(interval)&&_aspxIsExists(interval.start)&&_aspxIsExists(interval.end))return(interval.start-this.start)==0&&(interval.end-this.end)==0;else return false;},IntersectsWith:function(interval){return(interval.start-this.start)>=0&&(interval.end-this.end)<=0;},IntersectsWithExcludingBounds:function(interval){if(this.duration==0&&interval.duration==0&&interval.start-this.start==0)return true;return(interval.end-this.start)>0&&(interval.start-this.end)<0;},Contains:function(interval){if(interval==null)return false;return interval.start>=this.start&&interval.end<=this.end;}}); 