var RadTreeView_KeyboardHooked = false;
var RadTreeView_Active = null;
var RadTreeView_DragActive = null;
var RadTreeView_MouseMoveHooked = false;
var RadTreeView_MouseUpHooked = false;
var RadTreeView_MouseY = 0;
var RadTreeViewGlobalFirstParam = null;
var RadTreeViewGlobalSecondParam = null;
var RadTreeViewGlobalThirdParam = null;
var contextMenuToBeHidden = null;
if (typeof (window.RadControlsNamespace) == "undefined")
    {
    window.RadControlsNamespace = new Object();
    } ;
RadControlsNamespace.AppendStyleSheet = function(O, o, I)
    {
    if (!I)
        {
        return;
        }

    if (!O)
        {
        document.write("<" + "link"
                           + " rel='stylesheet' type='text/css' href='" + I
                           + "' />");
        }

    else
        {
        var U = document.createElement("LINK");
        U.rel = "stylesheet";
        U.type = "text/css";
        U.href = I;
        document.getElementById(o + "StyleSheetHolder").appendChild(U);
        }
    };
function RadTreeNode()
    {
    this.Parent = null;
    this.TreeView = null;
    this.Nodes = new Array();
    this.ID = null;
    this.ClientID = null;
    this.SignImage = null;
    this.SignImageExpanded = null;
    this.Image = 0;
    this.ImageExpanded = 0;
    this.Action = null;
    this.Index = 0;
    this.Level = 0;
    this.Text = null;
    this.Value = null;
    this.Category = null;
    this.NodeCss = null;
    this.NodeCssOver = null;
    this.NodeCssSelect = null;
    this.ContextMenuName = null;
    this.Enabled = true;
    this.Expanded = false;
    this.Checked = false;
    this.Selected = false;
    this.DragEnabled = 1;
    this.DropEnabled = 1;
    this.EditEnabled = 1;
    this.ExpandOnServer = 0;
    this.IsClientNode = 0;
    this.Attributes = new Array();
    this.Z = false;
    }
;
RadTreeNode.prototype.Next = function()
    {
    var z = (this.Parent != null) ? this.Parent.Nodes : this.TreeView.Nodes;
    return (this.Index >= z.length) ? null : z[this.Index + 1];
    };
RadTreeNode.prototype.Prev = function()
    {
    var z = (this.Parent != null) ? this.Parent.Nodes : this.TreeView.Nodes;
    return (this.Index <= 0) ? null : z[this.Index - 1];
    };
RadTreeNode.prototype.NextVisible = function()
    {
    if (this.Expanded)
        return this.Nodes[0];

    if (this.Next() != null)
        return this.Next();

    var W = this;

    while (W.Parent != null)
        {
        if (W.Parent.Next() != null)
            return W.Parent.Next();

        W = W.Parent;
        }

    return null;
    };
RadTreeNode.prototype.PrevVisible = function()
    {
    if (this.Prev() != null)
        {
        return this.Prev();
        }

    if (this.Parent != null)
        {
        return this.Parent;
        }

    return null;
    };
RadTreeNode.prototype.Toggle = function()
    {
    if (this.Enabled)
        {
        if (this.TreeView.FireEvent(this.TreeView.BeforeClientToggle, this) == false)
            {
            return;
            }

        (this.Expanded) ? this.Collapse() : this.Expand();
        this.TreeView.FireEvent(this.TreeView.AfterClientToggle, this);
        }
    };
RadTreeNode.prototype.CollapseNonParentNodes = function()
    {
    for (var i = 0; i < this.TreeView.AllNodes.length; i++)
        {
        if (this.TreeView.AllNodes[i].Expanded && !this.IsParent(this.TreeView.AllNodes[i]))
            {
            this.TreeView.AllNodes[i].CollapseNoEffect();
            }
        }
    };
RadTreeNode.prototype.V = function(s)
    {
    try
        {
        return encodeURIComponent(s);
        }
    catch (e)
        {
        return escape(s);
        }
    };
RadTreeNode.prototype.v = function()
    {
    throw new Error(
              "No RadTreeView instance has been created on the server."
                  + "Make sure that you have the control instance created."
                  + "Please review this article for additional information.");
    } ;
RadTreeNode.prototype.T = function()
    {
    var url = this.TreeView.LoadOnDemandUrl + "&rtnClientID=" + this.ClientID
            + "&rtnLevel=" + this.Level + "&rtnID=" + this.ID
            + "&rtnParentPosition=" + this.GetParentPositions() + "&rtnText="
            + this.V(this.Text) + "&rtnValue=" + this.V(this.Value)
            + "&rtnCategory=" + this.V(this.Category) + "&rtnChecked="
            + this.Checked;
    var S;

    if (typeof (XMLHttpRequest) != "undefined")
        {
        S = new XMLHttpRequest();
        }

    else
        {
        S = new ActiveXObject("Microsoft.XMLHTTP");
        }

    url = url + "&timeStamp=" + encodeURIComponent(( new Date()).getTime());
    S.open("GET", url, true);
    var R = this;
    S.onreadystatechange = function()
        {
        if (S.readyState != 4)
            return;

        var html = S.responseText;
        var index = html.indexOf(",");
        var Q = parseInt(html.substring(0, index));
        var P = html.substring(index + 1, Q + index + 1);
        var N = html.substring(Q + index + 1);
        R.LoadNodesOnDemand(P, S.status, url);
        R.ImageOn();
        R.SignOn();
        R.Expanded = true;
        R.ExpandOnServer = 0;
        var M = R.TextElement().parentNode;
        var m = M.parentNode;

        switch (R.TreeView.LoadingMessagePosition)
            {
            case 0:
            case 1:
                if (M.tagName == "A")
                    {
                    M.firstChild.innerHTML = R.Text;
                    }

                else
                    {
                    m = R.TextElement().parentNode;

                    if (R.TextElement().innerText)
                        {
                        R.TextElement().innerText = R.Text;
                        }

                    else
                        {
                        R.TextElement().innerHTML = R.Text;
                        }
                    }

                break;

            case 2:
                M.removeChild(document.getElementById(R.ClientID + "Loading"));

                m = R.TextElement().parentNode;
                break;

            case 3: m = R.TextElement().parentNode;
            }

        if (R.Nodes.length > 0)
            {
            rtvInsertHTML(m, N);
            var images = m.getElementsByTagName("IMG");

            for (var i = 0; i < images.length; i++)
                {
                RadTreeView.InitImageControl(images[i]);
                }

            var l = m.getElementsByTagName("INPUT");

            for (var i = 0; i < l.length; i++)
                {
                l[i].style.verticalAlign = "middle";
                }
            }

        R.Z = false;
        R.TreeView.FireEvent(R.TreeView.AfterClientToggle, R);
        };

    S.send(null);
    };
