var __aspxClientValidationStateNameSuffix = "$CVS";
ASPxClientEditBase = _aspxCreateClass(ASPxClientControl, {
 constructor: function(name) {
  this.constructor.prototype.constructor.call(this, name);
 },
 InlineInitialize: function(){
  this.InitializeEnabled(); 
 },
 InitializeEnabled: function() {
  this.SetEnabledInternal(this.clientEnabled, true);
 },
 GetValue: function() {
  var element = this.GetMainElement();
  if(_aspxIsExistsElement(element))
   return element.innerHTML;
  return "";
 },
 GetValueString: function(){
  var value = this.GetValue();
  return (value == null) ? null : value.toString();
 },
 SetValue: function(value) {
  if(value == null)
   value = "";
  var element = this.GetMainElement();
  if(_aspxIsExistsElement(element))
   element.innerHTML = value;
 },
 GetEnabled: function(){
  return this.enabled && this.clientEnabled;
 },
 SetEnabled: function(enabled){
  if(this.clientEnabled != enabled) {
   var errorFrameRequiresUpdate = this.GetIsValid && !this.GetIsValid();
   if(errorFrameRequiresUpdate && !enabled)
    this.UpdateErrorFrameAndFocus(false , null , true );
   this.clientEnabled = enabled;
   this.SetEnabledInternal(enabled, false);
   if(errorFrameRequiresUpdate && enabled)
    this.UpdateErrorFrameAndFocus(false );
  }
 },
 SetEnabledInternal: function(enabled, initialization){
  if(!this.enabled) return;
  if(!initialization || !enabled)
   this.ChangeEnabledStateItems(enabled);
  this.ChangeEnabledAttributes(enabled);
 },
 ChangeEnabledAttributes: function(enabled){
 },
 ChangeEnabledStateItems: function(enabled){
 }
});
ASPxValidationPattern = _aspxCreateClass(null, {
 constructor: function(errorText) {
  this.errorText = errorText;
 }
});
ASPxRequiredFieldValidationPattern = _aspxCreateClass(ASPxValidationPattern, {
 constructor: function(errorText) {
  this.constructor.prototype.constructor.call(this, errorText);
 },
 EvaluateIsValid: function(value) {
  return value != null && (value.constructor == Array || _aspxTrim(value.toString()) != "");
 }
});
ASPxRegularExpressionValidationPattern = _aspxCreateClass(ASPxValidationPattern, {
 constructor: function(errorText, pattern) {
  this.constructor.prototype.constructor.call(this, errorText);
  this.pattern = pattern;
 },
 EvaluateIsValid: function(value) {
  if (value == null) 
   return true;
  var strValue = value.toString();
  if (_aspxTrim(strValue).length == 0)
   return true;
  var regEx = new RegExp(this.pattern);
  var matches = regEx.exec(strValue);
  return matches != null && strValue == matches[0];
 }
});
function _aspxIsEditorFocusable(inputElement) {
 return _aspxIsFocusableCore(inputElement, function(container) {
  return container.getAttribute("errorFrame") == "errorFrame";
 });
}
var __aspxInvalidEditorToBeFocused = null;
ASPxValidationType = {
 PersonalOnValueChanged: "ValueChanged",
 PersonalViaScript: "CalledViaScript",
 MassValidation: "MassValidation"
};
ASPxErrorFrameDisplay = {
 Static: "Static",
 Dynamic: "Dynamic"
};
ASPxEditElementSuffix = {
 ExternalTable: "_ET",
 ControlCell: "_CC",
 ErrorCell: "_EC",
 ErrorTextCell: "_ETC",
 ErrorImage: "_EI"
};
ASPxClientEdit = _aspxCreateClass(ASPxClientEditBase, {
 constructor: function(name) {
  this.constructor.prototype.constructor.call(this, name);
  this.isASPxClientEdit = true;
  this.inputElement = null;
  this.elementCache = { };
  this.convertEmptyStringToNull = true;
  this.readOnly = false;
  this.focused = false;
  this.focusEventsLocked = false;
  this.receiveGlobalMouseWheel = true;
  this.styleDecoration = null;
  this.widthCorrectionRequired = false;
  this.heightCorrectionRequired = false;
  this.customValidationEnabled = false;
  this.display = ASPxErrorFrameDisplay.Static;
  this.initialErrorText = "";
  this.causesValidation = false;
  this.validateOnLeave = true;
  this.validationGroup = "";
  this.sendPostBackWithValidation = null;
  this.validationPatterns = [];
  this.setFocusOnError = false;
  this.errorDisplayMode = "it";
  this.errorText = "";
  this.isValid = true;
  this.errorImageIsAssigned = false;
  this.clientValidationStateElement = null;
  this.enterProcessed = false;
  this.keyDownHandlers = {};
  this.keyPressHandlers = {};
  this.keyUpHandlers = {};
  this.specialKeyboardHandlingUsed = false;
  this.onKeyDownHandler = null;
  this.onKeyPressHandler = null;
  this.onKeyUpHandler = null;
  this.onGotFocusHandler = null;
  this.onLostFocusHandler = null;
  this.GotFocus = new ASPxClientEvent();
  this.LostFocus = new ASPxClientEvent();
  this.Validation = new ASPxClientEvent();
  this.ValueChanged = new ASPxClientEvent();
  this.KeyDown = new ASPxClientEvent();
  this.KeyPress = new ASPxClientEvent();
  this.KeyUp = new ASPxClientEvent();
  ASPxClientEdit.controls.push(this);
 },
 Initialize: function() {
  this.initialErrorText = this.errorText;
  ASPxClientEditBase.prototype.Initialize.call(this);
  this.InitializeKeyHandlers();
  this.UpdateClientValidationState();
 },
 InlineInitialize: function() {
  ASPxClientEditBase.prototype.InlineInitialize.call(this);
  if(this.styleDecoration != null)
   this.styleDecoration.Update();
 }, 
 InitSpecialKeyboardHandling: function(){
  this.onKeyDownHandler = _aspxCreateEventHandlerFunction("aspxKBSIKeyDown", this.name, true);
  this.onKeyPressHandler = _aspxCreateEventHandlerFunction("aspxKBSIKeyPress", this.name, true);
  this.onKeyUpHandler = _aspxCreateEventHandlerFunction("aspxKBSIKeyUp", this.name, true);
  this.onGotFocusHandler = _aspxCreateEventHandlerFunction("aspxESGotFocus", this.name, false);
  this.onLostFocusHandler = _aspxCreateEventHandlerFunction("aspxESLostFocus", this.name, false);
  this.specialKeyboardHandlingUsed = true;
  this.InitializeDelayedSpecialFocus();
 },
 InitializeKeyHandlers: function() {
 },
 AddKeyDownHandler: function(key, handler) {
  this.keyDownHandlers[key] = handler;
 },
 ChangeSpecialInputEnabledAttributes: function(element, method){
  element.autocomplete = "off";
  if(this.onKeyDownHandler != null)
   method(element, "keydown", this.onKeyDownHandler);
  if(this.onKeyPressHandler != null)
   method(element, "keypress", this.onKeyPressHandler);
  if(this.onKeyUpHandler != null)
   method(element, "keyup", this.onKeyUpHandler);
  if(this.onGotFocusHandler != null)
   method(element, "focus", this.onGotFocusHandler);
  if(this.onLostFocusHandler != null)
   method(element, "blur", this.onLostFocusHandler);
 },
 UpdateClientValidationState: function() {
  if(!this.customValidationEnabled)
   return;
  var mainElement = this.GetMainElement();
  if (_aspxIsExists(mainElement)) {
   var hiddenField = this.GetClientValidationStateHiddenField();
   if(_aspxIsExists(hiddenField))
    hiddenField.value = _aspxEncodeHtml(!this.GetIsValid() ? ("-" + this.GetErrorText()) : "");
  }
 },
 GetCachedElementByIdSuffix: function(idSuffix) {
  var element = this.elementCache[idSuffix];
  if(!_aspxIsExistsElement(element)) {
   element = _aspxGetElementById(this.name + idSuffix);
   this.elementCache[idSuffix] = element;
  }
  return element;
 },
 FindInputElement: function(){
  return null;
 },
 GetInputElement: function(){
  if(!_aspxIsExistsElement(this.inputElement))
   this.inputElement = this.FindInputElement();
  return this.inputElement;
 },
 GetErrorImage: function() {
  return this.GetCachedElementByIdSuffix(ASPxEditElementSuffix.ErrorImage);
 },
 GetExternalTable: function() {
  return this.GetCachedElementByIdSuffix(ASPxEditElementSuffix.ExternalTable);
 },
 GetControlCell: function() {
  return this.GetCachedElementByIdSuffix(ASPxEditElementSuffix.ControlCell);
 },
 GetErrorCell: function() {
  return this.GetCachedElementByIdSuffix(ASPxEditElementSuffix.ErrorCell);
 },
 GetErrorTextCell: function() {
  return this.GetCachedElementByIdSuffix(this.errorImageIsAssigned ?
   ASPxEditElementSuffix.ErrorTextCell : ASPxEditElementSuffix.ErrorCell);
 },
 GetClientValidationStateHiddenField: function() {
  if(!_aspxIsExists(this.clientValidationStateElement))
   this.clientValidationStateElement = this.CreateClientValidationStateHiddenField();
  return this.clientValidationStateElement;
 },
 CreateClientValidationStateHiddenField: function() {
  var mainElement = this.GetMainElement();
  var hiddenField = _aspxCreateHiddenField(this.uniqueID + __aspxClientValidationStateNameSuffix);
  mainElement.parentNode.appendChild(hiddenField);
  return hiddenField;
 },
 SetVisible: function(isVisible){
  if(this.clientVisible == isVisible)
   return;
  if(this.customValidationEnabled) {
   var errorFrame = this.GetExternalTable();
   if(_aspxIsExists(errorFrame)) {
    _aspxSetElementDisplay(errorFrame, isVisible);
    var isValid = !isVisible ? true : void(0);
    this.UpdateErrorFrameAndFocus(false , true , isValid );
   }
  }
  ASPxClientControl.prototype.SetVisible.call(this, isVisible);
 },
 GetValueInputToValidate: function() {
  return this.GetInputElement();
 },
 IsVisible: function() {
  if (!this.clientVisible)
   return false;
  var element = this.GetMainElement();
  while(_aspxIsExists(element) && element.tagName != "BODY") {
   if (element.getAttribute("errorFrame") != "errorFrame" && (!_aspxGetElementVisibility(element) || !_aspxGetElementDisplay(element)))
    return false;
   element = element.parentNode;
  }
  return true;
 },
 AdjustControlCore: function() {
  this.CollapseControl();
  if (this.WidthCorrectionRequired())
   this.CorrectEditorWidth();
  else
   this.UnstretchInputElement();
  if (this.heightCorrectionRequired)
   this.CorrectEditorHeight();
 },
 WidthCorrectionRequired: function() {
  var mainElement = this.GetMainElement();
  if(_aspxIsExistsElement(mainElement)) {
   var mainElementCurStyle = _aspxGetCurrentStyle(mainElement);
   return this.widthCorrectionRequired && mainElementCurStyle.width != "" && mainElementCurStyle.width != "auto";
  }
  return false;
 },
 CorrectEditorWidth: function() {
 },
 CorrectEditorHeight: function() {
 },
 UnstretchInputElement: function() {
 },
 UseDelayedSpecialFocus: function() {
  return false;
 },
 GetDelayedSpecialFocusTriggers: function() {
  return [ this.GetMainElement() ];
 },
 InitializeDelayedSpecialFocus: function() {
  if(!this.UseDelayedSpecialFocus())
   return;
  this.specialFocusTimer = -1;    
  var instance = this;
  var handler = function() {
   window.setTimeout(function() { instance.SetFocus(); }, 0);
  };
  var triggers = this.GetDelayedSpecialFocusTriggers();
  for(var i = 0; i < triggers.length; i++)
   _aspxAttachEventToElement(triggers[i], "mousedown", handler);
 },
 IsFocusEventsLocked: function() {
  return this.focusEventsLocked;
 },
 LockFocusEvents: function() {
  if(!this.focused) return;
  this.focusEventsLocked = true;
 },
 UnlockFocusEvents: function() {
  this.focusEventsLocked = false;
 },
 ForceRefocusEditor: function() {
  this.LockFocusEvents();
  this.GetInputElement().blur(); 
  window.setTimeout("aspxGetControlCollection().Get('" + this.name + "').SetFocus();", 0);
 },
 IsEditorElement: function(element) {
  return this.GetMainElement() == element || _aspxGetIsParent(this.GetMainElement(), element);
 },
 OnFocusCore: function() {
  if(this.UseDelayedSpecialFocus()) {
   window.clearTimeout(this.specialFocusTimer);
   if(this.focused)
    return;
  }
  if (!this.IsFocusEventsLocked()){
   this.focused = true;
   ASPxClientEdit.SetFocusedEditor(this);
   if(this.styleDecoration != null && !this.readOnly)
    this.styleDecoration.Update();
   if(this.isInitialized)
    this.RaiseFocus();
  }
  else
   this.UnlockFocusEvents();
 },
 OnLostFocusCore: function() {
  if (!this.IsFocusEventsLocked()){
   this.focused = false;
   ASPxClientEdit.SetFocusedEditor(null);
   if(this.styleDecoration != null && !this.readOnly)
    this.styleDecoration.Update();
   this.RaiseLostFocus();
   if (this.validateOnLeave)
    this.SetFocusOnError();
  }
 },
 OnFocus: function() {
  if (!this.specialKeyboardHandlingUsed)
   this.OnFocusCore();
 },
 OnLostFocus: function() {
  if (this.isInitialized && !this.specialKeyboardHandlingUsed)
   this.OnLostFocusCore();
 },
 OnSpecialFocus: function() {
  if (this.isInitialized)
   this.OnFocusCore();
 },
 OnSpecialLostFocus: function() {
  if (this.isInitialized)
   this.OnLostFocusCore();
 },
 OnMouseWheel: function(evt){
 },
 OnValidation: function(validationType) {
  if (this.customValidationEnabled && this.isInitialized && _aspxIsExistsElement(this.GetExternalTable())) {
   this.BeginErrorFrameUpdate();
   try {
    this.SetIsValid(true);
    this.SetErrorText(this.initialErrorText);
    if(this.validateOnLeave || validationType != ASPxValidationType.PersonalOnValueChanged) {
     this.ValidateWithPatterns();
     this.RaiseValidation();
    }
    this.UpdateErrorFrameAndFocus(validationType == ASPxValidationType.PersonalOnValueChanged && this.validateOnLeave && !this.GetIsValid());
   } finally {
    this.EndErrorFrameUpdate();
   }
  }
 },
 OnValueChanged: function() {
  var processOnServer = this.RaiseValidationInternal();
  processOnServer = this.RaiseValueChangedEvent() && processOnServer;
  if (processOnServer)
   this.SendPostBackInternal("");
 },
 ParseValue: function() {
 },
 RaisePersonalStandardValidation: function() {
  if (_aspxIsFunction(window.ValidatorOnChange)) {
   var inputElement = this.GetValueInputToValidate();
   if (_aspxIsExists(inputElement.Validators))
    window.ValidatorOnChange({ srcElement: inputElement });
  }
 },
 RaiseValidationInternal: function() {
  if (this.autoPostBack && this.causesValidation && this.validateOnLeave)
   return ASPxClientEdit.ValidateGroup(this.validationGroup);
  else {
   this.OnValidation(ASPxValidationType.PersonalOnValueChanged);
   return this.GetIsValid();
  }
 },
 RaiseValueChangedEvent: function(){
  return this.RaiseValueChanged();
 },
 SendPostBackInternal: function(postBackArg) {
  if (_aspxIsFunction(this.sendPostBackWithValidation))
   this.sendPostBackWithValidation(postBackArg);
  else
   this.SendPostBack(postBackArg);
 },
 SetElementToBeFocused: function() {
  if (this.IsVisible())
   __aspxInvalidEditorToBeFocused = this;
 },
 SetFocus: function(){
  var inputElement = this.GetInputElement();
  if (_aspxGetActiveElement() != inputElement && _aspxIsEditorFocusable(inputElement)) 
   _aspxSetFocus(inputElement);
 },
 SetFocusOnError: function() {
  if (__aspxInvalidEditorToBeFocused == this) {
   this.SetFocus();
   __aspxInvalidEditorToBeFocused = null;
  }
 },
 BeginErrorFrameUpdate: function() {
  if(!this.errorFrameUpdateLocked)
   this.errorFrameUpdateLocked = true;
 },
 EndErrorFrameUpdate: function() {
  this.errorFrameUpdateLocked = false;
  var args = this.updateErrorFrameAndFocusLastCallArgs;
  if(args) {
   this.UpdateErrorFrameAndFocus(args[0], args[1]);
   delete this.updateErrorFrameAndFocusLastCallArgs;
  }
 },
 UpdateErrorFrameAndFocus: function(setFocusOnError, ignoreVisibilityCheck, isValid) {
  if(!this.GetEnabled() || !ignoreVisibilityCheck && !this.GetVisible() )
   return;
  if(this.errorFrameUpdateLocked) {
   this.updateErrorFrameAndFocusLastCallArgs = [ setFocusOnError, ignoreVisibilityCheck ];
   return;
  }
  if(typeof(isValid) == "undefined")
   isValid = this.GetIsValid();
  var externalTable = this.GetExternalTable();
  var isStaticDisplay = this.display == ASPxErrorFrameDisplay.Static;
  if(isValid) {
   if(isStaticDisplay) {
    externalTable.style.visibility = "hidden";
   } else {
    this.HideErrorCell();
    this.SaveErrorFrameStyles();
    this.ClearErrorFrameElementsStyles();
   }
  } else {
   var editorLocatedWithinVisibleContainer = this.IsVisible();
   if(this.widthCorrectionRequired) {
    if(editorLocatedWithinVisibleContainer)
     this.CollapseControl(); 
    else
     this.sizeCorrectedOnce = false;
   }
   this.UpdateErrorCellContent();
   if(isStaticDisplay) {
    externalTable.style.visibility = "visible";
   } else {
    this.EnsureErrorFrameStylesLoaded();
    this.RestoreErrorFrameElementsStyles();
    this.ShowErrorCell();
   }
   if(editorLocatedWithinVisibleContainer) {
    if(this.widthCorrectionRequired)
     this.AdjustControl(); 
    if(setFocusOnError && this.setFocusOnError && __aspxInvalidEditorToBeFocused == null)
     this.SetElementToBeFocused();
   }
  }
 },
 ShowErrorCell: function() {
  var errorCell = this.GetErrorCell();
  if(_aspxIsExists(errorCell))
   _aspxSetElementDisplay(errorCell, true);
 },
 HideErrorCell: function() {
  var errorCell = this.GetErrorCell();
  if(_aspxIsExists(errorCell))
   _aspxSetElementDisplay(errorCell, false);
 },
 SaveErrorFrameStyles: function() {
  this.EnsureErrorFrameStylesLoaded();
 },
 EnsureErrorFrameStylesLoaded: function() {
  if(typeof(this.errorFrameStyles) == "undefined") {
   var externalTable = this.GetExternalTable();
   var controlCell = this.GetControlCell();
   this.errorFrameStyles = {
    errorFrame: {
     cssClass: externalTable.className,
     style: this.ExtractElementStyleStringIgnoringVisibilityProps(externalTable)
    },
    controlCell: {
     cssClass: controlCell.className,
     style: this.ExtractElementStyleStringIgnoringVisibilityProps(controlCell)
    }
   };
  }
 },
 ClearErrorFrameElementsStyles: function() {
  this.ClearElementStyle(this.GetExternalTable());
  this.ClearElementStyle(this.GetControlCell());
 },
 RestoreErrorFrameElementsStyles: function() {
  var externalTable = this.GetExternalTable();
  externalTable.className = this.errorFrameStyles.errorFrame.cssClass;
  externalTable.style.cssText = this.errorFrameStyles.errorFrame.style;
  var controlCell = this.GetControlCell();
  controlCell.className = this.errorFrameStyles.controlCell.cssClass;
  controlCell.style.cssText = this.errorFrameStyles.controlCell.style;
 },
 ExtractElementStyleStringIgnoringVisibilityProps: function(element) {
  var savedVisibility = element.style.visibility;
  var savedDisplay = element.style.display;
  element.style.visibility = "";
  element.style.display = "";
  var styleStr = element.style.cssText;
  element.style.visibility = savedVisibility;
  element.style.display = savedDisplay;
  return styleStr;
 },
 ClearElementStyle: function(element) {
  if(!_aspxIsExists(element))
   return;
  element.className = "";
  var savedVisibility = element.style.visibility;
  var savedDisplay = element.style.display;
  var savedWidth = element.style.width;
  element.style.cssText = "";
  element.style.visibility = savedVisibility;
  element.style.display = savedDisplay;
  element.style.width = savedWidth;
 },
 UpdateErrorCellContent: function() {
  if (this.errorDisplayMode.indexOf("t") > -1)
   this.UpdateErrorText();
  if (this.errorDisplayMode == "i")
   this.UpdateErrorImage();
 },
 UpdateErrorImage: function() {
  var image = this.GetErrorImage();
  if (_aspxIsExistsElement(image)) {
   image.alt = this.errorText;
   image.title = this.errorText;
  } else {
   this.UpdateErrorText();
  }
 },
 UpdateErrorText: function() {
  var errorTextCell = this.GetErrorTextCell();
  if(_aspxIsExistsElement(errorTextCell))
   errorTextCell.innerHTML = _aspxEncodeHtml(this.errorText);
 },
 ValidateWithPatterns: function() {
  if (this.validationPatterns.length > 0) {
   var value = this.GetValue();
   for (var i = 0; i < this.validationPatterns.length; i++) {
    var validator = this.validationPatterns[i];
    if (!validator.EvaluateIsValid(value)) {
     this.SetIsValid(false);
     this.SetErrorText(validator.errorText);
     return;
    }
   }
  }
 },
 OnSpecialKeyDown: function(evt){
  this.RaiseKeyDown(evt);
  var handler = this.keyDownHandlers[evt.keyCode];
  if(_aspxIsExists(handler)) 
   return this[handler](evt);
  return false;
 },
 OnSpecialKeyPress: function(evt){
  this.RaiseKeyPress(evt);
  var handler = this.keyPressHandlers[evt.keyCode];
  if(_aspxIsExists(handler)) 
   return this[handler](evt);
  if(__aspxNetscapeFamily || __aspxOpera){
   if(evt.keyCode == ASPxKey.Enter)
    return this.enterProcessed;
  }
  return false;
 },
 OnSpecialKeyUp: function(evt){
  this.RaiseKeyUp(evt);
  var handler = this.keyUpHandlers[evt.keyCode];
  if(_aspxIsExists(handler)) 
   return this[handler](evt);
  return false;
 },
 OnKeyDown: function(evt) {
  if(!this.specialKeyboardHandlingUsed)
   this.RaiseKeyDown(evt);
 },
 OnKeyPress: function(evt) {
  if(!this.specialKeyboardHandlingUsed)
   this.RaiseKeyPress(evt);
 },
 OnKeyUp: function(evt) {
  if(!this.specialKeyboardHandlingUsed)
   this.RaiseKeyUp(evt);
 },
 RaiseKeyDown: function(evt){
  if(!this.KeyDown.IsEmpty()){
   var args = new ASPxClientEditKeyEventArgs(evt);
   this.KeyDown.FireEvent(this, args);
  }
 },
 RaiseKeyPress: function(evt){
  if(!this.KeyPress.IsEmpty()){
   var args = new ASPxClientEditKeyEventArgs(evt);
   this.KeyPress.FireEvent(this, args);
  }
 },
 RaiseKeyUp: function(evt){
  if(!this.KeyUp.IsEmpty()){
   var args = new ASPxClientEditKeyEventArgs(evt);
   this.KeyUp.FireEvent(this, args);
  }
 },
 RaiseFocus: function(){
  if(!this.GotFocus.IsEmpty()){
   var args = new ASPxClientEventArgs();
   this.GotFocus.FireEvent(this, args);
  }
 },
 RaiseLostFocus: function(){
  if(!this.LostFocus.IsEmpty()){
   var args = new ASPxClientEventArgs();
   this.LostFocus.FireEvent(this, args);
  }
 },
 RaiseValidation: function() {
  if (this.customValidationEnabled && !this.Validation.IsEmpty()) {
   var currentValue = this.GetValue();
   var args = new ASPxClientEditValidationEventArgs(currentValue, this.errorText, this.GetIsValid());
   this.Validation.FireEvent(this, args);
   this.SetErrorText(args.errorText);
   this.SetIsValid(args.isValid);
   if (args.value != currentValue)
    this.SetValue(args.value);
  }
 },
 RaiseValueChanged: function(){
  var processOnServer = this.autoPostBack;
  if(!this.ValueChanged.IsEmpty()){
   var args = new ASPxClientProcessingModeEventArgs(processOnServer);
   this.ValueChanged.FireEvent(this, args);
   processOnServer = args.processOnServer;
  }
  return processOnServer;  
 },
 RequireStyleDecoration: function() {
  this.styleDecoration = new ASPxClientEditStyleDecoration(this);
  this.PopulateStyleDecorationPostfixes();
 }, 
 PopulateStyleDecorationPostfixes: function() {
  this.styleDecoration.AddPostfix("");
 },
 Focus: function(){
  this.SetFocus();
 },
 GetIsValid: function(){
  var externalTable = this.GetExternalTable();
  return _aspxIsExistsElement(externalTable) ? this.isValid : true;
 },
 GetErrorText: function(){
  return this.errorText;
 },
 SetIsValid: function(isValid){
  if (this.customValidationEnabled) {
   this.isValid = isValid;
   this.UpdateErrorFrameAndFocus(false );
   this.UpdateClientValidationState();
  }
 },
 SetErrorText: function(errorText){
  if (this.customValidationEnabled) {
   this.errorText = errorText;
   this.UpdateErrorFrameAndFocus(false );
   this.UpdateClientValidationState();
  }
 },
 Validate: function(){
  this.ParseValue();
  this.OnValidation(ASPxValidationType.PersonalViaScript);
 }
});
ASPxClientEdit.controls = [];
ASPxClientEdit.focusedEditorName = "";
ASPxClientEdit.GetFocusedEditor = function(){
 var focusedEditor = aspxGetControlCollection().Get(ASPxClientEdit.focusedEditorName);
 if(focusedEditor && !focusedEditor.focused){
  ASPxClientEdit.SetFocusedEditor(null);
  focusedEditor = null;
 }
 return focusedEditor;
}
ASPxClientEdit.SetFocusedEditor = function(editor){
 ASPxClientEdit.focusedEditorName = editor ? editor.name : "";
}
ASPxClientEdit.ClearEditorsInContainer = function(container, validationGroup, clearInvisibleEditors) {
 __aspxInvalidEditorToBeFocused = null;
 _aspxProcessEditorsInContainer(container, _aspxClearProcessingProc, _aspxClearChoiceCondition, validationGroup, clearInvisibleEditors, true );
}
ASPxClientEdit.ClearEditorsInContainerById = function(containerId, validationGroup, clearInvisibleEditors) {
 var container = document.getElementById(containerId);
 this.ClearEditorsInContainer(container, validationGroup, clearInvisibleEditors);
}
ASPxClientEdit.ClearGroup = function(validationGroup, clearInvisibleEditors) {
 return this.ClearEditorsInContainer(null, validationGroup, clearInvisibleEditors);
}
ASPxClientEdit.ValidateEditorsInContainer = function(container, validationGroup, validateInvisibleEditors) {
 var validationResult = _aspxProcessEditorsInContainer(container, _aspxValidateProcessingProc, _aspxValidateChoiceCondition, validationGroup, validateInvisibleEditors,
  false );
 if(_aspxIsExistsType(typeof(aspxGetGlobalEvents))) {
  if(typeof(validateInvisibleEditors) == "undefined")
   validateInvisibleEditors = false;
  if(typeof(validationGroup) == "undefined")
   validationGroup = null;
  validationResult.isValid = aspxGetGlobalEvents().OnValidationCompleted(container, validationGroup,
   validateInvisibleEditors, validationResult.isValid, validationResult.firstInvalid, validationResult.firstVisibleInvalid);
 }
 return validationResult.isValid;
}
ASPxClientEdit.ValidateEditorsInContainerById = function(containerId, validationGroup, validateInvisibleEditors) {
 var container = document.getElementById(containerId);
 return this.ValidateEditorsInContainer(container, validationGroup, validateInvisibleEditors);
}
ASPxClientEdit.ValidateGroup = function(validationGroup, validateInvisibleEditors) {
 return this.ValidateEditorsInContainer(null, validationGroup, validateInvisibleEditors);
}
ASPxClientEditKeyEventArgs = _aspxCreateClass(ASPxClientEventArgs, {
 constructor: function(htmlEvent) {
  this.constructor.prototype.constructor.call(this);
  this.htmlEvent = htmlEvent;
 }
});
ASPxClientEditValidationEventArgs = _aspxCreateClass(ASPxClientEventArgs, {
 constructor: function(value, errorText, isValid) {
  this.constructor.prototype.constructor.call(this);
  this.errorText = errorText;
  this.isValid = isValid;
  this.value = value;
 }
});
ASPxClientEditStyleDecoration = _aspxCreateClass(null, {
 constructor: function(editor) {
  this.editor = editor;
  this.postfixList = [ ];
  this.styles = { };
 },
 GetStyleSheet: function() {
  if(!ASPxClientEditStyleDecoration.__sheet)
   ASPxClientEditStyleDecoration.__sheet = _aspxCreateStyleSheet();
  return ASPxClientEditStyleDecoration.__sheet;
 },
 AddPostfix: function(value, applyClass, applyBorders, applyBackground) {
  this.postfixList.push(value);
 },
 AddStyle: function(key, className, cssText) {
  this.styles[key] = _aspxTrim(className + " " + _aspxCreateImportantStyleRule(this.GetStyleSheet(), cssText));
 },
 Update: function() {
  for(var i = 0; i < this.postfixList.length; i++) {
   var postfix = this.postfixList[i];
   var element = _aspxGetElementById(this.editor.name + postfix);
   if(!element) continue;
   if(this.HasDecoration("F"))
    this.ApplyDecoration("F", element, this.editor.focused);
   if(this.HasDecoration("N")) {
    var apply = !this.editor.focused;
    if(apply) {
     var value = this.editor.GetValue();
     apply = apply && (value == null || value == "" && this.editor.convertEmptyStringToNull);
    }    
    this.ApplyDecoration("N", element, apply);
   }
  }   
 },
 HasDecoration: function(key) {
  return !!this.styles[key];
 },
 ApplyDecoration: function(key, element, active) {
  var value = this.styles[key];
  element.className = element.className.replace(value, "");
  if(active)
   element.className = _aspxTrim(element.className + " " + value);
 }
});
function aspxEGotFocus(name){
 var edit = aspxGetControlCollection().Get(name); 
 if(edit != null)
  edit.OnFocus();
}
function aspxELostFocus(name){
 var edit = aspxGetControlCollection().Get(name);
 if(edit != null) 
  edit.OnLostFocus();
}
function aspxESGotFocus(name){
 var edit = aspxGetControlCollection().Get(name); 
 if(edit != null)
  edit.OnSpecialFocus();
}
function aspxESLostFocus(name){
 var edit = aspxGetControlCollection().Get(name);
 if(edit == null)
  return;
 if(edit.UseDelayedSpecialFocus())
  edit.specialFocusTimer = window.setTimeout(function() { edit.OnSpecialLostFocus(); }, 30);
 else
  edit.OnSpecialLostFocus();
}
function aspxEValueChanged(name){
 var edit = aspxGetControlCollection().Get(name);
 if(edit != null)
  edit.OnValueChanged();
}
_aspxAttachEventToDocument("mousedown", aspxEMouseDown);
function aspxEMouseDown(evt) {
 var editor = ASPxClientEdit.GetFocusedEditor();
 if (editor != null && editor.IsEditorElement(_aspxGetEventSource(evt)))
  editor.ForceRefocusEditor();
}
_aspxAttachEventToDocument(__aspxNetscapeFamily ? "DOMMouseScroll" : "mousewheel", aspxEMouseWheel);
function aspxEMouseWheel(evt) {
 var editor = ASPxClientEdit.GetFocusedEditor();
 if (editor != null && _aspxIsExistsElement(editor.GetMainElement()) && editor.focused && editor.receiveGlobalMouseWheel)
  editor.OnMouseWheel(evt);
}
function aspxKBSIKeyDown(name, evt){
 var control = aspxGetControlCollection().Get(name);
 if(control != null){
  var isProcessed = control.OnSpecialKeyDown(evt);
  if(isProcessed)
   return _aspxPreventEventAndBubble(evt);
 }
}
function aspxKBSIKeyPress(name, evt){
 var control = aspxGetControlCollection().Get(name);
 if(control != null){
  var isProcessed = control.OnSpecialKeyPress(evt);
  if(isProcessed)
   return _aspxPreventEventAndBubble(evt);
 }
}
function aspxKBSIKeyUp(name, evt){
 var control = aspxGetControlCollection().Get(name);
 if(control != null){
  var isProcessed = control.OnSpecialKeyUp(evt);
  if(isProcessed)
   return _aspxPreventEventAndBubble(evt);
 }
}
function aspxEKeyDown(name, evt){
 var edit = aspxGetControlCollection().Get(name);
 if(edit != null)
  edit.OnKeyDown(evt);
}
function aspxEKeyPress(name, evt){
 var edit = aspxGetControlCollection().Get(name);
 if(edit != null)
  edit.OnKeyPress(evt);
}
function aspxEKeyUp(name, evt){
 var edit = aspxGetControlCollection().Get(name);
 if(edit != null)
  edit.OnKeyUp(evt);
}
ASPxValidationResult = _aspxCreateClass(null, {
 constructor: function(isValid, firstInvalid, firstVisibleInvalid) {
  this.isValid = isValid;
  this.firstInvalid = firstInvalid;
  this.firstVisibleInvalid = firstVisibleInvalid;
 }
});
function _aspxProcessEditorsInContainer(container, processingProc, choiceCondition, validationGroup, processInvisibleEditors, processDisabledEditors) {
 var allProcessedSuccessfull = true;
 var firstInvalid = null;
 var firstVisibleInvalid = null;
 var invalidEditorToBeFocused = null;
 var collection = aspxGetControlCollection();
 for (var key in collection.elements) {
  var control = collection.elements[key];
  if (control != null && ASPxIdent.IsASPxClientEdit(control) && (processDisabledEditors || control.GetEnabled())) {
   var mainElement = control.GetMainElement();
   if (_aspxIsExists(mainElement) &&
    (container == null || _aspxGetIsParent(container, mainElement)) &&
    (processInvisibleEditors || control.IsVisible()) &&
    choiceCondition(control, validationGroup)) {
    var isSuccess = processingProc(control);
    if(!isSuccess) {
     allProcessedSuccessfull = false;
     if(firstInvalid == null)
      firstInvalid = control;
     var isVisible = control.IsVisible();
     if(isVisible && firstVisibleInvalid == null)
      firstVisibleInvalid = control;
     if (control.setFocusOnError && invalidEditorToBeFocused == null && isVisible)
      invalidEditorToBeFocused = control;
    }
   }
  }
 }
 if (invalidEditorToBeFocused != null)
  invalidEditorToBeFocused.SetFocus();
 return new ASPxValidationResult(allProcessedSuccessfull, firstInvalid, firstVisibleInvalid);
}
function _aspxClearChoiceCondition(edit, validationGroup) {
 return !_aspxIsExists(validationGroup) || (edit.validationGroup == validationGroup);
}
function _aspxValidateChoiceCondition(edit, validationGroup) {
 return _aspxClearChoiceCondition(edit, validationGroup) && edit.customValidationEnabled;
}
function _aspxClearProcessingProc(edit) {
 edit.SetValue(null);
 edit.SetIsValid(true);
 return true;
}
function _aspxValidateProcessingProc(edit) {
 edit.OnValidation(ASPxValidationType.MassValidation);
 return edit.GetIsValid();
}
function _aspxSetSelectionCore(inputElement, startPos, endPos) {
 if (__aspxIE) {
  var range = inputElement.createTextRange();
  range.collapse(true);
  range.moveStart("character", startPos);
  range.moveEnd("character", endPos - startPos);
  range.select();
 } else
  inputElement.setSelectionRange(startPos, endPos);
}
function _aspxSetSelection(inputElement, startPos, endPos, scrollToSelection) {
 var textLen = inputElement.value.length;
 if (endPos == -1 || endPos > textLen) 
  endPos = textLen;
 if (startPos > textLen) 
  startPos = textLen;
 if (startPos > endPos)
  return;
 _aspxSetSelectionCore(inputElement, startPos, endPos);
 if (scrollToSelection && inputElement.tagName == 'TEXTAREA') {
  var scrollHeight = inputElement.scrollHeight;
  var approxCaretPos = startPos;
  var scrollTop = Math.max(Math.round(approxCaretPos * scrollHeight / textLen  - inputElement.clientHeight / 2), 0);
  inputElement.scrollTop = scrollTop;
 }
}
function _aspxSetCaretPosition(inputElement, caretPos, scrollToSelection) {
 if(!scrollToSelection)
  scrollToSelection = true;
 if (caretPos == -1)
  caretPos = inputElement.value.length;
 _aspxSetSelection(inputElement, caretPos, caretPos, scrollToSelection);
}
var __aspxLabelValueSuffix = "_V";
ASPxClientStaticEdit = _aspxCreateClass(ASPxClientEditBase, { 
 constructor: function(name) {
  this.constructor.prototype.constructor.call(this, name);
  this.Click = new ASPxClientEvent();
 },
 OnClick: function(htmlEvent) {
  this.RaiseClick(this.GetMainElement(), htmlEvent);
 },
 RaiseClick: function(htmlElement, htmlEvent){
  if(!this.Click.IsEmpty()){
   var args = new ASPxClientEditClickEventArgs(htmlElement, htmlEvent);
   this.Click.FireEvent(this, args);
  }
 },
 ChangeEnabledAttributes: function(enabled){
  this.ChangeMainElementAttributes(this.GetMainElement(), _aspxChangeAttributesMethod(enabled));
 },
 ChangeEnabledStateItems: function(enabled){
  aspxGetStateController().SetElementEnabled(this.GetMainElement(), enabled);
 },
 ChangeMainElementAttributes: function(element, method){
  method(element, "onclick");
 }
});
ASPxClientEditClickEventArgs = _aspxCreateClass(ASPxClientEventArgs, {
 constructor: function(htmlElement, htmlEvent){
  this.constructor.prototype.constructor.call(this);
  this.htmlElement = htmlElement;
  this.htmlEvent = htmlEvent;
 }
});
ASPxClientHyperLink = _aspxCreateClass(ASPxClientStaticEdit, {
 constructor: function(name) {
  this.constructor.prototype.constructor.call(this, name);
  this.sizingConfig.allowSetWidth = false;
  this.sizingConfig.allowSetHeight = false;
 },
 GetNavigateUrl: function(){
  var element = this.GetMainElement();
  if(_aspxIsExistsElement(element))
   return element.href;
  return "";
 },
 SetNavigateUrl: function(url){
  var element = this.GetMainElement();
  if(_aspxIsExistsElement(element))
   element.href = url;
 },
 GetText: function(){
  return this.GetValue();
 },
 SetText: function(value){
  this.SetValue(value);
 },
 ChangeMainElementAttributes: function(element, method){
  ASPxClientStaticEdit.prototype.ChangeMainElementAttributes.call(this, element, method);
  method(element, "href");
 }
});
ASPxClientImageBase = _aspxCreateClass(ASPxClientStaticEdit, {
 constructor: function(name) {
  this.constructor.prototype.constructor.call(this, name);
  this.imageWidth = "";
  this.imageHeight = "";
 },
 GetWidth: function(){
  return this.GetSize(true);
 },
 GetHeight: function(){
  return this.GetSize(false);
 },
 SetWidth: function(width) {
  this.SetSize(width, this.GetHeight());
 },
 SetHeight: function(height) {
  this.SetSize(this.GetWidth(), height);
 },
 SetSize: function(width, height){
  this.imageWidth = width + "px";
  this.imageHeight = height + "px";
  var image = this.GetMainElement();
  if(_aspxIsExistsElement(image))
   ASPxImageUtils.SetSize(image, width, height);
 },
 GetSize: function(isWidth){
  var image = this.GetMainElement();
  if(_aspxIsExistsElement(image))
   return ASPxImageUtils.GetSize(image, isWidth);
  return -1;
 }
});
ASPxClientImage = _aspxCreateClass(ASPxClientImageBase, {
 constructor: function(name) {
  this.constructor.prototype.constructor.call(this, name);
  this.emptyImageUrl = "";
  this.emptyImageWidth = "";
  this.emptyImageHeight = "";
  this.imageAlt = "";
  this.isEmpty = false;
 },
 GetValue: function() {
  if(!this.isEmpty) {
   var image = this.GetMainElement();
   if(_aspxIsExistsElement(image))
    return ASPxImageUtils.GetImageSrc(image);
  }
  return "";
 },
 SetValue: function(value) {
  if(value == null) value = "";
  this.isEmpty = (value == "");
  var image = this.GetMainElement();
  if(_aspxIsExistsElement(image)){
   if(this.emptyImageUrl != ""){
    if(value == "")
     this.ApplyImageProperties(image, this.emptyImageUrl, this.emptyImageWidth, this.emptyImageHeight, this.emptyImageAlt);
    else
     this.ApplyImageProperties(image, value, this.imageWidth, this.imageHeight, this.imageAlt);
   }
   else
    ASPxImageUtils.SetImageSrc(image, value);
  }
 },
 ApplyImageProperties: function(imageElement, url, width, height, alt){
  ASPxImageUtils.SetImageSrc(imageElement, url);
  imageElement.style.width = width;
  imageElement.style.height = height;
  imageElement.alt = alt;
 },
 GetImageUrl: function(url){
  return this.GetValue();
 },
 SetImageUrl: function(url){
  this.SetValue(url);
 }
});
ASPxClientBinaryImage = _aspxCreateClass(ASPxClientImageBase, {
 constructor: function(name) {
  this.constructor.prototype.constructor.call(this, name);
 },
 GetValue: function() {
  return "";
 },
 SetValue: function(value) {
 }
});
ASPxClientLabel = _aspxCreateClass(ASPxClientStaticEdit, {
 constructor: function(name) {
  this.constructor.prototype.constructor.call(this, name);
  this.sizingConfig.allowSetWidth = false;
  this.sizingConfig.allowSetHeight = false;         
 },
 GetValue: function() { 
  var element = this.GetMainElement();
  if(_aspxIsExistsElement(element))
   return element.innerHTML;
 },
 SetValue: function(value) {
  if(value == null)
   value = "";
  var element = this.GetMainElement();
  if(_aspxIsExistsElement(element)) 
   element.innerHTML = value;
 },
 SetVisible: function(visible){
  if(this.clientVisible != visible){
   this.clientVisible = visible;
   var element = this.GetMainElement();
   if(!visible)
    element.style.display = "none";
   else if((element.style.width != "" || element.style.height != "") && !__aspxNetscapeFamily)
    element.style.display = "inline-block";
   else
    element.style.display = "";
  }
 },
 GetText: function(){
  return this.GetValue();
 },
 SetText: function(value){
  this.SetValue(value);
 },
 ChangeMainElementAttributes: function(element, method){
  ASPxClientStaticEdit.prototype.ChangeMainElementAttributes.call(this, element, method);
  method(element, "htmlFor");
 }
});
function aspxSEClick(name, evt){
 var edit = aspxGetControlCollection().Get(name);
 if(edit != null) 
  edit.OnClick(evt);
}
ASPxClientNavBar = _aspxCreateClass(ASPxClientControl, {
 constructor: function(name){
  this.constructor.prototype.constructor.call(this, name);
  this.animationOffset = 10;
  this.animationDelay = 10;
  this.animationMaxDelay = 400;
  this.autoCollapse = false;
  this.allowExpanding = true;
  this.allowSelectItem = false;
  this.cookieName = "";
  this.groupCount = 0;
  this.enableAnimation = false;
  this.groups = [];
  this.groupsExpanding = new Array();
  this.groupsExpandingRequest = [];
  this.mouseOverActionDelay = 300;
  this.mouseOverActionTimerID = -1;
  this.ItemClick = new ASPxClientEvent();
  this.ExpandedChanged = new ASPxClientEvent();
  this.ExpandedChanging = new ASPxClientEvent();
  this.HeaderClick = new ASPxClientEvent();
 }, 
 InlineInitialize: function(){
  this.InitializeSelectedItem();
  this.InitializeEnabledAndVisible();
 },
 InitializeEnabledAndVisible: function(){
  for(var i = 0; i < this.groups.length; i++){
   var group = this.groups[i];
   for(var j = 0; j < group.items.length; j++){
    this.SetItemEnabled(i, j, group.items[j].clientEnabled, true);
    this.SetItemVisible(i, j, group.items[j].clientVisible, true);
   }
   this.SetGroupVisible(i, group.clientVisible, true);
  }
 },
 InitializeSelectedItem: function(){
  if(!this.allowSelectItem) return;
  this.SelectItem(this.GetSelectedItemIndexPath());
 },
 InitializeCallBackData: function(){
  for(var i = 0; i < this.GetGroupCountCore(); i ++){
   if(this.groupsExpanding[i]){
    var element = this.GetGroupContentElement(i);
    if(element != null) element.loaded = true;
   }
  }
 }, 
 GetClickableGroupHeaderElement: function(index) {
  var isDisplayed = false;
  var element = this.GetGroupHeaderExpandedElement(index);
  if (element != null) isDisplayed = !_aspxGetElementDisplay(element) || !this.allowExpanding ;
  if (!isDisplayed)
   element = this.GetGroupHeaderCollapsedElement(index);
  return element;
 },
 GetGroupHeaderExpandedElement: function(index){
  return this.GetChild("_GHE" + index);
 },
 GetGroupHeaderCollapsedElement: function(index){
  return this.GetChild("_GHC" + index);
 },
 GetGroupContentElement: function(index){
  return this.GetChild("_GC" + index);
 },
 GetGroupContentAnimationElement: function(index){
  return this.GetChild("_GCA" + index);
 },
 GetRowElement: function(cellElement){
  return cellElement.parentNode;
 },
 GetItemElement: function(groupIndex, itemIndex){
  return this.GetChild("_I" + this.GetIndexPath(groupIndex, itemIndex) + "_");
 },
 GetItemSeparatorElement: function(groupIndex, itemIndex){
  return this.GetChild("_I" + this.GetIndexPath(groupIndex, itemIndex) + "S");
 },
 GetItemTextElementByIndexPath: function(indexPath){
  return this.GetChild("_I" + indexPath + "_T");
 },
 GetItemImageElementByIndexPath: function(indexPath){
  return this.GetChild("_I" + indexPath + "_I");
 },
 GetGroupRow: function(groupIndex){
  return this.GetChild("_GR" + groupIndex);
 },
 GetGroupSeparatorRow: function(groupIndex){
  return this.GetChild("_GSR" + groupIndex);
 },
 GetGroupStateInputElement: function(index){
  return _aspxGetElementById(this.name + "GS");
 },
 GetSelectedItemInputElement: function(){
  return _aspxGetElementById(this.name + "SI");
 },
 DoItemClick: function(groupIndex, itemIndex, hasItemLink, htmlEvent){
  var processOnServer = this.RaiseItemClick(groupIndex, itemIndex, htmlEvent);
  if(processOnServer && !hasItemLink)
   this.SendPostBack("CLICK:" + this.GetIndexPath(groupIndex, itemIndex));
 },
 GetAutoCollapseCoGroupIndex: function(groupIndex){
  if(this.autoCollapse){
   for(var i = 0; i < this.GetGroupCountCore(); i ++){
    if(i != groupIndex && this.groupsExpanding[i])
     return i;
   }
  }
  return -1;
 },
 SetExpandedInternal: function(groupIndex, expanded){
  if(expanded == this.groupsExpanding[groupIndex]) return;
  var processingMode = this.RaiseExpandedChanging(groupIndex);
  if(processingMode == "Client"){
   if(expanded || !this.autoCollapse)
    this.ChangeExpanding(groupIndex, expanded);
  }
  else if(processingMode == "Server")
   this.SendPostBack("EXPAND:" + groupIndex);
 },
 ChangeExpanding: function(groupIndex, expanded){
  var element = this.GetGroupContentElement(groupIndex);
  var autoCollapseCoGroupIndex = this.GetAutoCollapseCoGroupIndex(groupIndex);
  if(expanded && _aspxIsFunction(this.callBack)  && element != null && !element.loaded){
   this.DoChangeExpanding(groupIndex, autoCollapseCoGroupIndex, expanded, false, false, true);
   if(!element.loading){
    element.loading = true;
    this.CreateLoadingPanelInsideContainer(this.GetGroupContentElement(groupIndex));
    this.CreateCallback(groupIndex);
    _aspxArrayPush(this.groupsExpandingRequest, groupIndex);
   }
  }
  else
   this.DoChangeExpanding(groupIndex, autoCollapseCoGroupIndex, expanded, this.enableAnimation, true, true);
 },
 DoChangeExpanding: function(groupIndex, autoCollapseCoGroupIndex, expanded, doAnimation, raiseChangedEvent, raiseCoGroupChangedEvent){
  this.ChangeGroupExpandState(groupIndex, expanded);
  if(autoCollapseCoGroupIndex > -1)
   this.ChangeGroupExpandState(autoCollapseCoGroupIndex, !expanded);
  if(doAnimation){
   var element = this.GetGroupContentAnimationElement(groupIndex);
   if(element != null){
    var controlHeight = this.GetMainElement().offsetHeight;
    this.PrepareGroupElementsForAnimation(groupIndex, expanded, 0);
    if(autoCollapseCoGroupIndex > -1){
     var heightDelta = controlHeight - this.GetMainElement().offsetHeight;
     this.PrepareGroupElementsForAnimation(autoCollapseCoGroupIndex, !expanded, heightDelta);
    }
    element.expanding = expanded;
    element.animationCount = 1;
    element.animationStart = new Date();
    element.autoCollapseCoGroupIndex = autoCollapseCoGroupIndex;
    element.timerID = window.setTimeout("aspxNBAnimT(\"" + this.name + "\", " + groupIndex + ")", this.animationDelay);
    return;
   }
  }
  this.ChangeGroupElementsExpandState(groupIndex, expanded);
  if(autoCollapseCoGroupIndex > -1)
   this.ChangeGroupElementsExpandState(autoCollapseCoGroupIndex, !expanded);
  if(raiseCoGroupChangedEvent && autoCollapseCoGroupIndex > -1)
   this.RaiseExpandedChanged(autoCollapseCoGroupIndex);
  if(raiseChangedEvent)
   this.RaiseExpandedChanged(groupIndex);
 },
 PrepareGroupElementsForAnimation: function(groupIndex, expanding, heightCorrection){
  var element = this.GetGroupContentAnimationElement(groupIndex);
  var contentElement = this.GetGroupContentElement(groupIndex);
  if(element == null || contentElement == null) return;
  element.style.overflow = "hidden";
  if(expanding){
   element.style.height = "0px";
   _aspxSetElementDisplay(this.GetRowElement(contentElement), true);
   if(__aspxNetscapeFamily && !__aspxFirefox){
    var innerElement = _aspxGetChildByTagName(element, "TABLE", 0);
    if(innerElement != null)
     element.style.width = innerElement.offsetWidth + "px";
    else{
     innerElement = _aspxGetChildByTagName(element, "UL", 0);
     if(innerElement != null)
      element.style.width = element.clientWidth + "px";
    }
   }
  }
  else{
   var height = element.offsetHeight + heightCorrection;
   if(height < 0) height = element.offsetHeight;
   element.style.height = height + "px";
  } 
 },
 ChangeGroupExpandState: function(groupIndex, expanded){
  this.groupsExpanding[groupIndex] = expanded;
  this.UpdateGroupStateInputElement();
  this.UpdateGroupStateCookie();
 },
 ChangeGroupElementsExpandState: function(groupIndex, expanded){
  var element = this.GetGroupContentElement(groupIndex);
  if(element != null) _aspxSetElementDisplay(this.GetRowElement(element), expanded);
  element = this.GetGroupHeaderExpandedElement(groupIndex);
  if(element != null) _aspxSetElementDisplay(this.GetRowElement(element), expanded);
  element = this.GetGroupHeaderCollapsedElement(groupIndex);
  if(element != null) _aspxSetElementDisplay(this.GetRowElement(element), !expanded);
  if (expanded)
   aspxGetControlCollection().AdjustControls(this.GetGroupContentElement(groupIndex), __aspxCheckSizeCorrectedFlag);
 },
 GetGroupCountCore: function(){
  return (this.groups.length > 0) ? this.groups.length : this.groupCount;
 },
 GetIndexPath: function(groupIndex, itemIndex){
  return (groupIndex != -1 && itemIndex != -1) ? groupIndex + __aspxItemIndexSeparator + itemIndex : "";
 },
 GetGroupIndex: function(indexPath){
  var indexes = indexPath.split(__aspxItemIndexSeparator);
  return (indexes.length > 0) ? indexes[0] : -1;
 },
 GetItemIndex: function(indexPath){
  var indexes = indexPath.split(__aspxItemIndexSeparator);
  return (indexes.length > 1) ? indexes[1] : -1;
 },
 GetGroupState: function(){
  var state = "";
  for(var i = 0; i < this.GetGroupCountCore(); i ++) {
   state += this.groupsExpanding[i] ? "1" : "0";
   if(i < this.GetGroupCountCore() - 1) state += ";";
  }
  return state;
 },
 UpdateGroupStateCookie: function(){
  if(this.cookieName == "") return;
  _aspxDelCookie(this.cookieName);
  _aspxSetCookie(this.cookieName, this.GetGroupState());
 },
 UpdateGroupStateInputElement: function(){
  var element = this.GetGroupStateInputElement();
  if(element != null) element.value = this.GetGroupState();
 },
 SelectItem: function(indexPath){
  element = this.GetItemTextElementByIndexPath(indexPath);
  if(element != null)
   aspxGetStateController().SelectElementBySrcElement(element);
 },
 DeselectItem: function(indexPath){
  var element = this.GetItemTextElementByIndexPath(indexPath);
  if(element != null)
   aspxGetStateController().DeselectElementBySrcElement(element);
 },
 GetSelectedItemIndexPath: function(){
  var inputElement = this.GetSelectedItemInputElement();
  if(inputElement != null)
   return inputElement.value;
  return ""; 
 },
 SetSelectedItemInternal: function(groupIndex, itemIndex){
  var indexPath = this.GetIndexPath(groupIndex, itemIndex);
  if(this.allowSelectItem){
   var inputElement = this.GetSelectedItemInputElement();
   if(inputElement != null){
    this.DeselectItem(inputElement.value);
    inputElement.value = indexPath;
    var item = _aspxIsExists(this.GetGroup(groupIndex)) ? this.GetGroup(groupIndex).GetItem(itemIndex) : null;
    if(item == null || item.GetEnabled())
     this.SelectItem(inputElement.value);
   }
  }
 },
 OnAnimationTimer: function(groupIndex){
  var element = this.GetGroupContentAnimationElement(groupIndex);
  if(element != null){
   window.clearTimeout(element.timerID);
   var autoCollapseCoGroupIndex = element.autoCollapseCoGroupIndex;
   var animationOffset = this.animationOffset * element.animationCount;
   var height = element.offsetHeight + (element.expanding ? animationOffset : -animationOffset);
   var innerElement = _aspxGetChildByTagName(element, "TABLE", 0);
   if(innerElement == null)
    innerElement = _aspxGetChildByTagName(element, "UL", 0);
   var finished = (element.expanding ? (height >= innerElement.offsetHeight) : (height <= 0)) ||
    (new Date() - element.animationStart > this.animationMaxDelay);
   if(finished){
    this.ChangeGroupElementsExpandState(groupIndex, element.expanding);
    if(autoCollapseCoGroupIndex > -1)
     this.ChangeGroupElementsExpandState(autoCollapseCoGroupIndex, !element.expanding);
    element.style.overflow = "";
    element.style.height = "";
    element.style.width = "";
    if(autoCollapseCoGroupIndex > -1)
     this.RaiseExpandedChanged(autoCollapseCoGroupIndex);
    this.RaiseExpandedChanged(groupIndex);
   }
   else{
    element.style.height = height + "px";
    if(autoCollapseCoGroupIndex > -1){
     var coGroupElement = this.GetGroupContentAnimationElement(autoCollapseCoGroupIndex);
     if(coGroupElement != null){
      var coGroupHeight = coGroupElement.offsetHeight + (!element.expanding ? animationOffset : -animationOffset);
      if(coGroupHeight <= 0) coGroupHeight = 1;
      coGroupElement.style.height = coGroupHeight + "px";
     }
    }
    element.animationCount ++;
    element.timerID = window.setTimeout("aspxNBAnimT(\"" + this.name + "\", " + groupIndex + ")", this.animationDelay);
   }
  }
 },
 OnHeaderClick: function(groupIndex, evt){
  this.ClearMouseMoverTimer();
  var processingMode = this.RaiseHeaderClick(groupIndex, evt);
  var linkElement = (evt != null) ? _aspxGetParentByTagName(_aspxGetEventSource(evt), "A") : null;
  if(linkElement == null || linkElement.href == __aspxAccessibilityEmptyUrl){
   if(processingMode == "Client" && this.allowExpanding){
    var expanded = this.groupsExpanding[groupIndex];
    this.SetExpandedInternal(groupIndex, !expanded);
    if(evt != null)
     aspxUpdateHoverState(evt);
   }
   else if(processingMode == "Server")
    this.SendPostBack("HEADERCLICK:" + groupIndex);
  }
 },
 OnHeaderMouseMove: function(groupIndex, evt){
  if(ASPxClientNavBar.MouseOverActiveNavBar != this || ASPxClientNavBar.MouseOverActiveGroupIndex != groupIndex){
   ASPxClientNavBar.MouseOverActiveNavBar = this; 
   ASPxClientNavBar.MouseOverActiveGroupIndex = groupIndex;
   this.ClearMouseMoverTimer();
   this.mouseOverActionTimerID = _aspxSetTimeout("aspxNBHMMoveTimer(\"" + this.name + "\", " + groupIndex + ");", this.mouseOverActionDelay);
  }
 },
 OnHeaderMouseMoveTimer: function(groupIndex){
  this.ClearMouseMoverTimer();
  if(ASPxClientNavBar.MouseOverActiveNavBar == this || ASPxClientNavBar.MouseOverActiveGroupIndex == groupIndex)
   this.OnHeaderClick(groupIndex, null)
 },
 ClearMouseMoverTimer: function(){
  if(this.mouseOverActionTimerID > -1){
   _aspxClearTimer(this.mouseOverActionTimerID);
   this.mouseOverActionTimerID = -1;
  }
 },
 OnItemClick: function(groupIndex, itemIndex, evt){
  var element = this.GetItemElement(groupIndex, itemIndex);
  var clickedLinkElement = _aspxGetParentByTagName(_aspxGetEventSource(evt), "A");
  var isLinkClicked = (clickedLinkElement != null && clickedLinkElement.href != __aspxAccessibilityEmptyUrl);
  var linkElement = (element != null) ? _aspxGetChildByTagName(element, "A", 0) : null;
  if(linkElement != null && linkElement.href == __aspxAccessibilityEmptyUrl)
   linkElement = null;
  aspxClearHoverState();
  this.SetSelectedItemInternal(groupIndex, itemIndex);
  aspxUpdateHoverState(evt);
  this.DoItemClick(groupIndex, itemIndex, isLinkClicked || (linkElement != null), evt);
  if(!isLinkClicked && linkElement != null) 
   _aspxNavigateUrl(linkElement.href, linkElement.target);
 },
 OnCallbackInternal: function(html, index, isError){
  this.SetCallbackContent(html, index, isError);
  if(!isError)
   this.RaiseExpandedChanged(index);
  _aspxArrayRemoveAt(this.groupsExpandingRequest, 0);
 },
 OnCallback: function(result){
  this.OnCallbackInternal(result.html, result.index, false);
 },
 OnCallbackError: function(result, data){
  this.OnCallbackInternal(result, data, true);
 },
 OnCallbackGeneralError: function(result){
  var callbackGroupIndex = (this.groupsExpandingRequest.length > 0) ? this.groupsExpandingRequest[0] : 0;
  this.SetCallbackContent(result, callbackGroupIndex, true);
  _aspxArrayRemoveAt(this.groupsExpandingRequest, 0);
 },
 SetCallbackContent: function(html, index, isError) {
  var element = this.GetGroupContentElement(index);
  if(element != null) {
   _aspxSetInnerHtml(element, html);
   if(!isError)
    element.loaded = true;
   element.loading = false;
  }
 },
 CreateGroups: function(groupsProperties){
  for(var i = 0; i < groupsProperties.length; i ++){
   var groupName = _aspxIsExists(groupsProperties[i][0]) ? groupsProperties[i][0] : "";
   var group = new ASPxClientNavBarGroup(this, i, groupName);
   if(_aspxIsExists(groupsProperties[i][1]))
    group.enabled = groupsProperties[i][1];
   if(_aspxIsExists(groupsProperties[i][2]))
    group.visible = groupsProperties[i][2];
   if(_aspxIsExists(groupsProperties[i][3]))
    group.clientVisible = groupsProperties[i][3];
   _aspxArrayPush(this.groups, group);
   group.CreateItems(groupsProperties[i][4]);
  }
 },
 RaiseItemClick: function(groupIndex, itemIndex, htmlEvent){
  var processOnServer = this.autoPostBack || this.IsServerEventAssigned("ItemClick");
  if(!this.ItemClick.IsEmpty()){
   var htmlElement = this.GetItemElement(groupIndex, itemIndex);   
   var args = new ASPxClientNavBarItemEventArgs(processOnServer, this.GetGroup(groupIndex).GetItem(itemIndex), htmlElement, htmlEvent);
   this.ItemClick.FireEvent(this, args);
   processOnServer = args.processOnServer;
  }
  return processOnServer;
 },
 RaiseExpandedChanged: function(groupIndex){
  if(!this.ExpandedChanged.IsEmpty()){
   var args = new ASPxClientNavBarGroupEventArgs(this.GetGroup(groupIndex));
   this.ExpandedChanged.FireEvent(this, args);
  }
 },
 RaiseExpandedChanging: function(groupIndex){
  var processingMode = this.autoPostBack ? "Server" : "Client";
  if(!this.ExpandedChanging.IsEmpty()){
   var args = new ASPxClientNavBarGroupCancelEventArgs(processingMode == "Server", this.GetGroup(groupIndex));
   this.ExpandedChanging.FireEvent(this, args);
   if(args.cancel)
    processingMode = "Handled";
   else 
    processingMode = args.processOnServer ? "Server" : "Client";
  }
  return processingMode;
 },
 RaiseHeaderClick: function(groupIndex, htmlEvent){
  var processingMode = this.autoPostBack || this.IsServerEventAssigned("HeaderClick") ? "Server" : "Client";
  if(!this.HeaderClick.IsEmpty()){
   var htmlElement = this.GetClickableGroupHeaderElement(groupIndex);
   var args = new ASPxClientNavBarGroupClickEventArgs(processingMode == "Server", this.GetGroup(groupIndex), htmlElement, htmlEvent);
   this.HeaderClick.FireEvent(this, args);
   if(args.cancel)
    processingMode = "Handled";
   else 
    processingMode = args.processOnServer ? "Server" : "Client";
  }
  return processingMode;
 },
 GetGroupCount: function(){
  return this.groups.length;
 },
 GetGroup: function(index){
  return (0 <= index && index < this.groups.length) ? this.groups[index] : null;
 },
 GetGroupByName: function(name){
  for(var i = 0; i < this.groups.length; i ++)
   if(this.groups[i].name == name) return this.groups[i];
  return null;
 },
 GetActiveGroup: function(){
  if(this.autoCollapse) {
   for(var i = 0; i < this.groups.length; i ++){
    if(this.groups[i].GetExpanded())
     return this.groups[i];
   }
  }
  return null;
 },
 SetActiveGroup: function(group){
  if(this.autoCollapse && group != null) 
   group.SetExpanded(true);
 },
 GetItemByName: function(name){
  for(var i = 0; i < this.groups.length; i ++){
   var item = this.groups[i].GetItemByName(name);
   if(item != null) return item;
  }
  return null;
 },
 GetSelectedItem: function(){
  var indexPath = this.GetSelectedItemIndexPath();
  if(indexPath != ""){
    var groupIndex = this.GetGroupIndex(indexPath);
    var itemIndex = this.GetItemIndex(indexPath);
    if(groupIndex > -1 && itemIndex > -1)
    return this.GetGroup(groupIndex).GetItem(itemIndex);
  }
  return null;
 },
 SetSelectedItem: function(item){
  var groupIndex = (item != null) ? item.group.index : -1;
  var itemIndex = (item != null) ? item.index : -1;
  this.SetSelectedItemInternal(groupIndex, itemIndex);
 },
 CollapseAll: function(){
  for(var i = 0; i < this.groupsExpanding.length; i++){
   if(this.groupsExpanding[i])
    this.SetExpandedInternal(i, false);
  }    
 },
 ExpandAll: function(){
  for(var i = 0; i < this.groupsExpanding.length; i++){
   if(!this.groupsExpanding[i])
    this.SetExpandedInternal(i, true);
  }    
 },
 ChangeItemElementsEnabledAttributes: function(groupIndex, itemIndex, method, styleMethod){
  var indexPath = this.GetIndexPath(groupIndex, itemIndex);
  var imageElement = this.GetItemImageElementByIndexPath(indexPath);
  if(_aspxIsExists(imageElement)){
   method(imageElement, "onclick");
   styleMethod(imageElement, "cursor");
      var link = this.GetInternalHyperlinkElement(imageElement, 0);
      if(link != null){
       method(link, "href");
       styleMethod(link, "cursor");
      }
  }
  var textElement = this.GetItemTextElementByIndexPath(indexPath);
  if(_aspxIsExists(textElement)){
   method(textElement, "onclick");
   styleMethod(textElement, "cursor");
      var link = this.GetInternalHyperlinkElement(textElement, 0);
      if(link != null){
       method(link, "href");
       styleMethod(link, "cursor");
       link = this.GetInternalHyperlinkElement(textElement, 1);
       if(link != null){
        method(link, "href");
        styleMethod(link, "cursor");
       }
      }
  }
  var itemElement = this.GetItemElement(groupIndex, itemIndex);
  if(_aspxIsExists(itemElement)){
   method(itemElement, "onclick");
   if(imageElement == null && textElement == null){
    styleMethod(itemElement, "cursor");
       var link = this.GetInternalHyperlinkElement(itemElement, 0);
       if(link != null){
        method(link, "href");
        styleMethod(link, "cursor");
       }
      }
  }
 },
 SetItemEnabled: function(groupIndex, itemIndex, enabled, initialization){
  if(!this.groups[groupIndex].items[itemIndex].enabled) return;
  var indexPath = this.GetIndexPath(groupIndex, itemIndex);
  if(!enabled){
   if(this.GetSelectedItemIndexPath() == indexPath)
    this.DeselectItem(indexPath);
  }
  if(!initialization || !enabled)
   this.ChangeItemEnabledStateItems(groupIndex, itemIndex, enabled);
  this.ChangeItemEnabledAttributes(groupIndex, itemIndex, enabled);
  if(enabled){
   if(this.GetSelectedItemIndexPath() == indexPath)
    this.SelectItem(indexPath);
  }
 },
 ChangeItemEnabledAttributes: function(groupIndex, itemIndex, enabled){
  this.ChangeItemElementsEnabledAttributes(groupIndex, itemIndex, _aspxChangeAttributesMethod(enabled), 
   _aspxChangeStyleAttributesMethod(enabled));
 },
 ChangeItemEnabledStateItems: function(groupIndex, itemIndex, enabled){
  var indexPath = this.GetIndexPath(groupIndex, itemIndex);
  var element = this.GetItemTextElementByIndexPath(indexPath);
  if(element == null)
   element = this.GetItemImageElementByIndexPath(indexPath);
  if(element == null)
   element = this.GetItemElement(groupIndex, itemIndex);
  if(element != null)
   aspxGetStateController().SetElementEnabled(element, enabled);
 },
 GetItemImageUrl: function(groupIndex, itemIndex){
  var indexPath = this.GetIndexPath(groupIndex, itemIndex);
  var element = this.GetItemImageElementByIndexPath(indexPath);
  if(element != null){
   var img = _aspxGetChildByTagName(element, "IMG", 0);
   if(img != null)
    return img.src;
  }
  element = this.GetItemTextElementByIndexPath(indexPath);
  if(element != null){
   var img = _aspxGetChildByTagName(element, "IMG", 0);
   if(img != null)
    return img.src;
  }
  return "";
 },
 SetItemImageUrl: function(groupIndex, itemIndex, url){
  var indexPath = this.GetIndexPath(groupIndex, itemIndex);
  var element = this.GetItemImageElementByIndexPath(indexPath);
  if(element != null){
   var img = _aspxGetChildByTagName(element, "IMG", 0);
   if(img != null)
    img.src = url;
  }
  element = this.GetItemTextElementByIndexPath(indexPath);
  if(element != null){
   var img = _aspxGetChildByTagName(element, "IMG", 0);
   if(img != null)
    img.src = url;
  }
 },
 GetItemNavigateUrl: function(groupIndex, itemIndex){
  var indexPath = this.GetIndexPath(groupIndex, itemIndex);
  var element = this.GetItemTextElementByIndexPath(indexPath);
  if(element != null){
   var link = _aspxGetChildByTagName(element, "A", 0);
   if(link != null)
    return link.href;
  }
  else{
   element = this.GetItemImageElementByIndexPath(indexPath);
   if(element != null){
    var link = _aspxGetChildByTagName(element, "A", 0);
    if(link != null)
     return link.href;
   }
   else{
    element = this.GetItemElement(groupIndex, itemIndex);
    if(element != null){
     var link = _aspxGetChildByTagName(element, "A", 0);
     if(link != null)
      return link.href;
    }
   }
  }
  return "";
 },
 SetItemNavigateUrl: function(groupIndex, itemIndex, url){
  var indexPath = this.GetIndexPath(groupIndex, itemIndex);
  var textElement = this.GetItemTextElementByIndexPath(indexPath);
  if(textElement != null){
   var link = _aspxGetChildByTagName(textElement, "A", 0);
   if(link != null){
    link.href = url;
    link = _aspxGetChildByTagName(textElement, "A", 1);
    if(link != null)
     link.href = url;
   }
  }
  var imageElement = this.GetItemImageElementByIndexPath(indexPath);
  if(imageElement != null){
   var link = _aspxGetChildByTagName(imageElement, "A", 0);
   if(link != null)
    link.href = url;
  }
  if(textElement == null && imageElement == null){
   var element = this.GetItemElement(groupIndex, itemIndex);
   if(element != null){
    var link = _aspxGetChildByTagName(element, "A", 0);
    if(link != null)
     link.href = url;
   }
  }
 },
 GetItemText: function(groupIndex, itemIndex){
  var indexPath = this.GetIndexPath(groupIndex, itemIndex);
  var element = this.GetItemTextElementByIndexPath(indexPath);
  if(element == null)
   element = this.GetItemElement(groupIndex, itemIndex);
  if(element != null){
   var textNode = _aspxGetChildTextNode(element, 0);
   if(textNode != null)
    return textNode.nodeValue;
  }
  return "";
 },
 SetItemText: function(groupIndex, itemIndex, text){
  var indexPath = this.GetIndexPath(groupIndex, itemIndex);
  var element = this.GetItemTextElementByIndexPath(indexPath);
  if(element == null)
   element = this.GetItemElement(groupIndex, itemIndex);
  if(element != null){
   var textNode = _aspxGetChildTextNode(element, 0);
   if(textNode != null)
    textNode.nodeValue = text;
  }
 },
 SetItemVisible: function(groupIndex, itemIndex, visible, initialization){
  if(!this.groups[groupIndex].items[itemIndex].visible) return;
  if(visible && initialization) return;
  var element = this.GetItemElement(groupIndex, itemIndex);
  if(element != null) _aspxSetElementDisplay(element, visible);
  this.SetItemSeparatorsVisiblility(groupIndex);
 },
 SetItemSeparatorsVisiblility: function(groupIndex){
  var group = this.groups[groupIndex];
  for(var i = 0; i < group.items.length; i++){
   var separatorVisible = group.items[i].GetVisible() && this.HasNextVisibleItems(group, i);
   var separatorElement = this.GetItemSeparatorElement(groupIndex, i);
   if(separatorElement != null) _aspxSetElementDisplay(separatorElement, separatorVisible);
  }
 },
 HasNextVisibleItems: function(group, index){
  for(var i = index + 1; i < group.items.length; i++){
   if(group.items[i].GetVisible())
    return true;
  }
  return false;
 },
 SetGroupVisible: function(groupIndex, visible, initialization){
  if(!this.groups[groupIndex].visible) return;
  if(visible && initialization) return;
  var element = this.GetGroupRow(groupIndex);
  if(element != null) _aspxSetElementDisplay(element, visible);
  this.SetGroupSeparatorsVisiblility();
 },
 SetGroupSeparatorsVisiblility: function(){
  for(var i = 0; i < this.groups.length; i++){
   var separatorVisible = this.groups[i].GetVisible() && this.HasNextVisibleGroups(i);
   var separatorElement = this.GetGroupSeparatorRow(i);
   if(separatorElement != null) _aspxSetElementDisplay(separatorElement, separatorVisible);
  }
 },
 HasNextVisibleGroups: function(index){
  for(var i = index + 1; i < this.groups.length; i++){
   if(this.groups[i].GetVisible())
    return true;
  }
  return false;
 }
});
ASPxClientNavBarGroup = _aspxCreateClass(null, {
 constructor: function(navBar, index, name){
  this.navBar = navBar;
  this.index = index;
  this.name = name;
  this.enabled = true;
  this.visible = true;
  this.clientVisible = true;
  this.items = []; 
 },
 CreateItems: function(itemsProperties){
  for(var i = 0; i < itemsProperties.length; i ++){
   var itemName = _aspxIsExists(itemsProperties[i][0]) ? itemsProperties[i][0] : "";
   var item = new ASPxClientNavBarItem(this.navBar, this, i, itemName);
   if(_aspxIsExists(itemsProperties[i][1]))
    item.enabled = itemsProperties[i][1];
   if(_aspxIsExists(itemsProperties[i][2]))    
    item.clientEnabled = itemsProperties[i][2];
   if(_aspxIsExists(itemsProperties[i][3]))
    item.visible = itemsProperties[i][3];
   if(_aspxIsExists(itemsProperties[i][4]))
    item.clientVisible = itemsProperties[i][4];
   _aspxArrayPush(this.items, item);
  }
 },
 GetEnabled: function(){
  return this.enabled;
 },
 GetExpanded: function(){
  return this.navBar.groupsExpanding[this.index];
 },
 SetExpanded: function(value){
  this.navBar.SetExpandedInternal(this.index, value);
 },
 GetVisible: function(){
  return this.visible && this.clientVisible;
 },
 SetVisible: function(value){
  if (this.clientVisible != value) {
   this.clientVisible = value;
   this.navBar.SetGroupVisible(this.index, value, false);
  }
 },
 GetItemCount: function(groupIndex){
  return this.items.length;
 },
 GetItem: function(index){
  return (0 <= index && index < this.items.length) ? this.items[index] : null;
 },
 GetItemByName: function(name){
  for(var i = 0; i < this.items.length; i ++)
   if(this.items[i].name == name) return this.items[i];
  return null;
 }
});
ASPxClientNavBarItem = _aspxCreateClass(null, {
 constructor: function(navBar, group, index, name){
  this.navBar = navBar;
  this.group = group;
  this.index = index;
  this.name = name;
  this.enabled = true;
  this.clientEnabled = true;
  this.visible = true;
  this.clientVisible = true;
 },
 GetEnabled: function(){
  return this.enabled && this.clientEnabled;
 },
 SetEnabled: function(value){
  if (this.clientEnabled != value) {
   this.clientEnabled = value;
   this.navBar.SetItemEnabled(this.group.index, this.index, value, false);
  }
 },
 GetImageUrl: function(){
  return this.navBar.GetItemImageUrl(this.group.index, this.index);
 },
 SetImageUrl: function(value){
  this.navBar.SetItemImageUrl(this.group.index, this.index, value);
 },
 GetNavigateUrl: function(){
  return this.navBar.GetItemNavigateUrl(this.group.index, this.index);
 },
 SetNavigateUrl: function(value){
  this.navBar.SetItemNavigateUrl(this.group.index, this.index, value);
 },
 GetText: function(){
  return this.navBar.GetItemText(this.group.index, this.index);
 },
 SetText: function(value){
  this.navBar.SetItemText(this.group.index, this.index, value);
 },
 GetVisible: function(){
  return this.visible && this.clientVisible;
 },
 SetVisible: function(value){
  if (this.clientVisible != value) {
   this.clientVisible = value;
   this.navBar.SetItemVisible(this.group.index, this.index, value, false);
  }
 } 
});
ASPxClientNavBarItemEventArgs = _aspxCreateClass(ASPxClientProcessingModeEventArgs, {
 constructor: function(processOnServer, item, htmlElement, htmlEvent){
  this.constructor.prototype.constructor.call(this, processOnServer);
  this.item = item;
  this.htmlElement = htmlElement;
  this.htmlEvent = htmlEvent;
 }
});
ASPxClientNavBarGroupEventArgs = _aspxCreateClass(ASPxClientEventArgs, {
 constructor: function(group){
  this.group = group;
 }
});
ASPxClientNavBarGroupCancelEventArgs = _aspxCreateClass(ASPxClientProcessingModeCancelEventArgs, {
 constructor: function(processOnServer, group){
  this.constructor.prototype.constructor.call(this, processOnServer);
  this.group = group;
 }
});
ASPxClientNavBarGroupClickEventArgs = _aspxCreateClass(ASPxClientNavBarGroupCancelEventArgs, {
 constructor: function(processOnServer, group, htmlElement, htmlEvent){
  this.constructor.prototype.constructor.call(this, processOnServer, group);
  this.htmlElement = htmlElement;
  this.htmlEvent = htmlEvent;  
 }
});
function aspxNBAnimT(name, groupIndex){
 var nb = aspxGetControlCollection().Get(name);
 if(nb != null) nb.OnAnimationTimer(groupIndex);
}
function aspxNBHClick(evt, name, groupIndex){
 var nb = aspxGetControlCollection().Get(name);
 if(nb != null) nb.OnHeaderClick(groupIndex, evt);
 if(!__aspxNetscapeFamily)
  evt.cancelBubble = true;
}
function aspxNBHMMove(evt, name, groupIndex){
 var nb = aspxGetControlCollection().Get(name);
 if(nb != null) nb.OnHeaderMouseMove(groupIndex, evt);
}
function aspxNBHMMoveTimer(name, groupIndex){
 var nb = aspxGetControlCollection().Get(name);
 if(nb != null) nb.OnHeaderMouseMoveTimer(groupIndex);
}
function aspxNBIClick(evt, name, groupIndex, itemIndex){
 var nb = aspxGetControlCollection().Get(name);
 if(nb != null) nb.OnItemClick(groupIndex, itemIndex, evt);
 if(!__aspxNetscapeFamily)
  evt.cancelBubble = true;
}
ASPxClientNavBar.MouseOverActiveNavBar = null;
ASPxClientNavBar.MouseOverActiveGroupIndex = -1;
ASPxClientNavBar.DocMouseMoveHandler = function(evt) {
 if(ASPxClientNavBar.MouseOverActiveNavBar != null && ASPxClientNavBar.MouseOverActiveGroupIndex != -1){
  var srcElement = _aspxGetEventSource(evt);
  var headerElement = ASPxClientNavBar.MouseOverActiveNavBar.GetGroupHeaderExpandedElement(ASPxClientNavBar.MouseOverActiveGroupIndex);
  if(headerElement == null || (srcElement != headerElement && !_aspxGetIsParent(headerElement, srcElement))){
   headerElement = ASPxClientNavBar.MouseOverActiveNavBar.GetGroupHeaderCollapsedElement(ASPxClientNavBar.MouseOverActiveGroupIndex);
   if(headerElement == null || (srcElement != headerElement && !_aspxGetIsParent(headerElement, srcElement))){
    ASPxClientNavBar.MouseOverActiveNavBar = null;
    ASPxClientNavBar.MouseOverActiveGroupIndex = -1;
   }
  }
 }
};
_aspxAttachEventToDocument("mousemove", ASPxClientNavBar.DocMouseMoveHandler);
ASPxClientLoadingPanel = _aspxCreateClass(ASPxClientControl, {
 constructor: function(name) {
  this.constructor.prototype.constructor.call(this, name);
  this.containerElementID = "";
  this.containerElement = null;
  this.horizontalOffset = 0;
  this.verticalOffset = 0;
  this.isTextEmpty = false;
  this.showImage = true;
  this.shown = false;
  this.currentoffsetElement = null;
  this.currentX = null;
  this.currentY = null;
 },
 Initialize: function(){
  if(this.containerElementID != "")
   this.containerElement = _aspxGetElementById(this.containerElementID);
  aspxGetControlCollection().SubscribeObjectToBrowserWindowResize(this);
  this.constructor.prototype.Initialize.call(this);
 },
 SetCurrentShowArguments: function(offsetElement, x, y){
  if(offsetElement == null) 
   offsetElement = this.containerElement;
  if(offsetElement == null) 
   offsetElement = document.body;
  this.currentoffsetElement = offsetElement;
  this.currentX = x;
  this.currentY = y;
 },
 ResetCurrentShowArguments: function(){
  this.currentoffsetElement = null;
  this.currentX = null;
  this.currentY = null;
 },
 SetLoadingPanelPosAndSize: function(){
  var element = this.GetMainElement();
  this.SetLoadingPanelLocation( this.currentoffsetElement, element, this.currentX, this.currentY, this.horizontalOffset, this.verticalOffset);
 },
 SetLoadingDivPosAndSize: function(){
  var element = this.GetLoadingDiv();
  if(element != null){
   _aspxSetElementDisplay(element, true);
   this.SetLoadingDivBounds(this.currentoffsetElement, element);
  }
 },
 ShowInternal: function(offsetElement, x, y){
  this.SetCurrentShowArguments(offsetElement, x, y);
  var element = this.GetMainElement();
  if(!this.isTextEmpty || this.showImage){
   _aspxSetElementDisplay(element, true);
   this.SetLoadingPanelPosAndSize();
  }
  this.SetLoadingDivPosAndSize();
  this.shown = true;
 },
 Show: function(){
  this.ShowInternal(null);
 },
 ShowInElement: function(htmlElement){
  if(_aspxIsExists(htmlElement))
   this.ShowInternal(htmlElement);
 },
 ShowInElementByID: function(id){
  var htmlElement = _aspxGetElementById(id);
  this.ShowInElement(htmlElement);
 },
 ShowAtPos: function(x, y){
  this.ShowInternal(null, x, y);
 },
 SetText: function(text){
  this.isTextEmpty = text == null || text == "";
  this.GetTextLabel().innerHTML = this.isTextEmpty ? "&nbsp;" : text;
 },
 GetText: function() {
  return this.isTextEmpty ? "" : this.GetTextLabel().innerHTML;
 },
 Hide: function(){
  var element = this.GetMainElement();
  _aspxSetElementDisplay(element, false);
  element = this.GetLoadingDiv();
  if(element != null) {
   _aspxSetStyleSize(element, 1, 1);
   _aspxSetElementDisplay(element, false);
  }
  this.ResetCurrentShowArguments();
  this.shown = false;
 },
 GetTextLabel: function(){
  return this.GetChild("_TL");
 },
 GetVisible: function(){
  return _aspxGetElementDisplay(this.GetMainElement());
 },
 SetVisible: function(visible){
  if(visible && !this.IsVisible())
   this.Show();
  else if(!visible && this.IsVisible())
   this.Hide();
 },
 OnBrowserWindowResize: function(){
  if(this.shown){
   this.SetLoadingPanelPosAndSize();
   this.SetLoadingDivPosAndSize();
  }
 }
});

