// JScript 文件
//记录外部连接字符串（动态生成的控件中的值）
//用于回掉服务器

 function GetOutURL()
    {
        document.getElementById("txtOutURLHid").value = document.getElementById("txtOutURL").value;
    }
function GetPageType(obj_event)
    {
        if (obj_event == undefined)
            objEvent  = event.srcElement;   //IE
        else
            objEvent = obj_event;   //FireFox,Opera,Netscape
        document.getElementById("txtPageTypeHid").value = objEvent.id.substring(10,objEvent.id.length); 
    }
 function GetMenuType(e)
    {
        if (e == undefined)
            objEvent  = event.srcElement;   //IE
        else
            objEvent = e;   //FireFox,Opera,Netscape
        document.getElementById("txtMenuTypeHid").value = objEvent.value; 
    }
    
function getMenuId(objTag)
{
    if (objTag == undefined)    
        obj = event.srcElement;     //IE
    else 
        obj = objTag;               //FireFox,Opera,Netscape
    var ID = obj.selectedIndex;     
	document.getElementById("txtInURLHid").value = obj.options[ID].value;
}

function beginBind()
    {

       var obj = document.getElementsByTagName("input");
       
       for(var i=0;i<obj.length;i++)
       {
            if(obj[i].id.substring(0,10) == "RBPageType" && obj[i].checked == true)
            {
                document.getElementById("txtPageTypeHid").value = obj[i].id.substring(10,obj[i].id.length);
            }
            if(obj[i].id.substring(0,11) == "RBLMenuType" && obj[i].checked == true)
            {
                document.getElementById("txtMenuTypeHid").value = obj[i].value;
            }
       }
       
    }
    
function URL(url,cateID)
{
    if(url=='MenuManage/editsysMenu.aspx')//外部连接
    {
        parent.main.location.href = "editsysMenu.aspx?ID=" + cateID;
    }
    else
    {
    parent.main.location.href = "../" + url + "?cateID=" + cateID;
    }
}

 function validfid()
    {
       
       var obj1 = document.getElementById("optionHid");
        var s1;
        s1 = obj1.value;
       
       var obj2 = document.getElementById("ddlfType");
       var id = obj2.selectedIndex;
       var s2 = s1.split(',');
      
       for(var i=0;i<s2.length - 1;i++)
        {
            if(s2[i] == obj2.options[id].value)
            {
                alert("所属级别不能是自己或自己的子级！");
                return false;
            }   
       }
    }
////禁止右键菜单
document.oncontextmenu=function()
{
 //   return false;
}
////禁止选择
//document.onselectstart=function()
//{
//    return false;
//}
//document.onmousemove=function()
//{
//    return false;
//}
//document.onmousedown =function()
//{
//    return false;
//}
////禁止拖动
//document.ondragstart=function()
//{
//    return false;
//}