RadTreeNode.prototype.Expand = function()
    {
    if (this.ExpandOnServer)
        {
        if (!this.TreeView.FireEvent(this.TreeView.BeforeClientToggle, this))
            {
            return;
            }

        if (this.ExpandOnServer == 1)
            {
            this.TreeView.K("NodeExpand", this.ClientID);
            return;
            }

        if (this.ExpandOnServer == 2)
            {
            if (!this.Z)
                {
                this.Z = true;

                switch (this.TreeView.LoadingMessagePosition)
                    {
                    case 0:
                        this.TextElement().innerHTML
                            = "<span class=" + this.TreeView.LoadingMessageCssClass
                                  + ">" + this.TreeView.LoadingMessage + "</span> "
                                  + this.TextElement().innerHTML;

                        break;

                    case 1:
                        this.TextElement().innerHTML
                            = this.TextElement().innerHTML + " " + "<span class="
                                  + this.TreeView.LoadingMessageCssClass + ">" + this.TreeView.LoadingMessage
                                  + "</span> ";

                        break;

                    case 2:
                        rtvInsertHTML(this.TextElement().parentNode,
                                      "<div id=" + this.ClientID
                                          + "Loading " + " class="
                                          + this.TreeView.LoadingMessageCssClass + ">" + this.TreeView.LoadingMessage
                                          + "</div>");

                        break;
                    }

                var R = this;
                window.setTimeout(function()
                    {
                    R.T();
                    } ,           024);

                return;
                }
            }
        }

    if (!this.Nodes.length)
        {
        return;
        }

    if (this.TreeView.SingleExpandPath)
        {
        this.CollapseNonParentNodes();
        }

    var k = document.getElementById("G" + this.ClientID);

    if (this.TreeView.ExpandDelay > 0)
        {
        k.style.overflow = "hidden";
        k.style.height = "1px";
        k.style.display = "block";
        k.firstChild.style.position = "relative";
        window.setTimeout(
            "rtvNodeExpand(1,'" + k.id + "',"
                + this.TreeView.ExpandDelay + ");",
            024);
        }

    else
        {
        k.style.display = "block";
        }

    this.ImageOn();
    this.SignOn();
    this.Expanded = true;

    if (!this.IsClientNode)
        {
        this.TreeView.UpdateExpandedState();
        }
    };
RadTreeNode.prototype.GetParentPositions = function()
    {
    var parentNode = this;
    var J = "";

    while (parentNode != null)
        {
        if (parentNode.Next() != null)
            {
            J = J + "1";
            }

        else
            {
            J = J + "0";
            }

        parentNode = parentNode.Parent;
        }

    return J;
    };
RadTreeNode.prototype.Collapse = function()
    {
    if (this.Nodes.length > 0)
        {
        if (this.TreeView.ExpandDelay > 0)
            {
            var k = document.getElementById("G" + this.ClientID);

            if (k.scrollHeight != "undefined")
                {
                k.style.overflow = "hidden";
                k.style.display = "block";
                k.firstChild.style.position = "relative";
                window.setTimeout(
                    "rtvNodeCollapse(" + k.scrollHeight + ",'"
                        + k.id + "'," + this.TreeView.ExpandDelay + " );",
                    024);
                }

            else
                {
                this.CollapseNoEffect();
                }
            }

        else
            {
            this.CollapseNoEffect();
            }

        this.ImageOff();
        this.SignOff();
        this.Expanded = false;
        this.TreeView.UpdateExpandedState();
        }
    };
RadTreeNode.prototype.CollapseNoEffect = function()
    {
    if (this.Nodes.length > 0)
        {
        var k = document.getElementById("G" + this.ClientID);
        k.style.display = "none";
        this.ImageOff();
        this.SignOff();
        this.Expanded = false;
        this.TreeView.UpdateExpandedState();
        }
    };
RadTreeNode.prototype.Highlight = function(e)
    {
    if (!this.Enabled)
        {
        return;
        }

    if (e)
        {
        if (this.TreeView.MultipleSelect && (e.ctrlKey || e.shiftKey))
            {
            if (this.Selected)
                {
                this.TextElement().className = this.NodeCss;
                this.Selected = false;

                if (this.TreeView.SelectedNode == this)
                    {
                    this.TreeView.SelectedNode = null;
                    }

                this.TreeView.UpdateSelectedState();
                return;
                }
            }

        else
            {
            this.TreeView.UnSelectAllNodes();
            }
        }

    this.TextElement().className = this.NodeCssSelect;
    this.TreeView.SelectNode(this);
    this.TreeView.FireEvent(this.TreeView.AfterClientHighlight, this);
    };
RadTreeNode.prototype.ExecuteAction = function(e)
    {
    if (this.IsClientNode)
        {
        return;
        }

    if (this.TextElement().tagName == "A")
        {
        this.TextElement().click();
        }

    else if (this.Action)
        {
        this.TreeView.K("NodeClick", this.ClientID);
        }

    if (e)
        {
        (document.all) ? e.returnValue = false : e.preventDefault();
        }
    };
RadTreeNode.prototype.Select = function(e)
    {
    if (this.TreeView.FireEvent(this.TreeView.BeforeClientClick, this, e) == false)
        return;

    if (this.Enabled)
        {
        this.Highlight(e);
        this.TreeView.LastHighlighted = this;
        this.ExecuteAction();
        }

    else
        {
        (document.all) ? e.returnValue = false : e.preventDefault();
        }

    this.TreeView.FireEvent(this.TreeView.AfterClientClick, this, e);
    };
RadTreeNode.prototype.UnSelect = function()
    {
    if (this.TextElement().parentNode && this.TextElement().parentNode.tagName == "A")
        {
        this.TextElement().parentNode.className = this.NodeCss;
        }

    this.TextElement().className = this.NodeCss;
    this.Selected = false;
    };
RadTreeNode.prototype.Disable = function()
    {
    this.TextElement().className = this.TreeView.NodeCssDisable;
    this.Enabled = false;
    this.Selected = false;

    if (this.CheckElement() != null)
        this.CheckElement().disabled = true;
    };
RadTreeNode.prototype.Enable = function()
    {
    this.TextElement().className = this.NodeCss;
    this.Enabled = true;

    if (this.CheckElement() != null)
        {
        this.CheckElement().disabled = false;
        }
    };
RadTreeNode.prototype.Hover = function()
    {
    if (this.Enabled)
        {
        if (this.TreeView.FireEvent(this.TreeView.BeforeClientHighlight, this) == false)
            {
            return;
            }

        this.TreeView.LastHighlighted = this;

        if (RadTreeView_DragActive != null && RadTreeView_DragActive.DragClone != null && (!this.Expanded)
            && this.ExpandOnServer != 1)
            {
            var R = this;
            window.setTimeout(function()
                {
                R.H();
                } ,           01750);
            }

        if (!this.Selected)
            {
            this.TextElement().className = this.NodeCssOver;

            if (this.Image)
                {
                this.ImageElement().style.cursor = "hand";
                }
            }

        this.TreeView.FireEvent(this.TreeView.AfterClientHighlight, this);
        }
    };
