﻿function getCookie(name)//取cookies函数        
{

    var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));

    if (arr != null) return unescape(arr[2]); return null;
}


function getmenuPop2String(path, level) {//更改横导航条链接函数
    var leveltype = "";
    if (level == "2") {
        leveltype = "manager";
    }
    else if (level == "3") {
        leveltype = "allinfo";
    }
    else if(level == "1") {
        leveltype = "common";
    }
    var patharr = path.split('.');
    return patharr[0] + leveltype + "." + patharr[1];
}
//alert(getCookie("UserLogin"));
var userlogin = getCookie("UserLogin");
var loginlev = "0";
if (userlogin != null) {
    loginlev = userlogin.split('&').toString().substring(userlogin.length - 1);
}

/*帮所有横导航加权限     START*/
var headerUrlarr = $(".menunews");

for (var j = 0; j < headerUrlarr.length; j++) {
    var a_object = headerUrlarr.eq(j).children("ul").children("li").children("a");
    
    for (var x = 0; x < a_object.length; x++) {
        a_object.eq(x).attr("href", getmenuPop2String(a_object.eq(x).attr("href"), loginlev));
       
    }
}

$("#li91 a").attr("href","History.aspx");
//alert(headerUrlarr.length);
/*帮所有横导航加权限     END*/

/*导航连接--start--*/
$(document).ready(function () {
    $(".menuPop_02").each(function () {
        $(this).parent().find("a").eq(0).attr("href", $(this).find("a").attr("href"));
    });
    $(".two a").click(function () {
        if ($(this).parent().find("ul").css("display") == "none") {
            $(this).parent().find("ul").show();
        } else {
            $(this).parent().find("ul").hide();
        }

    });
});
/*结束--end--*/

