var __aspxClassesScriptParsed = false; var __aspxDocumentLoaded = false; ASPxClientEvent = _aspxCreateClass(null, { constructor: function() { this.handlerInfoList = []; }, AddHandler: function(handler, executionContext) { if(typeof(executionContext) == "undefined") executionContext = null; var handlerInfo = ASPxClientEvent.CreateHandlerInfo(handler, executionContext); this.handlerInfoList.push(handlerInfo); }, RemoveHandler: function(handler, executionContext) { this.removeHandlerByCondition(function(handlerInfo) { return handlerInfo.handler == handler && (!executionContext || handlerInfo.executionContext == executionContext); }); }, removeHandlerByCondition: function(predicate) { for(var i = this.handlerInfoList.length - 1; i >= 0; i--) { var handlerInfo = this.handlerInfoList[i]; if(predicate(handlerInfo)) _aspxArrayRemoveAt(this.handlerInfoList, i); } }, removeHandlerByControlName: function(controlName) { this.removeHandlerByCondition(function(handlerInfo) { return handlerInfo.executionContext && handlerInfo.executionContext.name === controlName; }); }, ClearHandlers: function() { this.handlerInfoList.length = 0; }, FireEvent: function(obj, args) { for(var i = 0; i < this.handlerInfoList.length; i++) { var handlerInfo = this.handlerInfoList[i]; handlerInfo.handler.call(handlerInfo.executionContext, obj, args); } }, InsertFirstHandler: function(handler, executionContext){ if(typeof(executionContext) == "undefined") executionContext = null; var handlerInfo = ASPxClientEvent.CreateHandlerInfo(handler, executionContext); _aspxArrayInsert(this.handlerInfoList, handlerInfo, 0); }, IsEmpty: function() { return this.handlerInfoList.length == 0; } }); ASPxClientEvent.CreateHandlerInfo = function(handler, executionContext) { return { handler: handler, executionContext: executionContext }; }; ASPxClientEventArgs = _aspxCreateClass(null, { constructor: function() { } }); ASPxClientEventArgs.Empty = new ASPxClientEventArgs(); ASPxClientCancelEventArgs = _aspxCreateClass(ASPxClientEventArgs, { constructor: function(){ this.constructor.prototype.constructor.call(this); this.cancel = false; } }); ASPxClientProcessingModeEventArgs = _aspxCreateClass(ASPxClientEventArgs, { constructor: function(processOnServer){ this.constructor.prototype.constructor.call(this); this.processOnServer = processOnServer; } }); ASPxClientProcessingModeCancelEventArgs = _aspxCreateClass(ASPxClientProcessingModeEventArgs, { constructor: function(processOnServer){ this.constructor.prototype.constructor.call(this, processOnServer); this.cancel = false; } }); ASPxClientBeginCallbackEventArgs = _aspxCreateClass(ASPxClientEventArgs, { constructor: function(command){ this.constructor.prototype.constructor.call(this); this.command = command; } }); ASPxClientEndCallbackEventArgs = _aspxCreateClass(ASPxClientEventArgs, { constructor: function(){ this.constructor.prototype.constructor.call(this); } }); ASPxClientCustomDataCallbackEventArgs = _aspxCreateClass(ASPxClientEventArgs, { constructor: function(result) { this.constructor.prototype.constructor.call(this); this.result = result; } }); ASPxClientCallbackErrorEventArgs = _aspxCreateClass(ASPxClientEventArgs, { constructor: function(message){ this.constructor.prototype.constructor.call(this); this.message = message; this.handled = false; } }); ASPxClientControlsInitializedEventArgs = _aspxCreateClass(ASPxClientEventArgs, { constructor: function(isCallback) { this.isCallback = isCallback; } }); ASPxClientAdaptiveLayoutChangingEventArgs = _aspxCreateClass(ASPxClientEventArgs, { constructor: function(){ this.constructor.prototype.constructor.call(this); this.isAdaptiveView = false; } }); ASPxClientControlCollection = _aspxCreateClass(null, { constructor: function(){ this.elements = new Object(); this.prevWndWidth = ""; this.prevWndHeight = ""; this.BeforeInitCallback = new ASPxClientEvent(); this.ControlsInitialized = new ASPxClientEvent(); }, Add: function(element){ this.elements[element.name] = element; }, Remove: function(element) { this.elements[element.name] = null; }, Get: function(name){ return this.elements[name]; }, GetGlobal: function(name) { var result = window[name]; return result && result.isASPxClientControl ? result : null; }, GetByName: function(name){ return this.Get(name) || this.GetGlobal(name); }, ForEachControl: function(processFunc, context) { if(!context) context = this; for(var name in this.elements) { var control = this.elements[name]; if(ASPxIdent.IsASPxClientControl(control)) if(processFunc.call(context, control)) return; } }, AdjustControls: function(container) { if(typeof(container) == "undefined") container = null; var collection = this; window.setTimeout(function() { collection.ProcessControlsInContainer(container, function(control) { control.AdjustControl(); }); }, 0); }, CollapseControls: function(container) { this.ProcessControlsInContainer(container, function(control) { control.CollapseControl(); }); }, AtlasInitialize: function(isCallback) { if(__aspxIE && __aspxBrowserMajorVersion < 9) { var func = function() { if(_aspxIsLinksLoaded()) _aspxProcessScriptsAndLinks("", isCallback); else setTimeout(func, 100); } func(); } else _aspxProcessScriptsAndLinks("", isCallback); }, Initialize: function() { this.InitializeElements(false ); if(typeof(Sys) != "undefined" && typeof(Sys.Application) != "undefined") { var checkIsInitialized = function() { if(Sys.Application.get_isInitialized()) Sys.Application.add_load(aspxCAInit); else setTimeout(checkIsInitialized, 0); } checkIsInitialized(); } this.InitWindowSizeCache(); }, InitializeElements: function(isCallback) { this.ForEachControl(function(control){ if(!control.isInitialized) control.Initialize(); }); if(typeof(_aspxGetEditorStretchedInputElementsManager) != "undefined") _aspxGetEditorStretchedInputElementsManager().Initialize(); this.AfterInitializeElements(true); this.AfterInitializeElements(false); this.RaiseControlsInitialized(isCallback); }, AfterInitializeElements: function(leadingCall) { this.ForEachControl(function(control){ if (control.leadingAfterInitCall && leadingCall || !control.leadingAfterInitCall && !leadingCall) { if(!control.isInitialized) control.AfterInitialize(); } }); }, DoFinalizeCallback: function() { this.ForEachControl(function(control){ control.DoFinalizeCallback(); }); }, ProcessControlsInContainer: function(container, processFunc) { this.ForEachControl(function(control){ if(!container || this.IsControlInContainer(container, control)) processFunc(control); }); }, IsControlInContainer: function(container, control) { if(control.GetMainElement) { var mainElement = control.GetMainElement(); if(mainElement && (mainElement != container)) { if(_aspxGetIsParent(container, mainElement)) return true; } } return false; }, RaiseControlsInitialized: function(isCallback) { if(!this.ControlsInitialized.IsEmpty()){ if(typeof(isCallback) == "undefined") isCallback = true; var args = new ASPxClientControlsInitializedEventArgs(isCallback); this.ControlsInitialized.FireEvent(this, args); } }, Before_WebForm_InitCallback: function(callbackOwnerID){ var args = new ASPxClientBeforeInitCallbackEventArgs(callbackOwnerID); this.BeforeInitCallback.FireEvent(this, args); }, InitWindowSizeCache: function(){ this.prevWndWidth = _aspxGetDocumentClientWidth(); this.prevWndHeight = _aspxGetDocumentClientHeight(); }, BrowserWindowSizeChanged: function(){ var wndWidth = _aspxGetDocumentClientWidth(); var wndHeight = _aspxGetDocumentClientHeight(); var browserWindowSizeChanged = (this.prevWndWidth != wndWidth) || (this.prevWndHeight != wndHeight); if(browserWindowSizeChanged){ this.prevWndWidth = wndWidth; this.prevWndHeight = wndHeight; return true; } return false; }, OnBrowserWindowResize: function(evt){ if(this.BrowserWindowSizeChanged()){ this.ForEachControl(function(control) { if(control.IsDOMInitialized()) control.OnBrowserWindowResizeInternal(evt); }); } } }); ASPxClientControl = _aspxCreateClass(null, { constructor: function(name){ this.isASPxClientControl = true; this.name = name; this.uniqueID = name; this.encodeHtml = true; this.enabled = true; this.clientEnabled = true; this.clientVisible = true; this.rtl = false; this.autoPostBack = false; this.allowMultipleCallbacks = true; this.callBack = null; this.enableCallbackAnimation = false; this.enableSlideCallbackAnimation = false; this.slideAnimationDirection = null; this.beginCallbackAnimationProcessing = false; this.endCallbackAnimationProcessing = false; this.savedCallbackResult = null; this.savedCallbacks = null; this.isCallbackAnimationPrevented = false; this.lpDelay = 300; this.lpTimer = -1; this.isNative = false; this.requestCount = 0; this.enableSwipeGestures = false; this.supportGestures = false; this.repeatedGestureValue = 0; this.repeatedGestureCount = 0; this.isInitialized = false; this.initialFocused = false; this.leadingAfterInitCall = false; this.adjustedSizes = { }; this.adjustedHeight = 0; this.serverEvents = []; this.dialogContentHashTable = { }; this.loadingPanelElement = null; this.loadingDivElement = null; this.hasPhantomLoadingElements = false; this.mainElement = null; this.renderIFrameForPopupElements = false; this.widthValueSetInPercentage = false; this.heightValueSetInPercentage = false; this.touchUIMouseScroller = null; this.verticalAlignedElements = { }; this.wrappedTextContainers = { }; this.sizingConfig = { allowSetWidth: true, allowSetHeight: true, correction : false, adjustControl : false }; this.Init = new ASPxClientEvent(); this.BeginCallback = new ASPxClientEvent(); this.EndCallback = new ASPxClientEvent(); this.EndCallbackAnimationStart = new ASPxClientEvent(); this.CallbackError = new ASPxClientEvent(); this.CustomDataCallback = new ASPxClientEvent(); this.LayoutChanging = new ASPxClientEvent(); aspxGetControlCollection().Add(this); }, HtmlEncode: function(text) { return this.encodeHtml ? _aspxEncodeHtml(text) : text; }, Initialize: function() { if(this.callBack != null) this.InitializeCallBackData(); }, InlineInitialize: function() { this.InitializeDOM(); }, InitializeGestures: function() { if(this.enableSwipeGestures && this.supportGestures) { ASPxGesturesHelper.AddSwipeGestureHandler(this.name, function() { return this.GetCallbackAnimationElement(); }.aspxBind(this), function(evt) { return this.CanHandleGestureCore(evt); }.aspxBind(this), function(value) { return this.AllowStartGesture(); }.aspxBind(this), function(value) { return this.StartGesture(); }.aspxBind(this), function(value) { return this.AllowExecuteGesture(value); }.aspxBind(this), function(value) { this.ExecuteGesture(value); }.aspxBind(this), function(value) { this.CancelGesture(value); }.aspxBind(this) ); if(__aspxMSTouchUI) this.touchUIMouseScroller = ASPxMouseScroller.Create( function() { return this.GetCallbackAnimationElement(); }.aspxBind(this), function() { return null; }, function() { return this.GetCallbackAnimationElement(); }.aspxBind(this), function(element) { return this.NeedPreventTouchUIMouseScrolling(element); }.aspxBind(this), true ); } }, NeedPreventTouchUIMouseScrolling: function(element) { return false; }, InitailizeFocus: function() { if(this.initialFocused && this.IsVisible()) this.Focus(); }, AfterCreate: function() { this.InlineInitialize(); this.InitializeGestures(); this.UpdateAdjustmentFlags(); this.AdjustControl(); }, AfterInitialize: function() { this.AdjustControl(); this.InitailizeFocus(); this.isInitialized = true; this.RaiseInit(); if(this.savedCallbacks) { for(var i = 0; i < this.savedCallbacks.length; i++) this.CreateCallbackInternal(this.savedCallbacks[i].arg, this.savedCallbacks[i].command, false, this.savedCallbacks[i].callbackInfo); this.savedCallbacks = null; } }, InitializeCallBackData: function() { }, RenderExistsOnPage: function() { return _aspxIsExistsElement(this.GetMainElement()); }, IsStateControllerEnabled: function(){ return typeof(aspxGetStateController) != "undefined" && aspxGetStateController(); }, InitializeDOM: function() { var mainElement = this.GetMainElement(); if(mainElement) mainElement["dxinit"] = true; }, IsDOMInitialized: function() { var mainElement = this.GetMainElement(); return mainElement && mainElement["dxinit"]; }, GetWidth: function() { return this.GetMainElement().offsetWidth; }, GetHeight: function() { return this.GetMainElement().offsetHeight; }, SetWidth: function(width) { if(this.sizingConfig.allowSetWidth) this.SetSizeCore("width", width, "GetWidth", false); }, SetHeight: function(height) { if(this.sizingConfig.allowSetHeight) this.SetSizeCore("height", height, "GetHeight", false); }, SetSizeCore: function(sizePropertyName, size, getFunctionName, corrected) { if(size < 0) return; this.GetMainElement().style[sizePropertyName] = size + "px"; if(this.sizingConfig.adjustControl) this.AdjustControl(true); if(this.sizingConfig.correction && !corrected) { var realSize = this[getFunctionName](); if(realSize != size) { var correctedSize = size - (realSize - size); this.SetSizeCore(sizePropertyName, correctedSize, getFunctionName, true); } } }, AdjustControl: function(nestedCall) { if(this.IsAdjustmentRequired() && (!ASPxClientControl.adjustControlLocked || nestedCall)) { ASPxClientControl.adjustControlLocked = true; try { var mainElement = this.GetMainElement(); if (!mainElement || !this.IsDisplayed() || this.IsHidden() || !this.IsDOMInitialized()) return; this.AdjustControlCore(); this.UpdateAdjustedSizes(); } finally { delete ASPxClientControl.adjustControlLocked; } } this.TryShowPhantomLoadingElements(); }, ResetControlAdjustment: function () { this.adjustedSizes = { }; }, UpdateAdjustmentFlags: function() { var mainElement = this.GetMainElement(); if(mainElement) { var mainElementStyle = _aspxGetCurrentStyle(mainElement); this.widthValueSetInPercentage = _aspxIsPercentageSize(mainElementStyle.width) || _aspxIsPercentageSize(mainElement.style.width); this.heightValueSetInPercentage = _aspxIsPercentageSize(mainElementStyle.height) || _aspxIsPercentageSize(mainElement.style.height); } }, GetAdjustedSizes: function() { var mainElement = this.GetMainElement(); if(mainElement) return { width: mainElement.offsetWidth, height: mainElement.offsetHeight }; return { width: 0, height: 0 }; }, IsAdjusted: function() { return (this.adjustedSizes.width && this.adjustedSizes.width > 0) && (this.adjustedSizes.height && this.adjustedSizes.height > 0); }, IsAdjustmentRequired: function() { if(!this.IsAdjusted()) return true; if(this.widthValueSetInPercentage) return true; if(this.heightValueSetInPercentage) return true; var sizes = this.GetAdjustedSizes(); for(var name in sizes){ if(this.adjustedSizes[name] !== sizes[name]) return true; } return false; }, UpdateAdjustedSizes: function() { var sizes = this.GetAdjustedSizes(); for(var name in sizes) this.adjustedSizes[name] = sizes[name]; }, AdjustControlCore: function() { }, CollapseControl: function() { }, OnBrowserWindowResize: function(evt) { }, OnBrowserWindowResizeInternal: function(evt){ if(this.BrowserWindowResizeSubscriber()) this.OnBrowserWindowResize(evt); }, BrowserWindowResizeSubscriber: function() { return this.widthValueSetInPercentage; }, CorrectWrappedText: function(getElements, key, reCorrect) { var elements = this.GetCachedElements(getElements, this.wrappedTextContainers, key); for(var i = 0; i < elements.length; i++) this.CorrectWrappedTextInContainer(elements[i], reCorrect); }, CorrectWrappedTextInContainer: function(container, reCorrect) { if(!container || (container.dxWrappedTextCorrected && !reCorrect) || container.offsetWidth === 0) return; _aspxAdjustWrappedTextInContainer(container); container.dxWrappedTextCorrected = true; }, CorrectVerticalAlignment: function(alignMethod, getElements, key, reAlign) { var elements = this.GetCachedElements(getElements, this.verticalAlignedElements, key); for(var i = 0; i < elements.length; i++) this.CorrectElementVerticalAlignment(alignMethod, elements[i], reAlign); }, CorrectElementVerticalAlignment: function(alignMethod, element, reAlign) { if(!element || (element.dxVerticalAligned && !reAlign) || element.offsetHeight === 0) return; alignMethod(element); element.dxVerticalAligned = true; }, ClearVerticalAlignedElementsCache: function() { this.verticalAlignedElements = {}; }, GetCachedElements: function(getElements, cache, key) { if(!key) key = "elements"; if(!cache[key] || !_aspxIsValidElements(cache[key])){ var elements = getElements.call(this); if(!ASPxIdent.IsArray(elements)) elements = [elements]; cache[key] = elements; } return cache[key]; }, AdjustPagerControls: function() { if(typeof(aspxGetPagersCollection) != "undefined") aspxGetPagersCollection().AdjustControls(this.GetMainElement()); }, OnAdaptiveLayoutChanging: function(isAdaptiveView) { }, RaiseAdaptiveLayoutChanging: function(isAdaptiveView) { if(!this.LayoutChanging.IsEmpty()){ var args = new ASPxClientAdaptiveLayoutChangingEventArgs(isAdaptiveView); this.LayoutChanging.FireEvent(this, args); return args.isAdaptiveView; } return isAdaptiveView; }, SetAdaptiveClassNames: function(prevClassName, newClassName) { var maiElement = this.GetMainElement(); if(maiElement) { _aspxRemoveClassNameFromElement(maiElement, prevClassName); _aspxAddClassNameToElement(maiElement, newClassName); } }, RegisterServerEventAssigned: function(eventNames){ for(var i = 0; i < eventNames.length; i++) this.serverEvents[eventNames[i]] = true; }, IsServerEventAssigned: function(eventName){ return !!this.serverEvents[eventName]; }, GetChild: function(idPostfix){ var mainElement = this.GetMainElement(); return mainElement ? _aspxGetChildById(mainElement, this.name + idPostfix) : null; }, GetItemElementName: function(element) { var name = ""; if(element.id) name = element.id.substring(this.name.length + 1); return name; }, GetLinkElement: function(element) { if (element == null) return null; return (element.tagName == "A") ? element : _aspxGetChildByTagName(element, "A", 0); }, GetInternalHyperlinkElement: function(parentElement, index) { var element = _aspxGetChildByTagName(parentElement, "A", index); if (element == null) element = _aspxGetChildByTagName(parentElement, "SPAN", index); return element; }, GetParentForm: function(){ return _aspxGetParentByTagName(this.GetMainElement(), "FORM"); }, GetMainElement: function(){ if(!_aspxIsExistsElement(this.mainElement)) this.mainElement = _aspxGetElementById(this.name); return this.mainElement; }, OnControlClick: function(clickedElement, htmlEvent) { }, IsLoadingContainerVisible: function(){ return this.IsVisible(); }, GetLoadingPanelElement: function(){ return _aspxGetElementById(this.name + "_LP"); }, CloneLoadingPanel: function(element, parent) { var clone = element.cloneNode(true); clone.id = element.id + "V"; parent.appendChild(clone); return clone; }, CreateLoadingPanelWithoutBordersInsideContainer: function(container) { var loadingPanel = this.CreateLoadingPanelInsideContainer(container, false, true, true); var contentStyle = _aspxGetCurrentStyle(container); if(!loadingPanel || !contentStyle) return; var elements = [ ]; elements.push(loadingPanel.tagName == "TABLE" ? loadingPanel : _aspxGetChildByTagName(loadingPanel, "TABLE", 0)); var cells = _aspxGetElementsByTagName(loadingPanel, "TD"); if(!cells) cells = [ ]; for(var i = 0; i < cells.length; i++) elements.push(cells[i]); for(var i = 0; i < elements.length; i++) { var el = elements[i]; el.style.borderWidth = 0; el.style.backgroundColor = contentStyle.backgroundColor; if(_aspxIsExists(el.style.boxShadow)) el.style.boxShadow = "none"; else if(_aspxIsExists(el.style.MozBoxShadow)) el.style.MozBoxShadow = "none"; else if(_aspxIsExists(el.style.webkitBoxShadow)) el.style.webkitBoxShadow = "none"; } }, CreateLoadingPanelInsideContainer: function(parentElement, hideContent, collapseHeight, collapseWidth) { if(this.ShouldHideExistingLoadingElements()) this.HideLoadingPanel(); if(parentElement == null) return null; if(!this.IsLoadingContainerVisible()) { this.hasPhantomLoadingElements = true; return null; } var element = this.GetLoadingPanelElement(); if (element != null){ var width = collapseWidth ? 0 : _aspxGetClearClientWidth(parentElement); var height = collapseHeight ? 0 : _aspxGetClearClientHeight(parentElement); if(hideContent){ for(var i = parentElement.childNodes.length - 1; i > -1; i--){ if(parentElement.childNodes[i].style) parentElement.childNodes[i].style.display = "none"; else if(parentElement.childNodes[i].nodeType == 3) parentElement.removeChild(parentElement.childNodes[i]); } } else parentElement.innerHTML = ""; var table = document.createElement("TABLE"); parentElement.appendChild(table); table.border = 0; table.cellPadding = 0; table.cellSpacing = 0; _aspxSetStyles(table, { width: (width > 0) ? width : "100%", height: (height > 0) ? height : "100%" }); var tbody = document.createElement("TBODY"); table.appendChild(tbody); var tr = document.createElement("TR"); tbody.appendChild(tr); var td = document.createElement("TD"); tr.appendChild(td); td.align = "center"; td.vAlign = "middle"; element = this.CloneLoadingPanel(element, td); _aspxSetElementDisplay(element, true); this.loadingPanelElement = element; return element; } else parentElement.innerHTML = " "; return null; }, CreateLoadingPanelWithAbsolutePosition: function(parentElement, offsetElement) { if(this.ShouldHideExistingLoadingElements()) this.HideLoadingPanel(); if(parentElement == null) return null; if(!this.IsLoadingContainerVisible()) { this.hasPhantomLoadingElements = true; return null; } if(!offsetElement) offsetElement = parentElement; var element = this.GetLoadingPanelElement(); if(element != null) { element = this.CloneLoadingPanel(element, parentElement); _aspxSetStyles(element, { position: "absolute", display: "" }); this.SetLoadingPanelLocation(offsetElement, element); this.loadingPanelElement = element; return element; } return null; }, CreateLoadingPanelInline: function(parentElement){ if(this.ShouldHideExistingLoadingElements()) this.HideLoadingPanel(); if(parentElement == null) return null; if(!this.IsLoadingContainerVisible()) { this.hasPhantomLoadingElements = true; return null; } var element = this.GetLoadingPanelElement(); if(element != null) { element = this.CloneLoadingPanel(element, parentElement); _aspxSetElementDisplay(element, true); this.loadingPanelElement = element; return element; } return null; }, ShowLoadingPanel: function() { }, ShowLoadingElements: function() { if(this.InCallback() || this.lpTimer > -1) return; this.ShowLoadingDiv(); if(this.IsCallbackAnimationEnabled()) this.StartBeginCallbackAnimation(); else this.ShowLoadingElementsInternal(); }, ShowLoadingElementsInternal: function() { if(this.lpDelay > 0 && !this.IsCallbackAnimationEnabled()) { var _this = this; this.lpTimer = _aspxSetTimeout(function() { _this.ShowLoadingPanelOnTimer(); }, this.lpDelay); } else { this.RestoreLoadingDivOpacity(); this.ShowLoadingPanel(); } }, GetLoadingPanelOffsetElement: function (baseElement) { if(this.IsCallbackAnimationEnabled()) { var element = this.GetLoadingPanelCallbackAnimationOffsetElement(); if(element) { var container = typeof(ASPxAnimationHelper) != "undefined" ? ASPxAnimationHelper.findSlideAnimationContainer(element) : null; if(container) return container.parentNode.parentNode; else return element; } } return baseElement; }, GetLoadingPanelCallbackAnimationOffsetElement: function () { return this.GetCallbackAnimationElement(); }, IsCallbackAnimationEnabled: function () { return (this.enableCallbackAnimation || this.enableSlideCallbackAnimation) && !this.isCallbackAnimationPrevented; }, StartBeginCallbackAnimation: function () { this.beginCallbackAnimationProcessing = true; this.isCallbackFinished = false; var element = this.GetCallbackAnimationElement(); if(element && this.enableSlideCallbackAnimation && this.slideAnimationDirection) ASPxAnimationHelper.slideOut(element, this.slideAnimationDirection, this.FinishBeginCallbackAnimation.aspxBind(this)); else if(element && this.enableCallbackAnimation) ASPxAnimationHelper.fadeOut(element, this.FinishBeginCallbackAnimation.aspxBind(this)); else this.FinishBeginCallbackAnimation(); }, FinishBeginCallbackAnimation: function () { this.beginCallbackAnimationProcessing = false; if(!this.isCallbackFinished) this.ShowLoadingElementsInternal(); else { this.DoCallback(this.savedCallbackResult); this.savedCallbackResult = null; } }, CheckBeginCallbackAnimationInProgress: function(callbackResult) { if(this.beginCallbackAnimationProcessing) { this.savedCallbackResult = callbackResult; this.isCallbackFinished = true; return true; } return false; }, StartEndCallbackAnimation: function () { this.HideLoadingPanel(); this.SetInitialLoadingDivOpacity(); this.RaiseEndCallbackAnimationStart(); this.endCallbackAnimationProcessing = true; var element = this.GetCallbackAnimationElement(); if(element && this.enableSlideCallbackAnimation && this.slideAnimationDirection) ASPxAnimationHelper.slideIn(element, this.slideAnimationDirection, this.FinishEndCallbackAnimation.aspxBind(this)); else if(element && this.enableCallbackAnimation) ASPxAnimationHelper.fadeIn(element, this.FinishEndCallbackAnimation.aspxBind(this)); else this.FinishEndCallbackAnimation(); this.slideAnimationDirection = null; }, FinishEndCallbackAnimation: function () { this.DoEndCallback(); this.endCallbackAnimationProcessing = false; this.CheckRepeatGesture(); }, CheckEndCallbackAnimationNeeded: function() { if(!this.endCallbackAnimationProcessing && this.requestCount == 1) { this.StartEndCallbackAnimation(); return true; } return false; }, PreventCallbackAnimation: function() { this.isCallbackAnimationPrevented = true; }, GetCallbackAnimationElement: function() { return null; }, AssignSlideAnimationDirectionByPagerArgument: function(arg, currentPageIndex) { this.slideAnimationDirection = null; if(this.enableSlideCallbackAnimation && typeof(ASPxAnimationHelper) != "undefined") { if (arg == ASPxClientPagerCommands.Next || arg == ASPxClientPagerCommands.Last) this.slideAnimationDirection = ASPxAnimationHelper.SLIDE_LEFT_DIRECTION; else if (arg == ASPxClientPagerCommands.First || arg == ASPxClientPagerCommands.Prev) this.slideAnimationDirection = ASPxAnimationHelper.SLIDE_RIGHT_DIRECTION; else if(!isNaN(currentPageIndex) && arg.indexOf(ASPxClientPagerCommands.PageNumber) == 0) { var newPageIndex = parseInt(arg.substring(2)); if(!isNaN(newPageIndex)) this.slideAnimationDirection = newPageIndex < currentPageIndex ? ASPxAnimationHelper.SLIDE_RIGHT_DIRECTION : ASPxAnimationHelper.SLIDE_LEFT_DIRECTION; } } }, TryShowPhantomLoadingElements: function () { if (this.hasPhantomLoadingElements && this.InCallback()) { this.ShowLoadingDivAndPanel(); this.hasPhantomLoadingElements = false; } }, ShowLoadingDivAndPanel: function () { this.ShowLoadingDiv(); this.RestoreLoadingDivOpacity(); this.ShowLoadingPanel(); }, HideLoadingElements: function() { this.HideLoadingPanel(); this.HideLoadingDiv(); }, ShowLoadingPanelOnTimer: function() { this.ClearLoadingPanelTimer(); if(this.RenderExistsOnPage()) { this.RestoreLoadingDivOpacity(); this.ShowLoadingPanel(); } }, ClearLoadingPanelTimer: function() { this.lpTimer = _aspxClearTimer(this.lpTimer); }, HideLoadingPanel: function() { this.ClearLoadingPanelTimer(); this.hasPhantomLoadingElements = false; if(_aspxIsExistsElement(this.loadingPanelElement)) { _aspxRemoveElement(this.loadingPanelElement); this.loadingPanelElement = null; } }, SetLoadingPanelLocation: function(offsetElement, loadingPanel, x, y, offsetX, offsetY) { if(!_aspxIsExists(x) || !_aspxIsExists(y)){ var x1 = _aspxGetAbsoluteX(offsetElement); var y1 = _aspxGetAbsoluteY(offsetElement); var x2 = x1; var y2 = y1; if(offsetElement == document.body){ x2 += _aspxGetDocumentMaxClientWidth(); y2 += _aspxGetDocumentMaxClientHeight(); } else{ x2 += offsetElement.offsetWidth; y2 += offsetElement.offsetHeight; } if(x1 < _aspxGetDocumentScrollLeft()) x1 = _aspxGetDocumentScrollLeft(); if(y1 < _aspxGetDocumentScrollTop()) y1 = _aspxGetDocumentScrollTop(); if(x2 > _aspxGetDocumentScrollLeft() + _aspxGetDocumentClientWidth()) x2 = _aspxGetDocumentScrollLeft() + _aspxGetDocumentClientWidth(); if(y2 > _aspxGetDocumentScrollTop() + _aspxGetDocumentClientHeight()) y2 = _aspxGetDocumentScrollTop() + _aspxGetDocumentClientHeight(); x = x1 + ((x2 - x1 - loadingPanel.offsetWidth) / 2); y = y1 + ((y2 - y1 - loadingPanel.offsetHeight) / 2); } if(_aspxIsExists(offsetX) && _aspxIsExists(offsetY)){ x += offsetX; y += offsetY; } x = _aspxPrepareClientPosForElement(x, loadingPanel, true); y = _aspxPrepareClientPosForElement(y, loadingPanel, false); if(__aspxIE && __aspxBrowserVersion > 8 && (y - Math.floor(y) === 0.5)) y = Math.ceil(y); _aspxSetStyles(loadingPanel, { left: x, top: y }); }, GetLoadingDiv: function(){ return _aspxGetElementById(this.name + "_LD"); }, CreateLoadingDiv: function(parentElement, offsetElement){ if(this.ShouldHideExistingLoadingElements()) this.HideLoadingDiv(); if(parentElement == null) return null; if(!this.IsLoadingContainerVisible()) { this.hasPhantomLoadingElements = true; return null; } if(!offsetElement) offsetElement = parentElement; var div = this.GetLoadingDiv(); if(div != null){ div = div.cloneNode(true); parentElement.appendChild(div); _aspxSetElementDisplay(div, true); _aspxAttachEventToElement(div, ASPxClientTouchUI.touchMouseDownEventName, _aspxPreventEvent); _aspxAttachEventToElement(div, ASPxClientTouchUI.touchMouseMoveEventName, _aspxPreventEvent); _aspxAttachEventToElement(div, ASPxClientTouchUI.touchMouseUpEventName, _aspxPreventEvent); this.SetLoadingDivBounds(offsetElement, div); this.loadingDivElement = div; this.SetInitialLoadingDivOpacity(); return div; } return null; }, SetInitialLoadingDivOpacity: function() { if(!this.loadingDivElement) return; _aspxSaveStyleAttribute(this.loadingDivElement, "opacity"); _aspxSaveStyleAttribute(this.loadingDivElement, "filter"); _aspxSetElementOpacity(this.loadingDivElement, 0.01); }, RestoreLoadingDivOpacity: function() { if(!this.loadingDivElement) return; _aspxRestoreStyleAttribute(this.loadingDivElement, "opacity"); _aspxRestoreStyleAttribute(this.loadingDivElement, "filter"); }, SetLoadingDivBounds: function(offsetElement, loadingDiv) { var absX = (offsetElement == document.body) ? 0 : _aspxGetAbsoluteX(offsetElement); var absY = (offsetElement == document.body) ? 0 : _aspxGetAbsoluteY(offsetElement); _aspxSetStyles(loadingDiv, { left: _aspxPrepareClientPosForElement(absX, loadingDiv, true), top: _aspxPrepareClientPosForElement(absY, loadingDiv, false) }); var width = (offsetElement == document.body) ? _aspxGetDocumentWidth() : offsetElement.offsetWidth; var height = (offsetElement == document.body) ? _aspxGetDocumentHeight() : offsetElement.offsetHeight; if(height < 0) height = 0; _aspxSetStyles(loadingDiv, { width: width, height: height }); var correctedWidth = 2 * width - loadingDiv.offsetWidth; if(correctedWidth <= 0) correctedWidth = width; var correctedHeight = 2 * height - loadingDiv.offsetHeight; if (correctedHeight <= 0) correctedHeight = height; _aspxSetStyles(loadingDiv, { width: correctedWidth, height: correctedHeight }); }, ShowLoadingDiv: function() { }, HideLoadingDiv: function() { this.hasPhantomLoadingElements = false; if(_aspxIsExistsElement(this.loadingDivElement)){ _aspxRemoveElement(this.loadingDivElement); this.loadingDivElement = null; } }, CanHandleGesture: function(evt) { return false; }, CanHandleGestureCore: function(evt) { var source = _aspxGetEventSource(evt); if(_aspxGetIsParent(this.loadingPanelElement, source) || _aspxGetIsParent(this.loadingDivElement, source)) return true; var callbackAnimationElement = this.GetCallbackAnimationElement(); if(!callbackAnimationElement) return false; var animationContainer = ASPxAnimationHelper.getSlideAnimationContainer(callbackAnimationElement, false, false); if(animationContainer && _aspxGetIsParent(animationContainer, source) && !_aspxGetIsParent(animationContainer.childNodes[0], source)) return true; return this.CanHandleGesture(evt); }, AllowStartGesture: function() { return !this.beginCallbackAnimationProcessing && !this.endCallbackAnimationProcessing; }, StartGesture: function() { }, AllowExecuteGesture: function(value) { return false; }, ExecuteGesture: function(value) { }, CancelGesture: function(value) { if(this.repeatedGestureCount === 0) { this.repeatedGestureValue = value; this.repeatedGestureCount = 1; } else { if(this.repeatedGestureValue * value > 0) this.repeatedGestureCount++; else this.repeatedGestureCount--; if(this.repeatedGestureCount === 0) this.repeatedGestureCount = 0; } }, CheckRepeatGesture: function() { if(this.repeatedGestureCount !== 0) { if(this.AllowExecuteGesture(this.repeatedGestureValue)) this.ExecuteGesture(this.repeatedGestureValue, this.repeatedGestureCount); this.repeatedGestureValue = 0; this.repeatedGestureCount = 0; } }, AllowExecutePagerGesture: function (pageIndex, pageCount, value) { if(pageIndex < 0) return false; if(pageCount <= 1) return false; if(value > 0 && pageIndex === 0) return false; if(value < 0 && pageIndex === pageCount - 1) return false; return true; }, ExecutePagerGesture: function(pageIndex, pageCount, value, count, method) { if(!count) count = 1; var pageIndex = pageIndex + (value < 0 ? count : -count); if(pageIndex < 0) pageIndex = 0; if(pageIndex > pageCount - 1) pageIndex = pageCount - 1; method(ASPxClientPagerCommands.PageNumber + pageIndex); }, RaiseInit: function(){ if(!this.Init.IsEmpty()){ var args = new ASPxClientEventArgs(); this.Init.FireEvent(this, args); } }, RaiseBeginCallbackInternal: function(command){ if(!this.BeginCallback.IsEmpty()){ var args = new ASPxClientBeginCallbackEventArgs(command); this.BeginCallback.FireEvent(this, args); } }, RaiseBeginCallback: function(command){ this.RaiseBeginCallbackInternal(command); if(typeof(aspxGetGlobalEvents) != "undefined") aspxGetGlobalEvents().OnBeginCallback(this, command); }, RaiseEndCallback: function(){ if(!this.EndCallback.IsEmpty()){ var args = new ASPxClientEndCallbackEventArgs(); this.EndCallback.FireEvent(this, args); } if(typeof(aspxGetGlobalEvents) != "undefined") aspxGetGlobalEvents().OnEndCallback(this); }, RaiseEndCallbackAnimationStart: function(){ if(!this.EndCallbackAnimationStart.IsEmpty()){ var args = new ASPxClientEventArgs(); this.EndCallbackAnimationStart.FireEvent(this, args); } }, RaiseCallbackError: function(message) { if(!this.CallbackError.IsEmpty()) { var args = new ASPxClientCallbackErrorEventArgs(message); this.CallbackError.FireEvent(this, args); if(args.handled) return { isHandled: true, errorMessage: args.message }; } if(typeof(aspxGetGlobalEvents) != "undefined") { var args = new ASPxClientCallbackErrorEventArgs(message); aspxGetGlobalEvents().OnCallbackError(this, args); if(args.handled) return { isHandled: true, errorMessage: args.message }; } return { isHandled: false, errorMessage: message }; }, IsVisible: function() { var element = this.GetMainElement(); return _aspxElementIsVisible(element); }, IsDisplayed: function() { var element = this.GetMainElement(); while(element && element.tagName != "BODY") { if(!_aspxGetElementDisplay(element)) return false; element = element.parentNode; } return true; }, IsHidden: function() { var element = this.GetMainElement(); return element.offsetWidth == 0 && element.offsetHeight == 0; }, Focus: function() { }, GetClientVisible: function(){ return this.GetVisible(); }, SetClientVisible: function(visible){ this.SetVisible(visible); }, GetVisible: function(){ return this.clientVisible; }, SetVisible: function(visible){ if(this.clientVisible != visible){ this.clientVisible = visible; _aspxSetElementDisplay(this.GetMainElement(), visible); if (visible) { this.AdjustControl(); var mainElement = this.GetMainElement(); if(mainElement) aspxGetControlCollection().AdjustControls(mainElement); } } }, GetEnabled: function() { return this.clientEnabled; }, SetEnabled: function(enabled) { this.clientEnabled = enabled; if(ASPxClientControl.setEnabledLocked) return; else ASPxClientControl.setEnabledLocked = true; aspxGetControlCollection().ProcessControlsInContainer(this.GetMainElement(), function(control) { if(_aspxIsFunction(control.SetEnabled)) control.SetEnabled(enabled); }); delete ASPxClientControl.setEnabledLocked; }, InCallback: function() { return this.requestCount > 0; }, DoBeginCallback: function(command) { this.RaiseBeginCallback(command || ""); aspxGetControlCollection().Before_WebForm_InitCallback(this.name); if(typeof(WebForm_InitCallback) != "undefined" && WebForm_InitCallback) { __theFormPostData = ""; __theFormPostCollection = [ ]; this.ClearPostBackEventInput("__EVENTTARGET"); this.ClearPostBackEventInput("__EVENTARGUMENT"); WebForm_InitCallback(); this.savedFormPostData = __theFormPostData; this.savedFormPostCollection = __theFormPostCollection; } }, ClearPostBackEventInput: function(id){ var element = _aspxGetElementById(id); if(element != null) element.value = ""; }, PerformDataCallback: function(arg, handler) { this.CreateCustomDataCallback(arg, "", handler); }, CreateCallback: function(arg, command) { var callbackInfo = this.CreateCallbackInfo(ASPxCallbackType.Common, null); this.CreateCallbackByInfo(arg, command, callbackInfo); }, CreateCustomDataCallback: function(arg, command, handler) { var callbackInfo = this.CreateCallbackInfo(ASPxCallbackType.Data, handler); this.CreateCallbackByInfo(arg, command, callbackInfo); }, CreateCallbackByInfo: function(arg, command, callbackInfo) { if(!this.CanCreateCallback()) return; if(typeof(WebForm_DoCallback) != "undefined" && WebForm_DoCallback && __aspxDocumentLoaded) this.CreateCallbackInternal(arg, command, true, callbackInfo); else { if(!this.savedCallbacks) this.savedCallbacks = []; var callbackInfo = { arg: arg, command: command, callbackInfo: callbackInfo }; if(this.allowMultipleCallbacks) this.savedCallbacks.push(callbackInfo); else this.savedCallbacks[0] = callbackInfo; } }, CreateCallbackInternal: function(arg, command, viaTimer, callbackInfo) { this.requestCount++; this.DoBeginCallback(command); if(typeof(arg) == "undefined") arg = ""; if(typeof(command) == "undefined") command = ""; var callbackID = this.SaveCallbackInfo(callbackInfo); if(viaTimer) window.setTimeout("aspxCreateCallback('" + this.name + "', '" + escape(arg) + "', '" + escape(command) + "', " + callbackID + ");", 0); else this.CreateCallbackCore(arg, command, callbackID); }, CreateCallbackCore: function(arg, command, callbackID) { var callBackMethod = this.GetCallbackMethod(command); __theFormPostData = this.savedFormPostData; __theFormPostCollection = this.savedFormPostCollection; callBackMethod.call(this, this.GetSerializedCallbackInfoByID(callbackID) + arg); }, GetCallbackMethod: function(command){ return this.callBack; }, CanCreateCallback: function() { return !this.InCallback() || (this.allowMultipleCallbacks && !this.beginCallbackAnimationProcessing && !this.endCallbackAnimationProcessing); }, DoLoadCallbackScripts: function() { _aspxProcessScriptsAndLinks(this.name, true); }, DoEndCallback: function() { if(this.IsCallbackAnimationEnabled() && this.CheckEndCallbackAnimationNeeded()) return; this.requestCount--; if(this.HideLoadingPanelOnCallback() && this.requestCount < 1) this.HideLoadingElements(); if(this.enableSwipeGestures && this.supportGestures) { ASPxGesturesHelper.UpdateSwipeAnimationContainer(this.name); if(this.touchUIMouseScroller) this.touchUIMouseScroller.update(); } this.isCallbackAnimationPrevented = false; this.OnCallbackFinalized(); this.RaiseEndCallback(); }, DoFinalizeCallback: function() { }, OnCallbackFinalized: function() { }, HideLoadingPanelOnCallback: function() { return true; }, ShouldHideExistingLoadingElements: function() { return true; }, EvalCallbackResult: function(resultString){ return eval(resultString) }, DoCallback: function(result) { if(this.IsCallbackAnimationEnabled() && this.CheckBeginCallbackAnimationInProgress(result)) return; result = _aspxTrim(result); if(result.indexOf(__aspxCallbackResultPrefix) != 0) this.ProcessCallbackGeneralError(result); else { var resultObj = null; try { resultObj = this.EvalCallbackResult(result); } catch(e) { } if(resultObj) { if(resultObj.redirect){ if(!__aspxIE) window.location.href = resultObj.redirect; else { var fakeLink = document.createElement("a"); fakeLink.href = resultObj.redirect; document.body.appendChild(fakeLink); fakeLink.click(); } } else if(resultObj.generalError){ this.ProcessCallbackGeneralError(resultObj.generalError); } else { var errorObj = resultObj.error; if(errorObj) this.ProcessCallbackError(errorObj); else { if(resultObj.cp) { for(var name in resultObj.cp) this[name] = resultObj.cp[name]; } var callbackInfo = this.DequeueCallbackInfo(resultObj.id); if(callbackInfo.type == ASPxCallbackType.Data) this.ProcessCustomDataCallback(resultObj.result, callbackInfo); else this.ProcessCallback(resultObj.result); } } } } this.DoLoadCallbackScripts(); }, DoCallbackError: function(result) { this.HideLoadingElements(); this.ProcessCallbackGeneralError(result); }, DoControlClick: function(evt) { this.OnControlClick(_aspxGetEventSource(evt), evt); }, ProcessCallback: function(result) { this.OnCallback(result); }, ProcessCustomDataCallback: function(result, callbackInfo) { if(callbackInfo.handler != null) callbackInfo.handler(this, result); this.RaiseCustomDataCallback(result); }, RaiseCustomDataCallback: function(result) { if(!this.CustomDataCallback.IsEmpty()) { var arg = new ASPxClientCustomDataCallbackEventArgs(result); this.CustomDataCallback.FireEvent(this, arg); } }, OnCallback: function(result) { }, CreateCallbackInfo: function(type, handler) { return { type: type, handler: handler }; }, GetSerializedCallbackInfoByID: function(callbackID) { return this.GetCallbackInfoByID(callbackID).type + callbackID + __aspxCallbackSeparator; }, SaveCallbackInfo: function(callbackInfo) { var activeCallbacksInfo = this.GetActiveCallbacksInfo(); for(var i = 0; i < activeCallbacksInfo.length; i++) { if(activeCallbacksInfo[i] == null) { activeCallbacksInfo[i] = callbackInfo; return i; } } activeCallbacksInfo.push(callbackInfo); return activeCallbacksInfo.length - 1; }, GetActiveCallbacksInfo: function() { var persistentProperties = this.GetPersistentProperties(); if(!persistentProperties.activeCallbacks) persistentProperties.activeCallbacks = [ ]; return persistentProperties.activeCallbacks; }, GetPersistentProperties: function() { var storage = _aspxGetPersistentControlPropertiesStorage(); var persistentProperties = storage[this.name]; if(!persistentProperties) { persistentProperties = { }; storage[this.name] = persistentProperties; } return persistentProperties; }, GetCallbackInfoByID: function(callbackID) { return this.GetActiveCallbacksInfo()[callbackID]; }, DequeueCallbackInfo: function(index) { var activeCallbacksInfo = this.GetActiveCallbacksInfo(); if(index < 0 || index >= activeCallbacksInfo.length) return null; var result = activeCallbacksInfo[index]; activeCallbacksInfo[index] = null; return result; }, ProcessCallbackError: function(errorObj) { var data = _aspxIsExists(errorObj.data) ? errorObj.data : null; var result = this.RaiseCallbackError(errorObj.message); if(result.isHandled) this.OnCallbackErrorAfterUserHandle(result.errorMessage, data); else this.OnCallbackError(result.errorMessage, data); }, OnCallbackError: function(errorMessage, data) { if(errorMessage) alert(errorMessage); }, OnCallbackErrorAfterUserHandle: function(errorMessage, data) { }, ProcessCallbackGeneralError: function(errorMessage) { var result = this.RaiseCallbackError(errorMessage); if(!result.isHandled) this.OnCallbackGeneralError(result.errorMessage); }, OnCallbackGeneralError: function(errorMessage) { this.OnCallbackError(errorMessage, null); }, SendPostBack: function(params) { __doPostBack(this.uniqueID, params); } }); ASPxClientControl.AdjustControls = function(container){ aspxGetControlCollection().AdjustControls(container); }; ASPxClientControl.Cast = function(obj) { if(typeof obj == "string") return window[obj]; return obj; }; ASPxClientControl.GetControlCollection = function(){ return aspxGetControlCollection(); } var __aspxControlCollection = null; function aspxGetControlCollection(){ if(__aspxControlCollection == null) __aspxControlCollection = new ASPxClientControlCollection(); return __aspxControlCollection; } var __aspxPersistentControlPropertiesStorage = null; function _aspxGetPersistentControlPropertiesStorage() { if(__aspxPersistentControlPropertiesStorage == null) __aspxPersistentControlPropertiesStorage = { }; return __aspxPersistentControlPropertiesStorage; } function _aspxFunctionIsInCallstack(currentCallee, targetFunction, depthLimit) { var candidate = currentCallee; var depth = 0; while(candidate && depth <= depthLimit) { candidate = candidate.caller; if(candidate == targetFunction) return true; depth++; } return false; } function aspxCAInit() { var isAppInit = typeof(Sys$_Application$initialize) != "undefined" && _aspxFunctionIsInCallstack(arguments.callee, Sys$_Application$initialize, 10 ); aspxGetControlCollection().AtlasInitialize(!isAppInit); } function aspxCreateCallback(name, arg, command, callbackID){ var control = aspxGetControlCollection().Get(name); if(control != null) control.CreateCallbackCore(unescape(arg), unescape(command), callbackID); } function aspxCallback(result, context){ var collection = aspxGetControlCollection(); collection.DoFinalizeCallback(); var control = collection.Get(context); if(control != null) control.DoCallback(result); } function aspxCallbackError(result, context){ var control = aspxGetControlCollection().Get(context); if(control != null) control.DoCallbackError(result, false); } function aspxCClick(name, evt) { var control = aspxGetControlCollection().Get(name); if(control != null) control.DoControlClick(evt); } _aspxAttachEventToElement(window, "resize", aspxGlobalWindowResize); function aspxGlobalWindowResize(evt){ aspxGetControlCollection().OnBrowserWindowResize(evt); } _aspxAttachEventToElement(window, "load", aspxClassesWindowOnLoad); function aspxClassesWindowOnLoad(evt){ __aspxDocumentLoaded = true; ASPxResourceManager.SynchronizeResources(); aspxGetControlCollection().Initialize(); _aspxInitializeScripts(); _aspxInitializeLinks(); _aspxInitializeFocus(); } ASPxIdent = { }; ASPxIdent.IsDate = function(obj) { return obj && obj.constructor == Date; }; ASPxIdent.IsRegExp = function(obj) { return obj && obj.constructor === RegExp; }; ASPxIdent.IsArray = function(obj) { return obj && obj.constructor == Array; }; ASPxIdent.IsASPxClientControl = function(obj) { return obj && obj.isASPxClientControl; }; ASPxIdent.IsASPxClientEdit = function(obj) { return obj && obj.isASPxClientEdit; }; ASPxIdent.IsASPxClientRadioButtonList = function(obj) { return obj && obj.isASPxClientRadioButtonList; }; ASPxClientPagerCommands = { Next : "PBN", Prev : "PBP", Last : "PBL", First : "PBF", PageNumber : "PN", PageSize : "PSP" }; if(_aspxIsFunction(window.WebForm_InitCallbackAddField)) { (function() { var original = window.WebForm_InitCallbackAddField; window.WebForm_InitCallbackAddField = function(name, value) { if(typeof(name) == "string" && name) original.apply(null, arguments); }; })(); } function aspxFireDefaultButton(evt, buttonID) { if(_aspxIsDefaultButtonEvent(evt, buttonID)) { var defaultButton = _aspxGetElementById(buttonID); if(defaultButton && defaultButton.click) { if(_aspxIsFocusable(defaultButton)) defaultButton.focus(); _aspxDoElementClick(defaultButton); _aspxPreventEventAndBubble(evt); return false; } } return true; } function _aspxIsDefaultButtonEvent(evt, defaultButtonID) { if(evt.keyCode != ASPxKey.Enter) return false; var srcElement = _aspxGetEventSource(evt); if(!srcElement || srcElement.id === defaultButtonID) return true; var tagName = srcElement.tagName; var type = srcElement.type; return tagName != "TEXTAREA" && tagName != "BUTTON" && tagName != "A" && (tagName != "INPUT" || type != "checkbox" && type != "radio" && type != "button" && type != "submit" && type != "reset"); } ASPxPostHandler = _aspxCreateClass(null, { constructor: function() { this.Post = new ASPxClientEvent(); this.PostFinalization = new ASPxClientEvent(); this.observableForms = []; this.ReplaceGlobalPostFunctions(); this.HandleDxCallbackBeginning(); this.HandleMSAjaxRequestBeginning(); }, Update: function() { this.ReplaceFormsSubmit(true); }, OnPost: function(ownerID, isCallback, isMSAjaxRequest, isDXCallback) { var args = new ASPxClientPostHandlerOnPostEventArgs(ownerID, isCallback, isMSAjaxRequest, isDXCallback); this.Post.FireEvent(this, args); if(args.cancel) return false; this.PostFinalization.FireEvent(this, ASPxClientEventArgs.Empty); return true; }, ReplaceGlobalPostFunctions: function() { if(_aspxIsFunction(window.__doPostBack)) this.ReplaceDoPostBack(); if(_aspxIsFunction(window.WebForm_DoCallback)) this.ReplaceDoCallback(); this.ReplaceFormsSubmit(); }, HandleDxCallbackBeginning: function() { aspxGetControlCollection().BeforeInitCallback.AddHandler(function(s, e) { _aspxRaisePostHandlerOnPost(e.callbackOwnerID, true, false, true); }); }, HandleMSAjaxRequestBeginning: function() { if(window.Sys && Sys.WebForms && Sys.WebForms.PageRequestManager && Sys.WebForms.PageRequestManager.getInstance) { var pageRequestManager = Sys.WebForms.PageRequestManager.getInstance(); if(pageRequestManager != null && ASPxIdent.IsArray(pageRequestManager._onSubmitStatements)) { pageRequestManager._onSubmitStatements.unshift(function() { var manager = Sys.WebForms.PageRequestManager.getInstance()._postBackSettings; var targetID = manager && manager.postbackSettings && manager.postbackSettings.asyncTarget; _aspxRaisePostHandlerOnPost(targetID, true, true); return true; }); } } }, ReplaceDoPostBack: function() { var original = __doPostBack; __doPostBack = function(eventTarget, eventArgument) { var postHandler = aspxGetPostHandler(); _aspxRaisePostHandlerOnPost(eventTarget); if(postHandler.cancelPostProcessing) return; original(eventTarget, eventArgument); }; }, ReplaceDoCallback: function() { var original = WebForm_DoCallback; WebForm_DoCallback = function(eventTarget, eventArgument, eventCallback, context, errorCallback, useAsync) { var postHandler = aspxGetPostHandler(); if(postHandler.dxCallbackHandled) delete postHandler.dxCallbackHandled; else _aspxRaisePostHandlerOnPost(eventTarget, true); if(postHandler.cancelPostProcessing) return; return original(eventTarget, eventArgument, eventCallback, context, errorCallback, useAsync); }; }, ReplaceFormsSubmit: function(checkObservableCollection) { for(var i = 0; i < document.forms.length; i++) { var form = document.forms[i]; if(checkObservableCollection && _aspxArrayIndexOf(this.observableForms, form) >= 0) continue; if(form.submit) this.ReplaceFormSubmit(form); this.ReplaceFormOnSumbit(form); this.observableForms.push(form); } }, ReplaceFormSubmit: function(form) { var originalSubmit = form.submit; form.submit = function() { var postHandler = aspxGetPostHandler(); _aspxRaisePostHandlerOnPost(); if(postHandler.cancelPostProcessing) return false; var callee = arguments.callee; this.submit = originalSubmit; var submitResult = this.submit(); this.submit = callee; return submitResult; }; form = null; }, ReplaceFormOnSumbit: function(form) { var originalSubmit = form.onsubmit; form.onsubmit = function() { var postHandler = aspxGetPostHandler(); if(postHandler.msAjaxRequestBeginningHandled) delete postHandler.msAjaxRequestBeginningHandled; else _aspxRaisePostHandlerOnPost(); if(postHandler.cancelPostProcessing) return false; return _aspxIsFunction(originalSubmit) ? originalSubmit.apply(this, arguments) : true; }; form = null; } }); function _aspxRaisePostHandlerOnPost(ownerID, isCallback, isMSAjaxRequestBeginning, isDXCallbackBeginning) { var postHandler = aspxGetPostHandler(); if(isMSAjaxRequestBeginning) postHandler.msAjaxRequestBeginningHandled = true; else if(isDXCallbackBeginning) postHandler.dxCallbackHandled = true; postHandler.cancelPostProcessing = !postHandler.OnPost(ownerID, isCallback, isMSAjaxRequestBeginning, isDXCallbackBeginning); } function aspxGetPostHandler() { if (!window.__aspxPostHandler) window.__aspxPostHandler = new ASPxPostHandler(); return window.__aspxPostHandler; } ASPxClientBeforeInitCallbackEventArgs = _aspxCreateClass(ASPxClientEventArgs, { constructor: function(callbackOwnerID){ this.constructor.prototype.constructor.call(this); this.callbackOwnerID = callbackOwnerID; } }); ASPxClientPostHandlerOnPostEventArgs = _aspxCreateClass(ASPxClientCancelEventArgs, { constructor: function(ownerID, isCallback, isMSAjaxCallback, isDXCallback){ this.constructor.prototype.constructor.call(this); this.ownerID = ownerID; this.isCallback = !!isCallback; this.isDXCallback = !!isDXCallback; this.isMSAjaxCallback = !!isMSAjaxCallback; } }); ASPxResourceManager = { HandlerStr: "DXR.axd?r=", ResourceHashes: {}, SynchronizeResources: function(method){ if(!method){ method = function(name, resource) { this.UpdateInputElements(name, resource); }.aspxBind(this); } var resources = this.GetResourcesData(); for(var name in resources) method(name, resources[name]); }, GetResourcesData: function(){ return { DXScript: this.GetResourcesElementsString(_aspxGetIncludeScripts(), "src", "DXScript"), DXCss: this.GetResourcesElementsString(_aspxGetLinks(), "href", "DXCss") }; }, GetResourcesElementsString: function(elements, urlAttr, id){ if(!this.ResourceHashes[id]) this.ResourceHashes[id] = {}; var hash = this.ResourceHashes[id]; for(var i = 0; i < elements.length; i++) { var resourceUrl = _aspxGetAttribute(elements[i], urlAttr); if(resourceUrl) { var pos = resourceUrl.indexOf(this.HandlerStr); if(pos > -1){ var list = resourceUrl.substr(pos + this.HandlerStr.length); var ampPos = list.lastIndexOf("-"); if(ampPos > -1) list = list.substr(0, ampPos); var indexes = list.split(","); for(var j = 0; j < indexes.length; j++) hash[indexes[j]] = indexes[j]; } else hash[resourceUrl] = resourceUrl; } } var array = []; for(var key in hash) array.push(key); return array.join(","); }, UpdateInputElements: function(typeName, list){ for(var i = 0; i < document.forms.length; i++){ var inputElement = document.forms[i][typeName]; if(!inputElement) inputElement = this.CreateInputElement(document.forms[i], typeName); inputElement.value = list; } }, CreateInputElement: function(form, typeName){ var inputElement = _aspxCreateHiddenField(typeName, typeName); form.appendChild(inputElement); return inputElement; } }; var __aspxIncludeScriptPrefix = "dxis_"; var __aspxStartupScriptPrefix = "dxss_"; var __aspxIncludeScriptsCache = {}; var __aspxCreatedIncludeScripts = []; var __aspxAppendedScriptsCount = 0; var __aspxCallbackOwnerNames = []; var __aspxScriptsRestartHandlers = { }; function _aspxGetScriptCode(script) { var useFirstChildElement = __aspxChrome && __aspxBrowserVersion < 11 || __aspxSafari && __aspxBrowserVersion < 5; var text = useFirstChildElement ? script.firstChild.data : script.text; var comment = "