RadTreeNode.prototype.H = function()
    {
    if (RadTreeView_DragActive != null && RadTreeView_DragActive.DragClone != null && (!this.Expanded))
        {
        if (RadTreeView_Active.LastHighlighted == this)
            {
            this.Expand();
            }
        }
    };
RadTreeNode.prototype.UnHover = function()
    {
    if (this.Enabled)
        {
        this.TreeView.LastHighlighted = null;

        if (!this.Selected)
            {
            this.TextElement().className = this.NodeCss;

            if (this.Image)
                {
                this.ImageElement().style.cursor = "default";
                }
            }

        this.TreeView.FireEvent(this.TreeView.AfterClientMouseOut, this);
        }
    };
RadTreeNode.prototype.CheckBoxClick = function(e)
    {
    if (this.Enabled)
        {
        if (this.TreeView.FireEvent(this.TreeView.BeforeClientCheck, this) == false)
            {
            (this.Checked) ? this.Check() : this.UnCheck();
            return;
            }

        (this.Checked) ? this.UnCheck() : this.Check();
        this.TreeView.FireEvent(this.TreeView.AfterClientCheck, this);

        if (this.TreeView.AutoPostBackOnCheck)
            {
            this.TreeView.K("NodeCheck", this.ClientID);
            return;
            }
        }
    };
RadTreeNode.prototype.Check = function()
    {
    if (this.CheckElement() != null)
        {
        this.CheckElement().checked = true;
        this.Checked = true;
        this.TreeView.UpdateCheckedState();
        }
    };
RadTreeNode.prototype.UnCheck = function()
    {
    if (this.CheckElement() != null)
        {
        this.CheckElement().checked = false;
        this.Checked = false;
        this.TreeView.UpdateCheckedState();
        }
    };
RadTreeNode.prototype.IsSet = function(a)
    {
    return (a != null && a != "");
    } ;
RadTreeNode.prototype.ImageOn = function()
    {
    var h = document.getElementById(this.ClientID + "i");

    if (this.ImageExpanded != 0)
        {
        h.src = this.ImageExpanded;
        }
    };
RadTreeNode.prototype.ImageOff = function()
    {
    var h = document.getElementById(this.ClientID + "i");

    if (this.Image != 0)
        {
        h.src = this.Image;
        }
    };
RadTreeNode.prototype.SignOn = function()
    {
    var g = document.getElementById(this.ClientID + "c");

    if (this.IsSet(this.SignImageExpanded))
        {
        g.src = this.SignImageExpanded;
        }
    };
RadTreeNode.prototype.SignOff = function()
    {
    var g = document.getElementById(this.ClientID + "c");

    if (this.IsSet(this.SignImage))
        {
        g.src = this.SignImage;
        }
    };
RadTreeNode.prototype.TextElement = function()
    {
    var F = document.getElementById(this.ClientID);
    var f = F.getElementsByTagName("span")[0];

    if (f == null)
        {
        f = F.getElementsByTagName("a")[0];
        }

    return f;
    };
RadTreeNode.prototype.ImageElement = function()
    {
    return document.getElementById(this.ClientID + "i");
    } ;
RadTreeNode.prototype.CheckElement = function()
    {
    return document.getElementById(this.ClientID).getElementsByTagName("input")[0];
    } ;
RadTreeNode.prototype.IsParent = function(node)
    {
    var parent = this.Parent;

    while (parent != null)
        {
        if (node == parent)
            return true;

        parent = parent.Parent;
        }

    return false;
    };
RadTreeNode.prototype.StartEdit = function()
    {
    if (this.EditEnabled)
        {
        var D = this.Text;
        this.TreeView.EditMode = true;
        var parentElement = this.TextElement().parentNode;
        this.TreeView.EditTextElement = this.TextElement().cloneNode(true);
        this.TextElement().parentNode.removeChild(this.TextElement());
        var d = this;
        var C = document.createElement("input");
        C.setAttribute("type", "text");
        C.setAttribute("size", this.Text.length + 3);
        C.setAttribute("value", D);
        C.className = this.TreeView.NodeCssEdit;
        var B = this;
        C.onblur = function()
            {
            B.EndEdit();
            } ;

        C.onchange = function()
            {
            B.EndEdit();
            } ;

        C.onkeypress = function(e)
            {
            B.AnalyzeEditKeypress(e);
            } ;

        C.onsubmit = function()
            {
            return false;
            } ;

        parentElement.appendChild(C);
        this.TreeView.EditInputElement = C;
        C.focus();
        C.onselectstart = function(e)
            {
            if (!e)
                e = window.event;

            if (e.stopPropagation)
                {
                e.stopPropagation();
                }

            else
                {
                e.cancelBubble = true;
                }
            };

        var o0 = 0;
        var O0 = this.Text.length;

        if (C.createTextRange)
            {
            var l0 = C.createTextRange();
            l0.moveStart("character", o0);
            l0.moveEnd("character", O0);
            l0.select();
            }

        else
            {
            C.setSelectionRange(o0, O0);
            }
        }
    };
RadTreeNode.prototype.EndEdit = function()
    {
    this.TreeView.EditInputElement.onblur = null;
    this.TreeView.EditInputElement.onchange = null;
    var parentElement = this.TreeView.EditInputElement.parentNode;

    if (this.TreeView.FireEvent(this.TreeView.AfterClientEdit, this, this.Text,
                                this.TreeView.EditInputElement.value) != false)
        {
        if (this.Text != this.TreeView.EditInputElement.value)
            {
            var i0 = this.ClientID + ":" + this.TreeView.I0(this.TreeView.EditInputElement.value);
            this.TreeView.K("NodeEdit", i0);
            return;
            }

        this.TreeView.EditTextElement.innerHTML = this.TreeView.EditInputElement.value;
        this.Text = this.TreeView.EditInputElement.value;
        }

    this.TreeView.EditInputElement.parentNode.removeChild(this.TreeView.EditInputElement);
    parentElement.appendChild(this.TreeView.EditTextElement);
    this.TreeView.EditMode = false;
    this.TreeView.EditInputElement = null;
    this.TreeView.EditTextElement = null;
    };
RadTreeNode.prototype.AnalyzeEditKeypress = function(e)
    {
    if (document.all)
        e = event;

    if (e.keyCode == 015)
        {
        (document.all) ? e.returnValue = false : e.preventDefault();
        this.EndEdit();
        return false;
        }

    if (e.keyCode == 033)
        {
        this.TreeView.EditInputElement.value = this.TreeView.EditTextElement.innerHTML;
        this.EndEdit();
        }

    return true;
    };
RadTreeNode.prototype.LoadNodesOnDemand = function(s, o1, url)
    {
    if (o1 == 0624)
        {
        var O1 = "CallBack URL not found:"
                + url
                + "\r\n\r\nAre you using URL Rewriter? Please, try setting the CallBackUrl property to match the correct URL you need";
        alert(O1);
        }

    else
        {
        eval(s);
        var l1 = eval(this.ClientID + "ClientData");

        for (var i = 0; i < l1.length; i++)
            {
            l1[i][021] = 0;
            this.TreeView.LoadNode(l1[i], null, this);
            }
        }
    };
