var ASPxClientSchedulerRefreshAction = _aspxCreateClass(null, {
});
ASPxClientSchedulerRefreshAction.None = 0;
ASPxClientSchedulerRefreshAction.VisibleIntervalChanged = 1;
ASPxClientSchedulerRefreshAction.ActiveViewTypeChanged = 2;
ASPxClientAppointmentOperation = _aspxCreateClass(null, {
 constructor: function(helper, callbackParameters) {
  this.helper = helper;
  this.callbackParameters = callbackParameters;
 },
 Apply: function() {
  this.helper.Apply(this.callbackParameters);
 },
 Cancel: function() {
  this.helper.Cancel();  
 }
});
ASPxClientScheduler.Cast = ASPxClientControl.Cast;
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 = _aspxDateTimeToMilliseconds(date);
 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.ShowSelectionToolTip = function(x, y) {
 this.ShowSelectionToolTipInernal(x, y);
}
ASPxClientScheduler.prototype.GetSelectedInterval = function() {
 return new ASPxClientTimeInterval(this.selection.interval.start, this.selection.interval.duration);
}
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.RefreshClientAppointmentProperties = function(clientAppointment, propertyNames, onCallBack) {
 if (_aspxIsExists(onCallBack)) {
  this.RefreshClientAppointmentPropertiesUserCallbackFunction = onCallBack;
 }
 else
  this.RefreshClientAppointmentPropertiesUserCallbackFunction = null;
 var callbackDelegate = _aspxCreateDelegate(this.RefreshClientAppointmentPropertiesCore, this);
 this.RaiseFuncCallback("APTDATAEX|", clientAppointment.appointmentId + "," + propertyNames, callbackDelegate);
}
ASPxClientScheduler.prototype.ShowAppointmentFormByClientId = function(aptClientId) {
 this.RaiseCallback("EDTFRMSHOW|" + aptClientId);
}
ASPxClientScheduler.prototype.ShowAppointmentFormByServerId = function(aptServerId) {
 this.RaiseCallback("EDTFRMSHOWSID|" + aptServerId);
}
ASPxClientScheduler.prototype.SetTopRowTime = function(duration, viewType) {
 var actualViewType = this.privateActiveViewType;
 if (_aspxIsExists(viewType)) 
  actualViewType = viewType;
 var state = this.topRowTimeManager.CreateTopRowTimeState(duration, -1);
 this.topRowTimeManager.SetTopRowTimeState(state, actualViewType);
}
ASPxClientScheduler.prototype.GetTopRowTime = function(viewType) {
 var actualViewType = this.privateActiveViewType;
 if (_aspxIsExists(viewType)) 
  actualViewType = viewType;
 var state = this.topRowTimeManager.GetTopRowTimeState(actualViewType);
 return state.duration;
}
ASPxClientScheduler.prototype.ShowInplaceEditor = function(startDate, endDate, resourceId) {
 var start = _aspxDateTimeToMilliseconds(startDate);
 var end = _aspxDateTimeToMilliseconds(endDate);
 var args = start + "," + end;
 if (_aspxIsExists(resourceId))
  args += "," + resourceId;
 this.RaiseCallback("NEWAPTVIAINPLFRM|" + args);
}
ASPxClientScheduler.prototype.InsertAppointment = function(clientAppointment) {
 var args  = _aspxToJson(clientAppointment);
 this.RaiseCallback("INSRTAPT|" + args);
}
ASPxClientScheduler.prototype.UpdateAppointment = function(clientAppointment) {
 var args  = _aspxToJson(clientAppointment);
 this.RaiseCallback("UPDTAPT|" + args);
}
ASPxClientScheduler.prototype.DeleteAppointment = function(clientAppointment) {
 var aptIdCollection = [ clientAppointment.appointmentId ];
 if (this.RaseAppointmentDeleting(aptIdCollection))
  return;
 var args = _aspxToJson(clientAppointment);
 this.RaiseCallback("DLTAPT|" + args);
}
ASPxClientScheduler.prototype.GetVisibleIntervals = function() {
 var result = new Array();
 var count = this.visibleIntervals.length;
 for (var i = 0; i < count; i++) 
  _aspxArrayPush(result, this.visibleIntervals[i].Clone());
 return result;
}
ASPxClientScheduler.prototype.ChangePopupMenuContainer = function(container, attachEvents) {
 if(!_aspxIsExists(container) || (container == this)) {
  if(this.popupMenuMovedElements) {
   for(var i = 0; i < this.popupMenuMovedElements.length; i++)
    for(var j = 0; j < this.popupMenuMovedElements[i].length; j++)
     _aspxRestoreElementContainer(this.popupMenuMovedElements[i][j]);
   this.popupMenuMovedElements = null;
  }
  if(this.changePopupMenuContainerBeginCallbackHandler && (!_aspxIsExists(attachEvents) || attachEvents)) {
   this.BeginCallback.RemoveHandler(this.changePopupMenuContainerBeginCallbackHandler);
   this.changePopupMenuContainerBeginCallbackHandler = null;
   this.EndCallback.RemoveHandler(this.changePopupMenuContainerEndCallbackHandler);
   this.changePopupMenuContainerEndCallbackHandler = null;
  }
 }
 else {
  if(_aspxIsExists(aspxGetMenuCollection)) {
   if(this.popupMenuMovedElements) {
    for(var i = 0; i < this.popupMenuMovedElements.length; i++)
     for(var j = 0; j < this.popupMenuMovedElements[i].length; j++)
      _aspxChangeElementContainer(this.popupMenuMovedElements[i][j], container, false);
   }
   else
    this.popupMenuMovedElements = [];
   if(!this.changePopupMenuContainerBeginCallbackHandler && (!_aspxIsExists(attachEvents) || attachEvents)) {
    this.changePopupMenuContainerBeginCallbackHandler = function(s) { s.ChangePopupMenuContainer(s, false); };
    this.BeginCallback.AddHandler(this.changePopupMenuContainerBeginCallbackHandler);
    this.changePopupMenuContainerEndCallbackHandler = function(s) { s.ChangePopupMenuContainer(container, false); };
    this.EndCallback.AddHandler(this.changePopupMenuContainerEndCallbackHandler);
   }
   var popupMenuMovedElements = this.popupMenuMovedElements; 
   aspxGetMenuCollection().ProcessControlsInContainer(this.GetMainElement(), function(control) {
    if(control.isPopupMenu) {
     var menuElements = [ control.GetMainElement() ];
     var idPrefix = menuElements[0].id;
     var currentElement = menuElements[0].nextSibling;
     while(_aspxIsExists(currentElement)) {
      if(_aspxIsExists(currentElement.tagName) && (currentElement.id.indexOf(idPrefix) == 0)) {
       if(currentElement.tagName == "DIV" || currentElement.tagName == "TABLE")
        menuElements.push(currentElement);
      }
      currentElement = currentElement.nextSibling;
     }
     for(var i = 0; i < menuElements.length; i++)
      _aspxChangeElementContainer(menuElements[i], container, true);
     popupMenuMovedElements.push(menuElements);
    }
   });
  }
 }
}
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.RaiseAppointmentClick = function(appointmentId, evt) {
 if (!this.AppointmentClick.IsEmpty()) {
  var args = new AppointmentClickEventArgs(appointmentId, evt);
  this.AppointmentClick.FireEvent(this, args);
  return args.handled;
 }
 return false;
}
ASPxClientScheduler.prototype.RaiseAppointmentDoubleClick = function(appointmentId, evt) {
 if (!this.AppointmentDoubleClick.IsEmpty()) {
  var args = new AppointmentClickEventArgs(appointmentId, evt);
  this.AppointmentDoubleClick.FireEvent(this, args);
  return args.handled;
 }
 return false;
}
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.RaiseSelectionChanging = function() {
 if (!this.SelectionChanging.IsEmpty()) {
  var args = new ASPxClientEventArgs();
  this.SelectionChanging.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);
}
ASPxClientScheduler.prototype.RaiseMenuItemClicked = function(itemName) {
 if (!this.MenuItemClicked.IsEmpty()) {
  var args = new MenuItemClickedEventArgs(itemName);
  this.MenuItemClicked.FireEvent(this, args);
  return args.handled;
 }
 return false;
}
ASPxClientScheduler.prototype.RaiseAppointmentDrop = function(operation) {
 if (!this.AppointmentDrop.IsEmpty()) {
  var args = new ASPxClientAppointmentDragEventArgs(operation);
  this.AppointmentDrop.FireEvent(this, args);
  return args.handled;
 }
 return false;
}
ASPxClientScheduler.prototype.RaiseAppointmentResize = function(operation) {
 if (!this.AppointmentResize.IsEmpty()) {
  var args = new ASPxClientAppointmentResizeEventArgs(operation);
  this.AppointmentResize.FireEvent(this, args);
  return args.handled;
 }
 return false;
}
ASPxClientScheduler.prototype.RaseAppointmentDeleting = function(clientAppointments) {
 if (!this.AppointmentDeleting.IsEmpty()) {
  var args = new ASPxClientAppointmentDeletingEventArgs(clientAppointments);
  this.AppointmentDeleting.FireEvent(this, args);
  return args.cancel;
 }
 return false;
}
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";
ASPxClientAppointmentDeletingEventArgs = _aspxCreateClass(ASPxClientCancelEventArgs, {
 constructor: function(appointmentIds) {
  this.constructor.prototype.constructor.call(this);
  this.appointmentIds = appointmentIds;
 }
});
AppointmentClickEventArgs = _aspxCreateClass(ASPxClientEventArgs, {
 constructor: function(appointmentId, sourceEvent) {
  this.appointmentId = appointmentId;
  this.htmlElement = sourceEvent;
  this.handled = false;
 }
});
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;
 }
});
MenuItemClickedEventArgs = _aspxCreateClass(ASPxClientEventArgs, {
 constructor: function(itemName) {
  this.itemName = itemName;
  this.handled = false;
 }
});
ASPxClientAppointmentDragEventArgs = _aspxCreateClass(ASPxClientEventArgs, {
 constructor: function(operation) {
  this.handled = false;
  this.operation = operation;
 }
});
ASPxClientAppointmentResizeEventArgs = _aspxCreateClass(ASPxClientEventArgs, {
 constructor: function(operation) {
  this.handled = false;
  this.operation = operation;
 }
});
