ASPxSchedulerFormType=_aspxCreateClass(null,{});ASPxSchedulerFormType.None="None",ASPxSchedulerFormType.Appointment="Appointment",ASPxSchedulerFormType.AppointmentInplace="AppointmentInplace",ASPxSchedulerFormType.GotoDate="GotoDate";ASPxSchedulerFormVisibility=_aspxCreateClass(null,{});ASPxSchedulerFormVisibility.None="None",ASPxSchedulerFormVisibility.PopupWindow="PopupWindow",ASPxSchedulerFormVisibility.FillControlArea="FillControlArea";ASPxSchedulerSmartTagType=_aspxCreateClass(null,{});ASPxSchedulerSmartTagType.Appointment=1;ASPxSchedulerSmartTagType.Selection=2;ASPxSchedulerDateTimeHelper=_aspxCreateClass(null,{});ASPxSchedulerDateTimeHelper.DaySpan=24*60*60*1000;ASPxSchedulerDateTimeHelper.TruncToDate=function(dateTime){return new Date(dateTime.getFullYear(),dateTime.getMonth(),dateTime.getDate());}
ASPxSchedulerUtils=_aspxCreateClass(null,{});ASPxSchedulerUtils.IsAppointmentResourcesEmpty=function(appointmentResources){if(appointmentResources.length==0)return true;if(appointmentResources.length==1&&appointmentResources[0]=="null")return true;else return false;}
ASPxClientSchedulerRelatedControlBase=_aspxCreateClass(ASPxClientControl,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.schedulerControlId="";this.standalone=true;},GetMainElement:function(){if(!_aspxIsExistsElement(this.mainElement))this.mainElement=_aspxGetElementById(this.name+"_mainCell");return this.mainElement;},CreateLoadingDiv:function(parentNode,offsetNode){if(this.standalone)return this.constructor.prototype.CreateLoadingDiv.call(this,parentNode,offsetNode);return null;},GetLoadingDiv:function(){return _aspxGetElementById(this.schedulerControlId+"_LD");}});function aspxSchedulerSetRecurrenceControlsVisibility(controlsIds,recurrenceControlContainerId,visibleIndex){var count=controlsIds.length;for(var i=0;i<count;i++){var ctl=_aspxGetElementById(controlsIds[i]);if(_aspxIsExistsElement(ctl)){_aspxSetElementDisplay(ctl,visibleIndex==i);}}
var container=_aspxGetElementById(recurrenceControlContainerId);if(_aspxIsExists(container.rbcControlsSizeCorrected)){if(container.rbcControlsSizeCorrected[visibleIndex])return;}else{container.rbcControlsSizeCorrected=[];}
container.rbcControlsSizeCorrected[visibleIndex]=true;if(_aspxIsExistsElement(container))aspxGetControlCollection().AdjustControls(container,__aspxCheckSizeCorrectedFlag);}
function aspxSchedulerChangeElementVisibility(id){var ctl=_aspxGetElementById(id);if(_aspxIsExistsElement(ctl))_aspxSetElementDisplay(ctl,!_aspxGetElementDisplay(ctl));}
function _aspxArrayClone(src){return new Array(src);}
function _aspxArrayContains(array,element){return _aspxArrayIndexOf(array,element)>=0;}
function _aspxArrayEqual(array1,array2){var count1=array1.length;var count2=array2.length;if(count1!=count2)return false;for(var i=0;i<count1;i++)if(array1[i]!=array2[i])return false;return true;}
ASPxSchedulerMeasurer={SetCustomDateHeaderContent:function(headers,dates,headerCaptions,headerToolTips){var count=headers.length;if(count<=0)return;this.EnsureFormatter();this.formatter.SetFormatString("d MMMM yyyy");var toolTipHelper=new ASPxSchedulerSimpleToolTipHelper(headerToolTips);for(var i=0;i<count;i++){var header=headers[i];var toolTip=toolTipHelper.GetToolTip(i,this.formatter.Format(dates[i]));header.setAttribute("title",toolTip);header.innerHTML=headerCaptions[i];}},SetCustomDayOfWeekHeaderContent:function(headers,days,headerCaptions,headerToolTips){var count=headers.length;if(count<=0)return;this.EnsureFormatter();this.formatter.SetFormatString("d MMMM yyyy");var toolTipHelper=new ASPxSchedulerSimpleToolTipHelper(headerToolTips);for(var i=0;i<count;i++){var header=headers[i];var toolTip=toolTipHelper.GetToolTip(i,this.GetDayName(days[i]));header.setAttribute("title",toolTip);header.innerHTML=headerCaptions[i];}},SetOptimalDayNumberHeaderContent:function(headers,dates,formats,headerToolTips){var count=headers.length;if(count<=0)return;this.EnsureFormatter();var toolTipHelper=new ASPxSchedulerSimpleToolTipHelper(headerToolTips);this.formatter.SetFormatString("d MMMM yyyy");for(var i=0;i<count;i++){var header=headers[i];var toolTip=toolTipHelper.GetToolTip(i,this.formatter.Format(dates[i]));header.setAttribute("title",toolTip);header.innerHTML=dates[i].getDate();}},SetOptimalDayOfWeekHeadersContent:function(headers,days,headerToolTips){if(headers.length<=0)return;if(count<=0)return;var toolTipHelper=new ASPxSchedulerSimpleToolTipHelper(headerToolTips);this.EnsureFormatter();var measureDiv=this.CreateMeasureDiv(headers[0]);var headerTexts=[];var headerContentWidths=[];var count=headers.length;for(var i=0;i<count;i++){var day=days[i];var toolTip=toolTipHelper.GetToolTip(i,this.GetDayName(day));this.SetOptimalDayOfWeekHeader(headers[i],day,measureDiv,toolTip);}
document.body.removeChild(measureDiv);},SetOptimalDayOfWeekHeader:function(header,day,measureDiv,toolTip){var fullDayName=this.GetDayName(day);measureDiv.innerHTML=fullDayName;var width=measureDiv.clientWidth;var desiredWidth=header.clientWidth;if(width<=desiredWidth)header.innerHTML=fullDayName;else header.innerHTML=this.GetAbbrDayName(day);header.setAttribute("title",toolTip);},GetDayName:function(day){var dayNames=__aspxCultureInfo.dayNames;return(day==8)?dayNames[6]+"/"+dayNames[0]:dayNames[day];},GetAbbrDayName:function(day){var dayNames=__aspxCultureInfo.abbrDayNames;return(day==8)?dayNames[6]+"/"+dayNames[0]:dayNames[day];},SetOptimalHeadersContent:function(headers,dates,formats,headerToolTips){if(headers.length<=0)return;this.EnsureFormatter();var measureDiv=this.CreateMeasureDiv(headers[0]);var headerTexts=[];var headerContentWidths=[];this.InitializeHeadersIntermediateInfo(headers,headerTexts,headerContentWidths);var count=formats.length;for(var i=count-1;i>=0;i--){this.formatter.SetFormatString(formats[i]);this.SetOptimalHeadersContentCore(headers,dates,headerTexts,headerContentWidths,measureDiv);}
this.SetNewHeadersContent(headers,headerTexts,dates,headerToolTips);document.body.removeChild(measureDiv);},InitializeHeadersIntermediateInfo:function(headers,headerTexts,headerContentWidths){var count=headers.length;for(var i=0;i<count;i++){_aspxArrayPush(headerTexts,"&hellip;");_aspxArrayPush(headerContentWidths,-1);}},SetNewHeadersContent:function(headers,headerTexts,dates,headerToolTips){var toolTipHelper=new ASPxSchedulerSimpleToolTipHelper(headerToolTips);var count=headers.length;this.formatter.SetFormatString("d MMMM yyyy");for(var i=0;i<count;i++){var header=headers[i];var toolTip=toolTipHelper.GetToolTip(i,this.formatter.Format(dates[i]));header.setAttribute("title",toolTip);header.innerHTML=headerTexts[i];}},SetOptimalHeadersContentCore:function(headers,dates,headerTexts,headerContentWidths,measureDiv){var count=headers.length;for(var i=count-1;i>=0;i--){var text=this.formatter.Format(dates[i]);measureDiv.innerHTML=text;var width=measureDiv.clientWidth;var desiredWidth=headers[i].clientWidth;if(width<=desiredWidth){if(width>=headerContentWidths[i]){headerContentWidths[i]=width;headerTexts[i]=text;}}}},CreateMeasureDiv:function(element){var result=document.createElement("div");document.body.appendChild(result);result.style.cssText=element.style.cssText;result.style.position="absolute";result.style.top="-100px";result.style.width="";result.className=element.className;return result;},EnsureFormatter:function(){if(!_aspxIsExists(this.formatter))this.formatter=new ASPxDateFormatter();}}
ASPxSchedulerSimpleToolTipHelper=_aspxCreateClass(null,{constructor:function(toolTips){this.toolTips=toolTips;this.useToolTipFromServer=_aspxIsExists(toolTips);},GetToolTip:function(toolTipIndex,defaultToolTip){if(this.useToolTipFromServer)return this.toolTips[toolTipIndex];return defaultToolTip;}});function _aspxSetSchedulerDivDisplay(appointmentDiv,visible){appointmentDiv.style.display=visible?"block":"none";}
function aspxSchedulerSelectView(name,view){var schedulerViewSelector=aspxGetControlCollection().Get(name);if(_aspxIsExists(schedulerViewSelector))schedulerViewSelector.SelectView(view);}
ASPxClientSchedulerViewSelector=_aspxCreateClass(ASPxClientSchedulerRelatedControlBase,{SelectView:function(view){var schedulerControl=aspxGetControlCollection().Get(this.schedulerControlId);if(_aspxIsExists(schedulerControl))schedulerControl.SetActiveViewType(view);}});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();},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);},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(var 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="";},AppendChildToLayer:function(child,layer){layer.appendChild(child);},AppendChildToNavButtonLayer:function(child,layer){if(!_aspxIsExists(layer))layer=this.navButtonLayer;if(child.parentNode!=layer)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.MoreButtonClicked=new ASPxClientEvent();this.AppointmentsSelectionChanged=new ASPxClientEvent();this.isInsideBeginInit=false;this.isReadyForCallbacks=false;this.changedBlocks=null;this.isCallbackMode=true;this.menuManager=new ASPxSchedulerMenuManager(this);this.activeFormType=ASPxSchedulerFormType.None;this.aptFormVisibility=ASPxSchedulerFormVisibility.None;this.gotoDateFormVisibility=ASPxSchedulerFormVisibility.None;this.recurrentAppointmentDeleteFormVisibility=ASPxSchedulerFormVisibility.None;this.allowMultipleCallbacks=false;this.privateAllowAppointmentMultiSelect=true;this.privateShowAllAppointmentsOnTimeCells=false;this.contextMenuHandlers=[];this.prevCallbackResults=new Object();this.funcCallbacks=new Array();this.appointmentSmartTagEnabled=true;this.selectionSmartTagEnabled=true;this.funcCallbackCount=0;},_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(){this.reminderUpTimeDelay=null;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.ClearNavigationButtons();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.smartTagDiv.smartTagType=ASPxSchedulerSmartTagType.Selection;}
this.appointmentSmartTagDiv=_aspxGetElementById(this.name+"_commonControlsBlock_appointmentSmartTagDiv_mainDiv");if(_aspxIsExists(this.appointmentSmartTagDiv)){this.appointmentSmartTagDiv.aspxParentControl=this;this.appointmentSmartTagDiv.smartTagType=ASPxSchedulerSmartTagType.Appointment;}
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();this.HideLoadingPanel();this.RaiseClientEvents();this.isReadyForCallbacks=true;this.SetReminderTimer();},SetReminders:function(delay){this.reminderUpTimeDelay=delay;this.reminderTimerId=null;this.enableReminderTimer=true;this.suspendedCallAspxReminderAlerted=false;},SetReminderTimer:function(){if(this.reminderUpTimeDelay==null)return;this.reminderTimerId=_aspxSetTimeout("aspxReminderAlerted("+'"'+this.name+'")',this.reminderUpTimeDelay);},ClearReminderTimer:function(){if(this.reminderTimerId!=null){_aspxClearTimer(this.reminderTimerId);this.reminderTimerId=null;}},DisableReminderTimer:function(){this.enableReminderTimer=false;},EnableReminderTimer:function(){this.enableReminderTimer=true;if(this.suspendedCallAspxReminderAlerted){this.suspendedCallAspxReminderAlerted=false;aspxReminderAlerted(this.name);}},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.parentNode)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.datesForFormatsWithoutYearToolTips,this.datesForFormatsWithoutYearLocations,this.datesForFormatsWithoutYear,this.formatsWithoutYear,ASPxSchedulerMeasurer.SetOptimalHeadersContent);this.FormatHeadersContentOptimallyCore(this.datesForFormatsWithoutYearAndWeekDayToolTips,this.datesForFormatsWithoutYearAndWeekDayLocations,this.datesForFormatsWithoutYearAndWeekDay,this.formatsWithoutYearAndWeekDay,ASPxSchedulerMeasurer.SetOptimalHeadersContent);this.FormatHeadersContentOptimallyCore(this.datesForFormatsNewYearLocationsToolTips,this.datesForFormatsNewYearLocations,this.datesForFormatsNewYear,this.formatsNewYear,ASPxSchedulerMeasurer.SetOptimalHeadersContent);this.FormatHeadersContentOptimallyCore(this.daysForDayOfWeekFormatsLocationsToolTips,this.daysForDayOfWeekFormatsLocations,this.daysForDayOfWeekFormats,null,ASPxSchedulerMeasurer.SetOptimalDayOfWeekHeadersContent);this.FormatHeadersContentOptimallyCore(this.datesForDayNumberFormatToolTips,this.datesForDayNumberFormatLocations,this.datesForDayNumberFormat,null,ASPxSchedulerMeasurer.SetOptimalDayNumberHeaderContent);this.FormatHeadersContentOptimallyCore(this.datesForDateCustomFormatToolTips,this.datesForDateCustomFormatLocations,this.datesForDateCustomFormat,this.datesForDateCustomFormatCaptions,ASPxSchedulerMeasurer.SetCustomDateHeaderContent);this.FormatHeadersContentOptimallyCore(this.datesForDayOfWeekCustomFormatToolTips,this.datesForDayOfWeekCustomFormatLocations,this.datesForDayOfWeekCustomFormat,this.datesForDayOfWeekCustomFormatCaptions,ASPxSchedulerMeasurer.SetCustomDayOfWeekHeaderContent);},ClearDatesForFormats:function(){delete this.datesForFormatsWithoutYearLocations;delete this.datesForFormatsWithoutYearAndWeekDayLocations;delete this.datesForFormatsNewYearLocations;delete this.daysForDayOfWeekFormatsLocations;delete this.datesForDayNumberFormatLocations;delete this.datesForDateCustomFormatLocations;delete this.datesForDayOfWeekCustomFormatLocations;},FormatHeadersContentOptimallyCore:function(headerToolTips,headerLocations,dates,formats,delegate){if(_aspxIsExists(headerLocations)){var headers=this.GetHeadersByLocation(headerLocations);if(headers.length>0&&_aspxIsExists(dates))delegate.call(ASPxSchedulerMeasurer,headers,dates,formats,headerToolTips);}},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;},ClearNavigationButtons:function(){if(_aspxIsExists(this.navButtons)){var count=this.navButtons.length;for(var i=0;i<count;i++)this.ClearNavigationButton(this.navButtons[i]);}
this.navButtons=new Array();},ClearNavigationButton:function(navBtn){var navBtnDiv=this.GetNavButtonElementById(navBtn.divId);if(!_aspxIsExists(navBtnDiv)||!_aspxIsExists(navBtnDiv.parentNode))return;var parent=navBtnDiv.parentNode;parent.removeChild(navBtnDiv);},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=verticalContainer.parentNode.parentNode;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==ASPxSchedulerViewType.Timeline&&activeGroup!=ASPxSchedulerGroupType.None)return true;if((activeView==ASPxSchedulerViewType.Week||activeView==ASPxSchedulerViewType.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;if(cell.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]);if(__aspxFirefox3)this.ExactingSyncDayViewHeadersWithColumns();masterRow.style.display="none";},ExactingSyncDayViewHeadersWithColumns:function(){var tryCount=0;while(tryCount<5){if(this.ExactingSyncDayViewHeadersWithColumnsCore())break;tryCount++;}},ExactingSyncDayViewHeadersWithColumnsCore:function(){var masterRow=this.vertTable.rows[this.syncMasterRowIndex];var slaveRow=this.horzTable.rows[this.syncSlaveRowIndex];var isSyncSuccess=true;for(var i=1;i<this.syncColumnCount;i++){var delta=slaveRow.cells[i].offsetLeft-masterRow.cells[i].offsetLeft;if(delta==0)continue;slaveRow.cells[i-1].style.width=slaveRow.cells[i-1].offsetWidth-delta+"px";isSyncSuccess=false;}return isSyncSuccess;},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();},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).GetStart();},GetCellDuration:function(cell){return this.GetCellInterval(cell).GetDuration();},GetCellEndTime:function(cell){return this.GetCellInterval(cell).GetEnd();},GetCellResource:function(cell){var resource=cell.resource;if(_aspxIsExists(resource))return resource;else{this.InitializeCell(cell);return cell.resource;}},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);this.EnableReminderTimer();}},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);if(_aspxIsExists(mainElement.parentNode))mainElement.parentNode.removeChild(mainElement);this.currentPopupContainer=null;}},ShowFormPopupWindow:function(popupId){if(_aspxIsExists(this.currentPopupContainer)){this.DisableReminderTimer();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){if(_aspxIsExists(this.currentPopupContainer)){this.DisableReminderTimer();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()){if(!_aspxIsExists(contentDiv.parentNode))return;contentDiv.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=htmlParent.parentNode;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){this.appointmentSelection.BeginUpdate();var count=appointmentIds.length;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;var ctrlKeyPressed=_aspxGetCtrlKey(e);if(_aspxGetShiftKey(e))this.appointmentSelection.AddAppointmentToSelection(appointmentId);else{if(!ctrlKeyPressed){if(_aspxGetIsLeftButtonPressed(e)){var appointmentDiv=hitTestResult.appointmentDiv;if(_aspxIsExists(appointmentDiv.appointmentViewInfo.adornerDiv))appointmentClickHandler=this.OnActivateInplaceEditor;}
this.appointmentSelection.SelectSingleAppointment(appointmentId);}else{if(!this.appointmentSelection.IsAppointmentSelected(appointmentId))this.appointmentSelection.AddAppointmentToSelection(appointmentId);else appointmentClickHandler=function(){this.appointmentSelection.ChangeAppointmentSelection(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;this.InitializeCell(cell);return cell.container;},GetSmartTag:function(source){while(source!=null){if(_aspxIsExists(source.isSmartTag)&&source.isSmartTag)return source;source=source.parentNode;}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(){if(!this.isReadyForCallbacks){return false;}if(this.constructor.prototype.CanCreateCallback.call(this)){return true;}return this.funcCallbackCount==this.requestCount&&this.funcCallbackCount>0;},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){this.funcCallbackCount++;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;},ClearFuncCallbacks:function(){var count=this.funcCallbacks.length;for(var i=0;i<count;i++){if(this.funcCallbacks[i]!=null){this.funcCallbacks[i]=aspxSchedulerEmptyFuncCallbackHandler;}}},HideLoadingPanelOnCallback:function(){return false;},RaiseFuncCallback:function(callbackName,args,onCallback){if(!_aspxIsExists(args)||args=="")return;this.ClearReminderTimer();this.allowMultipleCallbacks=true;if(this.CanCreateCallback()){var id=this.RegisterCallbackHandler(onCallback);this.CreateCallback(callbackName+id.toString()+","+args);}
this.allowMultipleCallbacks=false;},RaiseCallback:function(args){this.ClearReminderTimer();_aspxSchedulerSmartTagHelper.HideActiveSmartTag();this.SaveScrollPositionState();if(_aspxIsExists(this.callBack)&&this.isCallbackMode){if(!this.CanCreateCallback())return;this.ShowLoadingPanel();var statusInfoManager=this.statusInfoManager;if(_aspxIsExists(statusInfoManager))statusInfoManager.Clear();this.CreateCallback(args);this.ClearFuncCallbacks();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){this.funcCallbackCount--;_aspxSetTimeout("aspxSchedulerFuncCallback(\""+this.name+"\", \""+escape(result.substr(3))+"\");",0);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,data){if(_aspxIsExists(this.onCallbackError))this.onCallbackError();_aspxClearSelection();this.HideLoadingPanel();this.isReadyForCallbacks=true;if(!this.NotifyCallbackError(result))alert("CALLBACK ERROR: "+result);},OnCallbackGeneralError:function(result){var length=result.length;this.OnCallbackError(length+",0|"+result,null);},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;this.ClearNavigationButtons();}},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=div.parentNode;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;},FindViewInfosByAppointmentId:function(appointmentId){var result=this.horizontalViewInfo.FindViewInfosByAppointmentId(appointmentId);return result.concat(this.verticalViewInfo.FindViewInfosByAppointmentId(appointmentId));},NavBtnClick:function(startTime,duration,resourceId){this.RaiseCallback("NVBTN|"+_aspxDateTimeToMilliseconds(startTime)+","+duration+","+resourceId);},SetTimelineScalesInfo:function(enabledScales,visibleScales){this.enabledTimeScalesInfo=enabledScales;this.visibleTimeScalesInfo=visibleScales;},SetCurrentTimeScaleMenuItemName:function(name){this.currentTimeScaleMenuItemName=name;},CanShowSmartTag:function(dataObject,smartTagDiv){switch(smartTagDiv.smartTagType){case ASPxSchedulerSmartTagType.Selection:return this.CanShowSelectionSmartTag(dataObject,smartTagDiv);case ASPxSchedulerSmartTagType.Appointment:return this.CanShowAptSmartTag(dataObject,smartTagDiv);default:return false;}},CanShowSelectionSmartTag:function(dataObject,smartTagDiv){if(!this.selectionSmartTagEnabled)return false;return this.menuManager.PrepareViewMenu()!=null;},CanShowAptSmartTag:function(dataObject,smartTagDiv){if(!this.appointmentSmartTagEnabled)return false;return this.menuManager.PrepareAptMenu(dataObject,smartTagDiv.appointmentViewInfo);},OnAppointmentSmartTagClick:function(sender,e){var dataObject=null;while(sender!=null){var dataObject=sender.dataObject;if(_aspxIsExists(dataObject))break;sender=sender.parentNode;}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.menuManager.ShowAptMenu(sender,e);}});ASPxSchedulerMenuManager=_aspxCreateClass(null,{constructor:function(scheduler){this.scheduler=scheduler;},OnAptMenuClick:function(itemName){this.HandleAptMenuClickAtServerSide(itemName);},OnViewMenuClick:function(itemName){if(this.IsClientAPIEnabled()){if(this.HandleViewMenuClickAtClientSide(itemName))return;}
this.HandleViewMenuClickAtServerSide(itemName);},PrepareAptMenu:function(appointmentViewInfo){var menu=aspxGetControlCollection().Get(this.scheduler.name+"_aptMenuBlock_SMAPT");if(!_aspxIsExists(menu))return null;if(!this.UpdateAppointmentMenuItems(appointmentViewInfo,menu))return null;return menu;},ShowAptMenu:function(sender,e){var menu=this.PrepareAptMenu(sender.appointmentViewInfo);if(menu)this.ShowMenu(e,menu);},PrepareViewMenu:function(){var menu=aspxGetControlCollection().Get(this.scheduler.name+"_viewMenuBlock_SMVIEW");if(!_aspxIsExists(menu))return null;this.UpdateViewMenuItems(menu);return menu;},ShowViewMenu:function(sender,e){var menu=this.PrepareViewMenu();if(menu)this.ShowMenu(e,menu);},ShowMenu:function(e,menu){if(this.scheduler.activeFormType!=ASPxSchedulerFormType.None)return;menu.ShowInternal(e);e.returnValue=false;e.cancelBubble=true;},HideMenu:function(e,menu){ASPxClientMenuBase.GetMenuCollection().HideAll();},HandleAptMenuClickAtServerSide:function(itemName){this.scheduler.RaiseCallback("MNUAPT|"+itemName);},HandleViewMenuClickAtClientSide:function(itemName){switch(itemName){case SchedulerMenuItemId.SwitchToDayView:this.scheduler.SetActiveViewType(ASPxSchedulerViewType.Day);return true;case SchedulerMenuItemId.SwitchToWorkWeekView:this.scheduler.SetActiveViewType(ASPxSchedulerViewType.WorkWeek);return true;case SchedulerMenuItemId.SwitchToWeekView:this.scheduler.SetActiveViewType(ASPxSchedulerViewType.Week);return true;case SchedulerMenuItemId.SwitchToMonthView:this.scheduler.SetActiveViewType(ASPxSchedulerViewType.Month);return true;case SchedulerMenuItemId.SwitchToTimelineView:this.scheduler.SetActiveViewType(ASPxSchedulerViewType.Timeline);return true;default:return false;}},HandleViewMenuClickAtServerSide:function(menuItemName){this.scheduler.RaiseCallback("MNUVIEW|"+menuItemName);},IsClientAPIEnabled:function(){return _aspxIsExists(this.scheduler.SetActiveViewType);},UpdateAppointmentMenuItems:function(appointmentViewInfo,menu){if(!_aspxIsExists(appointmentViewInfo))return;var apt=this.scheduler.GetAppointment(appointmentViewInfo.appointmentId);if(apt==null)return;var aptFlags=apt.flags;if(aptFlags==null)return;var canShowForm=this.scheduler.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++){var menuItem=menu.GetItem(i);if(menuItem.GetVisible())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);},UpdateViewMenuItems:function(menu){this.UpdateSwitchViewSubMenu(menu);var viewType=this.scheduler.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.scheduler.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.scheduler.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.scheduler.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.scheduler.enabledTimeScalesInfo[i]!=0){item.SetEnabled(true);item.SetChecked(this.scheduler.visibleTimeScalesInfo[i]!=0);}else{item.SetEnabled(false);item.SetChecked(false);}}},UpdateTimeSlotMenuItems:function(menu){var item=menu.GetItemByName(this.scheduler.currentTimeScaleMenuItemName);if(!_aspxIsExists(item))return;item.SetChecked(true);},GetCurrentViewMenuId:function(){switch(this.scheduler.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;}}});function aspxSchedulerShowViewMenu(name,sender,evt){evt=_aspxGetEvent(evt);var scheduler=aspxGetControlCollection().Get(name);if(scheduler!=null)scheduler.menuManager.ShowViewMenu(sender,evt);}
function aspxSchedulerShowAptMenu(name,sender,evt){evt=_aspxGetEvent(evt);var scheduler=aspxGetControlCollection().Get(name);if(scheduler!=null)scheduler.menuManager.ShowAptMenu(sender,evt);evt.returnValue=false;evt.cancelBubble=true;}
function aspxSchedulerAppointmentSmartTagClickMenu(name,sender,evt){var scheduler=aspxGetControlCollection().Get(name);if(scheduler!=null){scheduler.OnAppointmentSmartTagClick(sender,evt);}}
function aspxSchedulerGetSchedulerFromMenu(menu){if(menu==null)return null;var pos=menu.name.lastIndexOf("_");if(pos<0)return null;var name=menu.name.substring(0,pos);pos=name.lastIndexOf("_");if(pos>-1)return aspxGetControlCollection().Get(menu.name.substring(0,pos));return null;}
function aspxSchedulerOnViewMenuClick(s,args){var scheduler=aspxSchedulerGetSchedulerFromMenu(s);if(scheduler!=null){if(args.item.GetItemCount()<=0)scheduler.menuManager.OnViewMenuClick(args.item.name);}}
function aspxSchedulerOnAptMenuClick(s,args){var scheduler=aspxSchedulerGetSchedulerFromMenu(s);if(scheduler!=null){if(args.item.GetItemCount()<=0)scheduler.menuManager.OnAptMenuClick(args.item.name);}}
ASPxClientTimeInterval=_aspxCreateClass(null,{constructor:function(start,duration){this.start=start;this.duration=duration;this.end=_aspxDateIncreaseWithUtcOffset(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-=_aspxDateSubsWithTimezone(newStartTime,this.start);this.start=newStartTime;},SetDuration:function(newDuration){this.duration=newDuration;this.end=_aspxDateIncreaseWithUtcOffset(this.start,this.duration);},SetEnd:function(newEndTime){this.duration+=_aspxDateSubsWithTimezone(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;},IsSmallerThanDay:function(){return this.duration<ASPxSchedulerDateTimeHelper.DaySpan;},IsDurationEqualToDay:function(){return this.duration==ASPxSchedulerDateTimeHelper.DaySpan;},IsZerroDurationInterval:function(){return this.duration==0;},Clone:function(){return new ASPxClientTimeInterval(this.start,this.duration);}});var ASPxClientSchedulerRefreshAction=_aspxCreateClass(null,{});ASPxClientSchedulerRefreshAction.None=0;ASPxClientSchedulerRefreshAction.VisibleIntervalChanged=1;ASPxClientScheduler.prototype.GetActiveViewType=function(){return this.privateActiveViewType;}
ASPxClientScheduler.prototype.SetActiveViewType=function(newViewType){var activeViewType=this.GetActiveViewType();if(activeViewType==newViewType)return;if(this.RaiseActiveViewChanging(activeViewType,newViewType))this.RaiseCallback("SAVT|"+newViewType);}
ASPxClientScheduler.prototype.Refresh=function(refreshAction){var args="";if(_aspxIsExists(refreshAction))args=refreshAction;this.RaiseCallback("REFRESH|"+args);}
ASPxClientScheduler.prototype.GetGroupType=function(){return this.privateGroupType;}
ASPxClientScheduler.prototype.SetGroupType=function(groupType){this.RaiseCallback("SVGT|"+groupType);}
ASPxClientScheduler.prototype.GotoToday=function(){this.RaiseCallback("GOTODAY|");}
ASPxClientScheduler.prototype.GotoDate=function(date){var ms=date.valueOf()-60000*date.getTimezoneOffset();this.RaiseCallback("GOTODATE|"+ms);}
ASPxClientScheduler.prototype.NavigateBackward=function(){this.RaiseCallback("BACK|");}
ASPxClientScheduler.prototype.NavigateForward=function(){this.RaiseCallback("FORWARD|");}
ASPxClientScheduler.prototype.ShiftVisibleIntervals=function(offsetInDays){this.RaiseCallback("OFFSETVISI|"+offsetInDays);}
ASPxClientScheduler.prototype.SetVisibleDays=function(days){this.RaiseCallback("SETVISDAYS|"+days);}
ASPxClientScheduler.prototype.ChangeTimeZoneId=function(tzi){this.RaiseCallback("TZI|"+tzi);}
ASPxClientScheduler.prototype.GetSelectedInterval=function(){return this.selection.interval;}
ASPxClientScheduler.prototype.GetSelectedResource=function(){return this.selection.resource;}
ASPxClientScheduler.prototype.GetAppointmentById=function(id){return this.GetAppointment(id);}
ASPxClientScheduler.prototype.GetSelectedAppointmentIds=function(){return this.appointmentSelection.selectedAppointmentIds;}
ASPxClientScheduler.prototype.GetAppointmentProperties=function(aptId,propertyNames,onCallBack){this.RaiseFuncCallback("APTDATA|",aptId+","+propertyNames,onCallBack);}
ASPxClientScheduler.prototype.ShowAppointmentFormByClientId=function(aptClientId){this.RaiseCallback("EDTFRMSHOW|"+aptClientId);}
ASPxClientScheduler.prototype.ShowAppointmentFormByServerId=function(aptServerId){this.RaiseCallback("EDTFRMSHOWSID|"+aptServerId);}
ASPxClientScheduler.prototype.ShowLoadingPanel=function(){ASPxRelatedControlManager.Shade(this);}
ASPxClientScheduler.prototype.HideLoadingPanel=function(){ASPxRelatedControlManager.Unshade(this);}
ASPxClientScheduler.prototype.RaiseActiveViewChanging=function(oldView,newView){if(!this.ActiveViewChanging.IsEmpty()){var args=new ActiveViewChangingEventArgs(oldView,newView);this.ActiveViewChanging.FireEvent(this,args);return!args.cancel;}else return true;}
ASPxClientScheduler.prototype.RaiseActiveViewChanged=function(){if(!this.ActiveViewChanged.IsEmpty()){var args=new ASPxClientEventArgs();this.ActiveViewChanged.FireEvent(this,args);}}
ASPxClientScheduler.prototype.RaiseAppointmentsSelectionChanged=function(selectedAppointmentIds){if(!this.AppointmentsSelectionChanged.IsEmpty()){var args=new AppointmentsSelectionEventArgs(selectedAppointmentIds);this.AppointmentsSelectionChanged.FireEvent(this,args);}}
ASPxClientScheduler.prototype.RaiseSelectionChanged=function(){if(!this.SelectionChanged.IsEmpty()){var args=new ASPxClientEventArgs();this.SelectionChanged.FireEvent(this,args);}}
ASPxClientScheduler.prototype.RaiseVisibleIntervalChanged=function(){if(!this.VisibleIntervalChanged.IsEmpty()){var args=new ASPxClientEventArgs();this.VisibleIntervalChanged.FireEvent(this,args);}}
ASPxClientScheduler.prototype.RaiseMoreButtonClickedEvent=function(args){if(!this.MoreButtonClicked.IsEmpty())this.MoreButtonClicked.FireEvent(this,args);}
ASPxSchedulerViewType=_aspxCreateClass(null,{});ASPxSchedulerViewType.Day="Day";ASPxSchedulerViewType.WorkWeek="WorkWeek";ASPxSchedulerViewType.Week="Week";ASPxSchedulerViewType.Month="Month";ASPxSchedulerViewType.Timeline="Timeline";ASPxSchedulerGroupType=_aspxCreateClass(null,{});ASPxSchedulerGroupType.None="None";ASPxSchedulerGroupType.Date="Date";ASPxSchedulerGroupType.Resource="Resource";ASPxAppointmentType=_aspxCreateClass(null,{});ASPxAppointmentType.Normal="Normal";ASPxAppointmentType.Pattern="Pattern";ASPxAppointmentType.Occurrence="Occurrence",ASPxAppointmentType.ChangedOccurrence="ChangedOccurrence",ASPxAppointmentType.DeletedOccurrence="DeletedOccurrence";AppointmentsSelectionEventArgs=_aspxCreateClass(ASPxClientEventArgs,{constructor:function(appointmentIds){this.constructor.prototype.constructor.call(this);this.appointmentIds=appointmentIds;}});ActiveViewChangingEventArgs=_aspxCreateClass(ASPxClientEventArgs,{constructor:function(oldView,newView){this.constructor.prototype.constructor.call(this);this.oldView=oldView;this.newView=newView;this.cancel=false;}});MoreButtonClickedEventArgs=_aspxCreateClass(ASPxClientProcessingModeEventArgs,{constructor:function(targetDateTime,interval,resource){this.targetDateTime=targetDateTime;this.interval=interval;this.resource=resource;this.handled=false;}});ASPxClientAppointmentStatusViewInfo=_aspxCreateClass(null,{constructor:function(statusBackDivId,statusForeDivId,statusStartOffset,statusEndOffset){this.backDivId=statusBackDivId;this.foreDivId=statusForeDivId;this.startOffset=statusStartOffset;this.endOffset=statusEndOffset;}});ASPxClientAppointmentViewInfo=_aspxCreateClass(null,{constructor:function(schedulerViewInfo,containerIndex,firstCellIndex,lastCellIndex,startTime,duration,startRelativeIndent,endRelativeIndent,divId,appointmentId,statusBackDivId,statusForeDivId,statusStartOffset,statusEndOffset){this.schedulerViewInfo=schedulerViewInfo;this.containerIndex=containerIndex;this.firstCellIndex=firstCellIndex;this.lastCellIndex=lastCellIndex;this.startRelativeIndent=_aspxIsExists(startRelativeIndent)?startRelativeIndent:0;this.endRelativeIndent=_aspxIsExists(endRelativeIndent)?endRelativeIndent:0;this.initialStartRelativeIndent=this.startRelativeIndent;this.initialEndRelativeIndent=this.endRelativeIndent;if(startTime!=null&&duration!=null)this.appointmentInterval=new ASPxClientTimeInterval(startTime,duration);else this.appointmentInterval=null;this.initialAppointmentInterval=this.appointmentInterval!=null?this.appointmentInterval.Clone():null;this.appointmentId=appointmentId;this.visibleStartTime=startTime;this.visibleDuration=duration;this.visibleFirstCellIndex=firstCellIndex;this.visibleLastCellIndex=lastCellIndex;this.divId=divId;this.contentDiv=null;this.visibleFirstCell=null;this.visibleLastCell=null;this.mouseEvents=new ASPxSchedulerMouseEvents();this.mouseEvents.AddMouseOverHandler(this);this.mouseEvents.AddMouseOutHandler(this);this.statusViewInfo=new ASPxClientAppointmentStatusViewInfo(statusBackDivId,statusForeDivId,statusStartOffset,statusEndOffset);},getStartTime:function(){return this.appointmentInterval.GetStart();},getEndTime:function(){return this.appointmentInterval.GetEnd();},getDuration:function(){return this.appointmentInterval.GetDuration();},CanResizeAtLeft:function(){return false;},CanResizeAtRight:function(){return false;},CanResizeAtTop:function(){return false;},CanResizeAtBottom:function(){return false;},OnMouseOver:function(evt){this.schedulerViewInfo.OnAppointmentMouseOver(this);},OnMouseOut:function(evt){this.schedulerViewInfo.OnAppointmentMouseOut(this);},CanResize:function(){var appointment=this.schedulerViewInfo.scheduler.GetAppointment(this.appointmentId);return appointment.flags.allowResize;},GetToolTip:function(){var toolTip=this.schedulerViewInfo.scheduler.GetToolTipControl(this.schedulerViewInfo.scheduler);if(!_aspxIsExists(toolTip))return null;var appointment=this.schedulerViewInfo.scheduler.GetAppointment(this.appointmentId);toolTip.SetContent(appointment.GetToolTipContent(this.schedulerViewInfo.scheduler));return toolTip;},ResetRelativeIndentAndTime:function(){this.startRelativeIndent=this.initialStartRelativeIndent;this.endRelativeIndent=this.initialEndRelativeIndent;this.appointmentInterval=this.initialAppointmentInterval!=null?this.initialAppointmentInterval.Clone():null;}});ASPxClientHorizontalAppointmentViewInfo=_aspxCreateClass(ASPxClientAppointmentViewInfo,{constructor:function(schedulerViewInfo,containerIndex,firstCellIndex,lastCellIndex,startTime,duration,startRelativeIndent,endRelativeIndent,divId,appointmentId,hasLeftBorder,hasRightBorder,statusBackDivId,statusForeDivId,statusStartOffset,statusEndOffset){this.constructor.prototype.constructor.call(this,schedulerViewInfo,containerIndex,firstCellIndex,lastCellIndex,startTime,duration,startRelativeIndent,endRelativeIndent,divId,appointmentId,statusBackDivId,statusForeDivId,statusStartOffset,statusEndOffset);this.height=0;this.relativePosition=0;this.hasLeftBorder=hasLeftBorder;this.hasRightBorder=hasRightBorder;},clone:function(){return new ASPxClientHorizontalAppointmentViewInfo(this.schedulerViewInfo,this.containerIndex,this.firstCellIndex,this.lastCellIndex,this.getStartTime(),this.getDuration(),this.startRelativeIndent,this.endRelativeIndent,this.divId,this.appointmentId);},CanResizeAtLeft:function(){return this.CanResize()&&this.hasLeftBorder;},CanResizeAtRight:function(){return this.CanResize()&&this.hasRightBorder;},IsHorizontal:function(){return true;}});ASPxClientVerticalAppointmentViewInfo=_aspxCreateClass(ASPxClientAppointmentViewInfo,{constructor:function(schedulerViewInfo,containerIndex,firstCellIndex,lastCellIndex,startTime,duration,divId,startHorizontalIndex,endHorizontalIndex,maxIndexInGroup,startRelativeIndent,endRelativeIndent,appointmentId,hasTopBorder,hasBottomBorder,statusBackDivId,statusForeDivId,statusStartOffset,statusEndOffset){this.constructor.prototype.constructor.call(this,schedulerViewInfo,containerIndex,firstCellIndex,lastCellIndex,startTime,duration,startRelativeIndent,endRelativeIndent,divId,appointmentId,statusBackDivId,statusForeDivId,statusStartOffset,statusEndOffset);this.startHorizontalIndex=startHorizontalIndex;this.endHorizontalIndex=endHorizontalIndex;this.maxIndexInGroup=maxIndexInGroup;this.hasTopBorder=hasTopBorder;this.hasBottomBorder=hasBottomBorder;},clone:function(a){return new ASPxClientVerticalAppointmentViewInfo(this.schedulerViewInfo,this.containerIndex,this.firstCellIndex,this.lastCellIndex,this.getStartTime(),this.getDuration(),this.divId,this.startHorizontalIndex,this.endHorizontalIndex,this.maxIndexInGroup,this.startRelativeIndent,this.endRelativeIndent,this.appointmentId,this.hasTopBorder,this.hasBottomBorder,statusBackDivId,statusForeDivId,statusStartOffset,statusEndOffset);},CanResizeAtTop:function(){return this.CanResize()&&this.hasTopBorder;},CanResizeAtBottom:function(){return this.CanResize()&&this.hasBottomBorder;},IsHorizontal:function(){return false;}});ASPxAppointmentOperationPresenter=_aspxCreateClass(null,{constructor:function(scheduler,appointmentDiv){this.scheduler=scheduler;this.calculator=this.CreateCalculator();this.appointmentDiv=appointmentDiv;this.parent=this.GetParent();this.parentElement=this.GetParentElement();this.schedulerViewInfo=this.GetViewInfo();this.isSourceAppointmentVisible=new Object();this.sourceViewInfos=new Object();this.templateViewInfos=new Object();this.viewInfos=new Object();},ShowAppointment:function(appointment,showSourceAppointment){var aptId=appointment.appointmentId;if(!_aspxIsExists(this.sourceViewInfos[aptId])&&!_aspxIsExists(this.templateViewInfos[aptId])){this.sourceViewInfos[aptId]=this.FindSourceViewInfos(aptId,this.schedulerViewInfo);this.templateViewInfos[aptId]=this.GetTemplateViewInfos(aptId);}
var sourceViewInfos=this.sourceViewInfos[aptId];var templateViewInfos=this.templateViewInfos[aptId];this.ShowSourceAppointment(showSourceAppointment,aptId);this.HidePrevViewInfos(aptId);if(templateViewInfos.length==0)return;if(!this.CanShowAppointment(appointment))return;var containers=this.GetCellContainers();var count=containers.length;var viewInfos=new Array();this.viewInfos[aptId]=viewInfos;var operationInterval=appointment.operationInterval;var operationIntervalStartTime=operationInterval.GetStart();var operationIntervalEndTime=operationInterval.GetEnd();for(var i=0;i<count;i++){var container=containers[i];var containerInterval=container.interval;var containerStartTime=containerInterval.GetStart();var containerEndTime=containerInterval.GetEnd();var isAppointmentOutsideCell=operationIntervalStartTime>=containerEndTime||operationIntervalEndTime<containerStartTime||((operationIntervalEndTime-containerStartTime)==0&&!operationInterval.IsZerroDurationInterval());if(isAppointmentOutsideCell||!this.ShowAppointmentForResource(appointment,container.resource))continue;var intervalStart=_aspxDateTimeMaxValue(containerStartTime,operationIntervalStartTime);var intervalEnd=_aspxDateTimeMinValue(containerEndTime,operationIntervalEndTime);this.AddViewInfo(viewInfos,container,intervalStart,intervalEnd);}
count=viewInfos.length;for(var i=0;i<count;i++){var sourceDiv=this.appointmentDiv;var isPrimaryAppointment=this.appointmentDiv.appointmentViewInfo.appointmentId==appointment.appointmentId;if(count>1||!isPrimaryAppointment){if(i==count-1&&count>1){var index=templateViewInfos.length-1;sourceDiv=templateViewInfos[index].contentDiv;}else if(i==0||!isPrimaryAppointment)sourceDiv=templateViewInfos[0].contentDiv;}
var sourceViewInfo=sourceDiv.appointmentViewInfo;var newDiv=sourceDiv.cloneNode(true);viewInfos[i].maxIndexInGroup=_aspxIsExists(sourceViewInfo.maxIndexInGroup)?sourceViewInfo.maxIndexInGroup:1;viewInfos[i].startHorizontalIndex=_aspxIsExists(sourceViewInfo.startHorizontalIndex)?sourceViewInfo.startHorizontalIndex:0;viewInfos[i].endHorizontalIndex=_aspxIsExists(sourceViewInfo.endHorizontalIndex)?sourceViewInfo.endHorizontalIndex:1;var sourceStatusInfo=sourceViewInfo.statusViewInfo;if(_aspxIsExists(sourceStatusInfo))viewInfos[i].statusViewInfo=new ASPxClientAppointmentStatusViewInfo(sourceStatusInfo.backDivId,sourceStatusInfo.foreDivId,0,0);newDiv.style.width="";newDiv.style.height="";viewInfos[i].contentDiv=newDiv;viewInfos[i].startIndex;newDiv.appointmentViewInfo=viewInfos[i];this.parentElement.appendChild(newDiv);this.CalculateAppointmentLayout(viewInfos[i]);this.CalculateFinalContentLayout(viewInfos[i]);this.scheduler.appointmentSelection.SelectAppointmentViewInfoCore(viewInfos[i]);}},ShowAppointmentForResource:function(appointment,containerResource){var appointmentResources=appointment.operationResources;if(!_aspxIsExists(appointmentResources))appointmentResources=appointment.resources;if(!_aspxIsExists(appointmentResources))return false;if(ASPxSchedulerUtils.IsAppointmentResourcesEmpty(appointmentResources)||_aspxArrayIndexOf(appointmentResources,containerResource)>=0||containerResource=="null")return true;return false;},GetTemplateViewInfos:function(appointmentId){if(this.sourceViewInfos[appointmentId].length!=0)return this.sourceViewInfos[appointmentId];else{var horizontalAppointmentsViewInfos=this.FindSourceViewInfos(appointmentId,this.scheduler.horizontalViewInfo);var verticalAppointmentsViewInfos=this.FindSourceViewInfos(appointmentId,this.scheduler.verticalViewInfo);if(horizontalAppointmentsViewInfos.length>0)return horizontalAppointmentsViewInfos;else return verticalAppointmentsViewInfos;}},ShowSourceAppointment:function(showSourceAppointment,aptId){if(this.isSourceAppointmentVisible[aptId]!=showSourceAppointment){_aspxClearSelection();var sourceViewInfos=this.sourceViewInfos[aptId];var count=sourceViewInfos.length;for(var i=0;i<count;i++){viewInfo=sourceViewInfos[i];_aspxSetSchedulerDivDisplay(viewInfo.contentDiv,showSourceAppointment);if(_aspxIsExists(viewInfo.adornerDiv))_aspxSetSchedulerDivDisplay(viewInfo.adornerDiv,showSourceAppointment);}
this.isSourceAppointmentVisible[aptId]=showSourceAppointment;}},HideAppointment:function(aptId,showSourceAppointment){this.HidePrevViewInfos(aptId);if(!_aspxIsExists(this.sourceViewInfos[aptId])||this.sourceViewInfos[aptId].length==0)return;if(showSourceAppointment)this.ShowSourceAppointment(true,aptId);},FindSourceViewInfos:function(appointmentId,viewInfo){var result=new Array();var viewInfos=viewInfo.appointmentViewInfos;var count=viewInfos.length;for(var i=0;i<count;i++){if(viewInfos[i].appointmentId==appointmentId)_aspxArrayPush(result,viewInfos[i]);}return result;},HidePrevViewInfos:function(aptId){var viewInfos=this.viewInfos[aptId];if(!_aspxIsExists(viewInfos))return;var count=viewInfos.length;for(var i=0;i<count;i++){_aspxRemoveElement(viewInfos[i].contentDiv);this.scheduler.appointmentSelection.UnselectAppointmentViewInfoCore(viewInfos[i]);}
this.viewInfos[aptId]=null;},CalculateFinalContentLayout:function(viewInfo){this.calculator.CalculateContentDivSize(viewInfo)}});ASPxVerticalAppointmentOperationPresenter=_aspxCreateClass(ASPxAppointmentOperationPresenter,{constructor:function(scheduler,appointmentDiv){this.constructor.prototype.constructor.call(this,scheduler,appointmentDiv);this.isHorizontal=true;},CreateCalculator:function(){return this.scheduler.CreateVerticalAppointmentsCalculator();},GetCellContainers:function(){return this.scheduler.verticalViewInfo.cellContainers;},GetParent:function(){return this.scheduler.verticalViewInfo.parent;},GetParentElement:function(){return this.scheduler.verticalViewInfo.parent.parentElement;},GetViewInfo:function(){return this.scheduler.verticalViewInfo;},CanShowAppointment:function(appointment){if(this.scheduler.privateShowAllAppointmentsOnTimeCells)return true;else return appointment.operationInterval.IsSmallerThanDay();},AddViewInfo:function(aptViewInfos,cellContainer,startTime,endTime){var viewInfo=new ASPxClientVerticalAppointmentViewInfo(this.schedulerViewInfo,cellContainer.containerIndex,null,null,startTime,_aspxDateSubsWithTimezone(endTime,startTime),null,0,1,1,0,0,null);viewInfo.containerIndex=cellContainer.containerIndex;var startCellIndex=this.scheduler.verticalViewInfo.FindStartCellIndexByTime(cellContainer,startTime);var endCellIndex=this.scheduler.verticalViewInfo.FindEndCellIndexByTime(cellContainer,endTime);if(endCellIndex<startCellIndex)endCellIndex=startCellIndex;viewInfo.visibleFirstCellIndex=startCellIndex;viewInfo.visibleLastCellIndex=endCellIndex;var startCell=this.scheduler.verticalViewInfo.GetCell(cellContainer.index,startCellIndex);var endCell=this.scheduler.verticalViewInfo.GetCell(cellContainer.index,endCellIndex);if(!_aspxIsExists(startCell)||!_aspxIsExists(endCell))return null;var relativeTop=0;var relativeBottom=0;if(!this.scheduler.verticalViewInfo.appointmentsSnapToCells&&startCell!=endCell){var startCellStartTime=this.scheduler.GetCellStartTime(startCell);var endCellEndTime=this.scheduler.GetCellEndTime(endCell);var startCellDuration=this.scheduler.GetCellDuration(startCell);var endCellDuration=this.scheduler.GetCellDuration(endCell);relativeTop=_aspxDateSubsWithTimezone(startTime,startCellStartTime)*startCell.offsetHeight/startCellDuration;relativeBottom=_aspxDateSubsWithTimezone(endCellEndTime,endTime)*endCell.offsetHeight/endCellDuration;}
viewInfo.startCell=startCell;viewInfo.endCell=endCell;viewInfo.startRelativeIndent=relativeTop;viewInfo.endRelativeIndent=relativeBottom;viewInfo.initialStartRelativeIndent=relativeTop;viewInfo.initialEndRelativeIndent=relativeBottom;_aspxArrayPush(aptViewInfos,viewInfo);},CalculateAppointmentLayout:function(viewInfo){this.calculator.CalculateAppointmentLayout(viewInfo);}});ASPxHorizontalAppointmentOperationPresenter=_aspxCreateClass(ASPxAppointmentOperationPresenter,{constructor:function(scheduler,appointmentDiv){this.constructor.prototype.constructor.call(this,scheduler,appointmentDiv);this.isHorizontal=false;},CreateCalculator:function(){return this.scheduler.CreateHorizontalAppointmentsCalculator();},GetCellContainers:function(){return this.scheduler.horizontalViewInfo.cellContainers;},GetParent:function(){return this.scheduler.horizontalViewInfo.parent;},GetParentElement:function(){return this.scheduler.horizontalViewInfo.parent.innerParentElement;},GetViewInfo:function(){return this.scheduler.horizontalViewInfo;},CanShowAppointment:function(appointment){var isDayView=this.scheduler.privateActiveViewType==ASPxSchedulerViewType.Day||this.scheduler.privateActiveViewType==ASPxSchedulerViewType.WorkWeek;var isAptLongerThanDay=!appointment.operationInterval.IsSmallerThanDay();var showAllAppointmentsOnTimeCells=this.scheduler.privateShowAllAppointmentsOnTimeCells;if(isDayView)return(isAptLongerThanDay&&!showAllAppointmentsOnTimeCells);else return true;},AddViewInfo:function(aptViewInfos,cellContainer,startTime,endTime){var startCellIndex=this.scheduler.verticalViewInfo.FindStartCellIndexByTime(cellContainer,startTime);var endCellIndex=this.scheduler.verticalViewInfo.FindEndCellIndexByTime(cellContainer,endTime);if(startCellIndex<0||endCellIndex<0)return null;var lastCellTop=null;for(var i=startCellIndex;i<=endCellIndex;i++){var cell=this.schedulerViewInfo.GetCell(cellContainer.containerIndex,i);var cellTop=this.parent.CalcRelativeElementTop(cell);if(cellTop!=lastCellTop&&lastCellTop!=null){var viewInfo=this.CreateSingleViewInfo(cellContainer.containerIndex,startCellIndex,i>startCellIndex?i-1:startCellIndex);_aspxArrayPush(aptViewInfos,viewInfo);startCellIndex=i;}
lastCellTop=cellTop;}if(endCellIndex<startCellIndex)endCellIndex=startCellIndex;var viewInfo=this.CreateSingleViewInfo(cellContainer.containerIndex,startCellIndex,endCellIndex);_aspxArrayPush(aptViewInfos,viewInfo);},CreateSingleViewInfo:function(containerIndex,startCellIndex,endCellIndex){var viewInfo=new ASPxClientHorizontalAppointmentViewInfo(this.schedulerViewInfo,containerIndex,startCellIndex,endCellIndex,null,null,0,0,null,this.appointmentDiv.appointmentViewInfo.appointmentId);viewInfo.visibleFirstCellIndex=startCellIndex;viewInfo.visibleLastCellIndex=endCellIndex;viewInfo.containerIndex=containerIndex;return viewInfo;},CalculateAppointmentLayout:function(viewInfo){_aspxSetSchedulerDivDisplay(viewInfo.contentDiv,true);this.calculator.CalculateAppointmentSize(viewInfo);this.calculator.CalculateAppointmentPosition(viewInfo,true);}});ASPxDragViewHelper=_aspxCreateClass(null,{constructor:function(scheduler,primaryAppointmentId,appointmentDiv){this.scheduler=scheduler;this.primaryAppointmentId=primaryAppointmentId;this.horizontalDragPresenter=new ASPxHorizontalAppointmentOperationPresenter(scheduler,appointmentDiv);this.verticalDragPresenter=new ASPxVerticalAppointmentOperationPresenter(scheduler,appointmentDiv);},ShowDraggedAppointmentPosition:function(e,draggedAppointments,copy){var count=draggedAppointments.length;if(count<=0)return;for(var i=0;i<count;i++){var appointment=draggedAppointments[i];copy&=appointment.flags.allowCopy;this.horizontalDragPresenter.ShowAppointment(appointment,copy!=0);this.verticalDragPresenter.ShowAppointment(appointment,copy!=0);if(appointment.appointmentId==this.primaryAppointmentId){var content=appointment.GetToolTipContent(this.scheduler)+"<br />"+this.scheduler.operationToolTipCaption;var toolTip=this.scheduler.GetToolTipControl();if(_aspxIsExists(toolTip)){toolTip.SetContent(content);toolTip.ShowToolTip(_aspxGetEventX(e),_aspxGetEventY(e));}}}},HideDraggedAppointmentPosition:function(draggedAppointments,restoreAptPos){var count=draggedAppointments.length;for(var i=0;i<count;i++){var appointmentId=draggedAppointments[i].appointmentId;this.horizontalDragPresenter.HideAppointment(appointmentId,restoreAptPos);this.verticalDragPresenter.HideAppointment(appointmentId,restoreAptPos);}
var toolTip=this.scheduler.GetToolTipControl();if(_aspxIsExists(toolTip)){toolTip.HideToolTip();}},HideToolTip:function(){var toolTip=this.scheduler.GetToolTipControl();if(_aspxIsExists(toolTip)){toolTip.HideToolTip();}}});ASPxClientAppointmentDragHelper=_aspxCreateClass(null,{constructor:function(scheduler,appointmentDiv,cell,e,onDoClickHandler,owner){if(__aspxDragHelper!=null)__aspxDragHelper.cancelDrag();scheduler.DisableReminderTimer();this.dragArea=5;this.lastX=e.clientX;this.lastY=e.clientY;this.scheduler=scheduler;this.canDrag=true;this.startCell=cell;this.lastCell=null;this.lastCtrlState=null;this.scheduler=scheduler;this.appointmentSelection=scheduler.appointmentSelection;this.appointmentDiv=appointmentDiv;this.onDoClickHandler=onDoClickHandler;this.onEndDrag=this.OnApplyDrag;this.dragViewHelper=new ASPxDragViewHelper(scheduler,appointmentDiv.appointmentViewInfo.appointmentId,appointmentDiv);this.owner=owner;__aspxDragHelper=this;},drag:function(e){if(!this.canDrag)return;if(!this.isDragging()){if(!this.isOutOfDragArea(e.clientX,e.clientY))return;this.startDragCore(e);}if(!_aspxGetIsLeftButtonPressed(e)){this.cancelDrag(e);return;}if(this.isDragging())this.dragCore(e);},startDragCore:function(e){if(__aspxIE){this.scheduler.innerContentElement.setActive();}
this.startCellTime=this.scheduler.GetCellStartTime(this.startCell);this.startCellResource=this.scheduler.GetCellResource(this.startCell);var selectedAppointmentIds=this.appointmentSelection.selectedAppointmentIds;this.selectedAppointments=new Array();var count=selectedAppointmentIds.length;for(var i=0;i<count;i++){var apt=this.scheduler.GetAppointment(selectedAppointmentIds[i]);if(apt.flags.allowDrag)_aspxArrayPush(this.selectedAppointments,apt);}if(this.selectedAppointments.length==0)return;var hitTestResult=this.scheduler.CalcHitTest(e);var cell=hitTestResult.cell;if(_aspxIsExists(cell)){var cellTime=this.scheduler.GetCellStartTime(cell);var activeViewType=this.scheduler.GetActiveViewType();if(activeViewType==ASPxSchedulerViewType.Day||activeViewType==ASPxSchedulerViewType.WorkWeek){this.dragState=new ASPxDragDayViewAppointmentState(this.selectedAppointments,this.selectedAppointments[0],_aspxDateSubsWithTimezone(this.startCellTime,this.selectedAppointments[0].interval.GetStart()),this.scheduler.privateShowAllAppointmentsOnTimeCells);}else this.dragState=new ASPxDragAppointmentState(this.selectedAppointments,this.selectedAppointments[0],_aspxDateSubsWithTimezone(this.startCellTime,this.selectedAppointments[0].interval.GetStart()));}},dragCore:function(e){var hitTestResult=this.scheduler.CalcHitTest(e);var cell=hitTestResult.cell;if(_aspxIsExists(cell)&&(cell!=this.lastCell||this.lastCtrlState!=ctrlPressed)){var cellTime=this.scheduler.GetCellInterval(cell);var cellResource=this.scheduler.GetCellResource(cell);if(_aspxIsExists(cellTime)&&_aspxIsExists(cellResource)){this.dragState.DragTo(e,cellTime,cellResource);var ctrlPressed=_aspxGetCtrlKey(e);this.dragViewHelper.ShowDraggedAppointmentPosition(e,this.selectedAppointments,ctrlPressed);this.lastCell=cell;this.lastCtrlState=ctrlPressed;}}},isDragging:function(){return _aspxIsExists(this.dragState);},OnCallback:function(){this.cancelDrag(false);},OnCallbackError:function(){this.cancelDrag(true);},onEscKeyDown:function(){this.cancelDrag(true,true);},cancelDrag:function(restoreAptPos,restoreTimer){if(!_aspxIsExists(restoreAptPos))restoreAptPos=true;if(this.isDragging())this.dragViewHelper.HideDraggedAppointmentPosition(this.selectedAppointments,restoreAptPos);this.scheduler.onCallback=null;this.scheduler.onCallbackError=null;__aspxDragHelper=null;if(restoreTimer)this.scheduler.EnableReminderTimer();},endDrag:function(e){var restoreAptPos=true;var wasCallback=false;if(!this.isDragging()&&!this.isOutOfDragArea(e.clientX,e.clientY)){if(_aspxIsExists(this.onDoClickHandler))this.onDoClickHandler.call(this.owner,e);}else{var ctrlPressed=_aspxGetCtrlKey(e);wasCallback=this.onEndDrag(ctrlPressed);}if(!wasCallback)this.cancelDrag(true);else{this.dragViewHelper.HideToolTip();__aspxDragHelper=null;this.scheduler.onCallback=_aspxCreateDelegate(this.OnCallback,this);this.scheduler.onCallbackError=_aspxCreateDelegate(this.OnCallbackError,this);}},isOutOfDragArea:function(newX,newY){return Math.max(Math.abs(newX-this.lastX),Math.abs(newY-this.lastY))>=this.dragArea;},OnApplyDrag:function(copy){var selectedAppointmentIds=this.appointmentSelection.selectedAppointmentIds;var count=selectedAppointmentIds.length;var draggedAppointments=new Array();var params="APTSCHANGE|";var wasChanges=false;for(var i=0;i<count;i++){var id=selectedAppointmentIds[i];var appointment=this.scheduler.GetAppointment(id);if(!_aspxIsExists(appointment)||!_aspxIsExists(appointment.operationInterval)||!_aspxIsExists(appointment.operationResources))continue;var canCopy=copy&appointment.flags.allowCopy;var wasDragged=!appointment.operationInterval.Equals(appointment.interval)||!_aspxArrayEqual(appointment.resources,appointment.operationResources);if(!wasDragged&&!canCopy)continue;if(wasChanges)params+="!";params+=id+"?START="+_aspxDateTimeToMilliseconds(appointment.operationInterval.GetStart());if(appointment.operationInterval.GetDuration()!=appointment.interval.GetDuration())params+="?DURATION="+appointment.operationInterval.GetDuration();if(!_aspxArrayEqual(appointment.resources,appointment.operationResources))params+="?RESOURCES="+this.ResourcesToString(appointment.operationResources);if(canCopy)params+="?COPY=true";wasChanges=true;}if(wasChanges){this.scheduler.RaiseCallback(params);return true;}else return false;},ResourcesToString:function(resources){var result="";var count=resources.length;for(var i=0;i<count;i++){if(i>0)result+=",";result+=resources[i];}return result;}});ASPxDragAppointmentState=_aspxCreateClass(null,{constructor:function(sourceAppointments,primaryAppointment,appointmentDragOffset){this.appointmentDragOffset=appointmentDragOffset;this.primaryAppointment=primaryAppointment;this.lastHitResource="null";this.sourceAppointments=sourceAppointments;},DragTo:function(evt,layoutInterval,layoutResource){var appointmentsOffset=this.CalculateAppointmentsOffset(layoutInterval);this.lastHitResource=layoutResource;this.DragAppointments(evt,layoutInterval,layoutResource,appointmentsOffset);},DragAppointments:function(evt,layoutInterval,layoutResource,appointmentsOffset){this.DragAppointmentsCore(evt,layoutInterval,layoutResource,appointmentsOffset,this.DragAppointment);},CalculateAppointmentsOffset:function(layoutInterval){var newPrimaryAppointmentStart=_aspxDateIncreaseWithUtcOffset(layoutInterval.GetStart(),-this.appointmentDragOffset);return _aspxDateSubsWithTimezone(newPrimaryAppointmentStart,this.primaryAppointment.interval.GetStart());},DragAppointmentsCore:function(evt,layoutInterval,layoutResource,appointmentsOffset,dragAppointmentHandler){var sourceAppointments=this.sourceAppointments;var count=sourceAppointments.length;for(var i=0;i<count;i++){var sourceAppointment=sourceAppointments[i];if(sourceAppointment.flags.allowDrag){this.ChangeResource(evt,sourceAppointment,layoutResource);dragAppointmentHandler.call(this,sourceAppointment,layoutInterval,appointmentsOffset);}}},DragAppointment:function(appointment,layoutInterval,appointmentsOffset){var startTime=_aspxDateIncreaseWithUtcOffset(appointment.interval.GetStart(),appointmentsOffset);var endTime=_aspxDateIncreaseWithUtcOffset(appointment.interval.GetEnd(),appointmentsOffset);var duration=_aspxDateSubsWithTimezone(endTime,startTime);if(duration<0)duration=0;appointment.operationInterval=new ASPxClientTimeInterval(startTime,duration);},ChangeResource:function(evt,sourceAppointment,layoutResource){if(this.ShouldChangeResource(sourceAppointment,layoutResource))sourceAppointment.operationResources=[layoutResource];else sourceAppointment.operationResources=sourceAppointment.resources;},ShouldChangeResource:function(sourceAppointment,layoutResource){if(sourceAppointment.appointmentType!=ASPxAppointmentType.Normal||!sourceAppointment.flags.allowDragBetweenResources)return false;if(layoutResource=="null"||ASPxSchedulerUtils.IsAppointmentResourcesEmpty(sourceAppointment.resources)||_aspxArrayContains(sourceAppointment.resources,layoutResource))return false;return true;}});ASPxDragDayViewAppointmentState=_aspxCreateClass(ASPxDragAppointmentState,{constructor:function(sourceAppointments,primaryAppointment,appointmentDragOffset,showAllAppointmentsOnTimeCells){this.constructor.prototype.constructor.call(this,sourceAppointments,primaryAppointment,appointmentDragOffset);this.showAllAppointmentsOnTimeCells=showAllAppointmentsOnTimeCells;},DragAppointments:function(evt,layoutInterval,layoutResource,appointmentsOffset){if(layoutInterval.IsSmallerThanDay())this.DragAppointmentsCore(evt,layoutInterval,layoutResource,appointmentsOffset,this.DragToCell);else this.DragAppointmentsCore(evt,layoutInterval,layoutResource,appointmentsOffset,this.DragToAllDayArea);},DragToAllDayArea:function(sourceAppointment,layoutInterval,appointmentsOffset){if(sourceAppointment.interval.IsSmallerThanDay())this.DragShortAppointmentToAllDayArea(sourceAppointment,appointmentsOffset);else this.DragLongAppointmentToAllDayArea(sourceAppointment,appointmentsOffset,layoutInterval);},DragShortAppointmentToAllDayArea:function(sourceAppointment,appointmentsOffset){var start;start=_aspxDateIncreaseWithUtcOffset(ASPxSchedulerDateTimeHelper.TruncToDate(sourceAppointment.interval.GetStart()),appointmentsOffset);sourceAppointment.operationInterval=new ASPxClientTimeInterval(start,ASPxSchedulerDateTimeHelper.DaySpan);},DragLongAppointmentToAllDayArea:function(sourceAppointment,appointmentsOffset,layoutInterval){var start;if(this.showAllAppointmentsOnTimeCells){var offset=this.CalculateLongAppointmentOffset(layoutInterval,appointmentsOffset);var duration=this.ExtendToDay(sourceAppointment);start=_aspxDateIncreaseWithUtcOffset(ASPxSchedulerDateTimeHelper.TruncToDate(sourceAppointment.interval.GetStart()),offset);sourceAppointment.operationInterval=new ASPxClientTimeInterval(start,duration);}else{start=_aspxDateIncreaseWithUtcOffset(sourceAppointment.interval.GetStart(),appointmentsOffset);sourceAppointment.operationInterval=new ASPxClientTimeInterval(start,sourceAppointment.interval.GetDuration());}},CalculateLongAppointmentOffset:function(layoutInterval,appointmentsOffset){var dragStart=_aspxDateIncreaseWithUtcOffset(layoutInterval.GetStart(),-appointmentsOffset);var daysDifference=this.CalculateDaysDifference(dragStart,layoutInterval.GetStart());return ASPxSchedulerDateTimeHelper.DaySpan*daysDifference;},CalculateDaysDifference:function(date1,date2){snappedDate1=ASPxSchedulerDateTimeHelper.TruncToDate(date1);snappedDate2=ASPxSchedulerDateTimeHelper.TruncToDate(date2);return _aspxDateSubsWithTimezone(snappedDate2,snappedDate1)/ASPxSchedulerDateTimeHelper.DaySpan;},ExtendToDay:function(sourceAppointment){var duration=sourceAppointment.interval.GetDuration();;var remainder=duration%ASPxSchedulerDateTimeHelper.DaySpan;if(remainder!=0)return(duration-remainder+ASPxSchedulerDateTimeHelper.DaySpan);else return duration;},DragToCell:function(sourceAppointment,layoutInterval,appointmentsOffset){if(sourceAppointment.interval.IsSmallerThanDay())this.DragShortAppointmentToCell(sourceAppointment,layoutInterval,appointmentsOffset);else this.DragLongAppointmentToCell(sourceAppointment,layoutInterval,appointmentsOffset);},DragLongAppointmentToCell:function(sourceAppointment,layoutInterval,appointmentsOffset){if(this.showAllAppointmentsOnTimeCells){var start=_aspxDateIncreaseWithUtcOffset(sourceAppointment.interval.GetStart(),appointmentsOffset);sourceAppointment.operationInterval=new ASPxClientTimeInterval(start,sourceAppointment.interval.GetDuration());}else sourceAppointment.operationInterval=new ASPxClientTimeInterval(layoutInterval.GetStart(),layoutInterval.GetDuration());},DragShortAppointmentToCell:function(sourceAppointment,layoutInterval,appointmentsOffset){var start=_aspxDateIncreaseWithUtcOffset(sourceAppointment.interval.GetStart(),appointmentsOffset);sourceAppointment.operationInterval=new ASPxClientTimeInterval(start,sourceAppointment.interval.GetDuration());},CalculateAppointmentsOffset:function(layoutInterval){if(this.ShouldTruncToDate(layoutInterval))return _aspxDateSubsWithTimezone(layoutInterval.GetStart(),ASPxSchedulerDateTimeHelper.TruncToDate(this.primaryAppointment.interval.GetStart()));else return this.constructor.prototype.CalculateAppointmentsOffset.call(this,layoutInterval);},ShouldTruncToDate:function(layoutInterval){var dragToAllDayArea=!layoutInterval.IsSmallerThanDay();var isShortAppointment=this.primaryAppointment.interval.IsSmallerThanDay();return dragToAllDayArea&&isShortAppointment;}});ASPxClientAppointmentFlags=_aspxCreateClass(null,{constructor:function(){this.constructor.prototype.constructor.call(this);this.allowDelete=true;this.allowEdit=true;this.allowResize=true;this.allowCopy=true;this.allowDrag=true;this.allowDragBetweenResources=true;this.allowInplaceEditor=true;this.allowConflicts=true;}});ASPxClientAppointment=_aspxCreateClass(null,{constructor:function(interval,resources,flags,appointmentId,appointmentType,statusIndex,labelIndex){this.interval=interval;this.resources=resources;this.flags=flags;this.appointmentId=appointmentId;this.appointmentType=appointmentType;this.statusIndex=statusIndex;this.labelIndex=labelIndex;},GetToolTipContent:function(scheduler){var formatter=new ASPxDateFormatter();var interval=_aspxIsExists(this.operationInterval)?this.operationInterval:this.interval;var startTimeFormat=this.SelectStartTimeFormat(scheduler,interval);var endTimeFormat=this.SelectEndTimeFormat(scheduler,interval);formatter.SetFormatString(startTimeFormat);var result=formatter.Format(interval.GetStart());if(_aspxIsExists(endTimeFormat)){formatter.SetFormatString(endTimeFormat);result+=" - "+formatter.Format(interval.GetEnd());}return result;},SelectStartTimeFormat:function(scheduler,interval){var intervalStart=interval.GetStart();var intervalEnd=interval.GetEnd();var startDate=intervalStart.getDate();var startYear=intervalStart.getYear();var startMonth=intervalStart.getMonth();var endDate=intervalEnd.getDate();var endYear=intervalEnd.getYear();var endMonth=intervalEnd.getMonth();var truncStartDate=new Date(startYear,startMonth,startDate);var truncEndDate=new Date(endYear,endMonth,endDate);var datesEquals=startDate==endDate&&startMonth==endMonth&&startYear==endYear;if(datesEquals){if(interval.IsSmallerThanDay())return scheduler.formatsTimeWithMonthDay[0];else return scheduler.formatsWithoutYearAndWeekDay[0];}else{if(truncStartDate-interval.GetStart()==0&&truncEndDate-interval.GetEnd()==0){if(startYear==endYear||interval.IsDurationEqualToDay())return scheduler.formatsWithoutYearAndWeekDay[0];else return scheduler.formatsDateWithYear[0];}else{if(startYear==endYear)return scheduler.formatsTimeWithMonthDay[0];else return scheduler.formatsDateTimeWithYear[0];}}},SelectEndTimeFormat:function(scheduler,interval){var intervalStart=interval.GetStart();var intervalEnd=interval.GetEnd();var startDate=intervalStart.getDate();var startYear=intervalStart.getYear();var startMonth=intervalStart.getMonth();var endDate=intervalEnd.getDate();var endYear=intervalEnd.getYear();var endMonth=intervalEnd.getMonth();var truncStartDate=new Date(startYear,startMonth,startDate);var truncEndDate=new Date(endYear,endMonth,endDate);var datesEquals=startDate==endDate&&startMonth==endMonth&&startYear==endYear;if(datesEquals){if(interval.IsSmallerThanDay())return scheduler.formatsTimeOnly[0];else return null;}else{if(truncStartDate-interval.GetStart()==0&&truncEndDate-interval.GetEnd()==0){if(startYear==endYear||interval.IsDurationEqualToDay())return(interval.IsDurationEqualToDay())?null:scheduler.formatsWithoutYearAndWeekDay[0];else return scheduler.formatsDateWithYear[0];}else{if(startYear==endYear)return scheduler.formatsTimeWithMonthDay[0];else return scheduler.formatsDateTimeWithYear[0];}}}});ASPxClientAppointmentBounds=_aspxCreateClass(null,{constructor:function(x,y,width,height){this.x=x;this.y=y;this.width=width;this.height=height;},GetLeftBound:function(){return this.x;},GetRightBound:function(){return this.x+this.width;},GetTopBound:function(){return this.y;},GetBottomBound:function(){return this.y+this.height;},GetWidth:function(){return this.width;},GetHeight:function(){return this.height;}});ASPxClientAppointmentLayoutCalculator=_aspxCreateClass(null,{constructor:function(schedulerViewInfo,parent){this.schedulerViewInfo=schedulerViewInfo;this.minAppointmentWidth=7;this.minAppointmentHeight=7;},AfterCalculateAppointments:function(appointmentViewInfos){var count=appointmentViewInfos.length;for(var i=0;i<count;i++)this.AfterCalculateAppointment(appointmentViewInfos[i]);},AfterCalculateAppointment:function(appointmentViewInfo){var appointmentDiv=appointmentViewInfo.contentDiv;if(!_aspxIsExists(appointmentDiv))return;_aspxSubscribeSchedulerMouseEvents(appointmentDiv,appointmentViewInfo);_aspxAddSmartTag(appointmentViewInfo,this.schedulerViewInfo.scheduler.appointmentSmartTagDiv);this.CalculateFinalContentLayout(appointmentViewInfo);},CalculateFinalContentLayout:function(appointmentViewInfo){this.CalculateContentDivSize(appointmentViewInfo);this.LayoutAppointmentStatus(appointmentViewInfo);},LayoutAppointmentStatus:function(appointmentViewInfo){var statusBackDivId=appointmentViewInfo.statusViewInfo.backDivId;var statusForeDivId=appointmentViewInfo.statusViewInfo.foreDivId;if(_aspxIsExists(statusBackDivId)&&_aspxIsExists(statusForeDivId)){var statusBackDiv=this.schedulerViewInfo.scheduler.GetAppointmentBlockElementById(statusBackDivId);var statusForeDiv=this.schedulerViewInfo.scheduler.GetAppointmentBlockElementById(statusForeDivId);if(_aspxIsExists(statusBackDiv)&&_aspxIsExists(statusForeDiv)){var innerContentDiv=this.FindInnerContentDiv(appointmentViewInfo);if(!_aspxIsExists(innerContentDiv))innerContentDiv=appointmentViewInfo.contentDiv;statusBackDiv.appointmentDiv=innerContentDiv;statusForeDiv.appointmentDiv=innerContentDiv;this.LayoutAppointmentStatusCore(statusForeDiv,statusBackDiv,appointmentViewInfo);}}},CalculateContentDivSize:function(appointmentViewInfo){var innerContentDiv=this.FindInnerContentDiv(appointmentViewInfo);if(_aspxIsExists(innerContentDiv))this.SetInnerContentDivSize(innerContentDiv,appointmentViewInfo);},ResetContentDivSize:function(appointmentViewInfo){var innerContentDiv=this.FindInnerContentDiv(appointmentViewInfo);if(_aspxIsExists(innerContentDiv))innerContentDiv.style.height="";},FindInnerContentDiv:function(appointmentViewInfo){var appointmentDiv=appointmentViewInfo.contentDiv;if(!_aspxIsExists(appointmentDiv))return null;var children=appointmentDiv.childNodes;var count=children.length;for(var i=0;i<count;i++){var child=children[i];if(this.IsInnerContentDiv(child))return child;}return null;},IsInnerContentDiv:function(child){if(!_aspxIsExists(child.tagName))return false;else{var tagName=child.tagName.toUpperCase();return((tagName=="TABLE")||(tagName=="DIV"));}},SetInnerContentDivSize:function(contentDiv,aptViewInfo){var bordersHeight=contentDiv.offsetHeight-contentDiv.clientHeight;var bordersWidth=contentDiv.offsetWidth-contentDiv.clientWidth;contentDiv.style.height="";contentDiv.style.height=Math.max(aptViewInfo.contentDiv.offsetHeight-bordersHeight,this.minAppointmentHeight)+"px";contentDiv.style.width=Math.max(0,aptViewInfo.contentDiv.offsetWidth-bordersWidth)+"px";},RecalcAppointmentIntervalAndOffset:function(viewInfo,aptBounds,firstCell,lastCell){var firstCellInterval=this.schedulerViewInfo.scheduler.GetCellInterval(firstCell);var lastCellInterval=this.schedulerViewInfo.scheduler.GetCellInterval(lastCell);viewInfo.startRelativeIndent=this.RecalcStartOffset(aptBounds,firstCell);viewInfo.endRelativeIndent=this.RecalcEndOffset(aptBounds,lastCell);var start=this.CalculateStartTimeByOffset(firstCellInterval,viewInfo.startRelativeIndent);var end=this.CalculateEndTimeByOffset(lastCellInterval,viewInfo.endRelativeIndent);viewInfo.appointmentInterval.SetStart(start);viewInfo.appointmentInterval.SetDuration(end-start);},CalculateStartTimeByOffset:function(baseInterval,startOffset){var offset=baseInterval.GetDuration()*startOffset/100;return _aspxDateIncrease(baseInterval.GetStart(),offset);},CalculateEndTimeByOffset:function(baseInterval,endOffset){var offset=-baseInterval.GetDuration()*endOffset/100;return _aspxDateIncrease(baseInterval.GetEnd(),offset);},RecalcStartOffset:function(aptBounds,firstCell){},RecalcEndOffset:function(aptBounds,lastCell){}});ASPxClientVerticalAppointmentLayoutCalculator=_aspxCreateClass(ASPxClientAppointmentLayoutCalculator,{constructor:function(schedulerViewInfo,parent){this.constructor.prototype.constructor.call(this,schedulerViewInfo);this.gapBetweenAppointment=4;this.leftAppointmentIndent=2;this.rightAppointmentIndent=2;this.parent=parent;},CalculateLayout:function(appointmentViewInfos){if(!_aspxIsExists(appointmentViewInfos)||!_aspxIsExists(appointmentViewInfos.length))return;var count=appointmentViewInfos.length;if(count<=0)return;var count=appointmentViewInfos.length;for(var i=0;i<count;i++)this.CalculateAppointmentLayout(appointmentViewInfos[i]);this.AfterCalculateAppointments(appointmentViewInfos);},CalculateAppointmentLayout:function(viewInfo){viewInfo.ResetRelativeIndentAndTime();this.ResetContentDivSize(viewInfo);var schedulerViewInfo=this.schedulerViewInfo;var div=viewInfo.contentDiv;if(_aspxIsExists(div)){var startCell=_aspxIsExists(viewInfo.startCell)?viewInfo.startCell:schedulerViewInfo.GetCell(viewInfo.containerIndex,viewInfo.firstCellIndex);var endCell=_aspxIsExists(viewInfo.endCell)?viewInfo.endCell:schedulerViewInfo.GetCell(viewInfo.containerIndex,viewInfo.lastCellIndex);if(_aspxIsExists(startCell)&&_aspxIsExists(endCell)){_aspxSetSchedulerDivDisplay(div,true);viewInfo.startCell=startCell;viewInfo.endCell=endCell;var paddingBeforeAppointment=this.GetPaddingBeforeAppointment(viewInfo);var paddingAfterAppointment=this.GetPaddingAfterAppointment(viewInfo);var factor=startCell.offsetWidth/viewInfo.maxIndexInGroup;var topIndent=this.GetIndent(startCell,viewInfo.startRelativeIndent);var bottomIndent=this.GetIndent(endCell,viewInfo.endRelativeIndent);var aptLeft=Math.floor(schedulerViewInfo.parent.CalcRelativeElementLeft(startCell)+viewInfo.startHorizontalIndex*factor+paddingBeforeAppointment);var aptWidth=Math.floor((viewInfo.endHorizontalIndex-viewInfo.startHorizontalIndex)*factor-(paddingAfterAppointment+paddingBeforeAppointment));var aptTop=schedulerViewInfo.parent.CalcRelativeElementTop(startCell)+topIndent;var aptBottom=schedulerViewInfo.parent.CalcRelativeElementBottom(endCell)-bottomIndent;if(__aspxFirefox)aptTop=aptTop-1;var aptHeight=aptBottom-aptTop;var aptBounds=new ASPxClientAppointmentBounds(aptLeft,aptTop,aptWidth,aptHeight);if(aptHeight<this.minAppointmentHeight){this.ExtendAppointmentBounds(aptBounds,startCell,endCell);this.RecalcAppointmentIntervalAndOffset(viewInfo,aptBounds,startCell,endCell);}
div.style.left=aptLeft+"px";div.style.width=Math.max(aptWidth,0)+"px";div.style.top=aptBounds.GetTopBound()+"px";div.style.height=aptBounds.GetHeight()+"px";}}},ExtendAppointmentBounds:function(aptBounds,firstCell,lastCell){var firstCellTopBound=this.schedulerViewInfo.parent.CalcRelativeElementTop(firstCell);var lastCellBottomBound=this.schedulerViewInfo.parent.CalcRelativeElementBottom(lastCell);aptBounds.height=Math.min(this.minAppointmentHeight,lastCellBottomBound-aptBounds.GetTopBound());if(aptBounds.height<this.minAppointmentHeight)aptBounds.y=Math.max(firstCellTopBound,aptBounds.GetBottomBound()-this.minAppointmentHeight);},RecalcStartOffset:function(aptBounds,firstCell){var cellTopBound=this.schedulerViewInfo.parent.CalcRelativeElementTop(firstCell);var cellHeight=this.schedulerViewInfo.parent.CalcRelativeElementBottom(firstCell)-cellTopBound;return Math.floor((aptBounds.GetTopBound()-cellTopBound)/cellHeight*100);},RecalcEndOffset:function(aptBounds,lastCell){var cellBottomBound=this.schedulerViewInfo.parent.CalcRelativeElementBottom(lastCell);var cellHeight=cellBottomBound-this.schedulerViewInfo.parent.CalcRelativeElementTop(lastCell);return Math.floor((cellBottomBound-aptBounds.GetBottomBound())/cellHeight*100);},GetPaddingBeforeAppointment:function(viewInfo){if(this.IsFirstAppointment(viewInfo))return this.leftAppointmentIndent;else return this.gapBetweenAppointment/2;},GetPaddingAfterAppointment:function(viewInfo){if(this.IsLastAppointment(viewInfo))return this.rightAppointmentIndent;else return this.gapBetweenAppointment/2;},IsLastAppointment:function(viewInfo){return viewInfo.endHorizontalIndex==viewInfo.maxIndexInGroup;},IsFirstAppointment:function(viewInfo){return viewInfo.startHorizontalIndex==0;},GetIndent:function(cell,relativeIndent){if(!_aspxIsExists(relativeIndent))return 0;else return relativeIndent*cell.offsetHeight/100;},LayoutAppointmentStatusCore:function(statusForeDiv,statusBackDiv,appointmentViewInfo){var statusViewInfo=appointmentViewInfo.statusViewInfo;var aptDiv=statusBackDiv.appointmentDiv;var height=aptDiv.clientHeight;var topBorderHeight=this.CalculateTopBorderHeight(appointmentViewInfo,aptDiv);statusBackDiv.style.height=height+"px";statusBackDiv.style.top=topBorderHeight+"px";var topIndent=Math.floor(statusViewInfo.startOffset*height/100);var bottomIndent=Math.floor(statusViewInfo.endOffset*height/100);statusForeDiv.style.top=topIndent+topBorderHeight+"px";statusForeDiv.style.height=height-topIndent-bottomIndent+"px";},CalculateTopBorderHeight:function(aptViewInfo,aptDiv){var aptBordersHeight=aptDiv.offsetHeight-aptDiv.clientHeight;if(!aptViewInfo.hasTopBorder)return 0;if(aptViewInfo.hasBottomBorder)return Math.ceil(aptBordersHeight/2);else return aptBordersHeight;}});ASPxClientBusyInterval=_aspxCreateClass(null,{constructor:function(start,end){this.start=start;this.end=end;},ContainsExcludeEndBound:function(value){return this.start<=value&&this.end>value;}});ASPxClientHorizontalAppointmentLayoutCalculator=_aspxCreateClass(ASPxClientAppointmentLayoutCalculator,{constructor:function(schedulerViewInfo){this.constructor.prototype.constructor.call(this,schedulerViewInfo);this.gapBetweenAppointments=3;this.leftAppointmentIndent=2;this.rightAppointmentIndent=2;this.topAppointmentIndent=2;this.schedulerViewInfo=schedulerViewInfo;this.maxCellsInWeek=7;this.appointmentNotFitted=0;this.appointmentPartialFitted=1;this.appointmentFitted=2;},CalculateLayout:function(appointmentViewInfos){if(!_aspxIsExists(appointmentViewInfos)||!_aspxIsExists(appointmentViewInfos.length))return;var count=appointmentViewInfos.length;if(count<=0)return;this.PrepareViewInfos(appointmentViewInfos);var containerCount=this.schedulerViewInfo.cellContainers.length;for(var i=0;i<containerCount;i++){var containerViewInfos=this.SelectViewInfosForContainer(appointmentViewInfos,this.schedulerViewInfo.cellContainers[i].containerIndex);if(containerViewInfos.length>0)this.CalculateLayoutCore(containerViewInfos);}
this.AfterCalculateAppointments(appointmentViewInfos);},SelectViewInfosForContainer:function(viewInfos,containerIndex){var count=viewInfos.length;var result=new Array();for(var i=0;i<count;i++){if(viewInfos[i].containerIndex==containerIndex)_aspxArrayPush(result,viewInfos[i]);}return result;},CalculateLayoutCore:function(viewInfos){var count=viewInfos.length;var relativePositionCalculator=this.CreateRelativePositionCalculator();var index=0;do{relativePositionCalculator.CalculateAppointmentRelativePositions(viewInfos,index);index=this.CalculateAppointmentsPosition(viewInfos,index);}while(index<count);},CreateRelativePositionCalculator:function(){return new ASPxClientHorizontalAppointmentRelativePositionCalculator(this.gapBetweenAppointments);},PrepareViewInfos:function(viewInfos){for(var i=0;i<viewInfos.length;i++){this.PrepareViewInfo(viewInfos[i]);}},PrepareViewInfo:function(viewInfo){viewInfo.ResetRelativeIndentAndTime();this.ResetContentDivSize(viewInfo);var div=viewInfo.contentDiv;viewInfo.visibleFirstCellIndex=viewInfo.firstCellIndex;viewInfo.visibleLastCellIndex=viewInfo.lastCellIndex;if(_aspxIsExists(div)){_aspxSetSchedulerDivDisplay(div,true);this.CalculateAppointmentSize(viewInfo);}},CalculateAppointmentSize:function(viewInfo){var containerIndex=viewInfo.containerIndex;var firstCell=this.schedulerViewInfo.GetCell(containerIndex,viewInfo.visibleFirstCellIndex);var lastCell=this.schedulerViewInfo.GetCell(containerIndex,viewInfo.visibleLastCellIndex);if(_aspxIsExists(firstCell)&&_aspxIsExists(lastCell)){this.CalculateAppointmentHeight(viewInfo);this.CalculateAppointmentWidthAndPosition(viewInfo,firstCell,lastCell);viewInfo.height=viewInfo.contentDiv.offsetHeight;viewInfo.visibleFirstCell=firstCell;viewInfo.visibleLastCell=lastCell;}},CalculateAppointmentHeight:function(viewInfo){var div=viewInfo.contentDiv;this.ResetInnerContentDivHeight(viewInfo);var aptHeight=this.schedulerViewInfo.scheduler.privateAppointmentHeight;if(aptHeight!=0)div.style.height=aptHeight+"px";else div.style.height="";},CalculateAppointmentWidthAndPosition:function(viewInfo,firstCell,lastCell){var div=viewInfo.contentDiv;div.style.width="";var borderWidth=div.offsetWidth-div.clientWidth;var leftIndent=this.GetIndent(firstCell,viewInfo.startRelativeIndent)+this.leftAppointmentIndent;var rightIndent=this.GetIndent(lastCell,viewInfo.endRelativeIndent)+this.rightAppointmentIndent;var left=this.schedulerViewInfo.parent.CalcRelativeElementLeft(firstCell)+leftIndent;var width=this.schedulerViewInfo.parent.CalcRelativeElementRight(lastCell)-left-rightIndent;var aptBounds=new ASPxClientAppointmentBounds(left,0,width,div.offsetHeight);if(width<this.minAppointmentWidth){this.ExtendAppointmentBounds(aptBounds,firstCell,lastCell);this.RecalcAppointmentIntervalAndOffset(viewInfo,aptBounds,firstCell,lastCell);}
div.style.left=aptBounds.GetLeftBound()+"px";div.style.width=Math.max(aptBounds.GetWidth()-borderWidth,0)+"px";},ResetInnerContentDivHeight:function(aptViewInfo){var innerDiv=this.FindInnerContentDiv(aptViewInfo);if(_aspxIsExists(innerDiv)){innerDiv.style.height="";innerDiv.style.width="";}},ExtendAppointmentBounds:function(aptBounds,firstCell,lastCell){var firstCellLeftBound=this.schedulerViewInfo.parent.CalcRelativeElementLeft(firstCell);var lastCellRightBound=this.schedulerViewInfo.parent.CalcRelativeElementRight(lastCell);aptBounds.width=Math.min(this.minAppointmentWidth,lastCellRightBound-aptBounds.GetLeftBound());if(aptBounds.width<this.minAppointmentWidth)aptBounds.x=Math.max(firstCellLeftBound,aptBounds.GetRightBound()-this.minAppointmentWidth);},RecalcStartOffset:function(aptBounds,firstCell){var cellLeftBound=this.schedulerViewInfo.parent.CalcRelativeElementLeft(firstCell);var cellWidth=this.schedulerViewInfo.parent.CalcRelativeElementRight(firstCell)-cellLeftBound;return Math.floor((aptBounds.GetLeftBound()-cellLeftBound)/cellWidth*100);},RecalcEndOffset:function(aptBounds,lastCell){var cellRightBound=this.schedulerViewInfo.parent.CalcRelativeElementRight(lastCell);var cellWidth=cellRightBound-this.schedulerViewInfo.parent.CalcRelativeElementLeft(lastCell);return Math.floor((cellRightBound-aptBounds.GetRightBound())/cellWidth*100);},CalculateAppointmentsPosition:function(viewInfos,startIndex){var count=viewInfos.length;for(var i=startIndex;i<count;i++){var viewInfo=viewInfos[i];var result=this.CalculateAppointmentPosition(viewInfo,false);if(result==this.appointmentPartialFitted){this.CalculateAppointmentSize(viewInfo);return i;}}return count;},CalculateAppointmentPosition:function(viewInfo,dragMode){var firstCell=viewInfo.visibleFirstCell;var dxtop=this.schedulerViewInfo.parent.CalcRelativeElementTop(firstCell)+viewInfo.relativePosition+this.topAppointmentIndent;var bottom=dxtop+viewInfo.contentDiv.offsetHeight;var fitCount=0;var weekId=viewInfo.containerIndex;for(var i=viewInfo.visibleFirstCellIndex;i<=viewInfo.visibleLastCellIndex;i++){var isFitted=this.CalculateIsFitted(viewInfo.containerIndex,i,bottom);if(!isFitted&&!dragMode){var cell=this.schedulerViewInfo.GetCell(viewInfo.containerIndex,i);this.schedulerViewInfo.ShowMoreButton(cell,viewInfo);if(i>viewInfo.visibleFirstCellIndex&&i<viewInfo.visibleLastCellIndex&&fitCount>0){throw new Error("internal scheduler error");}
var prevCellsFitted=fitCount>0;if(viewInfo.visibleFirstCellIndex<viewInfo.visibleLastCellIndex&&i==viewInfo.visibleLastCellIndex&&prevCellsFitted){viewInfo.visibleLastCellIndex--;return this.appointmentPartialFitted;}}else{fitCount++;}}if(fitCount==0){_aspxSetSchedulerDivDisplay(viewInfo.contentDiv,false);return this.appointmentNotFitted;}else{viewInfo.contentDiv.style.top=dxtop+"px";return this.appointmentFitted;}},GetIndent:function(cell,relativeIndent){if(!_aspxIsExists(relativeIndent))return 0;else return relativeIndent*cell.offsetWidth/100;},CalculateIsFitted:function(containerIndex,cellIndex,bottom){var cell=this.schedulerViewInfo.GetCell(containerIndex,cellIndex);var cellBottom=this.schedulerViewInfo.parent.CalcRelativeElementBottom(cell);return bottom+this.schedulerViewInfo.GetMoreButtonSize()<cellBottom;},LayoutAppointmentStatusCore:function(statusForeDiv,statusBackDiv,appointmentViewInfo){var statusViewInfo=appointmentViewInfo.statusViewInfo;statusBackDiv.style.width=statusBackDiv.appointmentDiv.clientWidth+"px";var leftIndent=Math.ceil(statusViewInfo.startOffset*statusBackDiv.offsetWidth/100);var rightIndent=Math.ceil(statusViewInfo.endOffset*statusBackDiv.offsetWidth/100);statusForeDiv.style.top="1px";statusForeDiv.style.left=leftIndent+1+"px";statusForeDiv.style.width=Math.max(statusBackDiv.offsetWidth-leftIndent-rightIndent,1)+"px";}});ASPxClientHorizontalAppointmentLayoutCalculatorInfinityHeight=_aspxCreateClass(ASPxClientHorizontalAppointmentLayoutCalculator,{constructor:function(schedulerViewInfo){this.constructor.prototype.constructor.call(this,schedulerViewInfo);this.maxBottom=0;},CalculateIsFitted:function(containerIndex,cellIndex,bottom){this.maxBottom=Math.max(bottom,this.maxBottom);return true;}});ASPxClientAppointmentCellIndexes=_aspxCreateClass(null,{constructor:function(firstCellIndex,lastCellIndex){this.firstCellIndex=firstCellIndex;this.lastCellIndex=lastCellIndex;}});ASPxClientHorizontalAppointmentRelativePositionCalculator=_aspxCreateClass(null,{constructor:function(gapBetweenAppointments){this.gapBetweenAppointments=gapBetweenAppointments;},CreateAppointmentCellIndexesCollection:function(viewInfos){var result=new Array();var count=viewInfos.length;for(var i=0;i<count;i++){var viewInfo=viewInfos[i];var cellIndexes=new ASPxClientAppointmentCellIndexes(viewInfo.visibleFirstCellIndex,viewInfo.visibleLastCellIndex);_aspxArrayPush(result,cellIndexes);}return result;},RestoreCellIndexes:function(viewInfos,appointmentsCellIndexes){var count=viewInfos.length;if(count==appointmentsCellIndexes.length)for(var i=0;i<count;i++){var indexes=appointmentsCellIndexes[i];var viewInfo=viewInfos[i];viewInfo.visibleFirstCellIndex=indexes.firstCellIndex;viewInfo.visibleLastCellIndex=indexes.lastCellIndex;}},CalculateAppointmentRelativePositions:function(viewInfos,startIndex){var previousCellIndexes=this.CreateAppointmentCellIndexesCollection(viewInfos);this.AdjustAppointmentCellIndexes(viewInfos);this.CalculateAppointmentRelativePositionsCore(viewInfos,startIndex);this.RestoreCellIndexes(viewInfos,previousCellIndexes);},AdjustAppointmentCellIndexes:function(viewInfos){var dateTimes=this.CreateViewInfosDateTimeCollection(viewInfos);this.CalculateAdjustedCellIndexes(viewInfos,dateTimes);},CalculateAdjustedCellIndexes:function(viewInfos,dateTimes){var count=viewInfos.length;for(var i=0;i<count;i++)this.CalculateAdjustedCellIndexesCore(viewInfos[i],dateTimes);},CalculateAdjustedCellIndexesCore:function(viewInfo,dateTimes){var firstCellIndex=_aspxArrayBinarySearch(dateTimes,viewInfo.getStartTime(),aspxSchedulerDateTimeComparer);var lastCellIndex=_aspxArrayBinarySearch(dateTimes,viewInfo.getEndTime(),aspxSchedulerDateTimeComparer)-1;viewInfo.visibleFirstCellIndex=firstCellIndex;viewInfo.visibleLastCellIndex=lastCellIndex;},CreateViewInfosDateTimeCollection:function(viewInfos){var count=viewInfos.length;var dateTimeCollection=new Array();for(var i=0;i<count;i++){var viewInfo=viewInfos[i];this.AddDateTime(dateTimeCollection,viewInfo.getStartTime());this.AddDateTime(dateTimeCollection,viewInfo.getEndTime());}
dateTimeCollection.sort(aspxSchedulerDateTimeComparer);return dateTimeCollection;},AddDateTime:function(dateTimeCollection,dateTime){if(!this.IsAlreadyAdded(dateTimeCollection,dateTime))_aspxArrayPush(dateTimeCollection,dateTime);},IsAlreadyAdded:function(dateTimeCollection,dateTime){var count=dateTimeCollection.length;for(var i=0;i<count;i++)if(dateTimeCollection[i].valueOf()==dateTime.valueOf())return true;return false;},CalculateAppointmentRelativePositionsCore:function(viewInfos,startIndex){var count=viewInfos.length;var busyIntervals=this.CreateBusyIntervals(2*count);var i=0;while(i<startIndex){this.MakeIntervalBusy(viewInfos[i],busyIntervals);i++;}while(i<count){var viewInfo=viewInfos[i];var relativePosition=this.FindAvailableRelativePosition(viewInfo,busyIntervals);viewInfo.relativePosition=relativePosition;this.MakeIntervalBusy(viewInfo,busyIntervals);i++;}},CreateBusyIntervals:function(cellsCount){var result=new Array(cellsCount);for(var i=0;i<cellsCount;i++)result[i]=new Array();return result;},FindAvailableRelativePosition:function(viewInfo,cellsBusyIntervals){viewInfo.relativePosition=0;var relativePosition=0;var from=viewInfo.visibleFirstCellIndex;var to=viewInfo.visibleLastCellIndex;var i=from;while(i<=to){var busyIntervals=cellsBusyIntervals[i];var interval=this.FindPossibleIntersectionInterval(busyIntervals,relativePosition);if((interval==null)||(interval.start>=relativePosition+viewInfo.height))i++;else{relativePosition=interval.end;i=from;}}return relativePosition;},FindPossibleIntersectionInterval:function(busyIntervals,value){for(var i=0;i<busyIntervals.length;i++){var interval=busyIntervals[i];if((interval.ContainsExcludeEndBound(value))||(interval.start>value))return new ASPxClientBusyInterval(interval.start,interval.end);}return null;},MakeIntervalBusy:function(info,busyIntervals){for(var i=info.visibleFirstCellIndex;i<=info.visibleLastCellIndex;i++)this.AddBusyInterval(busyIntervals[i],new ASPxClientBusyInterval(info.relativePosition,info.relativePosition+info.height+this.gapBetweenAppointments));},AddBusyInterval:function(busyIntervals,busyInterval){var count=busyIntervals.length;var i=0;while(i<count){if(busyIntervals[i].start>busyInterval.start)break;i++;}
_aspxArrayInsert(busyIntervals,busyInterval,i);}});ASPxClientTimelineAppointmentLayoutCalculator=_aspxCreateClass(ASPxClientHorizontalAppointmentLayoutCalculator,{constructor:function(schedulerViewInfo){this.constructor.prototype.constructor.call(this,schedulerViewInfo);this.leftAppointmentIndent=0;this.rightAppointmentIndent=0;}});function _aspxDateIncrease(date,spanInMilliseconds){return new Date(date.valueOf()+spanInMilliseconds);}
function _aspxDateIncreaseWithUtcOffset(date,spanInMilliseconds){var result=_aspxDateIncrease(date,spanInMilliseconds);var utcDiff=(result.getTimezoneOffset()-date.getTimezoneOffset())*60000;return _aspxDateIncrease(result,utcDiff);}
function _aspxDateDiffInMilliseconds(date1,date2){return date1-date2;}
function _aspxDateSubsWithTimezone(date1,date2){return date1-date2+(date2.getTimezoneOffset()-date1.getTimezoneOffset())*60000;}
function _aspxDateTimeToMilliseconds(dateTime){var result=dateTime.valueOf();result-=60000*dateTime.getTimezoneOffset();return result;}
function _aspxDateTimeMinValue(value1,value2){return value1<value2?value1:value2;}
function _aspxDateTimeMaxValue(value1,value2){return value1>value2?value1:value2;}
function _aspxGetShiftKey(evt){if(__aspxIE)return(event!=null)?event.shiftKey:false;else return(evt!=null)?evt.shiftKey:false;}
function _aspxGetCtrlKey(evt){if(__aspxIE)return(event!=null)?event.ctrlKey:false;else return(evt!=null)?evt.ctrlKey:false;}
function aspxIsLeftKey(evt){return evt.keyCode==0x25;}
function aspxIsUpKey(evt){return evt.keyCode==0x26;}
function aspxIsRightKey(evt){return evt.keyCode==0x27;}
function aspxIsDownKey(evt){return evt.keyCode==0x28;}
function _aspxGetIsRightButtonPressed(evt){evt=_aspxGetEvent(evt);if(!_aspxIsExists(evt))return false;if(__aspxIE)return evt.button==2;else if(__aspxNS||__aspxSafariFamily)return evt.which==3;else if(__aspxOpera||__aspxOpera9)return evt.button==1;return true;}
function _aspxFindParentElement(element,testFunc){if(!_aspxIsExists(testFunc))return null;while(element!=null&&element.tagName!="BODY"){if(testFunc(element))return element;element=element.parentNode;}return null;}
function _aspxGetOnMouseOutEventTarget(evt){evt=_aspxGetEvent(evt);if(!_aspxIsExists(evt))return null;return __aspxIE?evt.toElement:evt.relatedTarget;}
function _aspxSetTableCellOffsetWidth(tableCell,newOffsetWidth){if(newOffsetWidth<=0){return;}
tableCell.style.width=newOffsetWidth+"px";_aspxRefreshTableCell(tableCell);var delta=tableCell.clientWidth-newOffsetWidth;var correctedWidth=newOffsetWidth-delta;if(correctedWidth>0)tableCell.style.width=correctedWidth+"px";else tableCell.style.width="0px";_aspxRefreshTableCell(tableCell);}
function _aspxRefreshTableCell(tableCell){if(__aspxOpera){tableCell.style.display="none";tableCell.style.display="table-cell";}}
function _aspxChangeTableLayout(table,layout){if(__aspxIE){table.style.tableLayout=layout;return;}
var parent=table.parentNode;var nextSibling=table.nextSibling;parent.removeChild(table);table.style.tableLayout=layout;if(_aspxIsExists(nextSibling))parent.insertBefore(table,nextSibling);else parent.appendChild(table);}
function _aspxGetItemByLocation(parentTable,location){return parentTable.rows[location[0]].cells[location[1]];}
function aspxSchedulerNavBtnClick(name,startTime,duration,resourceId){var scheduler=aspxGetControlCollection().Get(name);if(scheduler!=null)scheduler.NavBtnClick(startTime,duration,resourceId);}
function aspxSchedulerMainDivMouseDown(name,evt){var scheduler=aspxGetControlCollection().Get(name);if(scheduler!=null)scheduler.MainDivMouseDown(evt);}
function aspxSchedulerFuncCallback(name,result){var scheduler=aspxGetControlCollection().Get(name);if(scheduler!=null)scheduler.OnFuncCallback(unescape(result));}
function aspxSchedulerEmptyFuncCallbackHandler(){}
function aspxAppointmentSave(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control)){if(ASPxClientEdit.ValidateEditorsInContainerById(controlId+"_formBlock_innerContent"))control.RaiseCallback("APTSAVE|");}}
function aspxAppointmentCancel(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control)){control.CancelFormChangesAndClose(control.aptFormVisibility,"APTCANCEL|");}}
function aspxAppointmentDelete(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control)){control.RaiseCallback("APTDEL|");}}
function aspxInplaceEditorSave(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control)){control.RaiseCallback("INPLACESAVE|");}}
function aspxInplaceEditorEditForm(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control)){control.RaiseCallback("INPLACEFORM|");}}
function aspxShowInplacePopupWindow(name,popupId,aptId){var control=aspxGetControlCollection().Get(name);if(_aspxIsExists(control)){control.SaveCurrentPopupContainer(popupId);control.ShowInplacePopupWindow(popupId,aptId);}}
function aspxShowFormPopupWindow(name,popupId){var control=aspxGetControlCollection().Get(name);if(_aspxIsExists(control)){control.SaveCurrentPopupContainer(popupId);control.ShowFormPopupWindow(popupId);}}
function aspxGotoDateApply(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control)){control.RaiseCallback("GOTODATEFORM|");}}
function aspxGotoDateCancel(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control)){control.CancelFormChangesAndClose(control.gotoDateFormVisibility,"GOTODATEFORMCANCEL|");}}
function aspxRecurrentAptDeleteCancel(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control))control.CancelFormChangesAndClose(control.recurrentAppointmentDeleteFormVisibility,"RECURAPTDELETECANCEL|");}
function aspxRecurrentAptDelete(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control))return control.RaiseCallback("RECURAPTDELETE|");}
function aspxRecurrentAptEditCancel(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control))control.CancelFormChangesAndClose(control.recurrentAppointmentDeleteFormVisibility,"RECURAPTEDITCANCEL|");}
function aspxRecurrentAptEdit(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control))return control.RaiseCallback("RECURAPTEDIT|");}
function aspxSchedulerDateTimeComparer(dateTime1,dateTime2){var dif=dateTime2-dateTime1;if(dif==0)return 0;return dif<0?1:-1;}
function aspxMoreButtonClickEvent(evt){var srcMoreButtonDiv=_aspxGetEventSource(evt);var control=srcMoreButtonDiv.schedulerControl;var args=new MoreButtonClickedEventArgs(srcMoreButtonDiv.targetDateTime,srcMoreButtonDiv.interval,srcMoreButtonDiv.resource);control.RaiseMoreButtonClickedEvent(args);if(args.handled)return;var intervalArgs=_aspxDateTimeToMilliseconds(srcMoreButtonDiv.interval.GetStart())+","+srcMoreButtonDiv.interval.GetDuration();var targetDateTimeArg=_aspxDateTimeToMilliseconds(srcMoreButtonDiv.targetDateTime);control.RaiseCallback("MOREBTN|"+targetDateTimeArg+","+intervalArgs+","+srcMoreButtonDiv.resource);}
function aspxCancelRemindersForm(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control))control.RaiseCallback("CLSREMINDERSFRM|");}
function aspxReminderAlerted(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control)&&control.reminderTimerId!=null){if(control.enableReminderTimer){control.menuManager.HideMenu();return control.RaiseCallback("PROCESSREMINDER|");}else control.suspendedCallAspxReminderAlerted=true;return null;}}
function aspxDismissReminders(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control))return control.RaiseCallback("DSMSREMINDER|");}
function aspxDismissAllReminders(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control))return control.RaiseCallback("DSMSALLREMINDERS|");}
function aspxSnoozeReminders(controlId){var control=aspxGetControlCollection().Get(controlId);if(_aspxIsExists(control))return control.RaiseCallback("SNZREMINDERS|");}
var __aspxClientSchedulerSelectionHelper=null;function SchedulerSelectionHelper_onmouseup(e){if(__aspxClientSchedulerSelectionHelper!=null){__aspxClientSchedulerSelectionHelper.EndSelection(e);return true;}}
function SchedulerSelectionHelper_onmousemove(e){if(__aspxClientSchedulerSelectionHelper!=null){__aspxClientSchedulerSelectionHelper.MouseMove(e);return false;}return true;}
function SchedulerSelectionHelper_onselectstart(e){if(__aspxClientSchedulerSelectionHelper!=null){document.selection.empty();return false;}return true;}
_aspxAttachEventToDocument("mouseup",SchedulerSelectionHelper_onmouseup);_aspxAttachEventToDocument("mousemove",SchedulerSelectionHelper_onmousemove);_aspxAttachEventToDocument("selectstart",SchedulerSelectionHelper_onselectstart);ASPxSchedulerSelection=new _aspxCreateClass(null,{constructor:function(interval,resource,firstSelectedInterval){this.interval=interval;this.resource=resource;this.firstSelectedInterval=_aspxIsExists(firstSelectedInterval)?firstSelectedInterval:interval;}});ASPxClientSchedulerSelectionHelper=_aspxCreateClass(null,{constructor:function(scheduler,firstCell,continueSelection){if(__aspxClientSchedulerSelectionHelper!=null)__aspxClientSchedulerSelectionHelper.CancelSelection();this.scheduler=scheduler;if(!continueSelection||!_aspxIsExists(this.scheduler.selection)){var resource=scheduler.GetCellResource(firstCell);var interval=scheduler.GetCellInterval(firstCell);this.scheduler.SetSelectionCore(new ASPxSchedulerSelection(interval,resource));}else this.ContinueSelection(firstCell);__aspxClientSchedulerSelectionHelper=this;},MouseMove:function(e){var cell=this.scheduler.CalcHitTest(e).cell;if(_aspxIsExists(cell)){this.ContinueSelection(cell);}},ContinueSelection:function(cell){var interval=this.scheduler.GetCellInterval(cell);if(!_aspxIsExists(interval))return;var newSelectionInterval=this.CalculateSelectionInterval(interval);if(!newSelectionInterval.Equals(this.scheduler.selection.interval)){this.scheduler.SetSelectionInterval(newSelectionInterval);}},EndSelection:function(e){this.CancelSelection();},CancelSelection:function(e){__aspxClientSchedulerSelectionHelper=null;},CalculateSelectionInterval:function(hitInterval){var firstInterval=this.scheduler.selection.firstSelectedInterval;if(firstInterval.IntersectsWith(hitInterval))return new ASPxClientTimeInterval(firstInterval.GetStart(),_aspxDateSubsWithTimezone(hitInterval.GetEnd(),firstInterval.GetStart()));if(hitInterval.GetStart()-firstInterval.GetEnd()>=0)return new ASPxClientTimeInterval(firstInterval.GetStart(),_aspxDateSubsWithTimezone(hitInterval.GetEnd(),firstInterval.GetStart()));else return new ASPxClientTimeInterval(hitInterval.GetStart(),_aspxDateSubsWithTimezone(firstInterval.GetEnd(),hitInterval.GetStart()));}});ASPxAppointmentSelection=_aspxCreateClass(null,{constructor:function(scheduler){this.selectedAppointmentIds=new Array();this.selectedAppointmentViewInfos=new Array();this.scheduler=scheduler;this.lockCount=0;this.deferredOnAppointmentSelection=false;this.internalSelection=false;},BeginUpdate:function(internalSelection){this.internalSelection=internalSelection;this.lockCount++;},EndUpdate:function(){if(this.lockCount>0){this.lockCount--;if(this.lockCount==0){if(!this.internalSelection)this.ValidateViewInfos();if(this.deferredOnAppointmentSelection)this.OnAppointmentSelectionChanged();this.deferredOnAppointmentSelection=false;}}},ValidateViewInfos:function(){_aspxArrayClear(this.selectedAppointmentViewInfos);var count=this.selectedAppointmentIds.length;for(var i=count-1;i>=0;i--){if(!this.AddAppointmentCore(this.selectedAppointmentIds[i]))_aspxArrayRemoveAt(this.selectedAppointmentIds,i);}},AddAppointmentCore:function(appointmentId){var viewInfos=this.scheduler.FindViewInfosByAppointmentId(appointmentId);var count=viewInfos.length;if(count<=0)return false;for(var i=0;i<count;i++)this.SelectAppointmentViewInfo(viewInfos[i]);return true;},Prepare:function(){this.aptAdorner=this.scheduler.aptAdorner;},OnAppointmentSelectionChanged:function(){if(this.lockCount>0)this.deferredOnAppointmentSelection=true;else this.scheduler.OnAppointmentSelectionChanged(this.selectedAppointmentIds);},AddAppointmentToSelection:function(appointmentId){if(!this.scheduler.privateAllowAppointmentMultiSelect&&this.selectedAppointmentIds.length>=1)return;var contains=_aspxArrayIndexOf(this.selectedAppointmentIds,appointmentId)>=0;if(contains)return;if(this.lockCount>0&&!this.internalSelection){_aspxArrayPush(this.selectedAppointmentIds,appointmentId);this.OnAppointmentSelectionChanged();}else{if(this.AddAppointmentCore(appointmentId)){_aspxArrayPush(this.selectedAppointmentIds,appointmentId);this.OnAppointmentSelectionChanged();}}},ClearSelection:function(){var count=this.selectedAppointmentIds.length;if(count<=0)return;_aspxArrayClear(this.selectedAppointmentIds);if(this.lockCount<=0||this.internalSelection){count=this.selectedAppointmentViewInfos.length;for(var i=count-1;i>=0;i--)this.UnselectAppointmentViewInfoByIndex(i);}
this.OnAppointmentSelectionChanged();},RemoveAppointmentFromSelection:function(appointmentId){_aspxArrayRemove(this.selectedAppointmentIds,appointmentId);if(this.lockCount<=0){var count=this.selectedAppointmentViewInfos.length;for(var i=count-1;i>=0;i--){var viewInfo=this.selectedAppointmentViewInfos[i];if(viewInfo.appointmentId==appointmentId)this.UnselectAppointmentViewInfoByIndex(i);}}
this.OnAppointmentSelectionChanged();},ChangeAppointmentSelection:function(appointmentId){var contains=_aspxArrayIndexOf(this.selectedAppointmentIds,appointmentId)>=0;if(contains&&this.selectedAppointmentIds.length>1)this.RemoveAppointmentFromSelection(appointmentId);else if(this.scheduler.privateAllowAppointmentMultiSelect||this.selectedAppointmentIds.length<1)this.AddAppointmentToSelection(appointmentId);},SelectSingleAppointment:function(appointmentId){if(this.selectedAppointmentIds.length==1&&this.selectedAppointmentIds[0]==appointmentId)return;this.BeginUpdate(true);this.ClearSelection();this.AddAppointmentToSelection(appointmentId);this.EndUpdate();},IsAppointmentSelected:function(appointmentId){return _aspxArrayIndexOf(this.selectedAppointmentIds,appointmentId)>=0;},UnselectAppointmentViewInfoByIndex:function(index){var viewInfo=this.selectedAppointmentViewInfos[index];this.UnselectAppointmentViewInfoCore(viewInfo);_aspxArrayRemoveAt(this.selectedAppointmentViewInfos,index);viewInfo.adornerDiv=null;},UnselectAppointmentViewInfoCore:function(viewInfo){viewInfo.contentDiv.style.zIndex=1;_aspxRemoveElement(viewInfo.adornerDiv);},SelectAppointmentViewInfo:function(viewInfo){var adornerDiv=this.SelectAppointmentViewInfoCore(viewInfo);_aspxClearCurrentMouseEventDataObject();_aspxSubscribeSchedulerMouseEvents(adornerDiv,viewInfo);_aspxArrayPush(this.selectedAppointmentViewInfos,viewInfo);},SelectAppointmentViewInfoCore:function(viewInfo){var adornerDiv=this.aptAdorner.cloneNode(true);adornerDiv.oncontextmenu=this.aptAdorner.oncontextmenu;var appointmentDiv=viewInfo.contentDiv;var parent=appointmentDiv.parentNode;parent.appendChild(adornerDiv);adornerDiv.appointmentViewInfo=viewInfo;viewInfo.adornerDiv=adornerDiv;this.SetAdornerDivPosition(viewInfo);adornerDiv.style.zIndex=2;appointmentDiv.style.zIndex=3;return adornerDiv;},RecalcSelection:function(){var count=this.selectedAppointmentViewInfos.length;for(var i=0;i<count;i++)this.SetAdornerDivPosition(this.selectedAppointmentViewInfos[i]);},SetAdornerDivPosition:function(viewInfo){var adornerDiv=viewInfo.adornerDiv;var appointmentDiv=viewInfo.contentDiv;_aspxSetSchedulerDivDisplay(adornerDiv,true);var borderWidth=Math.max(adornerDiv.offsetWidth-adornerDiv.clientWidth,0)>>1;var borderHeight=Math.max(adornerDiv.offsetHeight-adornerDiv.clientHeight,0)>>1;adornerDiv.style.left=appointmentDiv.offsetLeft-borderWidth+"px";adornerDiv.style.width=appointmentDiv.offsetWidth+"px";adornerDiv.style.top=appointmentDiv.offsetTop-borderHeight+"px";adornerDiv.style.height=appointmentDiv.offsetHeight+"px";adornerDiv.appointmentDiv=appointmentDiv;this.CalculateContentTableHeight(adornerDiv);},CalculateContentTableHeight:function(adornerDiv){var children=adornerDiv.childNodes;var count=children.length;for(var i=0;i<count;i++){var child=children[i];if(_aspxIsExists(child.tagName)&&child.tagName.toUpperCase()=="TABLE"){child.style.height=adornerDiv.offsetHeight+"px";break;}}}});ASPxCellHighlightElement=_aspxCreateClass(null,{constructor:function(container,left,dxtop,width,height,interval){this.left=left;this.top=dxtop;this.width=width;this.height=height;this.interval=interval;this.container=container;}});ASPxCellHighlightViewInfo=_aspxCreateClass(null,{constructor:function(scheduler,viewInfo,divTemplate,layer){this.scheduler=scheduler;this.viewInfo=viewInfo;this.parent=viewInfo.parent;this.divTemplate=divTemplate;this.highlightDivs=new Array();this.highlightElements=new Array();this.highlightDivCache=new Array();this.layer=layer;},HighlightCells:function(interval,resource,smartTagDiv,highlightPartiallySelectedCell,selectionVisible){if(!_aspxIsExists(interval)||!_aspxIsExists(resource))return;this.RemovePrevCellHighlight();if(selectionVisible){this.CreateHighlightElements(interval,resource,highlightPartiallySelectedCell);this.CreateHighlightDivs(smartTagDiv);}},RemovePrevCellHighlight:function(){var count=this.highlightDivs.length;for(var i=0;i<count;i++){this.ReleaseHighlightDiv(this.highlightDivs[i]);}
_aspxArrayClear(this.highlightDivs);_aspxArrayClear(this.highlightElements);},CreateHighlightElements:function(interval,resource,highlightPartiallySelectedCell){var cellContainers=this.viewInfo.cellContainers;var count=cellContainers.length;var viewInfo=this.viewInfo;for(var i=0;i<count;i++){var container=cellContainers[i];if(container.resource!=resource||!container.interval.IntersectsWithExcludingBounds(interval))continue;if(interval.Contains(container.interval)){this.HighlightContainer(container);continue;}
var cellCount=container.cellCount;for(var j=0;j<cellCount;j++){var cell=this.viewInfo.GetCell(i,j);if(_aspxIsExists(cell)){var cellInterval=this.scheduler.GetCellInterval(cell);var highlightCell;if(highlightPartiallySelectedCell)highlightCell=cellInterval.IntersectsWithExcludingBounds(interval);else highlightCell=interval.Contains(cellInterval);if(highlightCell)this.HighlightCell(cell);}}}},CreateHighlightDivs:function(smartTagDiv){var count=this.highlightElements.length;for(var i=0;i<count;i++){var element=this.highlightElements[i];var highlightDiv=this.CreateHighlightDiv(element);if(_aspxIsExists(smartTagDiv)){_aspxSubscribeSchedulerMouseEvents(highlightDiv,highlightDiv);highlightDiv.mouseEvents=new ASPxSchedulerMouseEvents();_aspxAddSmartTag(highlightDiv,smartTagDiv);}
_aspxArrayPush(this.highlightDivs,highlightDiv);}},CreateHighlightDiv:function(highlightElement){var highlightDiv=this.CreateHightlightDiv();highlightDiv.style.height="0px";highlightDiv.container=highlightElement.container;highlightDiv.style.left=highlightElement.left+"px";highlightDiv.style.top=highlightElement.top+"px";highlightDiv.style.width=highlightElement.width+"px";highlightDiv.style.height=highlightElement.height+"px";_aspxSetElementDisplay(highlightDiv,true);return highlightDiv;},CreateHightlightDiv:function(){if(this.highlightDivCache.length>0)return this.highlightDivCache.pop();else{var highlightDiv=this.divTemplate.cloneNode(true);highlightDiv.oncontextmenu=highlightDiv;_aspxSetElementDisplay(highlightDiv,false);this.viewInfo.parent.AppendChildToLayer(highlightDiv,this.layer);return highlightDiv;}},ReleaseHighlightDiv:function(div){_aspxArrayPush(this.highlightDivCache,div);_aspxSetElementDisplay(div,false);},HighlightContainer:function(container){if(!this.IsValidContainer(container))return;var bounds=this.parent.CalcRelativeContainerBounds(this.viewInfo,container);if(!_aspxIsExists(bounds))return;var left=bounds.left;var dxtop=bounds.top;var width=bounds.width;var height=bounds.height;var newHighlightElement=new ASPxCellHighlightElement(container,left,dxtop,width,height,container.interval);_aspxArrayPush(this.highlightElements,newHighlightElement);},HighlightCell:function(cell){var findResult=this.FindAdjacentHighlightElement(cell);if(_aspxIsExists(findResult)){var highlightElement=findResult.highlightElement;if(_aspxIsExists(findResult.newLeft))highlightElement.left=findResult.newLeft;if(_aspxIsExists(findResult.newTop))highlightElement.top=findResult.newTop;if(_aspxIsExists(findResult.newRight))highlightElement.width=findResult.newRight-highlightElement.left;if(_aspxIsExists(findResult.newBottom))highlightElement.height=findResult.newBottom-highlightElement.top;if(_aspxIsExists(findResult.newStartTime))highlightElement.interval.SetStart(findResult.newStartTime);if(_aspxIsExists(findResult.newEndTime))highlightElement.interval.SetEnd(findResult.newEndTime);}else{var container=this.scheduler.GetCellContainer(cell);if(!this.IsValidContainer(container))return;var left=this.parent.CalcRelativeElementLeft(cell);var dxtop=this.parent.CalcRelativeElementTop(cell);var width=cell.offsetWidth;var height=this.parent.CalcCellHeight(cell);var startTime=this.scheduler.GetCellStartTime(cell);var endTime=this.scheduler.GetCellEndTime(cell);if(!_aspxIsExists(container)||!_aspxIsExists(left)||!_aspxIsExists(dxtop)||!_aspxIsExists(width)||!_aspxIsExists(height)||!_aspxIsExists(startTime)||!_aspxIsExists(endTime))return;var interval=new ASPxClientTimeInterval(startTime,_aspxDateSubsWithTimezone(endTime,startTime));var newHighlightElement=new ASPxCellHighlightElement(container,left,dxtop,width,height,interval);_aspxArrayPush(this.highlightElements,newHighlightElement);}},FindAdjacentHighlightElement:function(cell){var count=this.highlightElements.length;var startTime=this.scheduler.GetCellStartTime(cell);var endTime=this.scheduler.GetCellEndTime(cell);var container=this.scheduler.GetCellContainer(cell);if(!_aspxIsExists(startTime)||!_aspxIsExists(endTime)||!_aspxIsExists(container))return null;for(var i=0;i<count;i++){var highlightElement=this.highlightElements[i];if(highlightElement.container!=container)continue;var highlightInterval=highlightElement.interval;var cellBeforeHighlight=(highlightInterval.GetStart()-endTime)==0;var cellAfterHighlight=(highlightInterval.GetEnd()-startTime)==0;if(!cellBeforeHighlight&&!cellAfterHighlight)continue;var result=new Object();if(cellBeforeHighlight)result.newStartTime=startTime;if(cellAfterHighlight)result.newEndTime=endTime;if(this.IsVisuallyAdjacent(highlightElement,cell,result)){result.highlightElement=highlightElement;return result;}}return null;}});ASPxHorizontalCellHighlightViewInfo=_aspxCreateClass(ASPxCellHighlightViewInfo,{constructor:function(scheduler,viewInfo,divTemplate,layer){this.constructor.prototype.constructor.call(this,scheduler,viewInfo,divTemplate,layer);},IsValidContainer:function(container){return _aspxIsExists(container.isVertical)&&(!container.isVertical);},IsVisuallyAdjacent:function(highlightElement,cell,result){var cellTop=this.parent.CalcRelativeElementTop(cell);var cellHeight=this.parent.CalcCellHeight(cell);if(cellTop==highlightElement.top&&cellHeight==highlightElement.height){var cellLeft=this.parent.CalcRelativeElementLeft(cell);result.newLeft=Math.min(cellLeft,highlightElement.left);result.newRight=Math.max(this.parent.CalcRelativeElementRight(cell),highlightElement.left+highlightElement.width);return true;}}});ASPxVerticalCellHighlightViewInfo=_aspxCreateClass(ASPxCellHighlightViewInfo,{constructor:function(scheduler,viewInfo,divTemplate,layer){this.constructor.prototype.constructor.call(this,scheduler,viewInfo,divTemplate,layer);},IsValidContainer:function(container){return _aspxIsExists(container.isVertical)&&container.isVertical;},IsVisuallyAdjacent:function(highlightElement,cell,result){var cellLeft=this.parent.CalcRelativeElementLeft(cell);if(cellLeft==highlightElement.left&&cell.offsetWidth==highlightElement.width){var cellTop=this.parent.CalcRelativeElementTop(cell);result.newTop=Math.min(cellTop,highlightElement.top);result.newBottom=Math.max(this.parent.CalcRelativeElementBottom(cell),highlightElement.top+highlightElement.height);return true;}}});var _aspxSchedulerMoreButtonId="moreButton";ASPxClientCellDurationIterator=_aspxCreateClass(null,{constructor:function(durations){this.durations=durations;this.start();},start:function(){this.currentDurationIndex=-1;this.restDurationCount=0;},getNextDuration:function(){if(this.restDurationCount==0){this.currentDurationIndex++;this.restDurationCount=this.durations[2*this.currentDurationIndex];this.currentDuration=this.durations[2*this.currentDurationIndex+1];}
this.restDurationCount--;return this.currentDuration;}});ASPxSchedulerContainer=_aspxCreateClass(null,{constructor:function(containerIndex,index,startTime,cellCount,cellDurationInfos,resource,isVertical,cellsLocation){this.index=index;this.cellCount=cellCount;this.cellDurationInfos=cellDurationInfos;this.containerIndex=containerIndex;this.resource=resource;this.interval=new ASPxClientTimeInterval(startTime,this.GetTotalContainerDuration(cellDurationInfos));this.isVertical=isVertical;this.privateCellsLocation=cellsLocation;this.cellsLocation=this.ExpandCellsLocation(cellsLocation);this.initializedCells=new Array();},GetTotalContainerDuration:function(cellDurationInfos){this.cellTimes=new Array();var count=cellDurationInfos.length;var totalDuration=0;for(var i=0;i<count;i+=2){_aspxArrayPush(this.cellTimes,totalDuration);totalDuration+=cellDurationInfos[i]*cellDurationInfos[i+1];}
_aspxArrayPush(this.cellTimes,totalDuration);return totalDuration;},ExpandCellsLocation:function(cellsLocation){var result=new Array();var count=cellsLocation.length;for(var i=0;i<count;i++){this.ExpandCellsLocationCore(cellsLocation[i],result);}return result;},ExpandCellsLocationCore:function(cellsLocation,result){var count=cellsLocation[0];var row=cellsLocation[1];var column=cellsLocation[2];for(var i=0;i<count;i++){var position=new Object();if(this.isVertical){position.row=row+i;position.column=column;}else{position.row=row;position.column=column+i;}
_aspxArrayPush(result,position);}},GetCellLocation:function(cellIndex){return this.cellsLocation[cellIndex];},InitializeCell:function(cell,cellIndex){var cellDurations=this.cellDurationInfos;var time=this.interval.GetStart();var durationIndex=0;var duration;while(cellIndex>=cellDurations[durationIndex]){var cellCount=cellDurations[durationIndex];if(cellCount>0){cellIndex-=cellCount;duration=cellDurations[durationIndex]*cellDurations[durationIndex+1];}else duration=-cellDurations[durationIndex+1];time=_aspxDateIncreaseWithUtcOffset(time,duration);durationIndex+=2;}
duration=cellDurations[durationIndex+1];var cellStart=_aspxDateIncreaseWithUtcOffset(time,cellIndex*duration);var cellEnd=_aspxDateIncreaseWithUtcOffset(cellStart,duration);cell.interval=new ASPxClientTimeInterval(cellStart,duration);cell.resource=this.resource;cell.container=this;_aspxArrayPush(this.initializedCells,cell);},ClearInitializedCells:function(){var count=this.initializedCells.length;for(var i=0;i<count;i++){var cell=this.initializedCells[i];cell.interval=null;cell.resource=null;cell.container=null;}}});ASPxSchedulerViewInfo=_aspxCreateClass(null,{constructor:function(scheduler,prevViewInfo,usePrevCache){this.scheduler=scheduler;this.appointmentViewInfos=new Array();this.cellContainers=new Array();this.isVertical=null;if(_aspxIsExists(prevViewInfo)&&usePrevCache){this.ClearPrevContainers(prevViewInfo.cellContainers);this.cachedCells=prevViewInfo.cachedCells;}else{this.cachedCells=null;}},ClearPrevContainers:function(containers){var count=containers.length;for(var i=0;i<count;i++){containers[i].ClearInitializedCells();}},Initialize:function(table){this.table=table;if(!this.cachedCells)this.cachedCells=new Object();},Dispose:function(){var count=this.appointmentViewInfos.length;for(var i=0;i<count;i++)this.DisposeAppointmentViewInfo(this.appointmentViewInfos[i]);},DisposeAppointmentViewInfo:function(appointmentViewInfo){var appointmentDiv=appointmentViewInfo.contentDiv;if(!_aspxIsExists(appointmentDiv))return;_aspxUnsubscribeSchedulerMouseEvents(appointmentDiv,appointmentViewInfo);},Prepare:function(parent){this.parent=parent;var count=this.appointmentViewInfos.length;for(var i=0;i<count;i++){var viewInfo=this.appointmentViewInfos[i];var div=this.scheduler.GetAppointmentDivById(viewInfo.divId);if(!_aspxIsExists(div))continue;viewInfo.contentDiv=div;viewInfo.contentDiv.appointmentId=viewInfo.appointmentId;div.appointmentViewInfo=viewInfo;if(div.parentNode!=parent.appointmentLayer)parent.AppendChildToAppointmentLayer(div);}
this.selectionViewInfo=this.CreateSelectionViewInfoCore();},HideAppointments:function(){var count=this.appointmentViewInfos.length;for(var i=0;i<count;i++){_aspxSetSchedulerDivDisplay(this.appointmentViewInfos[i].contentDiv,false);}},ShowCellSelection:function(interval,resource,highlightPartiallySelectedCell,selectionVisible){if(_aspxIsExists(interval)&&_aspxIsExists(resource))this.selectionViewInfo.HighlightCells(interval,resource,this.scheduler.smartTagDiv,highlightPartiallySelectedCell,selectionVisible);},AddCellContainer:function(containerIndex,cellCount,containerStartTime,cellDurationInfos,resource,cellsLocations){var container=new ASPxSchedulerContainer(containerIndex,this.cellContainers.length,containerStartTime,cellCount,cellDurationInfos,resource,this.isVertical,cellsLocations);_aspxArrayPush(this.cellContainers,container);},InitializeCell:function(cell,containerIndex,cellIndex){this.cellContainers[containerIndex].InitializeCell(cell,cellIndex);},GetCellById:function(id){return this.cachedCells[id];},GetCell:function(containerIndex,index){var hashCode=(containerIndex<<16)+index;var result=this.cachedCells[hashCode];if(!_aspxIsExists(result)){var container=this.cellContainers[containerIndex];if(!_aspxIsExists(container))return null;var loc=container.GetCellLocation(index);if(_aspxIsExists(loc)){result=this.table.rows[loc.row].cells[loc.column];this.cachedCells[hashCode]=result;}}return result;},FindCellContainerByTimeInterval:function(start,end){var interval=new ASPxClientTimeInterval(start,_aspxDateSubsWithTimezone(end,start));var index=_aspxArrayBinarySearch(this.cellContainers,interval,this.ContainerWithIntervalComparer);if(index<0)return null;else return this.cellContainers[index];},FindStartCellIndexByTime:function(cellContainer,time){var start=cellContainer.interval.GetStart();var durations=cellContainer.cellDurationInfos;var count=durations.length;var cellCount=0;var i=0;for(;i<count-2;i+=2){var duration=durations[i]*durations[i+1];if(duration>0){if((start-time)+duration>0){break;}
cellCount+=durations[i];}else{duration=-durations[i+1];if(start-time+duration>0)return cellCount;}
start=_aspxDateIncrease(start,duration);}
var dif=_aspxDateSubsWithTimezone(time,start);var rem=dif%durations[i+1];return(dif-rem)/durations[i+1]+cellCount;},FindStartCellByTime:function(cellContainer,time){return this.GetCell(cellContainer.index,this.FindStartCellIndexByTime(cellContainer,time));},FindEndCellIndexByTime:function(cellContainer,time){var start=cellContainer.interval.GetStart();var durations=cellContainer.cellDurationInfos;var count=durations.length;var cellCount=0;var i=0;for(;i<count-2;i+=2){var duration=durations[i]*durations[i+1];if(duration>0){if((start-time)+duration>0){break;}
cellCount+=durations[i];}else{duration=-durations[i+1];if(start-time+duration>0)return cellCount-1;}
start=_aspxDateIncrease(start,duration);}
var dif=_aspxDateSubsWithTimezone(time,start);var rem=dif%durations[i+1];var cellIndex=(dif-rem)/durations[i+1]+cellCount;if(rem==0&&cellIndex>0)cellIndex--;return Math.min(cellIndex,cellContainer.cellCount-1);},FindEndCellByTime:function(cellContainer,time){return this.GetCell(cellContainer.index,this.FindEndCellIndexByTime(cellContainer,time));},ContainerWithIntervalComparer:function(container,interval){var conteinerInterval=container.interval;if(conteinerInterval.GetStart()>interval.GetEnd())return 1;if(conteinerInterval.GetEnd()<interval.GetStart())return-1;return 0;},AddViewInfo:function(viewInfo){_aspxArrayPush(this.appointmentViewInfos,viewInfo);},FindCellByPosition:function(containerIndex,firstCellIndex,lastCellIndex,x,y){if(_aspxIsExists(containerIndex))return this.FindCellByPositionCore(containerIndex,firstCellIndex,lastCellIndex,x,y);var count=this.cellContainers.length;for(var i=0;i<count;i++){var container=this.cellContainers[i];var lastCellIndex=container.cellCount-1;if(!this.IsPointInsideContainer(i,0,lastCellIndex,x,y))continue;var result=this.FindCellByPositionCore(i,0,lastCellIndex,x,y);if(_aspxIsExists(result))return result;}return null;},IsPointInsideContainer:function(containerIndex,firstCellIndex,lastCellIndex,x,y){var firstCell=this.GetCell(containerIndex,firstCellIndex);var lastCell=this.GetCell(containerIndex,lastCellIndex);if(!_aspxIsExists(firstCell)||!_aspxIsExists(lastCell))return false;var dxtop=this.parent.CalcRelativeElementTop(firstCell);if(y<dxtop)return false;var bottom=this.parent.CalcRelativeElementBottom(lastCell);if(y>bottom)return false;var left=this.parent.CalcRelativeElementLeft(firstCell);if(x<left)return false;var right=this.parent.CalcRelativeElementRight(lastCell);if(x>right)return false;return true;},FindCellByPositionCore:function(containerIndex,firstCellIndex,lastCellIndex,x,y){var firstCell=this.GetCell(containerIndex,firstCellIndex);var lastCell=this.GetCell(containerIndex,lastCellIndex);if(!_aspxIsExists(firstCell)||!_aspxIsExists(lastCell))return null;if(this.CompareCellAndPosition(x,y,firstCell)<0)return null;if(this.CompareCellAndPosition(x,y,lastCell)>0)return null;while(firstCellIndex<=lastCellIndex){var cellIndex=(firstCellIndex+lastCellIndex)>>1;var cell=this.GetCell(containerIndex,cellIndex);var result=this.CompareCellAndPosition(x,y,cell);if(result==0)return cell;if(result<0)lastCellIndex=cellIndex-1;else firstCellIndex=cellIndex+1;}return null;},FindViewInfosByAppointmentId:function(appointmentId){var result=new Array();var count=this.appointmentViewInfos.length;for(var i=0;i<count;i++){var viewInfo=this.appointmentViewInfos[i];if(viewInfo.appointmentId==appointmentId)_aspxArrayPush(result,viewInfo);}return result;},OnAppointmentMouseOver:function(appointmentViewInfo){var div=appointmentViewInfo.contentDiv;var resizeDivs=new Array();if(appointmentViewInfo.CanResizeAtTop())_aspxArrayPush(resizeDivs,this.ShowResizeDiv(appointmentViewInfo,this.scheduler.topResizeDiv,0,0,div.clientWidth,null));if(appointmentViewInfo.CanResizeAtLeft())_aspxArrayPush(resizeDivs,this.ShowResizeDiv(appointmentViewInfo,this.scheduler.leftResizeDiv,0,0,null,div.clientHeight));if(appointmentViewInfo.CanResizeAtBottom())_aspxArrayPush(resizeDivs,this.ShowResizeDiv(appointmentViewInfo,this.scheduler.bottomResizeDiv,0,null,div.clientWidth,null));if(appointmentViewInfo.CanResizeAtRight())_aspxArrayPush(resizeDivs,this.ShowResizeDiv(appointmentViewInfo,this.scheduler.rightResizeDiv,null,0,null,div.clientHeight));if(resizeDivs.length>0)appointmentViewInfo.contentDiv.resizeDivs=resizeDivs;},OnAppointmentMouseOut:function(appointmentViewInfo){this.HideResizeDivs(appointmentViewInfo);},ShowResizeDiv:function(viewInfo,resizeDiv,left,dxtop,width,height){var appointmentDiv=viewInfo.contentDiv;var offsetX=0;var offsetY=0;var targetDiv=appointmentDiv;var clone=resizeDiv.cloneNode(true);_aspxSetElementDisplay(clone,true);targetDiv.appendChild(clone);if(!_aspxIsExists(width))width=clone.offsetWidth;if(!_aspxIsExists(height))height=clone.offsetHeight;if(!_aspxIsExists(left))left=appointmentDiv.clientWidth-width;if(!_aspxIsExists(dxtop))dxtop=appointmentDiv.clientHeight-height;clone.style.left=left+offsetX+"px";clone.style.top=dxtop+offsetY+"px";clone.style.width=width+"px";clone.style.height=height+"px";return clone;},HideResizeDivs:function(viewInfo){var appointmentDiv=viewInfo.contentDiv;var targetDiv=appointmentDiv;if(!_aspxIsExists(targetDiv.resizeDivs))return;var count=appointmentDiv.resizeDivs.length;for(var i=0;i<count;i++){var resizeDiv=appointmentDiv.resizeDivs[i];if(_aspxIsExists(resizeDiv)&&resizeDiv.parentNode==targetDiv){targetDiv.removeChild(resizeDiv);}}
appointmentDiv.resizeDivs=null;}});function _aspxCreateDelegate(method,object,args){function handler(e){if(_aspxIsExists(object))method.apply(object,[e,args]);else method(e,args);}return handler;}
ASPxMoreButtonHelper=_aspxCreateClass(null,{constructor:function(schedulerViewInfo){this.schedulerViewInfo=schedulerViewInfo;this.scheduler=schedulerViewInfo.scheduler;this.moreButtonParent=this.scheduler.containerCell;this.scrollContainer=this.schedulerViewInfo.parent.parentElement.parentNode;this.moreButtonContainers=this.CreateMoreButtonContainers(this.scrollContainer.scrollHeight);this.horizontalOffset=2;this.verticalOffset=2;this.subscribedElements=new Array();},Dispose:function(){var count=this.subscribedElements.length;for(var i=0;i<count;i++){var elem=this.subscribedElements[i];_aspxDetachEventFromElement(elem[0],elem[1],elem[2]);}
this.subscribedElements=new Array();},CalculateMoreButtons:function(){var visibleTop=this.scrollContainer.scrollTop;var visibleBottom=visibleTop+this.scrollContainer.offsetHeight;var appointmentViewInfos=this.schedulerViewInfo.appointmentViewInfos;var count=appointmentViewInfos.length;this.ResetMoreButtonContainers();for(var i=0;i<count;i++){var viewInfo=appointmentViewInfos[i];var div=viewInfo.contentDiv;var dxtop=div.offsetTop;var bottom=dxtop+div.offsetHeight;var moreButtonContainerObject=this.GetMoreButtonContainer(viewInfo);if(bottom<=visibleTop){if(dxtop>=moreButtonContainerObject.nearestTopAppointmentPosition){moreButtonContainerObject.nearestTopAppointmentPosition=dxtop;moreButtonContainerObject.nearestTopAppointmentViewInfo=viewInfo;}
continue;}if(dxtop>=visibleBottom){if(bottom<=moreButtonContainerObject.nearestBottomAppointmentPosition){moreButtonContainerObject.nearestBottomAppointmentPosition=bottom;moreButtonContainerObject.nearestBottomAppointmentViewInfo=viewInfo;}
continue;}}
this.DisplayMoreButtons();},DisplayMoreButtons:function(){var count=this.moreButtonContainers.length;for(var i=0;i<count;i++){this.DisplayMoreButtonsCore(this.moreButtonContainers[i]);}},ResetMoreButtonContainers:function(){var count=this.moreButtonContainers.length;for(var i=0;i<count;i++)this.moreButtonContainers[i].Reset(this.scrollContainer.scrollHeight);},DisplayMoreButtonsCore:function(moreButtonContainer){var scrollContainer=this.scrollContainer;var moreButtonParent=this.moreButtonParent;if(_aspxIsExists(moreButtonContainer.nearestTopAppointmentViewInfo)){var div=this.GetDivForContainer(moreButtonContainer,0);if(!_aspxIsExists(div))return;div.targetAppointmentViewInfo=moreButtonContainer.nearestTopAppointmentViewInfo;var appointment=this.scheduler.GetAppointment(div.targetAppointmentViewInfo.appointmentId);div.targetDateTime=appointment.interval.GetStart();var top=_aspxGetAbsoluteY(scrollContainer)-_aspxGetAbsoluteY(moreButtonParent);div.style.top=top+this.verticalOffset+"px";}else this.HideDivForContainer(moreButtonContainer,0);if(_aspxIsExists(moreButtonContainer.nearestBottomAppointmentViewInfo)){var div=this.GetDivForContainer(moreButtonContainer,1);if(!_aspxIsExists(div))return;div.targetAppointmentViewInfo=moreButtonContainer.nearestBottomAppointmentViewInfo;var appointment=this.scheduler.GetAppointment(div.targetAppointmentViewInfo.appointmentId);div.targetDateTime=appointment.interval.GetEnd();var top=_aspxGetAbsoluteY(scrollContainer)-_aspxGetAbsoluteY(moreButtonParent);var bottom=top+scrollContainer.clientHeight;div.style.top=bottom-this.verticalOffset-div.offsetHeight+"px";}else this.HideDivForContainer(moreButtonContainer,1);},GetDivForContainer:function(moreButtonContainer,buttonIndex){var div=moreButtonContainer.moreButtons[buttonIndex];if(!_aspxIsExists(div)){var isTop=buttonIndex==0;div=this.scheduler.GetContainerElementById("MoreButtons_"+(isTop?"Top_":"Bottom_")+moreButtonContainer.index);if(!_aspxIsExists(div))return null;moreButtonContainer.moreButtons[buttonIndex]=div;var clickDelegate=_aspxCreateDelegate(this.schedulerViewInfo.OnMoreButtonClick,this.schedulerViewInfo,[div,isTop]);_aspxAttachEventToElement(div,"click",clickDelegate);_aspxArrayPush(this.subscribedElements,[div,"click",clickDelegate]);}
_aspxSetElementDisplay(div,true);div.style.left=this.GetDivLeftPosition(moreButtonContainer,div)+"px";return div;},HideMoreButtons:function(){var count=this.moreButtonContainers.length;for(var i=0;i<count;i++){var container=this.moreButtonContainers[i];this.HideDivForContainer(container,0);this.HideDivForContainer(container,1);}},HideDivForContainer:function(moreButtonContainer,buttonIndex){var div=moreButtonContainer.moreButtons[buttonIndex];if(_aspxIsExists(div))_aspxSetElementDisplay(div,false);}});ASPxMoreButtonContainer=_aspxCreateClass(null,{constructor:function(scrollHeight,index){this.Reset(scrollHeight);this.moreButtons=[null,null];this.index=index;},Reset:function(scrollHeight){this.nearestTopAppointmentViewInfo=null;this.nearestBottomAppointmentViewInfo=null;this.nearestTopAppointmentPosition=-1;this.nearestBottomAppointmentPosition=scrollHeight+1;}});ASPxSingleMoreButtonHelper=_aspxCreateClass(ASPxMoreButtonHelper,{constructor:function(schedulerViewInfo){this.constructor.prototype.constructor.call(this,schedulerViewInfo);},CreateMoreButtonContainers:function(scrollHeight){return[new ASPxMoreButtonContainer(scrollHeight,0)];},GetMoreButtonContainer:function(viewInfo){return this.moreButtonContainers[0];},GetDivLeftPosition:function(moreButtonContainer,div){return this.schedulerViewInfo.parent.CalcRelativeElementLeft(this.schedulerViewInfo.GetCell(0,0))-div.offsetWidth-this.horizontalOffset;}});ASPxMoreButtonInEachColumnHelper=_aspxCreateClass(ASPxMoreButtonHelper,{constructor:function(schedulerViewInfo){this.constructor.prototype.constructor.call(this,schedulerViewInfo);},CreateMoreButtonContainers:function(scrollHeight){var count=this.schedulerViewInfo.cellContainers.length;var result=new Array();for(var i=0;i<count;i++){var moreButtonContainer=new ASPxMoreButtonContainer(scrollHeight,i);_aspxArrayPush(result,moreButtonContainer);}return result;},GetMoreButtonContainer:function(viewInfo){return this.moreButtonContainers[viewInfo.containerIndex];},GetDivLeftPosition:function(moreButtonContainer){return this.schedulerViewInfo.parent.CalcRelativeElementLeft(this.schedulerViewInfo.GetCell(moreButtonContainer.index,0))+this.horizontalOffset;}});ASPxClientVerticalSchedulerViewInfo=_aspxCreateClass(ASPxSchedulerViewInfo,{constructor:function(scheduler,prevViewInfo,usePrevCache,appointmentsSnapToCells){this.constructor.prototype.constructor.call(this,scheduler,prevViewInfo,usePrevCache);this.appointmentsSnapToCells=appointmentsSnapToCells;this.isVertical=true;if(_aspxIsExists(prevViewInfo)&&_aspxIsExists(prevViewInfo.moreButtonHelper)){prevViewInfo.moreButtonHelper.HideMoreButtons();}},_constCellPrefix:function(){return "DXCntv";},CreateSelectionViewInfoCore:function(){return new ASPxVerticalCellHighlightViewInfo(this.scheduler,this,this.scheduler.selectionDiv,this.parent.selectionLayer);},CompareCellAndPosition:function(x,y,cell){var dxtop=this.parent.CalcRelativeElementTop(cell);if(y<dxtop)return-1;var bottom=this.parent.CalcRelativeElementBottom(cell);if(y>bottom)return 1;return 0;},Dispose:function(){this.constructor.prototype.Dispose.call(this);if(this.containerScrollDelegate&&this.scrollContainer){_aspxDetachEventFromElement(this.scrollContainer,"scroll",this.containerScrollDelegate);this.containerScrollDelegate=null;}
this.moreButtonHelper.Dispose();},Prepare:function(parent){this.constructor.prototype.Prepare.call(this,parent);if(_aspxIsExists(this.scheduler.privateShowMoreButtonsOnEachColumn)&&this.scheduler.privateShowMoreButtonsOnEachColumn)this.moreButtonHelper=new ASPxMoreButtonInEachColumnHelper(this);else this.moreButtonHelper=new ASPxSingleMoreButtonHelper(this);},ShowMoreButton:function(){var scrollContainer=this.parent.parentElement.parentNode;if(scrollContainer.scrollHeight==scrollContainer.offsetHeight)return;this.ShowMoreButtonCore();this.containerScrollDelegate=_aspxCreateDelegate(this.OnContainerScroll,this);this.scrollContainer=scrollContainer;_aspxAttachEventToElement(scrollContainer,"scroll",this.containerScrollDelegate);},OnContainerScroll:function(){_aspxSetTimeout(_aspxCreateDelegate(this.ShowMoreButtonCore,this),0);},ShowMoreButtonCore:function(){this.moreButtonHelper.CalculateMoreButtons();},OnMoreButtonClick:function(e,arguments){var moreButtonDiv=arguments[0];var targetDateTime=moreButtonDiv.targetDateTime;var args=new MoreButtonClickedEventArgs(targetDateTime,moreButtonDiv.interval,moreButtonDiv.resource);this.scheduler.RaiseMoreButtonClickedEvent(args);if(args.handled)return;if(args.processOnServer){if(_aspxIsExists(moreButtonDiv.interval))var intervalArgs=_aspxDateTimeToMilliseconds(moreButtonDiv.interval.GetStart())+","+moreButtonDiv.interval.GetDuration();else var intervalArgs="0, 0";var targetDateTimeArg=_aspxDateTimeToMilliseconds(targetDateTime);this.scheduler.RaiseCallback("RAISEMOREBTN|"+targetDateTimeArg+","+intervalArgs+","+moreButtonDiv.resource);return;}
var toTop=arguments[1];var appointmentDiv=moreButtonDiv.targetAppointmentViewInfo.contentDiv;var scrollContainer=this.parent.parentElement.parentNode;if(toTop)scrollContainer.scrollTop=appointmentDiv.offsetTop;else{if(scrollContainer.clientHeight>appointmentDiv.offsetHeight)scrollContainer.scrollTop=appointmentDiv.offsetTop-scrollContainer.clientHeight+appointmentDiv.offsetHeight;else scrollContainer.scrollTop=appointmentDiv.offsetTop;}}});ASPxClientHorizontalSchedulerViewInfo=_aspxCreateClass(ASPxSchedulerViewInfo,{constructor:function(scheduler,prevViewInfo,usePrevCache){this.constructor.prototype.constructor.call(this,scheduler,prevViewInfo,usePrevCache);this.moreButtonDiv=this.GetMoreButtonDiv();this.isVertical=false;this.moreButtonLeftMargin=3;this.moreButtonRightMargin=3;this.moreButtonBottomMargin=3;},_constCellPrefix:function(){return "DXCnth";},GetMoreButtonDiv:function(){return this.scheduler.GetContainerElementById(_aspxSchedulerMoreButtonId);},GetMoreButtonSize:function(){if(!_aspxIsExists(this.moreButtonSize)||this.moreButtonSize<=0)this.moreButtonSize=this.CalculateMoreButtonSize();return this.moreButtonSize;},CalculateMoreButtonSize:function(){var result;if(_aspxIsExists(this.moreButtonDiv)){this.moreButtonDiv.style.display="block";result=this.moreButtonDiv.offsetHeight;this.moreButtonDiv.style.display="none";}else result=0;return result;},CreateSelectionViewInfoCore:function(){return new ASPxHorizontalCellHighlightViewInfo(this.scheduler,this,this.scheduler.selectionDiv,this.parent.selectionLayer);},ShowMoreButton:function(cell,viewInfo){if(_aspxIsExists(this.moreButtonDiv)&&(!_aspxIsExists(cell.hasMoreButton)||!cell.hasMoreButton)){var newDiv=this.moreButtonDiv.cloneNode(true);newDiv.id=cell.id+"_moreButton";newDiv.style.display="block";newDiv.schedulerControl=this.scheduler;newDiv.interval=this.scheduler.GetCellInterval(cell);newDiv.targetDateTime=this.CalculateMoreButtonTargetDateTime(cell,viewInfo);newDiv.resource=this.scheduler.GetCellResource(cell);this.parent.AppendChildToMoreButtonLayer(newDiv);cell.hasMoreButton=true;_aspxSetElementDisplay(newDiv,true);_aspxAttachEventToElement(newDiv,"click",aspxMoreButtonClickEvent);var cellLeft=this.parent.CalcRelativeElementLeft(cell)+this.moreButtonLeftMargin;var cellRight=this.parent.CalcRelativeElementRight(cell)-this.moreButtonRightMargin;newDiv.style.left=Math.max(cellLeft,cellRight-newDiv.offsetWidth)+"px";newDiv.style.width=Math.max(0,Math.min(newDiv.offsetWidth,cellRight-cellLeft))+"px";newDiv.style.top=this.parent.CalcRelativeElementBottom(cell)-newDiv.offsetHeight-this.moreButtonBottomMargin+"px";}},CalculateMoreButtonTargetDateTime:function(cell,aptViewInfo){var appointment=this.scheduler.GetAppointment(aptViewInfo.appointmentId);var cellInterval=this.scheduler.GetCellInterval(cell);var cellStart=cellInterval.GetStart();var aptStart=appointment.interval.GetStart();var cellStartMSec=parseInt(_aspxDateTimeToMilliseconds(cellStart));var aptStartMSec=parseInt(_aspxDateTimeToMilliseconds(aptStart));if(cellStartMSec>aptStartMSec)return cellStart;else return aptStart;},CompareCellAndPosition:function(x,y,cell){var left=this.parent.CalcRelativeElementLeft(cell);if(x<left)return-1;var right=this.parent.CalcRelativeElementRight(cell);if(x>right)return 1;var dxtop=this.parent.CalcRelativeElementTop(cell);if(y<dxtop)return-1;var bottom=this.parent.CalcRelativeElementBottom(cell);if(y>bottom)return 1;return 0;}});ASPxClientTimelineHeaderLevelViewInfo=_aspxCreateClass(null,{constructor:function(){this.timelineHeaders=new Array();},Add:function(cellLocation,offset,baseCellLocation){var header=new ASPxClientTimelineHeaderCellViewInfo(cellLocation,offset,baseCellLocation);this.timelineHeaders.push(header);}});ASPxClientTimelineHeaderCellViewInfo=_aspxCreateClass(null,{constructor:function(cellLocation,offset,baseCellLocation){this.cellLocation=cellLocation;this.offset=offset;this.baseCellLocation=baseCellLocation;}});ASPxClientTimelineHeaderLayoutCalculator=_aspxCreateClass(null,{constructor:function(schedulerControl){this.schedulerControl=schedulerControl;this.headerCellFinder=new ASPxTimelineHeaderCellFinder(this.schedulerControl.horzTable);this.coordinatesCalculator=schedulerControl.horizontalViewInfo.parent;},CalculateLayout:function(headerLevels){var levelCount=headerLevels.length;for(levelIndex=0;levelIndex<levelCount;levelIndex++){if(headerLevels[levelIndex]!=null){var headerLevel=headerLevels[levelIndex];this.CalculateLevelLayout(headerLevel.timelineHeaders);}}},CalculateLevelLayout:function(headers){var count=headers.length;var header=headers[0];var start=this.GetStartPosition(header);var end=0;for(var headerIndex=1;headerIndex<count-1;headerIndex++){var nextHeader=headers[headerIndex];end=this.GetStartPosition(nextHeader);this.SetHeaderPosition(header,start,end);header=nextHeader;start=end;}
this.SetLastHeaderPosition(headers[count-2],end);},GetStartPosition:function(header){var cell=this.headerCellFinder.GetCellByPathLocation(header.baseCellLocation);return this.coordinatesCalculator.CalcRelativeElementLeft(cell)+header.offset*cell.offsetWidth/100;},SetHeaderPosition:function(header,start,end){var headerCell=this.headerCellFinder.GetCellByPathLocation(header.cellLocation);var totalBorderWidth=headerCell.offsetWidth-headerCell.clientWidth;var totalHorizontalPadding=0;headerCell.style.left=start+"px";var expectedOffsetWidth=end-start;if(expectedOffsetWidth>0)_aspxSetTableCellOffsetWidth(headerCell,expectedOffsetWidth-totalBorderWidth);},SetLastHeaderPosition:function(header,start){var headerCell=this.headerCellFinder.GetCellByPathLocation(header.cellLocation);headerCell.style.width="100%";headerCell.style.left=start+"px";}});ASPxTimelineHeaderCellFinder=_aspxCreateClass(null,{constructor:function(parentTable){this.parentTable=parentTable;},GetCellByPathLocation:function(path){var count=path.length;var table=this.parentTable;var result=null;for(var i=0;i<count;i++){var location=path[i];var rowIndex=location[0];var cellIndex=location[1];result=table.rows[rowIndex].cells[cellIndex];table=this.GetNextTable(table.rows[rowIndex].cells[cellIndex]);}return result;},GetNextTable:function(cell){var children=cell.childNodes;var count=children.length;for(var i=0;i<count;i++){var child=children[i];if(_aspxIsExists(child.tagName)&&child.tagName.toUpperCase()=="TABLE")return child;}return null;}});ASPxNavigationButton=_aspxCreateClass(null,{constructor:function(divId,resourceId,anchorType){this.divId=divId;this.anchorType=anchorType;this.resourceId=resourceId;}});__aspxSchedulerMouseEventDataObject=null;ASPxSchedulerMouseEvents=_aspxCreateClass(null,{constructor:function(){this.mouseOverHandlerList=[];this.mouseMoveHandlerList=[];this.mouseOutHandlerList=[];},CreateHandler:function(handlerObject,param){var result=new Object();result.handlerObject=handlerObject;result.param=param;return result;},AddMouseOverHandler:function(handlerObject,param){var handler=this.CreateHandler(handlerObject,param);_aspxArrayPush(this.mouseOverHandlerList,handler);},AddMouseMoveHandler:function(handlerObject,param){var handler=this.CreateHandler(handlerObject,param);_aspxArrayPush(this.mouseMoveHandlerList,handler);},AddMouseOutHandler:function(handlerObject,param){var handler=this.CreateHandler(handlerObject,param);_aspxArrayPush(this.mouseOutHandlerList,handler);},FireMouseOverEvent:function(evt,dataObject){function fireMouseOver(handlerObject,evt,dataObject,param){return handlerObject.OnMouseOver(evt,dataObject,param);}
this.FireMouseEvent(this.mouseOverHandlerList,fireMouseOver,evt,dataObject);},FireMouseOutEvent:function(evt,dataObject){function fireMouseOut(handlerObject,evt,dataObject,param){return handlerObject.OnMouseOut(evt,dataObject,param);}
this.FireMouseEvent(this.mouseOutHandlerList,fireMouseOut,evt,dataObject);},FireMouseMoveEvent:function(evt,dataObject){function fireMouseMove(handlerObject,evt,dataObject,param){return handlerObject.OnMouseMove(evt,dataObject,param);}
this.FireMouseEvent(this.mouseMoveHandlerList,fireMouseMove,evt,dataObject);},FireMouseEvent:function(handlerList,fireEventFunc,evt,dataObject){for(var i=0;i<handlerList.length;i++){var handler=handlerList[i];fireEventFunc(handler.handlerObject,evt,dataObject,handler.param);}}});function _aspxSchedulerTestIsSupportMouseEvents(element){return _aspxIsExists(element.schedulerMouseEventDataObject)&&_aspxIsExists(element.schedulerMouseEventDataObject.mouseEvents);}
function _aspxSubscribeSchedulerMouseEvents(element,schedulerMouseEventDataObject){if(_aspxIsExists(element.schedulerMouseEventDataObject))return;element.schedulerMouseEventDataObject=schedulerMouseEventDataObject;_aspxAttachEventToElement(element,"mouseover",_aspxOnSchedulerMouseOver);_aspxAttachEventToElement(element,"mousemove",_aspxOnSchedulerMouseMove);_aspxAttachEventToElement(element,"mouseout",_aspxOnSchedulerMouseOut);}
function _aspxUnsubscribeSchedulerMouseEvents(element,schedulerMouseEventDataObject){if(!_aspxIsExists(element.schedulerMouseEventDataObject))return;element.schedulerMouseEventDataObject=null;_aspxDetachEventFromElement(element,"mouseover",_aspxOnSchedulerMouseOver);_aspxDetachEventFromElement(element,"mousemove",_aspxOnSchedulerMouseMove);_aspxDetachEventFromElement(element,"mouseout",_aspxOnSchedulerMouseOut);}
function _aspxClearCurrentMouseEventDataObject(){if(_aspxIsExists(__aspxSchedulerMouseEventDataObject))__aspxSchedulerMouseEventDataObject.mouseEvents.FireMouseOutEvent(null,__aspxSchedulerMouseEventDataObject);__aspxSchedulerMouseEventDataObject=null;}
function _aspxOnSchedulerMouseMove(evt){evt=_aspxGetEvent(evt);var eventSource=_aspxGetEventSource(evt);eventSource=_aspxFindParentElement(eventSource,_aspxSchedulerTestIsSupportMouseEvents);if(!_aspxIsExists(eventSource))return true;var dataObject=eventSource.schedulerMouseEventDataObject;if(dataObject!=__aspxSchedulerMouseEventDataObject){__aspxSchedulerMouseEventDataObject=dataObject;dataObject.mouseEvents.FireMouseOverEvent(evt,dataObject);}
dataObject.mouseEvents.FireMouseMoveEvent(evt,dataObject);return true;}
function _aspxOnSchedulerMouseOver(evt){evt=_aspxGetEvent(evt);var eventSource=_aspxGetEventSource(evt);eventSource=_aspxFindParentElement(eventSource,_aspxSchedulerTestIsSupportMouseEvents);if(!_aspxIsExists(eventSource))return;var dataObject=eventSource.schedulerMouseEventDataObject;if(__aspxSchedulerMouseEventDataObject==dataObject)return;dataObject.mouseEvents.FireMouseOverEvent(evt,dataObject);__aspxSchedulerMouseEventDataObject=dataObject;return _aspxCancelBubble(evt);}
function _aspxOnSchedulerMouseOut(evt){evt=_aspxGetEvent(evt);var eventSource=_aspxGetEventSource(evt);var eventTarget=_aspxGetOnMouseOutEventTarget(evt);eventSource=_aspxFindParentElement(eventSource,_aspxSchedulerTestIsSupportMouseEvents);eventTarget=_aspxFindParentElement(eventTarget,_aspxSchedulerTestIsSupportMouseEvents);var sourceDataObject=_aspxIsExists(eventSource)?eventSource.schedulerMouseEventDataObject:null;var targetDataObject=_aspxIsExists(eventTarget)?eventTarget.schedulerMouseEventDataObject:null;if(sourceDataObject==targetDataObject)return _aspxCancelBubble(evt);sourceDataObject.mouseEvents.FireMouseOutEvent(evt,sourceDataObject);__aspxSchedulerMouseEventDataObject=null;}
ASPxSchedulerToolTipHelper=_aspxCreateClass(null,{constructor:function(){this.timeBeforeShow=500;this.timerId=-1;this.lastX=null;this.lastY=null;this.dataObject=null;this.activeToolTip=null;},OnMouseOver:function(evt,dataObject){function isToolTipSource(element){return _aspxIsExists(element.isToolTip)?element.isToolTip:false;}
_aspxClearTimer(this.timerId);var toolTipSource=_aspxFindParentElement(_aspxGetEventSource(evt),isToolTipSource);if(_aspxIsExists(toolTipSource)){return;}
this.lastX=_aspxGetEventX(evt);this.lastY=_aspxGetEventY(evt);this.dataObject=dataObject;this.timerId=_aspxSetTimeout(_aspxOnToolTipTimer,this.timeBeforeShow);},OnMouseMove:function(evt){this.lastX=_aspxGetEventX(evt);this.lastY=_aspxGetEventY(evt);},OnMouseOut:function(evt,dataObject,smartTag){_aspxClearTimer(this.timerId);this.HideActiveToolTip();this.activeToolTip=null;this.dataObject=null;},ShowToolTip:function(){this.HideActiveToolTip();if(!_aspxIsExists(this.dataObject))return;var toolTip=this.dataObject.GetToolTip();this.activeToolTip=toolTip;toolTip.ShowToolTip(this.lastX,this.lastY);_aspxSubscribeSchedulerMouseEvents(toolTip.mainDiv,this.dataObject);},HideActiveToolTip:function(){if(!_aspxIsExists(this.activeToolTip))return;_aspxUnsubscribeSchedulerMouseEvents(this.activeToolTip.mainDiv,this.dataObject);this.activeToolTip.HideToolTip();this.activeToolTip=null;}});ASPxSchedulerSmartTagHelper=_aspxCreateClass(null,{constructor:function(){this.timeBeforeShow=500;this.timerId=-1;this.lastX=null;this.lastY=null;this.smartTag=null;this.dataObject=null;this.activeSmartTag=null;this.smartTagOffsetX=-15;this.smartTagOffsetY=-20;},OnMouseOver:function(evt,dataObject,smartTag){this.OnMouseMove(evt,dataObject,smartTag);},OnMouseMove:function(evt,dataObject,smartTag){function isSmartTagSource(element){return _aspxIsExists(element.isSmartTag)?element.isSmartTag:false;}
_aspxClearTimer(this.timerId);var eventSource=_aspxGetEventSource(evt);var smartTagSource=_aspxFindParentElement(eventSource,isSmartTagSource);if(_aspxIsExists(smartTagSource)){return;}
this.lastX=_aspxGetEventX(evt);this.lastY=_aspxGetEventY(evt);this.smartTag=smartTag;this.dataObject=dataObject;this.timerId=_aspxSetTimeout(_aspxOnSmartTagTimer,this.timeBeforeShow);},OnMouseOut:function(evt,dataObject,smartTag){_aspxClearTimer(this.timerId);this.HideActiveSmartTag();this.smartTag=null;this.dataObject=null;},ShowSmartTag:function(){var scheduler=this.smartTag.aspxParentControl;if(scheduler.containerCell.parentNode==null)return;this.HideActiveSmartTag();if(!_aspxIsExists(this.smartTag))return;if(!_aspxIsExists(scheduler))return;if(!scheduler.CanShowSmartTag(this.dataObject,this.smartTag))return;var smartTag=this.smartTag.cloneNode(true);smartTag.aspxParentControl=scheduler;smartTag.style.left=this.lastX-_aspxGetAbsoluteX(scheduler.containerCell)+this.smartTagOffsetX+"px";smartTag.style.top=this.lastY-_aspxGetAbsoluteY(scheduler.containerCell)+this.smartTagOffsetY+"px";smartTag.isSmartTag=true;smartTag.dataObject=this.dataObject;scheduler.containerCell.appendChild(smartTag);_aspxSubscribeSchedulerMouseEvents(smartTag,this.dataObject);_aspxSetElementDisplay(smartTag,true);this.activeSmartTag=smartTag;},HideActiveSmartTag:function(){if(!_aspxIsExists(this.activeSmartTag))return;var scheduler=this.activeSmartTag.aspxParentControl;_aspxSetElementDisplay(this.activeSmartTag,false);var parent=this.activeSmartTag.parentNode;if(_aspxIsExists(parent))parent.removeChild(this.activeSmartTag);this.activeSmartTag=null;}});_aspxSchedulerSmartTagHelper=new ASPxSchedulerSmartTagHelper();_aspxSchedulerToolTipHelper=new ASPxSchedulerToolTipHelper();function _aspxOnSmartTagTimer(){if(_aspxIsExists(_aspxSchedulerSmartTagHelper))_aspxSchedulerSmartTagHelper.ShowSmartTag();}
function _aspxOnToolTipTimer(){if(_aspxIsExists(_aspxSchedulerToolTipHelper))_aspxSchedulerToolTipHelper.ShowToolTip();}
function _aspxRemoveSmartTag(dataObject,smartTag){smartTag.isSmartTag=false;dataObject.mouseEvents.RemoveMouseOverHandler(_aspxSchedulerSmartTagHelper,smartTag);dataObject.mouseEvents.RemoveMouseMoveHandler(_aspxSchedulerSmartTagHelper,smartTag);dataObject.mouseEvents.RemoveMouseOutHandler(_aspxSchedulerSmartTagHelper,smartTag);}
function _aspxAddSmartTag(dataObject,smartTag){smartTag.isSmartTag=true;dataObject.mouseEvents.AddMouseOverHandler(_aspxSchedulerSmartTagHelper,smartTag);dataObject.mouseEvents.AddMouseMoveHandler(_aspxSchedulerSmartTagHelper,smartTag);dataObject.mouseEvents.AddMouseOutHandler(_aspxSchedulerSmartTagHelper,smartTag);}
function _aspxAddToolTip(dataObject){dataObject.mouseEvents.AddMouseOverHandler(_aspxSchedulerToolTipHelper);dataObject.mouseEvents.AddMouseMoveHandler(_aspxSchedulerToolTipHelper);dataObject.mouseEvents.AddMouseOutHandler(_aspxSchedulerToolTipHelper);}
function aspxSchedulerLeftResizeDivMouseDown(name,element,evt){evt=_aspxGetEvent(evt);var scheduler=aspxGetControlCollection().Get(name);if(!_aspxIsExists(scheduler))return;var appointmentDiv=element.parentNode;var appointmentViewInfo=appointmentDiv.appointmentViewInfo;if(_aspxIsExists(appointmentViewInfo))scheduler.BeginAppointmentResizeAtLeft(appointmentViewInfo);}
function aspxSchedulerRightResizeDivMouseDown(name,element,evt){evt=_aspxGetEvent(evt);var scheduler=aspxGetControlCollection().Get(name);if(!_aspxIsExists(scheduler))return;var appointmentDiv=element.parentNode;var appointmentViewInfo=appointmentDiv.appointmentViewInfo;if(_aspxIsExists(appointmentViewInfo))scheduler.BeginAppointmentResizeAtRight(appointmentViewInfo);}
function aspxSchedulerTopResizeDivMouseDown(name,element,evt){evt=_aspxGetEvent(evt);var scheduler=aspxGetControlCollection().Get(name);if(!_aspxIsExists(scheduler))return;var appointmentDiv=element.parentNode;var appointmentViewInfo=appointmentDiv.appointmentViewInfo;if(_aspxIsExists(appointmentViewInfo))scheduler.BeginAppointmentResizeAtTop(appointmentViewInfo);}
function aspxSchedulerBottomResizeDivMouseDown(name,element,evt){evt=_aspxGetEvent(evt);var scheduler=aspxGetControlCollection().Get(name);if(!_aspxIsExists(scheduler))return;var appointmentDiv=element.parentNode;var appointmentViewInfo=appointmentDiv.appointmentViewInfo;if(_aspxIsExists(appointmentViewInfo))scheduler.BeginAppointmentResizeAtBottom(appointmentViewInfo);}
function aspxAppointmentResizeLeft(scheduler,appointmentDiv,cell){var cellTime=scheduler.GetCellStartTime(cell);var appointment=scheduler.GetAppointment(appointmentDiv.appointmentViewInfo.appointmentId);;var newStart=_aspxDateTimeMinValue(cellTime,appointment.interval.GetEnd());var newEnd=appointment.interval.GetEnd();var newInterval=new ASPxClientTimeInterval(newStart,_aspxDateSubsWithTimezone(newEnd,newStart));if(!newInterval.Equals(appointment.operationInterval)){appointment.operationInterval=newInterval;return true;}else return false;}
function aspxAppointmentResizeTop(scheduler,appointmentDiv,cell){var cellTime=scheduler.GetCellStartTime(cell);var appointment=scheduler.GetAppointment(appointmentDiv.appointmentViewInfo.appointmentId);;var newStart=_aspxDateTimeMinValue(cellTime,appointment.interval.GetEnd());var newEnd=appointment.interval.GetEnd();var newInterval=new ASPxClientTimeInterval(newStart,_aspxDateSubsWithTimezone(newEnd,newStart));if(!newInterval.Equals(appointment.operationInterval)){appointment.operationInterval=newInterval;return true;}else return false;}
function aspxAppointmentResizeRight(scheduler,appointmentDiv,cell){var cellTime=scheduler.GetCellEndTime(cell);var appointment=scheduler.GetAppointment(appointmentDiv.appointmentViewInfo.appointmentId);;var newStart=appointment.interval.GetStart();var newEnd=_aspxDateTimeMaxValue(cellTime,appointment.interval.GetStart());var newInterval=new ASPxClientTimeInterval(newStart,_aspxDateSubsWithTimezone(newEnd,newStart));if(!newInterval.Equals(appointment.operationInterval)){appointment.operationInterval=newInterval;return true;}else return false;}
function aspxAppointmentResizeBottom(scheduler,appointmentDiv,cell){var cellTime=scheduler.GetCellEndTime(cell);var appointment=scheduler.GetAppointment(appointmentDiv.appointmentViewInfo.appointmentId);;var newStart=appointment.interval.GetStart();var newEnd=_aspxDateTimeMaxValue(cellTime,appointment.interval.GetStart());var newInterval=new ASPxClientTimeInterval(newStart,_aspxDateSubsWithTimezone(newEnd,newStart));if(!newInterval.Equals(appointment.operationInterval)){appointment.operationInterval=newInterval;return true;}else return false;}
function ResizeHelper_onmouseup(e){if(__aspxResizeHelper!=null){__aspxResizeHelper.endResize(e);return true;}}
function ResizeHelper_onmousemove(e){if(__aspxResizeHelper!=null){__aspxResizeHelper.resize(e);return false;}return true;}
function ResizeHelper_onkeydown(e){if(__aspxResizeHelper==null)return true;if(e.keyCode==27)__aspxResizeHelper.cancelResize(true,true);return true;}
_aspxAttachEventToDocument("mouseup",ResizeHelper_onmouseup);_aspxAttachEventToDocument("mousemove",ResizeHelper_onmousemove);_aspxAttachEventToDocument("keydown",ResizeHelper_onkeydown);__aspxResizeHelper=null;ASPxResizeViewHelper=_aspxCreateClass(null,{constructor:function(scheduler,appointmentDiv){this.scheduler=scheduler;this.horizontalResizePresenter=new ASPxHorizontalAppointmentOperationPresenter(scheduler,appointmentDiv);this.verticalResizePresenter=new ASPxVerticalAppointmentOperationPresenter(scheduler,appointmentDiv);},ShowResizedAppointmentPosition:function(e,resizedAppointment){this.horizontalResizePresenter.ShowAppointment(resizedAppointment,false);this.verticalResizePresenter.ShowAppointment(resizedAppointment,false);var content=resizedAppointment.GetToolTipContent(this.scheduler)+"<br />"+this.scheduler.operationToolTipCaption;var toolTip=this.scheduler.GetToolTipControl();if(_aspxIsExists(toolTip)){toolTip.SetContent(content);toolTip.ShowToolTip(_aspxGetEventX(e),_aspxGetEventY(e));}},HideResizedAppointmentPosition:function(aptId,restoreAptPos){this.horizontalResizePresenter.HideAppointment(aptId,restoreAptPos);this.verticalResizePresenter.HideAppointment(aptId,restoreAptPos);var toolTip=this.scheduler.GetToolTipControl();if(_aspxIsExists(toolTip)){toolTip.HideToolTip();}},HideToolTip:function(){var toolTip=this.scheduler.GetToolTipControl();if(_aspxIsExists(toolTip)){toolTip.HideToolTip();}}});ASPxResizeHelper=_aspxCreateClass(null,{constructor:function(scheduler,appointmentDiv,handler,cell){if(__aspxResizeHelper!=null)__aspxResizeHelper.cancelResize(true);scheduler.DisableReminderTimer();this.lastCell=cell;this.scheduler=scheduler;this.appointmentDiv=appointmentDiv;this.resizeHandler=handler;this.resizeViewHelper=new ASPxResizeViewHelper(scheduler,appointmentDiv);__aspxResizeHelper=this;},resize:function(e){if(__aspxIE)this.scheduler.innerContentElement.setActive();var hitTestResult=this.scheduler.CalcHitTest(e);var cell=hitTestResult.cell;if(_aspxIsExists(cell)&&cell!=this.lastCell){if(this.resizeHandler(this.scheduler,this.appointmentDiv,cell)){var appointment=this.scheduler.GetAppointment(this.appointmentDiv.appointmentViewInfo.appointmentId);this.resizeViewHelper.ShowResizedAppointmentPosition(e,appointment);}
this.lastCell=cell;}},endResize:function(){var wasCallback=this.ApplyChanges();if(!wasCallback)this.cancelResize(true);else{this.resizeViewHelper.HideToolTip();__aspxResizeHelper=null;this.scheduler.onCallback=_aspxCreateDelegate(this.OnCallback,this);this.scheduler.onCallbackError=_aspxCreateDelegate(this.OnCallbackError,this);}},OnCallback:function(){this.cancelResize(false);},OnCallbackError:function(){this.cancelResize(true);},ApplyChanges:function(){var id=this.appointmentDiv.appointmentViewInfo.appointmentId;var appointment=this.scheduler.GetAppointment(id);if(!_aspxIsExists(appointment)||!_aspxIsExists(appointment.operationInterval))return false;var wasResized=(appointment.operationInterval.GetStart()-appointment.interval.GetStart()!=0)||(appointment.operationInterval.GetEnd()-appointment.interval.GetEnd()!=0);if(wasResized){var params="APTSCHANGE|"+id;params+="?START="+_aspxDateTimeToMilliseconds(appointment.operationInterval.GetStart());params+="?DURATION="+appointment.operationInterval.GetDuration();this.scheduler.RaiseCallback(params);return true;}else return false;},cancelResize:function(restoreAptPos,restoreTimer){if(!_aspxIsExists(restoreAptPos))restoreAptPos=true;this.resizeViewHelper.HideResizedAppointmentPosition(this.appointmentDiv.appointmentViewInfo.appointmentId,restoreAptPos);this.scheduler.onCallback=null;this.scheduler.onCallbackError=null;__aspxResizeHelper=null;if(restoreTimer)this.scheduler.EnableReminderTimer();}});function aspxSchedulerNavigateViewBackward(name){var schedulerViewNavigator=aspxGetControlCollection().Get(name);if(_aspxIsExists(schedulerViewNavigator))schedulerViewNavigator.NavigateBackward();}
function aspxSchedulerNavigateViewForward(name){var schedulerViewNavigator=aspxGetControlCollection().Get(name);if(_aspxIsExists(schedulerViewNavigator))schedulerViewNavigator.NavigateForward();}
function aspxSchedulerGotoToday(name){var schedulerViewNavigator=aspxGetControlCollection().Get(name);if(_aspxIsExists(schedulerViewNavigator))schedulerViewNavigator.GotoToday();}
ASPxClientSchedulerViewNavigator=_aspxCreateClass(ASPxClientSchedulerRelatedControlBase,{NavigateBackward:function(){var schedulerControl=aspxGetControlCollection().Get(this.schedulerControlId);if(_aspxIsExists(schedulerControl))schedulerControl.NavigateBackward();},NavigateForward:function(){var schedulerControl=aspxGetControlCollection().Get(this.schedulerControlId);if(_aspxIsExists(schedulerControl))schedulerControl.NavigateForward();},GotoToday:function(){var schedulerControl=aspxGetControlCollection().Get(this.schedulerControlId);if(_aspxIsExists(schedulerControl))schedulerControl.GotoToday();}});function aspxTimeZoneEditComboSelectedIndexChanged(name,tzId){var timeZoneEdit=aspxGetControlCollection().Get(name);if(_aspxIsExists(timeZoneEdit))timeZoneEdit.ChangeTimeZoneId(tzId);}
ASPxClientTimeZoneEdit=_aspxCreateClass(ASPxClientSchedulerRelatedControlBase,{ChangeTimeZoneId:function(tzId){var schedulerControl=aspxGetControlCollection().Get(this.schedulerControlId);if(_aspxIsExists(schedulerControl)){schedulerControl.ChangeTimeZoneId(tzId);}}});ASPxClientSchedulerToolTip=_aspxCreateClass(ASPxClientControl,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.isVisible=false;this.maxContentWidth=300;this.widthBeforeArrow=20;this.offsetX=28;},Initialize:function(){this.constructor.prototype.Initialize.call(this);this.mainDiv=this.GetElementById("mainDiv");this.topLeftImage=this.GetElementById("topLeftImage");this.topMiddleImage=this.GetElementById("topMiddleImage");this.topRightImage=this.GetElementById("topRightImage");this.leftMiddleImage=this.GetElementById("leftMiddleImage");this.rightMiddleImage=this.GetElementById("rightMiddleImage");this.bottomLeftImage=this.GetElementById("bottomLeftImage");this.bottomLeftMiddleImage=this.GetElementById("bottomLeftMiddleImage");this.bottomRightMiddleImage=this.GetElementById("bottomRightMiddleImage");this.bottomRightImage=this.GetElementById("bottomRightImage");this.bottomArrowImage=this.GetElementById("bottomArrowImage");this.topLeftDiv=this.GetElementById("topLeftDiv");this.topMiddleDiv=this.GetElementById("topMiddleDiv");this.topRightDiv=this.GetElementById("topRightDiv");this.leftMiddleDiv=this.GetElementById("leftMiddleDiv");this.contentDiv=this.GetElementById("contentDiv");this.rightMiddleDiv=this.GetElementById("rightMiddleDiv");this.bottomLeftDiv=this.GetElementById("bottomLeftDiv");this.bottomRightDiv=this.GetElementById("bottomRightDiv");this.bottomLeftMiddleDiv=this.GetElementById("bottomLeftMiddleDiv");this.bottomArrowDiv=this.GetElementById("bottomArrowDiv");this.bottomRightMiddleDiv=this.GetElementById("bottomRightMiddleDiv");this.toolTipParent=this.mainDiv.parentNode;this.mainDiv.isToolTip=true;if(this.isVisible)this.ShowToolTip();},HideToolTip:function(){if(!this.isVisible)return;this.isVisible=false;_aspxSetElementDisplay(this.mainDiv,false);},ShowToolTip:function(documentX,documentY){this.isVisible=true;_aspxSetElementVisibility(this.mainDiv,false);_aspxSetElementDisplay(this.mainDiv,true);this.contentDiv.style.width="";this.contentDiv.style.height="";var topHeight=this.topLeftImage.offsetHeight;var bottomHeight=this.bottomLeftImage.offsetHeight;var bottomArrowHeight=this.bottomArrowImage.offsetHeight;var leftWidth=this.topLeftImage.offsetWidth;var rightWidth=this.topRightImage.offsetWidth;var bottomArrowWidth=this.bottomArrowImage.offsetWidth;var contentWidth=this.contentDiv.offsetWidth;if(contentWidth<bottomArrowWidth+this.widthBeforeArrow*2)this.contentDiv.style.width=bottomArrowWidth+this.widthBeforeArrow*2+"px";else if(this.contentDiv.offsetWidth>this.maxContentWidth)this.contentDiv.style.width=this.maxContentWidth+"px";var contentWidth=this.contentDiv.offsetWidth;var contentHeight=this.contentDiv.offsetHeight;this.SetDivPosition(this.topLeftDiv,0,0);this.SetDivPosition(this.topMiddleDiv,leftWidth,0);this.SetDivPosition(this.topRightDiv,leftWidth+contentWidth,0);this.SetDivPosition(this.leftMiddleDiv,0,topHeight);this.SetDivPosition(this.rightMiddleDiv,leftWidth+contentWidth,topHeight);this.SetDivPosition(this.bottomLeftDiv,0,topHeight+contentHeight);this.SetDivPosition(this.bottomLeftMiddleDiv,leftWidth,topHeight+contentHeight);this.SetDivPosition(this.bottomArrowDiv,leftWidth+this.widthBeforeArrow,topHeight+contentHeight);this.SetDivPosition(this.bottomRightMiddleDiv,leftWidth+this.widthBeforeArrow+bottomArrowWidth,topHeight+contentHeight);this.SetDivPosition(this.bottomRightDiv,leftWidth+contentWidth,topHeight+contentHeight);this.SetDivPosition(this.contentDiv,leftWidth,topHeight);this.topMiddleDiv.style.width=contentWidth+"px";this.bottomLeftMiddleDiv.style.width=this.widthBeforeArrow+"px";this.bottomRightMiddleDiv.style.width=Math.max(contentWidth-this.widthBeforeArrow-bottomArrowWidth,0)+"px";this.leftMiddleDiv.style.height=contentHeight+"px";this.rightMiddleDiv.style.height=contentHeight+"px";this.leftMiddleDiv.style.width=leftWidth+"px";this.rightMiddleDiv.style.width=rightWidth+"px";this.bottomArrowDiv.style.width=bottomArrowWidth;this.topMiddleDiv.style.height=topHeight;var positionX=documentX-this.offsetX-_aspxGetAbsoluteX(this.toolTipParent);var positionY=documentY-topHeight-contentHeight-bottomArrowHeight-_aspxGetAbsoluteY(this.toolTipParent);this.SetDivPosition(this.mainDiv,positionX,positionY);_aspxSetElementVisibility(this.mainDiv,true);},SetDivPosition:function(element,left,dxtop){element.style.left=left+"px";element.style.top=dxtop+"px";},AdjustImageWidth:function(element){},AdjustCellSize:function(cell,image){},GetElementById:function(id){return _aspxGetElementById(this.name+"_"+id);},SetContent:function(content){this.contentDiv.innerHTML=content;}});function aspxSchedulerResNavCmd(name,cmdId,params){var resourceNavigator=aspxGetControlCollection().Get(name);if(_aspxIsExists(resourceNavigator))resourceNavigator.ExecuteCallbackCommand(cmdId,params);}
function aspxSchedulerResNavDecorateCombo(name){var resourceNavigator=aspxGetControlCollection().Get(name);if(_aspxIsExists(resourceNavigator))resourceNavigator.DecorateCombo();}
ASPxClientSchedulerResourceNavigator=_aspxCreateClass(ASPxClientSchedulerRelatedControlBase,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.visibleResCount=0;this.savedIndex=-1;},Initialize:function(){this.DecorateCombo();},RegisterScriptsRestartHandler:function(){var func=new Function("aspxSchedulerResNavDecorateCombo('"+this.name+"');");_aspxAddScriptsRestartHandler(this.name,func);},ProcessCallbackResult:function(id,html,params){ASPxRelatedControlManager.ProcessCallbackResultDefault(id,html,"");this.visibleResCount=params;},GetCombo:function(){return aspxGetControlCollection().Get(this.name+"_cmb");},DecorateCombo:function(){if(this.visibleResCount<2)return;var combo=this.GetCombo();if(_aspxIsExists(combo)){var bag=[];var item;var startIndex=combo.GetSelectedIndex();if(startIndex<0)startIndex=this.savedIndex;else this.savedIndex=startIndex;for(var i=0;i<this.visibleResCount;i++){item=combo.GetItem(startIndex+i);if(_aspxIsExists(item))bag.push(item.text);}if(combo.GetInputElement()!=null)ASPxClientTextEdit.prototype.SetValue.call(combo,bag.join(", "));}},ExecuteCallbackCommand:function(cmdId,params){var schedulerControl=aspxGetControlCollection().Get(this.schedulerControlId);if(_aspxIsExists(schedulerControl))schedulerControl.RaiseCallback(cmdId+"|"+params);}});function aspxVisibleMonthChanged(dateNavigatorId,offset){var dateNavigator=aspxGetControlCollection().Get(dateNavigatorId);if(_aspxIsExists(dateNavigator))dateNavigator.OnVisibleMonthChanged(offset);}
function aspxDateNavigatorSelectionChanged(dateNavigatorId){var dateNavigator=aspxGetControlCollection().Get(dateNavigatorId);if(_aspxIsExists(dateNavigator))dateNavigator.OnSelectionChanged();}
ASPxClientDateNavigator=_aspxCreateClass(ASPxClientSchedulerRelatedControlBase,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.calendarId="";},OnVisibleMonthChanged:function(offset){var calendar=aspxGetControlCollection().Get(this.calendarId);if(_aspxIsExists(calendar)){var schedulerControl=aspxGetControlCollection().Get(this.schedulerControlId);if(_aspxIsExists(schedulerControl))schedulerControl.ShiftVisibleIntervals(offset);}},OnSelectionChanged:function(){var calendar=aspxGetControlCollection().Get(this.calendarId);if(_aspxIsExists(calendar)){var schedulerControl=aspxGetControlCollection().Get(this.schedulerControlId);if(_aspxIsExists(schedulerControl))var formattedDates=calendar.FormatDates(calendar.selection.GetDates(),",");schedulerControl.SetVisibleDays(formattedDates);}}});ASPxClientSchedulerViewVisibleInterval=_aspxCreateClass(ASPxClientControl,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.schedulerControlId="";}});__aspxSchedulerStatusInfosQueue=new Array();ASPxSchedulerStatusInfoType=_aspxCreateClass(null,{});ASPxSchedulerStatusInfoType.Exception="Exception";ASPxSchedulerStatusInfoType.Error="Error";ASPxSchedulerStatusInfoType.Warning="Warning";ASPxSchedulerStatusInfoType.Info="Info";function aspxSchedulerRefreshStatusInfos(name){AfterInitializeStatusInfos();var statusInfo=aspxGetControlCollection().Get(name);if(_aspxIsExists(statusInfo)){statusInfo.RefreshStatusInfos();}}
function AfterInitializeStatusInfos(){var count=__aspxSchedulerStatusInfosQueue.length;if(count==0)return;for(var i=count-1;i>=0;i--){var statusInfo=__aspxSchedulerStatusInfosQueue[i];var scheduler=aspxGetControlCollection().Get(statusInfo.schedulerControlId);if(_aspxIsExists(scheduler))scheduler.statusInfoManager.AddStatusInfo(statusInfo);}
__aspxSchedulerStatusInfosQueue=new Array();}
ASPxClientSchedulerStatusInfoManager=_aspxCreateClass(ASPxClientSchedulerRelatedControlBase,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.statusInfos=new Array();this.visibleStatusInfo=null;this.image=new Object();this.ClearInfo();},Initialize:function(){this.constructor.prototype.Initialize.call(this);var scheduler=aspxGetControlCollection().Get(this.schedulerControlId);if(_aspxIsExists(scheduler)){if(_aspxIsExists(scheduler.statusInfoManager)){this.statusInfos=scheduler.statusInfoManager.statusInfos;this.visibleStatusInfo=scheduler.statusInfoManager.visibleStatusInfo;this.contentDiv=scheduler.statusInfoManager.contentDiv;this.subjectSpan=scheduler.statusInfoManager.subjectSpan;this.detailInfoSpan=scheduler.statusInfoManager.detailInfoSpan;this.image=scheduler.statusInfoManager.image;this.visibleImage=scheduler.statusInfoManager.visibleImage;this.detailInfoLink=scheduler.statusInfoManager.detailInfoLink;}else{this.contentDiv=_aspxGetElementById(this.name+"_contentDiv");this.subjectSpan=_aspxGetElementById(this.name+"_subject");this.detailInfoSpan=_aspxGetElementById(this.name+"_detailInfo");this.detailInfoLink=_aspxGetElementById(this.name+"_detailInfoLink");this.image[ASPxSchedulerStatusInfoType.Exception]=_aspxGetElementById(this.name+"_exceptionImg");this.image[ASPxSchedulerStatusInfoType.Error]=_aspxGetElementById(this.name+"_errorImg");this.image[ASPxSchedulerStatusInfoType.Warning]=_aspxGetElementById(this.name+"_warningImg");this.image[ASPxSchedulerStatusInfoType.Info]=_aspxGetElementById(this.name+"_infoImg");this.visibleImage=null;this.contentDiv.parentNode.removeChild(this.contentDiv);}
scheduler.statusInfoManager=this;}
var func=new Function("aspxSchedulerRefreshStatusInfos('"+this.name+"');");_aspxSetTimeout(func,1);},SetInfo:function(imageType,subject,detail){this.subject=subject;this.detailInfo=detail;this.imageType=imageType;},ClearInfo:function(){this.SetInfo("","","");},AddStatusInfo:function(statusInfo){_aspxArrayPush(this.statusInfos,statusInfo);},Clear:function(){this.ClearInfo();this.RefreshStatusInfos();},RegisterScriptsRestartHandler:function(){var func=new Function("aspxSchedulerRefreshStatusInfos('"+this.name+"');");_aspxAddScriptsRestartHandler(this.name,func);},RefreshStatusInfos:function(){var statusInfo=this.GetStatusInfo();if(_aspxIsExists(this.visibleStatusInfo))this.visibleStatusInfo.HideContent();if(_aspxIsExists(statusInfo)&&(this.subject!=""||this.detailInfo!="")){this.subjectSpan.innerHTML=this.subject;this.detailInfoSpan.innerHTML=this.detailInfo;_aspxSetElementDisplay(this.detailInfoLink,this.detailInfo!="");if(_aspxIsExists(this.visibleImage))_aspxSetElementDisplay(this.visibleImage,false);this.visibleImage=this.image[this.imageType];if(_aspxIsExists(this.visibleImage))_aspxSetElementDisplay(this.visibleImage,true);statusInfo.SetContent(this.contentDiv);this.visibleStatusInfo=statusInfo;}},GetStatusInfo:function(){var maxPriority=-1;var result=null;for(var i=this.statusInfos.length-1;i>=0;i--){var statusInfo=this.statusInfos[i];if(statusInfo.IsVisible()){if(statusInfo.priority>maxPriority){maxPriority=statusInfo.priority;result=statusInfo;}}else _aspxArrayRemoveAt(this.statusInfos,i);}return result;},ShowExceptionInfo:function(msg){var subjectLengthEnd=msg.indexOf(",");var detailInfoLengthEnd=msg.indexOf("|");var subjectLength=parseInt(msg.substr(0,subjectLengthEnd));var detailInfoLength=parseInt(msg.substr(subjectLengthEnd+1,detailInfoLengthEnd-subjectLengthEnd-1));var subject=msg.substr(detailInfoLengthEnd+1,subjectLength);var detailInfo=msg.substr(detailInfoLengthEnd+subjectLength+1,detailInfoLength);this.SetInfo(ASPxSchedulerStatusInfoType.Exception,subject,detailInfo);}});ASPxClientSchedulerStatusInfo=_aspxCreateClass(ASPxClientControl,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.priority=0;this.currentContent=null;},Initialize:function(){this.constructor.prototype.Initialize.call(this);this.contentDiv=_aspxGetElementById(this.name+"_mainDiv");this.outerContainer=this.isInsideRow?this.contentDiv.parentNode.parentNode:this.contentDiv;_aspxArrayPush(__aspxSchedulerStatusInfosQueue,this);},SetContent:function(content){this.HideContent();var newContent=content.cloneNode(true);this.contentDiv.appendChild(newContent);_aspxSetElementDisplay(this.outerContainer,true);this.currentContent=newContent;},HideContent:function(){if(_aspxIsExists(this.currentContent)){var parentNode=this.currentContent.parentNode;if(_aspxIsExists(parentNode)){parentNode.removeChild(this.currentContent);}}if(_aspxIsExists(this.contentDiv))_aspxSetElementDisplay(this.outerContainer,false);this.currentContent=null;},IsVisible:function(){this.contentDiv=_aspxGetElementById(this.name+"_mainDiv");if(_aspxIsExists(this.contentDiv)){this.outerContainer=this.isInsideRow?this.contentDiv.parentNode.parentNode:this.contentDiv;return true;}return false;}}); 