function RadTreeView(i1)
    {
    if (window.tlrkTreeViews == null)
        {
        window.tlrkTreeViews = new Array();
        }

    if (window.tlrkTreeViews[i1] != null)
        {
        I1 = window.tlrkTreeViews[i1];
        I1.Dispose();
        }

    tlrkTreeViews[i1] = this;
    this.Nodes = new Array();
    this.AllNodes = new Array();
    this.ClientID = null;
    this.SelectedNode = null;
    this.DragMode = false;
    this.DragSource = null;
    this.DragClone = null;
    this.LastHighlighted = null;
    this.MouseInside = false;
    this.HtmlElementID = "";
    this.EditMode = false;
    this.EditTextElement = null;
    this.EditInputElement = null;
    this.BeforeClientClick = null;
    this.BeforeClientHighlight = null;
    this.AfterClientHighlight = null;
    this.AfterClientMouseOut = null;
    this.BeforeClientDrop = null;
    this.AfterClientDrop = null;
    this.BeforeClientToggle = null;
    this.AfterClientToggle = null;
    this.BeforeClientContextClick = null;
    this.BeforeClientContextMenu = null;
    this.AfterClientContextClick = null;
    this.BeforeClientCheck = null;
    this.AfterClientCheck = null;
    this.AfterClientMove = null;
    this.AfterClientFocus = null;
    this.BeforeClientDrag = null;
    this.AfterClientEdit = null;
    this.AfterClientClick = null;
    this.BeforeClientDoubleClick = null;
    this.AutoPostBackOnCheck = false;
    this.CausesValidation = true;
    this.ContextMenuVisible = false;
    this.ContextMenuName = null;
    this.o2 = null;
    this.SingleExpandPath = false;
    this.ExpandDelay = 2;
    this.TabIndex = 0;
    this.AllowNodeEditing = false;
    this.LoadOnDemandUrl = null;
    this.LoadingMessage = "(loading...)";
    this.LoadingMessagePosition = 0;
    this.LoadingMessageCssClass = "LoadingMessage";
    this.O2 = false;
    }
;
RadTreeView.InitImageControl = function(l2)
    {
    l2.align = "absmiddle";
    l2.style.display = "inline";

    if (!document.all || window.opera)
        {
        l2.nextSibling.style.verticalAlign = "middle";
        }
    };
RadTreeView.prototype.OnInit = function()
    {
	var ImageList = new Array();
    this.PreloadImages(ImageList);
    i2 = ImageList;
    var images = document.getElementById(this.Container).getElementsByTagName("IMG");

    for (var i = 0; i < images.length; i++)
        {
        var index = images[i].className;

        if (index != null && index != "")
            {
            images[i].src = ImageList[index].src;
            RadTreeView.InitImageControl(images[i]);
            }
        }

    this.LoadTree(ImageList);
    var l = document.getElementById(this.Container).getElementsByTagName("INPUT");

    for (var i = 0; i < l.length; i++)
        {
        l[i].style.verticalAlign = "middle";
        }

    if (document.addEventListener && (!RadTreeView_KeyboardHooked))
        {
        RadTreeView_KeyboardHooked = true;
        document.addEventListener("keydown", this.KeyDownMozilla, false);
        }

    if ((!RadTreeView_MouseMoveHooked) && (this.DragAndDrop))
        {
        RadTreeView_MouseMoveHooked = true;

        if (document.attachEvent)
            {
            document.attachEvent("onmousemove", rtvMouseMove);
            }

        if (document.addEventListener)
            {
            document.addEventListener("mousemove", rtvMouseMove, false);
            }
        }

    if (!RadTreeView_MouseUpHooked)
        {
        RadTreeView_MouseUpHooked = true;

        if (document.attachEvent)
            {
            document.attachEvent("onmouseup", rtvMouseUp);
            }

        if (document.addEventListener)
            {
            document.addEventListener("mouseup", rtvMouseUp, false);
            }
        }

    this.I2();
    this.O2 = true;
    };
RadTreeView.prototype.I2 = function()
    {
    var d = this;
    var o3 = document.getElementById(this.Container);
    o3.onfocus = function(e)
        {
        rtvDispatcher(d.ClientID, "focus", e);
        } ;

    o3.onmouseover = function(e)
        {
        rtvDispatcher(d.ClientID, "mover", e);
        } ;

    o3.onmouseout = function(e)
        {
        rtvDispatcher(d.ClientID, "mout", e);
        } ;

    o3.oncontextmenu = function(e)
        {
        rtvDispatcher(d.ClientID, "context", e);
        } ;

    o3.onscroll = function(e)
        {
        rtvDispatcher(d.ClientID, "scroll", e);
        } ;

    o3.onclick = function(e)
        {
        rtvDispatcher(d.ClientID, "mclick", e);
        } ;

    o3.ondblclick = function(e)
        {
        rtvDispatcher(d.ClientID, "mdclick", e);
        } ;

    o3.onkeydown = function(e)
        {
        rtvDispatcher(d.ClientID, "keydown", e);
        } ;

    o3.onselectstart = function()
        {
        return false;
        } ;

    o3.ondragstart = function()
        {
        return false;
        } ;

    if (this.DragAndDrop)
        {
        o3.onmousedown = function(e)
            {
            rtvDispatcher(d.ClientID, "mdown", e);
            } ;
        }

    if (window.attachEvent)
        {
        window.attachEvent("onunload", function()
            {
            d.Dispose();
            } );
        }

    this.O3 = o3;
    };
RadTreeView.prototype.Dispose = function()
    {
    if (this.l3)
        return;

    this.l3 = true;

    try
        {
        var o3 = this.O3;

        if (o3 != null)
            {
            for (var i3 in o3)
                {
                if (typeof (o3[i3]) == "function")
                    {
                    o3[i3] = null;
                    }
                }

            for (var i3 in this)
                {
                if (i3 != "Dispose")
                    {
                    this[i3] = null;
                    }
                }
            }

        this.O3 = null;
        }
    catch (I3)
        {
        }
    };
RadTreeView.prototype.PreloadImages = function(images)
    {
    var imageData = eval(this.ClientID + "ImageData");

    for (var i = 0; i < imageData.length; i++)
        {
        var o4 = new Image();
        o4.src = imageData[i];
        images[i] = o4;
        }
    };
RadTreeView.prototype.FindNode = function(node)
    {
    for (var i = 0; i < this.AllNodes.length; i++)
        {
        if (this.AllNodes[i].ClientID == node)
            {
            return this.AllNodes[i];
            }
        }

    return null;
    };
RadTreeView.prototype.FindNodeByID = function(id)
    {
    for (var i = 0; i < this.AllNodes.length; i++)
        {
        if (this.AllNodes[i].ID == id)
            {
            return this.AllNodes[i];
            }
        }

    return null;
    };    
