Type.registerNamespace("Telerik.Web");
Telerik.Web.BehaviorBase = function(_1) {
    Telerik.Web.BehaviorBase.initializeBase(this, [_1]);
    this._clientStateFieldID = null;
    this._pageRequestManager = null;
    this._partialUpdateBeginRequestHandler = null;
    this._partialUpdateEndRequestHandler = null;
};
Telerik.Web.BehaviorBase.prototype = { initialize: function() {
    Telerik.Web.BehaviorBase.callBaseMethod(this, "initialize");
}, dispose: function() {
    var _2 = this.get_element();
    Telerik.Web.BehaviorBase.callBaseMethod(this, "dispose");
    if (_2 && _2._behaviors && _2._behaviors.length == 0) {
        _2._behaviors = null;
    }
    _2 = null;
    if (this._pageRequestManager) {
        if (this._partialUpdateBeginRequestHandler) {
            this._pageRequestManager.remove_beginRequest(this._partialUpdateBeginRequestHandler);
            this._partialUpdateBeginRequestHandler = null;
        }
        if (this._partialUpdateEndRequestHandler) {
            this._pageRequestManager.remove_endRequest(this._partialUpdateEndRequestHandler);
            this._partialUpdateEndRequestHandler = null;
        }
        this._pageRequestManager = null;
    }
}, get_ClientStateFieldID: function() {
    return this._clientStateFieldID;
}, set_ClientStateFieldID: function(_3) {
    if (this._clientStateFieldID != _3) {
        this._clientStateFieldID = _3;
        this.raisePropertyChanged("ClientStateFieldID");
    }
}, get_ClientState: function() {
    if (this._clientStateFieldID) {
        var _4 = document.getElementById(this._clientStateFieldID);
        if (_4) {
            return _4.value;
        }
    }
    return null;
}, set_ClientState: function(_5) {
    if (this._clientStateFieldID) {
        var _6 = document.getElementById(this._clientStateFieldID);
        if (_6) {
            _6.value = _5;
        }
    }
}, registerPartialUpdateEvents: function() {
    if (Sys && Sys.WebForms && Sys.WebForms.PageRequestManager) {
        this._pageRequestManager = Sys.WebForms.PageRequestManager.getInstance();
        if (this._pageRequestManager) {
            this._partialUpdateBeginRequestHandler = Function.createDelegate(this, this._partialUpdateBeginRequest);
            this._pageRequestManager.add_beginRequest(this._partialUpdateBeginRequestHandler);
            this._partialUpdateEndRequestHandler = Function.createDelegate(this, this._partialUpdateEndRequest);
            this._pageRequestManager.add_endRequest(this._partialUpdateEndRequestHandler);
        }
    }
}, _partialUpdateBeginRequest: function(_7, _8) {
}, _partialUpdateEndRequest: function(_9, _a) {
} 
};
Telerik.Web.BehaviorBase.registerClass("Telerik.Web.BehaviorBase", Sys.UI.Behavior);
Type.registerNamespace("Telerik.Web");
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ModalExtender = function(_b) {
    this._windowResizeDelegate = null;
    this._windowScrollDelegate = null;
    this._xCoordinate = -1;
    this._yCoordinate = -1;
    this._backgroundElement = null;
    this._foregroundElement = _b;
    this._saveTabIndexes = new Array();
    this._saveDesableSelect = new Array();
    this._tagWithTabIndex = new Array("A", "AREA", "BUTTON", "INPUT", "OBJECT", "SELECT", "TEXTAREA", "IFRAME");
};
Telerik.Web.UI.ModalExtender.prototype = { dispose: function() {
    this.hide();
    this._backgroundElement = null;
    this._foregroundElement = null;
}, show: function() {
    this._attachWindowHandlers(true);
    var _c = this._getModalOverlay();
    this._foregroundElement.parentNode.appendChild(_c);
    _c.style.zIndex = $telerik.getCurrentStyle(this._foregroundElement, "zIndex", this._foregroundElement.style.zIndex) - 1;
    _c.style.display = "";
    this._disableTab();
    this._updatePageLayout();
    this._updatePageLayout();
}, _storeBrowserPosition: function() {
    var _d = document.body;
    var _e = document.documentElement;
    this._browserTop = _d.scrollTop > _e.scrollTop ? _d.scrollTop : _e.scrollTop;
    this._browserLeft = _d.scrollLeft > _e.scrollLeft ? _d.scrollTop : _e.scrollLeft;
}, _restoreBrowserPosition: function(_f, top) {
    try {
        if (null == _f) {
            _f = this._browserLeft;
        }
        if (null == top) {
            top = this._browserTop;
        }
        var _11 = document.body;
        var _12 = document.documentElement;
        _11.scrollTop = top;
        _11.scrollLeft = _f;
        _12.scrollTop = top;
        _12.scrollLeft = _f;
    }
    catch (ex) {
    }
}, hide: function() {
    this._restoreTab();
    this._attachWindowHandlers(false);
    var _13 = this._backgroundElement;
    if (_13) {
        _13.parentNode.removeChild(_13);
        this._backgroundElement = null;
    }
}, _enableScroll: function(_14) {
    if (_14) {
        document.body.style.overflow = null != this._overflow ? this._overflow : "";
        document.documentElement.style.overflow = null != this._documentOverflow ? this._documentOverflow : "";
        document.body.style.marginRight = "";
    } else {
        this._overflow = document.body.style.overflow;
        document.body.style.overflow = "hidden";
        this._documentOverflow = document.documentElement.style.overflow;
        document.documentElement.style.overflow = "hidden";
        document.body.style.marginRight = "18px";
    }
}, _getModalOverlay: function() {
    if (!this._backgroundElement) {
        var div = document.createElement("div");
        div.style.display = "none";
        div.style.position = "absolute";
        if ($telerik.isRightToLeft(this._foregroundElement)) {
            div.style.right = "0px";
        } else {
            div.style.left = "0px";
        }
        div.style.top = "0px";
        div.style.zIndex = 10000;
        div.style.backgroundColor = "#454545";
        div.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=75)";
        div.style.opacity = ".75";
        div.style.mozOpacity = ".75";
        div.setAttribute("unselectable", "on");
        div.className = "TelerikModalOverlay";
        this._backgroundElement = div;
    }
    return this._backgroundElement;
}, _attachWindowHandlers: function(_16) {
    var _17 = window;
    if (true == _16) {
        this._windowResizeDelegate = Function.createDelegate(this, this._updatePageLayout);
        $addHandler(_17, "resize", this._windowResizeDelegate);
        this._windowScrollDelegate = Function.createDelegate(this, this._updatePageLayout);
        $addHandler(_17, "scroll", this._windowScrollDelegate);
    } else {
        if (this._windowResizeDelegate) {
            $removeHandler(_17, "resize", this._windowResizeDelegate);
        }
        this._windowResizeDelegate = null;
        if (this._windowScrollDelegate) {
            $removeHandler(_17, "scroll", this._windowScrollDelegate);
        }
        this._windowScrollDelegate = null;
    }
}, _updatePageLayout: function() {
    var _18 = (document.documentElement.scrollLeft ? $telerik.getCorrectScrollLeft(document.documentElement) : $telerik.getCorrectScrollLeft(document.body));
    var _19 = (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
    var _1a = $telerik.getClientBounds();
    var _1b = _1a.width;
    var _1c = _1a.height;
    var _1d = this._getModalOverlay();
    _1d.style.width = Math.max(Math.max(document.documentElement.scrollWidth, document.body.scrollWidth), _1b) + "px";
    _1d.style.height = Math.max(Math.max(document.documentElement.scrollHeight, document.body.scrollHeight), _1c) + "px";
}, _disableTab: function() {
    var i = 0;
    var _1f;
    var _20 = new Array();
    Array.clear(this._saveTabIndexes);
    for (var j = 0; j < this._tagWithTabIndex.length; j++) {
        _1f = this._foregroundElement.getElementsByTagName(this._tagWithTabIndex[j]);
        for (var k = 0; k < _1f.length; k++) {
            _20[i] = _1f[k];
            i++;
        }
    }
    i = 0;
    for (var j = 0; j < this._tagWithTabIndex.length; j++) {
        _1f = document.getElementsByTagName(this._tagWithTabIndex[j]);
        for (var k = 0; k < _1f.length; k++) {
            if (Array.indexOf(_20, _1f[k]) == -1) {
                this._saveTabIndexes[i] = { tag: _1f[k], index: _1f[k].tabIndex };
                _1f[k].tabIndex = "-1";
                i++;
            }
        }
    }
    i = 0;
    if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7)) {
        var _23 = new Array();
        for (var j = 0; j < this._tagWithTabIndex.length; j++) {
            _1f = this._foregroundElement.getElementsByTagName("SELECT");
            for (var k = 0; k < _1f.length; k++) {
                _23[i] = _1f[k];
                i++;
            }
        }
        i = 0;
        Array.clear(this._saveDesableSelect);
        _1f = document.getElementsByTagName("SELECT");
        for (var k = 0; k < _1f.length; k++) {
            if (Array.indexOf(_23, _1f[k]) == -1) {
                this._saveDesableSelect[i] = { tag: _1f[k], visib: $telerik.getCurrentStyle(_1f[k], "visibility") };
                _1f[k].style.visibility = "hidden";
                i++;
            }
        }
    }
}, _restoreTab: function() {
    for (var i = 0; i < this._saveTabIndexes.length; i++) {
        this._saveTabIndexes[i].tag.tabIndex = this._saveTabIndexes[i].index;
    }
    if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7)) {
        for (var k = 0; k < this._saveDesableSelect.length; k++) {
            this._saveDesableSelect[k].tag.style.visibility = this._saveDesableSelect[k].visib;
        }
    }
} 
};
Telerik.Web.UI.ModalExtender.registerClass("Telerik.Web.UI.ModalExtender", null);
Type.registerNamespace("Telerik.Web");
Telerik.Web.PositioningMode = function() {
    throw Error.invalidOperation();
};
Telerik.Web.PositioningMode.prototype = { Absolute: 0, Center: 1, BottomLeft: 2, BottomRight: 3, TopLeft: 4, TopRight: 5 };
Telerik.Web.PositioningMode.registerEnum("Telerik.Web.PositioningMode");
Telerik.Web.PopupBehavior = function(_26) {
    Telerik.Web.PopupBehavior.initializeBase(this, [_26]);
    this._x = 0;
    this._y = 0;
    this._positioningMode = Telerik.Web.PositioningMode.Absolute;
    this._parentElement = null;
    this._parentElementID = null;
    this._moveHandler = null;
    this._firstPopup = true;
    this._originalParent = null;
    this._overlay = false;
    this._keepInScreenBounds = true;
    this._manageVisibility = true;
};
Telerik.Web.PopupBehavior._ie6pinnedList = {};
Telerik.Web.PopupBehavior.prototype = { getPageOffset: function() {
    var _27 = { x: ($telerik.getCorrectScrollLeft(document.documentElement) || $telerik.getCorrectScrollLeft(document.body)), y: (document.documentElement.scrollTop || document.body.scrollTop) };
    return _27;
}, pin: function(_28) {
    var _29 = this.get_element();
    var _2a = this.getPageOffset();
    if ($telerik.isIE6) {
        var id = this.get_id();
        if (_28) {
            if (Telerik.Web.PopupBehavior._ie6pinnedList[id]) {
                return;
            }
            var _2c = $telerik.getBounds(_29);
            Telerik.Web.PopupBehavior._ie6pinnedList[id] = window.setInterval(Function.createDelegate(this, function() {
                var _2d = this.getPageOffset();
                var x = _2c.x - _2a.x + _2d.x;
                var y = _2c.y - _2a.y + _2d.y;
                var _30 = this.get_parentElement();
                this.set_parentElement(document.documentElement);
                this.set_x(x);
                this.set_y(y);
                this.show();
                this.set_parentElement(_30);
            }), 130);
        } else {
            var _31 = Telerik.Web.PopupBehavior._ie6pinnedList[id];
            if (_31) {
                window.clearInterval(_31);
            }
            delete Telerik.Web.PopupBehavior._ie6pinnedList[id];
        }
    } else {
        var _32 = _28 ? "fixed" : "absolute";
        if (_29.style.position == _32) {
            return;
        }
        var _2c = $telerik.getBounds(_29);
        if (_28 && (_2a.x || _2a.y)) {
            this._x = _2c.x - _2a.x;
            this._y = _2c.y - _2a.y;
            $telerik.setLocation(_29, { x: this._x, y: this._y });
        }
        _29.style.position = _32;
    }
}, center: function() {
    var _33 = this.get_element();
    if (this._manageVisibility) {
        $telerik.setVisible(_33, true);
    }
    var _34 = $telerik.getClientBounds();
    var _35 = $telerik.getBounds(_33);
    var x = parseInt((_34.width - _35.width) / 2);
    var y = parseInt((_34.height - _35.height) / 2);
    var _38 = this.get_parentElement();
    this.set_parentElement(document.documentElement);
    this.set_x(x);
    this.set_y(y);
    this.show();
    this.set_parentElement(_38);
}, get_parentElement: function() {
    if (!this._parentElement && this._parentElementID) {
        this.set_parentElement($get(this._parentElementID));
        Sys.Debug.assert(this._parentElement != null, String.format("Couldn't find parent element \"{0}\"", this._parentElementID));
    }
    return this._parentElement;
}, set_parentElement: function(_39) {
    this._parentElement = _39;
}, get_parentElementID: function() {
    if (this._parentElement) {
        return this._parentElement.id;
    }
    return this._parentElementID;
}, set_parentElementID: function(_3a) {
    this._parentElementID = _3a;
    if (this.get_isInitialized()) {
        this.set_parentElement($get(_3a));
    }
}, get_positioningMode: function() {
    return this._positioningMode;
}, set_positioningMode: function(_3b) {
    this._positioningMode = _3b;
}, get_x: function() {
    return this._x;
}, set_x: function(_3c) {
    if (_3c != this._x) {
        this._x = _3c;
        if ($telerik.getVisible(this.get_element()) && this._manageVisibility) {
            this.show();
        }
    }
}, get_y: function() {
    return this._y;
}, set_y: function(_3d) {
    if (_3d != this._y) {
        this._y = _3d;
        if ($telerik.getVisible(this.get_element()) && this._manageVisibility) {
            this.show();
        }
    }
}, get_overlay: function() {
    return this._overlay;
}, set_overlay: function(_3e) {
    this._overlay = _3e;
    this._attachWindowHandlers(false);
    if (this._overlay) {
        this._attachWindowHandlers(true);
    } else {
        if (!((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7))) {
            var elt = this.get_element();
            var _40 = elt._hideWindowedElementsIFrame;
            if (_40) {
                _40.style.display = "none";
            }
        }
    }
}, get_manageVisibility: function() {
    return this._manageVisibility;
}, set_manageVisibility: function(_41) {
    this._manageVisibility = _41;
}, get_keepInScreenBounds: function() {
    return this._keepInScreenBounds;
}, set_keepInScreenBounds: function(_42) {
    this._keepInScreenBounds = _42;
}, hide: function() {
    var elt = this.get_element();
    if (this._manageVisibility) {
        $telerik.setVisible(elt, false);
    }
    if (elt.originalWidth) {
        elt.style.width = elt.originalWidth + "px";
        elt.originalWidth = null;
    }
    if (Sys.Browser.agent === Sys.Browser.InternetExplorer || this._overlay) {
        var _44 = elt._hideWindowedElementsIFrame;
        if (_44) {
            _44.style.display = "none";
        }
    }
}, show: function() {
    var elt = this.get_element();
    if ($telerik.isFirefox) {
        var doc = document.documentElement;
        var _47 = $telerik.getCurrentStyle(doc, "overflow");
        if ("hidden" == _47) {
            elt.style.left = doc.scrollLeft + "px";
            elt.style.top = doc.scrollLeft + "px";
        }
    }
    if (this._manageVisibility) {
        $telerik.setVisible(elt, true);
    }
    var _48 = elt.offsetParent || document.documentElement;
    var _49;
    var _4a;
    if (this._parentElement) {
        _4a = $telerik.getBounds(this._parentElement);
        if (_48.tagName.toUpperCase() != "BODY" && _48.tagName.toUpperCase() != "HTML") {
            var _4b = $telerik.getLocation(_48);
            var _4c = $telerik.getBorderBox(_48);
            _4b.x += _4c.top;
            _4b.y += _4c.left;
            _49 = { x: _4a.x - _4b.x + _48.scrollLeft, y: _4a.y - _4b.y + _48.scrollTop };
        } else {
            _49 = { x: _4a.x, y: _4a.y };
        }
    } else {
        _4a = $telerik.getBounds(_48);
        _49 = { x: 0, y: 0 };
    }
    var _4d = elt.offsetWidth - (elt.clientLeft ? elt.clientLeft * 2 : 0);
    var _4e = elt.offsetHeight - (elt.clientTop ? elt.clientTop * 2 : 0);
    var _4f;
    switch (this._positioningMode) {
        case Telerik.Web.PositioningMode.Center:
            _4f = { x: Math.round(_4a.width / 2 - _4d / 2), y: Math.round(_4a.height / 2 - _4e / 2) };
            break;
        case Telerik.Web.PositioningMode.BottomLeft:
            _4f = { x: 0, y: _4a.height };
            break;
        case Telerik.Web.PositioningMode.BottomRight:
            _4f = { x: _4a.width - _4d, y: _4a.height };
            break;
        case Telerik.Web.PositioningMode.TopLeft:
            _4f = { x: 0, y: -elt.offsetHeight };
            break;
        case Telerik.Web.PositioningMode.TopRight:
            _4f = { x: _4a.width - _4d, y: -elt.offsetHeight };
            break;
        default:
            _4f = { x: 0, y: 0 };
    }
    _4f.x += this._x + _49.x;
    _4f.y += this._y + _49.y;
    $telerik.setLocation(elt, _4f);
    if (this._firstPopup) {
        elt.style.width = _4d + "px";
    }
    this._firstPopup = false;
    var _50 = $telerik.getBounds(elt);
    var _51 = this._getViewportBounds();
    if (this._keepInScreenBounds) {
        var _52 = false;
        var _53 = self.innerWidth ? self.innerWidth : document.documentElement.clientWidth;
        if (!_53) {
            _53 = document.body.clientWidth;
        }
        if ($telerik.isRightToLeft(document.body)) {
            _53 = document.documentElement.scrollWidth ? document.documentElement.scrollWidth : document.body.scrollWidth;
        }
        if (_50.x + _50.width - _51.scrollLeft > _53) {
            _4f.x = _53 - _50.width + _51.scrollLeft;
            _52 = true;
        }
        if (_50.x < 0) {
            _4f.x -= _50.x;
            _52 = true;
        }
        if (_50.y < 0) {
            _4f.y -= _50.y;
            _52 = true;
        }
        if (_51.height < _50.y + _50.height - _51.scrollTop) {
            if (_51.height - _50.height > 0) {
                _4f.y = _51.height - _50.height + _51.scrollTop;
                _52 = true;
            }
        }
        if (_52) {
            $telerik.setLocation(elt, _4f);
            _50 = $telerik.getBounds(elt);
        }
    }
    elt.zIndex = 1000;
    if (((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.version < 7)) || this._overlay) {
        var _54 = elt._hideWindowedElementsIFrame;
        if (!_54) {
            _54 = document.createElement("iframe");
            _54.src = "javascript:'<html></html>';";
            _54.style.position = "absolute";
            _54.style.display = "none";
            _54.scrolling = "no";
            _54.frameBorder = "0";
            _54.tabIndex = "-1";
            _54.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
            elt.parentNode.insertBefore(_54, elt);
            elt._hideWindowedElementsIFrame = _54;
            this._moveHandler = Function.createDelegate(this, this._onMove);
            $telerik.addExternalHandler(elt, "move", this._moveHandler);
        }
        $telerik.setBounds(_54, _50);
        if (Sys.Browser.agent === Sys.Browser.Firefox) {
            _54.style.top = parseInt(_50.y) - _51.scrollTop + "px";
            _54.style.left = parseInt(_50.x) - _51.scrollLeft + "px";
            _54.style.position = "fixed";
        }
        if ($telerik.quirksMode) {
            return;
        }
        _54.style.display = elt.style.display;
        if (elt.currentStyle && elt.currentStyle.zIndex) {
            _54.style.zIndex = elt.currentStyle.zIndex;
        } else {
            if (elt.style.zIndex) {
                _54.style.zIndex = elt.style.zIndex;
            }
        }
    }
}, _getViewportBounds: function() {
    var _55 = $telerik.getClientBounds();
    var _56 = $telerik.getCorrectScrollLeft(document.documentElement) || $telerik.getCorrectScrollLeft(document.body);
    var _57 = document.documentElement.scrollTop || document.body.scrollTop;
    _55.scrollLeft = _56;
    _55.scrollTop = _57;
    return _55;
}, _setCoordinates: function(x, y) {
    var _5a = false;
    if (x != this._x) {
        this._x = x;
        _5a = true;
    }
    if (y != this._y) {
        this._y = y;
        _5a = true;
    }
    if ($telerik.getVisible(this.get_element()) && _5a && this._manageVisibility) {
        this.show();
    }
}, initialize: function() {
    Telerik.Web.PopupBehavior.callBaseMethod(this, "initialize");
    this.hide();
    this.get_element().style.position = "absolute";
}, dispose: function() {
    var elt = this.get_element();
    if (elt) {
        if (this._moveHandler) {
            $telerik.removeExternalHandler(elt, "move", this._moveHandler);
            this._moveHandler = null;
        }
        this._attachWindowHandlers(false);
        if ($telerik.getVisible(elt) && this._manageVisibility) {
            this.hide();
        }
        if (this._originalParent) {
            elt.parentNode.removeChild(elt);
            this._originalParent.appendChild(elt);
            this._originalParent = null;
        }
        var _5c = elt._hideWindowedElementsIFrame;
        if (_5c) {
            var _5d = _5c.parentNode;
            var _5e = _5c.nextSibling;
            if (_5d) {
                _5d.removeChild(_5c);
                if (_5e) {
                    _5d.insertBefore(document.createElement("SPAN"), _5e);
                } else {
                    _5d.appendChild(document.createElement("SPAN"));
                }
            }
        }
    }
    this._parentElement = null;
    Telerik.Web.PopupBehavior.callBaseMethod(this, "dispose");
}, _onMove: function() {
    var elt = this.get_element();
    var _60 = elt._hideWindowedElementsIFrame;
    if (_60) {
        if (Sys.Browser.agent === Sys.Browser.Firefox) {
            var _61 = this._getViewportBounds();
            _60.style.top = parseInt(elt.style.top) - _61.scrollTop + "px";
            _60.style.left = parseInt(elt.style.left) - _61.scrollLeft + "px";
            _60.style.position = "fixed";
        } else {
            _60.style.top = elt.style.top;
            _60.style.left = elt.style.left;
        }
    }
}, _handleElementResize: function() {
    var elt = this.get_element();
    var _63 = elt._hideWindowedElementsIFrame;
    if (_63) {
        var _64 = $telerik.getBounds(elt);
        $telerik.setBounds(_63, _64);
    }
}, _attachWindowHandlers: function(_65) {
    if (!Sys.Browser.agent === Sys.Browser.Firefox) {
        return;
    }
    var _66 = window;
    if (true == _65) {
        this._windowResizeDelegate = Function.createDelegate(this, this._onMove);
        $telerik.addExternalHandler(_66, "resize", this._windowResizeDelegate);
        this._windowScrollDelegate = Function.createDelegate(this, this._onMove);
        $telerik.addExternalHandler(_66, "scroll", this._windowScrollDelegate);
    } else {
        if (this._windowResizeDelegate) {
            $telerik.removeExternalHandler(_66, "resize", this._windowResizeDelegate);
        }
        this._windowResizeDelegate = null;
        if (this._windowScrollDelegate) {
            $telerik.removeExternalHandler(_66, "scroll", this._windowScrollDelegate);
        }
        this._windowScrollDelegate = null;
    }
} 
};
Telerik.Web.PopupBehavior.registerClass("Telerik.Web.PopupBehavior", Telerik.Web.BehaviorBase);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ResizeExtender = function(_67, _68, _69, _6a, doc, _6c, _6d) {
    this._document = doc ? doc : document;
    this._documentMouseMoveDelegate = null;
    this._documentMouseUpDelegate = null;
    this._element = null;
    this._tableElement = null;
    this._moveCursorType = "move";
    this._enabled = true;
    this._jsOwner = null;
    this._hideIframes = true;
    this._autoScrollEnabled = true;
    this._saveDelegates = {};
    this.makeResizable(_67, _68, _69, _6a, _6c, _6d);
};
Telerik.Web.UI.ResizeExtender.containsBounds = function(_6e, _6f) {
    if (!_6e || !_6f) {
        return false;
    }
    var _70 = $telerik.containsPoint(_6e, _6f.x, _6f.y);
    if (_70) {
        var x = _6f.x + _6f.width;
        var y = _6f.y + _6f.height;
        _70 = $telerik.containsPoint(_6e, x, y);
    }
    return _70;
};
Telerik.Web.UI.ResizeExtender.prototype = { dispose: function() {
    this._attachDocumentHandlers(false);
    this._configureHandleElements(false);
    this._jsOwner = null;
}, enable: function(_73) {
    this._enabled = _73;
}, set_hideIframes: function(_74) {
    this._hideIframes = _74;
}, get_hideIframes: function() {
    return this._hideIframes;
}, makeResizable: function(_75, _76, _77, _78, _79, _7a) {
    if (!_76) {
        return;
    }
    if (this._element) {
        alert("Element " + _76.getAttribute("id") + " cannot be made resizable, as the resizeExtender already has the element " + this._element.getAttribute("id") + " associated with it. You must create a new extender resizer object");
        return;
    }
    this._jsOwner = _75;
    this._element = _76;
    this._tableElement = _78;
    this._resizeHandles = _77;
    if (_79) {
        this._moveCursorType = _79;
    }
    if (_7a != null) {
        this._autoScrollEnabled = _7a;
    }
    this._startX = 0;
    this._startY = 0;
    this._cancelResize = true;
    this._configureHandleElements(true);
}, _raiseDragEvent: function(_7b, ev, _7d) {
    if (this._jsOwner && this._jsOwner["on" + _7b]) {
        var _7e = ev;
        if (!_7e) {
            _7e = {};
        }
        _7e.element = this._element;
        _7e.ownerEvent = _7d;
        return this._jsOwner["on" + _7b](_7e);
    }
    return true;
}, _raiseEvent: function(_7f, ev) {
    if (this._jsOwner && this._jsOwner["on" + _7f]) {
        if (!ev) {
            ev = new Sys.EventArgs();
        } else {
            if (_7f == "Resize") {
                ev = this._resizeDir;
            } else {
                if (_7f == "Resizing") {
                    ev = this._getProposedBounds(ev);
                }
            }
        }
        return this._jsOwner["on" + _7f](ev);
    }
    return true;
}, _getProposedBounds: function(b1) {
    var b2 = $telerik.getBounds(this._element);
    return { x: b1.x || b2.x, y: b1.y || b2.y, width: b1.width || b2.width, height: b1.height || b2.height };
}, _resize: function(e) {
    if (!this._enabled || this._cancelResize) {
        return false;
    }
    var _84 = 0;
    var _85 = 0;
    var _86 = 0;
    var _87 = 0;
    var _88 = this._originalBounds;
    var _89 = this._resizeDir.move;
    if (_89) {
        _86 = _88.x + (e.clientX - this._startX);
        _87 = _88.y + (e.clientY - this._startY);
    } else {
        if (this._resizeDir.east) {
            _84 = _88.width + (e.clientX - this._startX);
        } else {
            if (this._resizeDir.west) {
                _86 = e.clientX - this._leftHandleMouseDelta;
                _84 = _88.width - (e.clientX - this._startX);
            }
        }
        if (this._resizeDir.south) {
            _85 = _88.height + (e.clientY - this._startY);
        } else {
            if (this._resizeDir.north) {
                _87 = _88.y + (e.clientY - this._startY);
                _85 = _88.height - (e.clientY - this._startY);
            }
        }
    }
    if (this._offsetLocation) {
        _86 -= this._offsetLocation.x;
        _87 -= this._offsetLocation.y;
    }
    var _8a = new Sys.UI.Bounds(_86, _87, _84, _85);
    var _8b = _89 ? this._raiseDragEvent("Drag", _8a, e) : this._raiseEvent("Resizing", _8a);
    if (false == _8b) {
        return true;
    }
    if (_89 || _8a.x > 0) {
        this._element.style.left = _8a.x + "px";
    }
    if (_89 || _8a.y > 0) {
        this._element.style.top = _8a.y + "px";
    }
    if (_8a.width > 0) {
        this._element.style.width = _8a.width + "px";
    }
    if (_8a.height > 0) {
        this._element.style.height = _8a.height + "px";
    }
    if (!_89) {
        this._updateInnerTableSize();
    }
    return true;
}, _storeStartCoords: function(e) {
    if (!this._enabled) {
        return;
    }
    this._cancelResize = false;
    this._startX = e.clientX;
    this._startY = e.clientY;
    var _8d = $telerik.getBounds(this._element);
    this._originalBounds = _8d;
    var _8e = e.target ? e.target : e.srcElement;
    if (_8e && _8e.type == 3) {
        _8e = _8e.parentNode;
    }
    this._resizeType = $telerik.getCurrentStyle(_8e, "cursor");
    this._resizeDir = { north: this._resizeType.match(/n.?-/) ? 1 : 0, east: this._resizeType.match(/e-/) ? 1 : 0, south: this._resizeType.match(/s.?-/) ? 1 : 0, west: this._resizeType.match(/w-/) ? 1 : 0, move: new RegExp(this._moveCursorType).test(this._resizeType) ? 1 : 0 };
    this._leftHandleMouseDelta = 0;
    if (this._resizeDir.west) {
        this._leftHandleMouseDelta = Math.abs($telerik.getBounds(_8e).x - this._startX);
    }
    var _8f = this._resizeDir.move ? this._raiseDragEvent("DragStart", null, e) : this._raiseEvent("ResizeStart");
    this._cancelResize = (_8f == false);
    var _90 = $telerik.getCurrentStyle(this._element.parentNode, "position");
    var _91 = ("relative" == _90) || ("absolute" == _90);
    this._offsetLocation = _91 ? $telerik.getLocation(this._element.parentNode) : null;
    if (!this._cancelResize) {
        this._clearSelection();
        this._setIframesVisible(false);
        this._attachDocumentHandlers(false);
        this._attachDocumentHandlers(true);
    }
}, _updateInnerTableSize: function() {
    var dir = this._resizeDir;
    if (dir.south || dir.north) {
        var _93 = this._element.style.height;
        var _94 = this._tableElement;
        if (_94) {
            _94.style.height = _93;
            this._fixIeHeight(_94, _93);
        }
    }
}, _setIframesVisible: function(_95) {
    if (!this._hideIframes) {
        return;
    }
    var _96 = this._document.getElementsByTagName("IFRAME");
    for (var i = 0; i < _96.length; i++) {
        var _98 = _96[i];
        _98.style.visibility = _95 ? "" : "hidden";
        if ($telerik.isIE) {
            try {
                _98.contentWindow.document.body.style.visibility = _95 ? "" : "hidden";
            }
            catch (ex) {
            }
        }
    }
}, _configureHandleElements: function(_99) {
    var _9a = ["nw", "n", "ne", "w", "e", "sw", "s", "se", this._moveCursorType];
    for (var i = 0; i < _9a.length; i++) {
        var _9c = _9a[i];
        var _9d = this._resizeHandles[_9c];
        if (_9d) {
            if (_9d instanceof Array) {
                for (var j = 0; j < _9d.length; j++) {
                    this._configureHandle("id" + i + "_" + j, _99, _9d[j], _9c);
                }
            } else {
                this._configureHandle("id" + i, _99, _9d, _9c);
            }
        }
    }
    if (!_99) {
        this._saveDelegates = {};
    }
}, _configureHandle: function(_9f, _a0, _a1, _a2) {
    if (_a0) {
        var _a3 = Function.createDelegate(this, this._onHandleMouseDown);
        $telerik.addExternalHandler(_a1, "mousedown", _a3);
        this._saveDelegates[_9f] = { delegate: _a3, element: _a1 };
        var _a4 = (_a2 == this._moveCursorType ? this._moveCursorType : _a2 + "-resize");
        _a1.style.cursor = _a4;
    } else {
        $telerik.removeExternalHandler(_a1, "mousedown", this._saveDelegates[_9f].delegate);
        _a1.style.cursor = "";
    }
}, _attachDocumentHandlers: function(_a5) {
    var _a6 = this._document;
    if (true == _a5) {
        this._documentMouseMoveDelegate = Function.createDelegate(this, this._onDocumentMouseMove);
        $telerik.addExternalHandler(_a6, "mousemove", this._documentMouseMoveDelegate);
        this._documentMouseUpDelegate = Function.createDelegate(this, this._onDocumentMouseUp);
        $telerik.addExternalHandler(_a6, "mouseup", this._documentMouseUpDelegate);
    } else {
        if (this._documentMouseMoveDelegate) {
            $telerik.removeExternalHandler(_a6, "mousemove", this._documentMouseMoveDelegate);
        }
        this._documentMouseMoveDelegate = null;
        if (this._documentMouseUpDelegate) {
            $telerik.removeExternalHandler(_a6, "mouseup", this._documentMouseUpDelegate);
        }
        this._documentMouseUpDelegate = null;
    }
}, _onDocumentMouseMove: function(e) {
    var _a8 = this._resize(e);
    if (this._autoScrollEnabled) {
        this._autoScroll(e);
    }
    if (_a8) {
        return $telerik.cancelRawEvent(e);
    }
}, _onDocumentMouseUp: function(e) {
    var _aa = !this._cancelResize;
    this._cancelResize = true;
    if (_aa) {
        this._clearSelection();
        this._setIframesVisible(true);
        if (this._resizeDir && this._resizeDir.move) {
            this._raiseDragEvent("DragEnd", null, e);
        } else {
            this._raiseEvent("ResizeEnd");
        }
        this._attachDocumentHandlers(false);
        if (this._scroller) {
            this._scroller.set_enabled(false);
        }
    }
}, _onHandleMouseDown: function(e) {
    this._storeStartCoords(e);
    return $telerik.cancelRawEvent(e);
}, _clearSelection: function() {
    if (this._document.selection && this._document.selection.empty) {
        this._document.selection.empty();
    }
}, _fixIeHeight: function(_ac, _ad) {
    if ("CSS1Compat" == document.compatMode) {
        var _ae = (_ac.offsetHeight - parseInt(_ad));
        if (_ae > 0) {
            var _af = (parseInt(_ac.style.height) - _ae);
            if (_af > 0) {
                _ac.style.height = _af + "px";
            }
        }
    }
}, _initializeAutoScroll: function() {
    if (this._autoScrollInitialized) {
        return;
    }
    this._scrollEdgeConst = 40;
    this._scrollByConst = 10;
    this._scroller = null;
    this._scrollDeltaX = 0;
    this._scrollDeltaY = 0;
    this._scrollerTickHandler = Function.createDelegate(this, this._onScrollerTick);
    this._scroller = new Telerik.Web.Timer();
    this._scroller.set_interval(10);
    this._scroller.add_tick(this._scrollerTickHandler);
    this._autoScrollInitialized = true;
}, _autoScroll: function(ev) {
    this._initializeAutoScroll();
    var _b1 = $telerik.getClientBounds();
    if (_b1.width > 0) {
        this._scrollDeltaX = this._scrollDeltaY = 0;
        if (ev.clientX < _b1.x + this._scrollEdgeConst) {
            this._scrollDeltaX = -this._scrollByConst;
        } else {
            if (ev.clientX > _b1.width - this._scrollEdgeConst) {
                this._scrollDeltaX = this._scrollByConst;
            }
        }
        if (ev.clientY < _b1.y + this._scrollEdgeConst) {
            this._scrollDeltaY = -this._scrollByConst;
        } else {
            if (ev.clientY > _b1.height - this._scrollEdgeConst) {
                this._scrollDeltaY = this._scrollByConst;
            }
        }
        var _b2 = this._scroller;
        if (this._scrollDeltaX != 0 || this._scrollDeltaY != 0) {
            this._originalStartX = this._startX;
            this._originalStartY = this._startY;
            _b2.set_enabled(true);
        } else {
            if (_b2.get_enabled()) {
                this._startX = this._originalStartX;
                this._startY = this._originalStartY;
            }
            _b2.set_enabled(false);
        }
    }
}, _onScrollerTick: function() {
    var _b3 = document.documentElement.scrollLeft || document.body.scrollLeft;
    var _b4 = document.documentElement.scrollTop || document.body.scrollTop;
    window.scrollBy(this._scrollDeltaX, this._scrollDeltaY);
    var _b5 = document.documentElement.scrollLeft || document.body.scrollLeft;
    var _b6 = document.documentElement.scrollTop || document.body.scrollTop;
    var _b7 = _b5 - _b3;
    var _b8 = _b6 - _b4;
    var _b9 = this._element;
    var _ba = { x: parseInt(_b9.style.left) + _b7, y: parseInt(_b9.style.top) + _b8 };
    this._startX -= _b7;
    this._startY -= _b8;
    $telerik.setLocation(_b9, _ba);
} 
};
Telerik.Web.UI.ResizeExtender.registerClass("Telerik.Web.UI.ResizeExtender", null);


