var __aspxNotSetAlignIndicator = "NotSet"; var __aspxInnerAlignIndicator = "Sides"; function _aspxIsAlignNotSet(align){ return align == __aspxNotSetAlignIndicator; } function _aspxIsInnerAlign(align){ return align.indexOf(__aspxInnerAlignIndicator) != -1; } function _aspxIsOuterAlign(align){ return (!this.IsInnerAlign(align)) && (!_aspxIsAlignNotSet(align)); } function _aspxPopupPosition(position, isInverted){ this.position = position; this.isInverted = isInverted; } function _aspxSegment(pos, len){ this.pos = pos; this.len = len; } function _aspxRect(left, top, width, height){ this.left = left; this.top = top; this.width = width; this.height = height; } function _aspxSize(width, height){ this.width = width; this.height = height; } function _aspxFindPopupElementById(id){ if(id == "") return null; var popupElement = _aspxGetElementById(id); if(!_aspxIsExistsElement(popupElement)){ var idParts = id.split("_"); var uniqueId = idParts.join("$"); popupElement = _aspxGetElementById(uniqueId); } return popupElement; } function _aspxFindEventSourceParentByTestFunc(evt, testFunc){ return _aspxFindParentByTestFunc(_aspxGetEventSource(evt), testFunc); } function _aspxPreventContextMenu(evt){ if (__aspxWebKitFamily){ if(evt.stopPropagation) evt.stopPropagation(); evt.returnValue = false; if(evt.preventDefault) evt.preventDefault(); } else if (__aspxNetscapeFamily || (__aspxIE && __aspxBrowserVersion > 8)) evt.preventDefault(); } function _aspxIsExistsAbsolutePosParent(element){ return _aspxIsExistsParentWithSpecPosition(element, ["absolute"]); } function _aspxIsExistsAbsoluteOrRelativePosParent(element){ return _aspxIsExistsParentWithSpecPosition(element, ["absolute", "relative"]); } function _aspxIsExistsParentWithSpecPosition(element, positions){ var curEl = element.offsetParent; while(curEl != null) { for(var i = 0; i < positions.length; i ++){ if (_aspxGetCurrentStyle(curEl).position == positions[i]) return true; } curEl = curEl.offsetParent; } return false; } function _aspxGetDocumentClientWidthForPopup(){ return (__aspxWebKitTouchUI ? _aspxGetDocumentWidth() : _aspxGetDocumentClientWidth()); } function _aspxAdjustPositionToClientScreen(element, shadowSize, pos, isX){ var min = isX ? _aspxGetDocumentScrollLeft() : _aspxGetDocumentScrollTop(); var documentClientWidth = _aspxGetDocumentClientWidthForPopup(); var max = min + (isX ? documentClientWidth : _aspxGetDocumentClientHeight()); max -= (isX ? element.offsetWidth + shadowSize : element.offsetHeight + shadowSize); if (pos > max) pos = max; if (pos < min) pos = min; return pos; } function _aspxGetPopupAbsoluteX(element, shadowWidth, popupElement, hAlign, hOffset, x, left, rtl, isPopupFullCorrectionOn){ var width = element.offsetWidth; var bodyWidth = _aspxGetDocumentClientWidth(); var elementX = _aspxGetAbsoluteX(popupElement); var scrollX = _aspxGetDocumentScrollLeft(); if (hAlign == "WindowCenter"){ var showAtPos = x != __aspxInvalidPosition && !popupElement; if(showAtPos) hAlign = ""; else return new _aspxPopupPosition(Math.ceil((__aspxWebKitTouchUI ? window.innerWidth : bodyWidth) / 2 - width / 2) + scrollX + hOffset, false); } if (popupElement) { var leftX = elementX - width; var rightX = elementX + popupElement.offsetWidth; var innerLeftX = elementX; var innerRightX = elementX + popupElement.offsetWidth - width; var isMoreFreeSpaceLeft = bodyWidth - (rightX + width) < leftX - 2 * scrollX; } else hAlign = ""; var isInverted = false; if (hAlign == "OutsideLeft"){ isInverted = isPopupFullCorrectionOn && (!(leftX - scrollX > 0 || isMoreFreeSpaceLeft)); if(isInverted) x = rightX - hOffset; else x = leftX + hOffset; } else if (hAlign == "LeftSides"){ x = innerLeftX + hOffset; if (isPopupFullCorrectionOn) x = _aspxAdjustPositionToClientScreen(element, shadowWidth, x, true); } else if (hAlign == "Center"){ x = elementX + Math.round((popupElement.offsetWidth - width) / 2) + hOffset; } else if (hAlign == "RightSides"){ x = innerRightX + hOffset; if (isPopupFullCorrectionOn) x = _aspxAdjustPositionToClientScreen(element, shadowWidth, x, true); } else if (hAlign == "OutsideRight"){ isInverted = isPopupFullCorrectionOn && (!(rightX + width < bodyWidth + scrollX || !isMoreFreeSpaceLeft)); if(isInverted) x = leftX - hOffset; else x = rightX + hOffset; } else{ if(rtl){ if(!_aspxGetIsValidPosition(x)) { if(popupElement) x = innerRightX; else if(hOffset) x = 0; else x = left; } else x -= width; isInverted = isPopupFullCorrectionOn && (x < scrollX && x - scrollX < bodyWidth / 2); if(isInverted) x = x + width + hOffset; else x = x - hOffset; } else { if (!_aspxGetIsValidPosition(x)) { if(popupElement) x = elementX; else if(hOffset) x = 0; else x = left; } isInverted = isPopupFullCorrectionOn && (x - scrollX + width > bodyWidth && x - scrollX > bodyWidth / 2); if(isInverted) x = x - width - hOffset; else x = x + hOffset; } } return new _aspxPopupPosition(x, isInverted); } function _aspxGetPopupAbsoluteY(element, shadowHeight, popupElement, vAlign, vOffset, y, top, isPopupFullCorrectionOn){ var height = element.offsetHeight; var bodyHeight = _aspxGetDocumentClientHeight(); var elementY = _aspxGetAbsoluteY(popupElement); var scrollY = _aspxGetDocumentScrollTop(); if (vAlign == "WindowCenter"){ var showAtPos = y != __aspxInvalidPosition && !popupElement; if(showAtPos) hAlign = ""; else return new _aspxPopupPosition(Math.ceil((__aspxWebKitTouchUI ? window.innerHeight : bodyHeight) / 2 - height / 2) + scrollY + vOffset, false); } if (popupElement) { var bottomY = elementY + popupElement.offsetHeight; var topY = elementY - height; var innerBottomY = elementY + popupElement.offsetHeight - height; var innerTopY = elementY; var isMoreFreeSpaceAbove = bodyHeight - (bottomY + height) < topY - 2 * scrollY; } else vAlign = ""; var isInverted = false; if (vAlign == "Above"){ isInverted = isPopupFullCorrectionOn && (!(topY - scrollY > 0 || isMoreFreeSpaceAbove)); if(isInverted) y = bottomY - vOffset; else y = topY + vOffset; } else if (vAlign == "TopSides"){ y = innerTopY + vOffset; if (isPopupFullCorrectionOn) y = _aspxAdjustPositionToClientScreen(element, shadowHeight, y, false); } else if (vAlign == "Middle"){ y = elementY + Math.round((popupElement.offsetHeight - height) / 2) + vOffset; } else if (vAlign == "BottomSides"){ y = innerBottomY + vOffset; if (isPopupFullCorrectionOn) y = _aspxAdjustPositionToClientScreen(element, shadowHeight, y, false); } else if (vAlign == "Below"){ isInverted = isPopupFullCorrectionOn && (!(bottomY + height < bodyHeight + scrollY || !isMoreFreeSpaceAbove)); if(isInverted) y = topY - vOffset; else y = bottomY + vOffset; } else{ if (!_aspxGetIsValidPosition(y)) { if (popupElement) y = _aspxGetAbsoluteY(popupElement); else if(vOffset) y = 0; else y = top; } isInverted = isPopupFullCorrectionOn && (y - _aspxGetDocumentScrollTop() + height > bodyHeight && y - _aspxGetDocumentScrollTop() > bodyHeight / 2); if(isInverted) y = y - height - vOffset; else y = y + vOffset; } return new _aspxPopupPosition(y, isInverted); } function _aspxRemoveFocus(parent){ var div = document.createElement('div'); div.tabIndex = "-1"; _aspxConcealDivElement(div); parent.appendChild(div); if(_aspxIsFocusable(div)) div.focus(); _aspxRemoveElement(div); } function _aspxConcealDivElement(div){ div.style.position = "absolute"; div.style.left = 0; div.style.top = 0; if(__aspxWebKitFamily) { div.style.opacity = 0; div.style.width = 1; div.style.height = 1; } else { div.style.border = 0; div.style.width = 0; div.style.height = 0; } } function _aspxInitAnimationDiv(element, x, y, onAnimStopCallString, skipSizeInit) { element.popuping = true; element.onAnimStopCallString = onAnimStopCallString; var popupInOldIe = __aspxIE && __aspxBrowserVersion < 8 && element.tagName == "TABLE"; if (popupInOldIe) { var mainDiv = _aspxGetDescendantNodesByClassName(element, "dxpc-mainDiv")[0]; var animationWrapper = _aspxGetDescendantNodesByClassName(element, "dxpc-animationWrapper")[0]; mainDiv.style.position = "relative"; animationWrapper.style.overflow = "hidden"; animationWrapper.style.position = "relative"; } element.style.overflow = "hidden"; element.style.position = "absolute"; if (!skipSizeInit) _aspxSetStyles(element, { width: element.offsetWidth, height: element.offsetHeight }); _aspxSetStyles(element, { left: x, top: y }); } function _aspxStartSlideAnimation(animationDivElement, element, iframeElement, duration) { if (iframeElement) { var endLeft = _aspxPxToInt(iframeElement.style.left); var endTop = _aspxPxToInt(iframeElement.style.top); var startLeft = _aspxPxToInt(element.style.left) < 0 ? endLeft : animationDivElement.offsetLeft + animationDivElement.offsetWidth; var startTop = _aspxPxToInt(element.style.top) < 0 ? endTop : animationDivElement.offsetTop + animationDivElement.offsetHeight; ASPxAnimationHelper.createMultipleAnimationTransition(iframeElement, { duration: duration }).Start({ left: { from: startLeft, to: endLeft, unit: "px" }, top: { from: startTop, to: endTop, unit: "px" }, width: { to: element.offsetWidth, unit: "px" }, height: { to: element.offsetHeight, unit: "px" } }); } ASPxAnimationHelper.createMultipleAnimationTransition(element, { duration: duration, onComplete: function () { _aspxAnimationFinished(animationDivElement); } }).Start({ left: { to: 0, unit: "px" }, top: { to: 0, unit: "px" } }); } function _aspxAnimationFinished(element){ if(_aspxStopAnimation(element) && _aspxIsExists(element.onAnimStopCallString) && element.onAnimStopCallString !== ""){ window.setTimeout(element.onAnimStopCallString, 0); } } function _aspxStopAnimation(element){ if (element.popuping) { ASPxAnimationHelper.cancelAnimation(element); element.popuping = false; element.style.overflow = "visible"; var popupInOldIe = __aspxIE && __aspxBrowserVersion < 8 && element.tagName == "TABLE"; if (popupInOldIe) { var mainDiv = _aspxGetDescendantNodesByClassName(element, "dxpc-mainDiv")[0]; var animationWrapper = _aspxGetDescendantNodesByClassName(element, "dxpc-animationWrapper")[0]; mainDiv.style.position = "static"; animationWrapper.style.overflow = "visible"; animationWrapper.style.position = "static"; } return true; } return false; } function _aspxGetAnimationHorizontalDirection(popupPosition, horizontalAlign, verticalAlign, rtl){ if (_aspxIsInnerAlign(horizontalAlign) && !_aspxIsInnerAlign(verticalAlign) && !_aspxIsAlignNotSet(verticalAlign)) return 0; var toTheLeft = (horizontalAlign == "OutsideLeft" || horizontalAlign == "RightSides" || (horizontalAlign == "NotSet" && rtl)) ^ popupPosition.isInverted; return toTheLeft ? 1 : -1; } function _aspxGetAnimationVerticalDirection(popupPosition, horizontalAlign, verticalAlign){ if (_aspxIsInnerAlign(verticalAlign) && !_aspxIsInnerAlign(horizontalAlign) && !_aspxIsAlignNotSet(horizontalAlign)) return 0; var toTheTop = (verticalAlign == "Above" || verticalAlign == "BottomSides") ^ popupPosition.isInverted; return toTheTop ? 1 : -1; } function _aspxIsVerticalScrollExists() { return _aspxGetDocumentHeight() > _aspxGetDocumentClientHeight() || __aspxIE && __aspxBrowserVersion < 8; } var _aspxBodyScrollHelper = (function () { var hideBodyScrollCount = 0; function fixScrollsBug() { var scrollTop = document.body.scrollTop; var scrollLeft = document.body.scrollLeft; document.body.scrollTop ++; document.body.scrollTop --; document.body.scrollLeft ++; document.body.scrollLeft --; document.body.scrollLeft = scrollLeft; document.body.scrollTop = scrollTop; } return { HideBodyScroll: function() { hideBodyScrollCount++; if(hideBodyScrollCount > 1) return; if(__aspxIE) { _aspxChangeAttribute(document.body, "scroll", "no"); _aspxChangeStyleAttribute(document.documentElement, "overflow", "hidden"); } else if(__aspxFirefox && __aspxBrowserVersion < 3) { var scrollTop = document.documentElement.scrollTop; _aspxChangeStyleAttribute(document.body, "overflow", "hidden"); document.documentElement.scrollTop = scrollTop; } else { _aspxChangeStyleAttribute(document.documentElement, "overflow", "hidden"); var documentHeight = _aspxGetDocumentHeight(); var documentWidth = _aspxGetDocumentWidth(); if(window.pageYOffset > 0 && _aspxPxToInt(window.getComputedStyle(document.body, null)) != documentHeight) _aspxChangeStyleAttribute(document.body, "height", documentHeight + "px"); if(window.pageXOffset > 0 && _aspxPxToInt(window.getComputedStyle(document.body, null)) != documentWidth) _aspxChangeStyleAttribute(document.body, "width", documentWidth + "px"); if(__aspxChrome) { fixScrollsBug(); } } if(_aspxIsVerticalScrollExists()) _aspxChangeStyleAttribute(document.body, "margin-right", _aspxGetVerticalScrollBarWidth() + "px"); if(__aspxIE && __aspxBrowserVersion == 7) _aspxWindowResizedByBodyScrollToggle(); }, RestoreBodyScroll: function() { hideBodyScrollCount--; if(hideBodyScrollCount > 0) return; if(__aspxIE) { _aspxRestoreAttribute(document.body, "scroll"); _aspxRestoreStyleAttribute(document.documentElement, "overflow"); } else { _aspxRestoreStyleAttribute(document.documentElement, "overflow"); } _aspxRestoreStyleAttribute(document.body, "margin-right"); _aspxRestoreStyleAttribute(document.body, "height"); _aspxRestoreStyleAttribute(document.body, "width"); if(__aspxWebKitFamily) { fixScrollsBug(); } if(__aspxIE && __aspxBrowserVersion == 7) _aspxWindowResizedByBodyScrollToggle(); } } })(); function _aspxWindowResizedByBodyScrollToggle() { if(aspxGetPopupControlCollection) aspxGetPopupControlCollection().LockWindowResizeByBodyScrollVisibilityChanging(); var docWidth = document.documentElement.clientWidth; if(aspxGetPopupControlCollection) aspxGetPopupControlCollection().UnlockWindowResizeByBodyScrollVisibilityChanging(); } function _aspxCoordinatesInDocumentRect(x, y){ var docScrollLeft = _aspxGetDocumentScrollLeft(); var docScrollTop = _aspxGetDocumentScrollTop(); return (x > docScrollLeft && y > docScrollTop && x < _aspxGetDocumentClientWidth() + docScrollLeft && y < _aspxGetDocumentClientHeight() + docScrollTop); } function _aspxGetElementZIndexArray(element){ var currentElement = element; var zIndexesArray = [0]; while(currentElement && currentElement.tagName != "BODY") { if(currentElement.style) { if(typeof(currentElement.style.zIndex) != "undefined" && currentElement.style.zIndex != "") zIndexesArray.unshift(currentElement.style.zIndex); } currentElement = currentElement.parentNode; } return zIndexesArray; } function _aspxIsHigher(higherZIndexArrat, zIndexArray){ if (zIndexArray == null) return true; var count = (higherZIndexArrat.length >= zIndexArray.length) ? higherZIndexArrat.length : zIndexArray.length; for (var i = 0; i < count; i++) if(typeof(higherZIndexArrat[i]) != "undefined" && typeof(zIndexArray[i]) != "undefined"){ var higherZIndexArrayCurrentElement = parseInt(higherZIndexArrat[i].toString()); var zIndexArrayCurrentElement = parseInt(zIndexArray[i].toString()); if(higherZIndexArrayCurrentElement != zIndexArrayCurrentElement) return higherZIndexArrayCurrentElement > zIndexArrayCurrentElement; } else return typeof(zIndexArray[i]) == "undefined"; return true; } function _aspxTestIsPopupElement(element) { return !!element.DXPopupElementControl; } var _aspxClientOverControlUtils = { GetPopupElementByEvt: function(evt) { return _aspxFindEventSourceParentByTestFunc(evt, _aspxTestIsPopupElement); }, OnMouseEvent: function (evt, mouseOver) { var popupElement = _aspxClientOverControlUtils.GetPopupElementByEvt(evt); if (mouseOver) popupElement.DXPopupElementControl.OnPopupElementMouseOver(evt, popupElement); else popupElement.DXPopupElementControl.OnPopupElementMouseOut(evt, popupElement); }, OnMouseOut: function(evt) { _aspxClientOverControlUtils.OnMouseEvent(evt, false); }, OnMouseOver: function(evt) { _aspxClientOverControlUtils.OnMouseEvent(evt, true); } }