RadTreeView.prototype.FindNodeByText = function(text)
    {
    for (var i = 0; i < this.AllNodes.length; i++)
        {
        if (this.AllNodes[i].Text == text)
            {
            return this.AllNodes[i];
            }
        }

    return null;
    };
RadTreeView.prototype.FindNodeByValue = function(value)
    {
    for (var i = 0; i < this.AllNodes.length; i++)
        {
        if (this.AllNodes[i].Value == value)
            {
            return this.AllNodes[i];
            }
        }

    return null;
    };
RadTreeView.prototype.LoadTree = function(ImageList)
    {
    var treeview2ClientData = eval(this.ClientID + "ClientData");
    for (var i = 0; i < treeview2ClientData.length; i++)
        {
        this.LoadNode(treeview2ClientData[i], ImageList);
        }
    };
RadTreeView.prototype.LoadNode = function(nodeClientData, ImageList, parentNode)
    {
    var newTreeNode = new RadTreeNode();
    newTreeNode.ClientID = nodeClientData[0];
    newTreeNode.TreeView = this;
    var parentNodeIndex = nodeClientData[17];

    if (parentNodeIndex > 0)
        {
        newTreeNode.Parent = this.AllNodes[parentNodeIndex - 1];
        }

    if (parentNode != null)
        {
        newTreeNode.Parent = parentNode;
        }

    newTreeNode.NodeCss = this.NodeCss;
    newTreeNode.NodeCssOver = this.NodeCssOver;
    newTreeNode.NodeCssSelect = this.NodeCssSelect;
    newTreeNode.Text = nodeClientData[1];
    newTreeNode.Value = nodeClientData[2];
    newTreeNode.Category = nodeClientData[3];

    if (ImageList != null)
        {
        newTreeNode.SignImage = ImageList[nodeClientData[4]].src;
        newTreeNode.SignImageExpanded = ImageList[nodeClientData[5]].src;
        }

    else
        {
        newTreeNode.SignImage = i2[nodeClientData[4]].src;
        newTreeNode.SignImageExpanded = i2[nodeClientData[5]].src;
        }

    if (nodeClientData[6] > 0)
        {
        newTreeNode.Image = ImageList[nodeClientData[6]].src;
        }

    if (nodeClientData[7] > 0)
        {
        newTreeNode.ImageExpanded = ImageList[nodeClientData[7]].src;
        }

    newTreeNode.Selected = nodeClientData[8];
    if (newTreeNode.Selected)
        {
        this.SelectedNode = newTreeNode;
        }

    newTreeNode.Checked = nodeClientData[9];
    newTreeNode.Enabled = nodeClientData[10];
    newTreeNode.Expanded = nodeClientData[11];
    newTreeNode.Action = nodeClientData[12];

    if (this.IsSet(nodeClientData[13]))
        newTreeNode.NodeCss = nodeClientData[13];

    if (this.IsSet(nodeClientData[14]))
        newTreeNode.ContextMenuName = nodeClientData[14];

    this.AllNodes[this.AllNodes.length] = newTreeNode;

    if (newTreeNode.Parent != null)
        {
        newTreeNode.Parent.Nodes[newTreeNode.Parent.Nodes.length] = newTreeNode;
        }

    else
        {
        this.Nodes[this.Nodes.length] = newTreeNode;
        }

    newTreeNode.Index = nodeClientData[16];
    newTreeNode.DragEnabled = nodeClientData[18];
    newTreeNode.DropEnabled = nodeClientData[19];
    newTreeNode.ExpandOnServer = nodeClientData[20];

    if (this.IsSet(nodeClientData[21]))
        newTreeNode.NodeCssOver = nodeClientData[21];

    if (this.IsSet(nodeClientData[22]))
        newTreeNode.NodeCssSelect = nodeClientData[22];

    newTreeNode.Level = nodeClientData[23];
    newTreeNode.ID = nodeClientData[24];
    newTreeNode.IsClientNode = nodeClientData[25];
    newTreeNode.EditEnabled = nodeClientData[26];
    newTreeNode.Attributes = nodeClientData[27];
    };
RadTreeView.prototype.Toggle = function(node)
    {
    this.FindNode(node).Toggle();
    } ;
RadTreeView.prototype.Select = function(node, e)
    {
    this.FindNode(node).Select(e);
    } ;
RadTreeView.prototype.Hover = function(node)
    {
    var node = this.FindNode(node);

    if (node)
        node.Hover();
    };
RadTreeView.prototype.UnHover = function(node)
    {
    var node = this.FindNode(node);

    if (node)
        node.UnHover();
    };
RadTreeView.prototype.CheckBoxClick = function(node, e)
    {
    this.FindNode(node).CheckBoxClick(e);
    } ;
RadTreeView.prototype.Highlight = function(node, e)
    {
    this.FindNode(node).Highlight(e);
    } ;
RadTreeView.prototype.SelectNode = function(node)
    {
    this.SelectedNode = node;
    node.Selected = true;
    this.UpdateSelectedState();
    };
RadTreeView.prototype.GetSelectedNodes = function()
    {
    var o5 = new Array();

    for (var i = 0; i < this.AllNodes.length; i++)
        {
        if (this.AllNodes[i].Selected)
            o5[o5.length] = this.AllNodes[i];
        }

    return o5;
    };
RadTreeView.prototype.UnSelectAllNodes = function(node)
    {
    for (var i = 0; i < this.AllNodes.length; i++)
        {
        if (this.AllNodes[i].Selected && this.AllNodes[i].Enabled)
            {
            this.AllNodes[i].UnSelect();
            }
        }
    };
RadTreeView.prototype.KeyDownMozilla = function(e)
    {
    var LastActiveRadTreeView = RadTreeView_Active;

    if (LastActiveRadTreeView)
        {
        if (!LastActiveRadTreeView.O2)
            return;

        if (LastActiveRadTreeView != null && LastActiveRadTreeView.SelectedNode != null)
            {
            if (LastActiveRadTreeView.EditMode)
                return;

            if (e.keyCode == 0153 || e.keyCode == 0155 || e.keyCode == 045 || e.keyCode == 047)
                LastActiveRadTreeView.SelectedNode.Toggle();

            if (e.keyCode == 050 && LastActiveRadTreeView.SelectedNode.NextVisible() != null)
                LastActiveRadTreeView.SelectedNode.NextVisible().Highlight(e);

            if (e.keyCode == 046 && LastActiveRadTreeView.SelectedNode.PrevVisible() != null)
                LastActiveRadTreeView.SelectedNode.PrevVisible().Highlight(e);

            if (e.keyCode == 015)
                {
                if (LastActiveRadTreeView.FireEvent(LastActiveRadTreeView.BeforeClientClick,
                                                    LastActiveRadTreeView.SelectedNode,
                                                    e) == false)
                    {
                    return;
                    }

                LastActiveRadTreeView.SelectedNode.ExecuteAction();
                LastActiveRadTreeView.FireEvent(LastActiveRadTreeView.AfterClientClick,
                                                LastActiveRadTreeView.SelectedNode,
                                                e);
                }

            if (e.keyCode == 040)
                LastActiveRadTreeView.SelectedNode.CheckBoxClick();

            if (e.keyCode == 0161 && LastActiveRadTreeView.AllowNodeEditing)
                LastActiveRadTreeView.SelectedNode.StartEdit();
            }
        }
    };
