// JScript 文件

//用Treeview chekbox节点单选的处理事件
function TreeSingleSelect(treeID,checkNode)
{
    if(!treeID)
    return;
    var objs = document.getElementsByTagName("input");
    for(var i=0;i<objs.length;i++)
    {
        if(objs[i].type=='checkbox')
        {
            var obj=objs[i];

            if(obj.id.indexOf(treeID)!=-1)
            {
                if(obj!=checkNode)
                {
                    obj.checked=false;
                }
            }
        }
    }    
}
//用于给TreeView的 chebox添加 单击事件(如果要将某一TreeView变为单选择 只需调用下面方法)
function SetTreeNodeClickHander(treeID)
{
    var objs = document.getElementsByTagName("input");
    for(var i=0;i<objs.length;i++)
    {
        if(objs[i].type=='checkbox')
        {
            var obj=objs[i];
            if(obj.id.indexOf(treeID)!=-1)
            {
                objs[i].onclick=function(){TreeSingleSelect(treeID,this);};
            }
        }
    }
}

function openwin()
{
    var text = document.getElementById("DepTree").getChildren().getAttribute("NodeData");  
    alert(text);

    var strValue=document.getElementById("DepTree").value;

    var url = "AddDepartment.aspx?id="+strValue+"";
    window.open(url);

}

    