RadTreeView.prototype.KeyDown = function(e)
    {
    if (this.EditMode)
        return;

    var node = this.SelectedNode;

    if (node != null)
        {
        if (e.keyCode == 0153 || e.keyCode == 0155 || e.keyCode == 045 || e.keyCode == 047)
            node.Toggle();

        if (e.keyCode == 050 && node.NextVisible() != null)
            node.NextVisible().Highlight(e);

        if (e.keyCode == 046 && node.PrevVisible() != null)
            node.PrevVisible().Highlight(e);

        if (e.keyCode == 015)
            {
            if (this.FireEvent(this.BeforeClientClick, this.SelectedNode, e) == false)
                {
                return;
                }

            node.ExecuteAction(e);
            this.FireEvent(this.AfterClientClick, this.SelectedNode, e);
            }

        if (e.keyCode == 040)
            {
            node.CheckBoxClick();
            (document.all) ? e.returnValue = false : e.preventDefault();
            }

        if (e.keyCode == 0161 && this.AllowNodeEditing)
            {
            node.StartEdit();
            }
        }

    else
        {
        if (e.keyCode == 046 || e.keyCode == 050 || e.keyCode == 015 || e.keyCode == 040)
            {
            this.Nodes[0].Highlight();
            }
        }
    };
RadTreeView.prototype.UpdateState = function()
    {
    this.UpdateExpandedState();
    this.UpdateCheckedState();
    this.UpdateSelectedState();
    };
RadTreeView.prototype.UpdateExpandedState = function()
    {
    var O5 = "";

    for (var i = 0; i < this.AllNodes.length; i++)
        {
        var l5 = (this.AllNodes[i].Expanded) ? "1" : "0";
        O5 += l5;
        }

    document.getElementById(this.ClientID + "_expanded").value = O5;
    };
RadTreeView.prototype.UpdateCheckedState = function()
    {
    var i5 = "";

    for (var i = 0; i < this.AllNodes.length; i++)
        {
        var I5 = (this.AllNodes[i].Checked) ? "1" : "0";
        i5 += I5;
        }

    document.getElementById(this.ClientID + "_checked").value = i5;
    };
RadTreeView.prototype.UpdateSelectedState = function()
    {
    var o6 = "";

    for (var i = 0; i < this.AllNodes.length; i++)
        {
        var O6 = (this.AllNodes[i].Selected) ? "1" : "0";
        o6 += O6;
        }

    document.getElementById(this.ClientID + "_selected").value = o6;
    };
RadTreeView.prototype.Scroll = function(e)
    {
    document.getElementById(
        this.ClientID + "\x5fscroll").value = document.getElementById(this.Container).scrollTop;
    } ;
RadTreeView.prototype.ContextMenuClick = function(e, l6, i6, I6)
    {
    d = this;
    window.setTimeout(function()
        {
        d.HideContextMenu();
        } ,           012);

    if (this.FireEvent(this.BeforeClientContextClick, this.o2, l6, I6) == false)
        {
        return;
        }

    if (i6)
        {
        var o7 = this.o2.ClientID + ":" + this.I0(l6) + ":" + this.I0(I6);
        this.K("ContextMenuClick", o7);
        }
    };
RadTreeView.prototype.ContextMenu = function(e, O7)
    {
    var src = (e.srcElement) ? e.srcElement : e.target;
    var node = this.FindNode(O7);

    if (node != null && this.BeforeClientContextMenu != null)
        {
        var l7 = this.SelectedNode;

        if (this.FireEvent(this.BeforeClientContextMenu, node, e, l7) == false)
            {
            return;
            }

        this.Highlight(O7, e, l7);
        }

    if (node != null && node.ContextMenuName != null && node.Enabled)
        {
        if (!this.ContextMenuVisible)
            {
            this.o2 = node;

            if (!node.Selected)
                {
                this.Highlight(O7, e);
                }

            this.ShowContextMenu(node.ContextMenuName, e);
            document.all ? e.returnValue = false : e.preventDefault();
            }
        }
    };
RadTreeView.prototype.ShowContextMenu = function(name, e)
    {
    if (!document.readyState || document.readyState == "complete")
        {
        var i7 = "rtvcm" + this.ClientID + name;
        var menu = document.getElementById(i7);

        if (menu)
            {
            var I7 = menu.cloneNode(true);
            I7.id = i7 + "_clone";
            document.body.appendChild(I7);
            I7 = document.getElementById(i7 + "_clone");
            I7.style.left = this.o8(e) + "px";
            I7.style.top = this.O8(e) + "px";
            I7.style.position = "absolute";
            I7.style.display = "block";
            this.ContextMenuVisible = true;
            this.ContextMenuName = name;
            document.all ? e.returnValue = false : e.preventDefault();
            }
        }
    };
RadTreeView.prototype.O8 = function(e)
    {
    if (document.compatMode && document.compatMode == "CSS1Compat")
        {
        return (e.clientY + document.documentElement.scrollTop);
        }

    return (e.clientY + document.body.scrollTop);
    };
RadTreeView.prototype.o8 = function(e)
    {
    if (document.compatMode && document.compatMode == "CSS1Compat")
        {
        return (e.clientX + document.documentElement.scrollLeft);
        }

    return (e.clientX + document.body.scrollLeft);
    };
RadTreeView.prototype.HideContextMenu = function()
    {
    if (!document.readyState || document.readyState == "complete")
        {
        var l8 = document.getElementById(
                     "rtvcm" + this.ClientID + this.ContextMenuName + "_clone");

        if (l8)
            {
            document.body.removeChild(l8);
            }

        this.ContextMenuVisible = false;
        }
    };
RadTreeView.prototype.MouseClickDispatcher = function(e)
    {
    var src = (e.srcElement) ? e.srcElement : e.target;
    var O7 = rtvGetNodeID(e);

    if (O7 != null)
        {
        var i8 = this.FindNode(O7);

        if (i8.Selected)
            {
            if (this.AllowNodeEditing)
                {
                i8.StartEdit();
                return;
                }

            else
                {
                this.Select(O7, e);
                }
            }

        else
            {
            this.Select(O7, e);
            }
        }

    if (src.tagName == "IMG")
        {
        var I8 = src.className;
        if (this.IsSet(I8) && this.o9(I8))
            {
            e.cancelBubble = true;
            this.Toggle(src.parentNode.id);
            }
        }

    if (src.tagName == "INPUT" && rtvInsideNode(src))
        {
        this.CheckBoxClick(src.parentNode.id, e);
        }
    };
RadTreeView.prototype.o9 = function(O9)
    {
    return (O9 == 1 || O9 == 2 || O9 == 5 || O9 == 6 || O9 == 7 || O9 == 8 || O9 == 012 || O9 == 013);
    } ;
RadTreeView.prototype.DoubleClickDispatcher = function(e, O7)
    {
    var node = this.FindNode(O7);

    if (this.FireEvent(this.BeforeClientDoubleClick, node) == false)
        {
        return;
        }

    this.Toggle(O7);
    };
RadTreeView.prototype.MouseOverDispatcher = function(e, O7)
    {
    this.Hover(O7);
    } ;
RadTreeView.prototype.MouseOutDispatcher = function(e, O7)
    {
    this.UnHover(O7);
    } ;
RadTreeView.prototype.MouseDown = function(e)
    {
    if (this.LastHighlighted != null && this.DragAndDrop)
        {
        if (this.FireEvent(this.BeforeClientDrag, this.LastHighlighted) == false)
            return;

        if (!this.LastHighlighted.DragEnabled)
            return;

        if (e.button == 2)
            return;

        this.DragSource = this.LastHighlighted;
        this.DragClone = document.createElement("div");
        document.body.appendChild(this.DragClone);
        RadTreeView_DragActive = this;
        var l9 = "";

        if (this.MultipleSelect && (this.SelectedNodesCount() > 1))
            {
            for (var i = 0; i < this.AllNodes.length; i++)
                {
                if (this.AllNodes[i].Selected)
                    {
                    if (this.AllNodes[i].Image)
                        {
                        var img = this.AllNodes[i].ImageElement();
                        var i9 = img.cloneNode(true);
                        this.DragClone.appendChild(i9);
                        }

                    var I9 = this.AllNodes[i].TextElement().cloneNode(true);
                    I9.className = this.AllNodes[i].NodeCss;
                    I9.style.color = "gray";
                    this.DragClone.appendChild(I9);
                    this.DragClone.appendChild(document.createElement("BR"));
                    }

                l9 = l9 + "text";
                }
            }

        if (l9 == "")
            {
            if (this.LastHighlighted.Image)
                {
                var img = this.LastHighlighted.ImageElement();
                var i9 = img.cloneNode(true);
                this.DragClone.appendChild(i9);
                }

            var I9 = this.LastHighlighted.TextElement().cloneNode(true);
            I9.className = this.LastHighlighted.NodeCss;
            I9.style.color = "gray";
            this.DragClone.appendChild(I9);
            }

        this.DragClone.style.position = "absolute";
        this.DragClone.style.display = "none";

        if (e.preventDefault)
            {
            e.preventDefault();
            }
        }
    };
RadTreeView.prototype.SelectedNodesCount = function()
    {
    var count = 0;

    for (var i = 0; i < this.AllNodes.length; i++)
        {
        if (this.AllNodes[i].Selected)
            count++;
        }

    return count;
    };
RadTreeView.prototype.FireEvent = function(oa, a, b, Oa)
    {
    if (!oa)
        {
        return true;
        }

    RadTreeViewGlobalFirstParam = a;
    RadTreeViewGlobalSecondParam = b;
    RadTreeViewGlobalThirdParam = Oa;
    var s = oa
            + "(RadTreeViewGlobalFirstParam, RadTreeViewGlobalSecondParam, RadTreeViewGlobalThirdParam);";
    return eval(s);
    };
RadTreeView.prototype.Focus = function(e)
    {
    this.FireEvent(this.AfterClientFocus, this);
    } ;
RadTreeView.prototype.IsSet = function(a)
    {
    return (a != null && a != "");
    } ;
RadTreeView.prototype.la = function(ia)
    {
    var Ia = 0;

    if (ia.offsetParent)
        {
        while (ia.offsetParent)
            {
            Ia += ia.offsetLeft;
            ia = ia.offsetParent;
            }
        }

    else if (ia.x)
        Ia += ia.x;

    return Ia;
    };
RadTreeView.prototype.ob = function(ia)
    {
    var Ob = 0;

    if (ia.offsetParent)
        {
        while (ia.offsetParent)
            {
            Ob += ia.offsetTop;
            ia = ia.offsetParent;
            }
        }

    else if (ia.y)
        Ob += ia.y;

    return Ob;
    };
RadTreeView.prototype.K = function(lb, i0)
    {
    var ib = lb + "#" + i0;

    if (this.PostBackOptionsClientString)
        {
        var Ib = this.PostBackOptionsClientString.replace(/@@arguments@@/g, ib);

        if (typeof (WebForm_PostBackOptions) != "undefined"
                || Ib.indexOf("_doPostBack") > -1 || Ib.indexOf("AsyncRequest") > -1)
            {
            eval(Ib);
            }
        }

    else
        {
        if (this.CausesValidation)
            {
            if (!( typeof (Page_ClientValidate) != "function" || Page_ClientValidate()))
                {
                return;
                }
            }

       var oc = this.PostBackFunction.replace(/@@arguments@@/g, ib);
        eval(oc);
        }
    };
RadTreeView.prototype.I0 = function(param)
    {
    var Oc = param.replace(/'/g, "&squote");
    Oc = Oc.replace(/#/g, "&ssharp");
    Oc = Oc.replace(/:/g, "&scolon");
    Oc = Oc.replace(/\\/g, "\\\\");
    return Oc;
    };
function rtvIsAnyContextMenuVisible()
    {
    for (var key in tlrkTreeViews)
        if (( typeof (tlrkTreeViews[key]) != "function")
            && tlrkTreeViews[key].ContextMenuVisible)
            return true;

    return false;
    }
;
function rtvAdjustScroll()
    {
    if (RadTreeView_DragActive == null || RadTreeView_DragActive.DragClone == null)
        {
        return;
        }

    var lc = RadTreeView_Active;
    var ic = document.getElementById(RadTreeView_Active.Container);
    var Ic, od;
    Ic = lc.ob(ic);
    od = Ic + ic.offsetHeight;

    if ((RadTreeView_MouseY - Ic) < 062 && ic.scrollTop > 0)
        {
        ic.scrollTop = ic.scrollTop - 012;
        lc.Scroll();
        RadTreeView_ScrollTimeout = window.setTimeout(function()
            {
            rtvAdjustScroll();
            } ,                                       0144);
        }

    else if ((od - RadTreeView_MouseY) < 062 && ic.scrollTop < (ic.scrollHeight - ic.offsetHeight + 020))
        {
        ic.scrollTop = ic.scrollTop + 012;
        lc.Scroll();
        RadTreeView_ScrollTimeout = window.setTimeout(function()
            {
            rtvAdjustScroll();
            } ,                                       0144);
        }
    }
;
function rtvMouseUp(e)
    {
    if (RadTreeView_Active == null)
        return;

    if (e && !e.ctrlKey)
        {
        for (var key in tlrkTreeViews)
            {
            if (( typeof (tlrkTreeViews[key]) != "function")
                && tlrkTreeViews[key].ContextMenuVisible)
                {
                contextMenuToBeHidden = tlrkTreeViews[key];
                window.setTimeout(function()
                    {
                    if (contextMenuToBeHidden)
                        {
                        contextMenuToBeHidden.HideContextMenu();
                        }
                    },            012);

                return;
                }
            }
        }

    if (RadTreeView_DragActive == null || RadTreeView_DragActive.DragClone == null)
        {
        return;
        }

    (document.all) ? e.returnValue = false : e.preventDefault();
    var Od = RadTreeView_DragActive.DragSource;
    var ld = RadTreeView_Active.LastHighlighted;
    var oe = RadTreeView_Active;
    document.body.removeChild(RadTreeView_DragActive.DragClone);
    RadTreeView_DragActive.DragClone = null;

    if (ld != null && ld.DropEnabled == false)
        return;

    if (Od == ld)
        return;

    if (RadTreeView_DragActive.FireEvent(RadTreeView_DragActive.BeforeClientDrop, Od, ld, e) == false)
        return;

    if (Od.IsClientNode || ((ld != null) && ld.IsClientNode))
        return;

    var Oe = RadTreeView_DragActive.ClientID + "#" + Od.ClientID + "#";
    var le = "";

    if (ld == null)
        {
        le = "\x6e\x75\x6c\x6c" + "#" + RadTreeView_DragActive.HtmlElementID;
        }

    else
        {
        le = oe.ClientID + "#" + ld.ClientID;
        }

    if (ld == null && RadTreeView_DragActive.HtmlElementID == "")
        {
        return;
        }

    RadTreeView_DragActive.K("NodeDrop", Oe + le);
    RadTreeView_DragActive.FireEvent(RadTreeView_DragActive.AfterClientDrop, Od, ld, e);
    RadTreeView_DragActive = null;
    }
;
function rtvMouseMove(e)
    {
    if (rtvIsAnyContextMenuVisible())
        {
        return;
        }

    if (RadTreeView_DragActive != null && RadTreeView_DragActive.DragClone != null)
        {
        var ie, Ie;
        ie = RadTreeView_DragActive.o8(e) + 8;
        Ie = RadTreeView_DragActive.O8(e) + 4;
        RadTreeView_MouseY = Ie;
        rtvAdjustScroll();
        RadTreeView_DragActive.DragClone.style.zIndex = 01747;
        RadTreeView_DragActive.DragClone.style.top = Ie + "px";
        RadTreeView_DragActive.DragClone.style.left = ie + "px";
        RadTreeView_DragActive.DragClone.style.display = "block";
        RadTreeView_DragActive.FireEvent(RadTreeView_DragActive.AfterClientMove, e);
        (document.all) ? e.returnValue = false : e.preventDefault();
        }
    }
;
function rtvNodeExpand(a, id, of)
    {
    var Of = document.getElementById(id);
    var If = Of.scrollHeight;
    var og = (If - a) / of;
    var height = a + og;

    if (height > If - 1)
        {
        Of.style.height = "";
        Of.firstChild.style.position = "";
        }

    else
        {
        Of.style.height = height + "px";
        window.setTimeout(
            "rtvNodeExpand(" + height + "," + "'" + id + "'," + of
                + ");",
            5);
        }
    }
;
function rtvNodeCollapse(a, id, of)
    {
    var Of = document.getElementById(id);
    var If = Of.scrollHeight;
    var og = (If - Math.abs(If - a)) / of;
    var height = a - og;

    if (height <= 3)
        {
        Of.style.height = "";
        Of.style.display = "none";
        Of.firstChild.style.position = "";
        }

    else
        {
        Of.style.height = height + "px";
        window.setTimeout(
            "rtvNodeCollapse(" + height + "," + "'" + id
                + "'," + of + " );",
            5);
        }
    }
;
function rtvGetNodeID(e)
    {
    if (RadTreeView_Active == null)
        return;

    var target = (e.srcElement) ? e.srcElement : e.target;

    if (target.tagName == "IMG" && target.nextSibling)
        {
        var index = target.className;

        if (index)
            {
            index = parseInt(index);

            if (index > 014)
                {
                target = target.nextSibling;
                }
            }
        }

    while (target != null)
        {
        if ((target.tagName == "SPAN" || target.tagName == "A") && rtvInsideNode(target))
            {
            return target.parentNode.id;
            }

        target = target.parentNode;
        }

    return null;
    }
;
function rtvInsideNode(Og)
    {
    if (Og.parentNode && Og.parentNode.tagName == "DIV" && Og.parentNode.id.indexOf(RadTreeView_Active.ID) > -1)
        {
        return Og.parentNode.id;
        }
    }
;
function rtvDispatcher(t, w, e, l6, i6, I6)
    {
    if (!e)
        {
        e = window.event;
        }

    if (tlrkTreeViews)
        {
        var O7 = rtvGetNodeID(e);
        var lg = tlrkTreeViews[t];

        if (!lg.O2)
            return;

        if (rtvIsAnyContextMenuVisible() && w != "mclick" && w != "cclick")
            return;

        if (lg.EditMode)
            return;

        RadTreeView_Active = lg;

        switch (w)
            {
            case "mover":
                if (O7 != null)
                    lg.MouseOverDispatcher(e, O7);

                break;

            case "mout":
                if (O7 != null)
                    lg.MouseOutDispatcher(e, O7);

                break;

            case "mclick":
                lg.MouseClickDispatcher(e);

                break;

            case "mdclick":
                if (O7 != null)
                    lg.DoubleClickDispatcher(e, O7);

                break;

            case "mdown":
                lg.MouseDown(e);

                break;

            case "mup":
                lg.ig(e);

                break;

            case "context":
                if (O7 != null)
                    {
                    lg.ContextMenu(e, O7);
                    return false;
                    }

                break;

            case "cclick":
                lg.ContextMenuClick(e, l6, i6, I6);

                break;

            case "scroll":
                lg.Scroll(e);

                break;

            case "focus": lg.Focus(e);

            case "keydown": lg.KeyDown(e);
            }
        }
    }
;
function rtvAppendStyleSheet(o, I)
    {
    var Ig = (navigator.appName
                 == "Microsoft Internet Explorer")
            && ((navigator.userAgent.toLowerCase().indexOf(
                     "mac") != -1) || (navigator.appVersion.toLowerCase().indexOf("mac") != -1));
    var oh = (navigator.userAgent.toLowerCase().indexOf("safari") != -1);

    if (Ig || oh)
        {
        document.write("<" + "link"
                           + " rel='stylesheet' type='text/css' href='" + I
                           + "'>");
        }

    else
        {
        var U = document.createElement("LINK");
        U.rel = "stylesheet";
        U.type = "text/css";
        U.href = I;
        document.getElementById(o + "StyleSheetHolder").appendChild(U);
        }
    }
;
function rtvInsertHTML(Oh, html)
    {
    if (Oh.tagName == "A")
        {
        Oh = Oh.parentNode;
        }

    if (document.all)
        {
        Oh.insertAdjacentHTML("beforeEnd", html);
        }

    else
        {
        var r = Oh.ownerDocument.createRange();
        r.setStartBefore(Oh);
        var lh = r.createContextualFragment(html);
        Oh.appendChild(lh);
        }
    }

;

