//var currentTabC = "";

function tab(tabId, tabC) {

    var len = document.getElementById('left_content1').getElementsByTagName('li').length;

    for (i = 1; i <= len; i++) {
        if ("tabId" + i == tabId) {
            document.getElementById(tabId).className = "left_back_onclick";
        }
        else {
            document.getElementById("tabId" + i).className = "left_back";
        }

        if ("tabC" + i == tabC) {
            document.getElementById(tabC).className = "left_main_nav1";
        }
        else {
            document.getElementById("tabC" + i).className = "left_main_nav2";
        }
    }

    //currentTabC = tabC;
}

//点击菜单链接高亮显示
function highLightLink(obj) {
    //alert(99);
//    var tabC = currentTabC;
//    var ulList = document.getElementById(tabC).getElementsByTagName("ul");
//    for (var j = 0; j < ulList.length; j++) {
//        liList = ulList[j].getElementsByTagName("li");
//        for (var k = 0; k < liList.length; k++) {
//            liList[k].getElementsByTagName("a")[0].style.backgroundColor = "";
//        }
    //    }

    for (var i = 2; i <= 4; i++) {
        //var tabID = "#tabC" + i;
        var tabC = "tabC" + i;
        var ulList = document.getElementById(tabC).getElementsByTagName("ul");
        for (var j = 0; j < ulList.length; j++) {
            liList = ulList[j].getElementsByTagName("li");
            for (var k = 0; k < liList.length; k++) {
                //liList[k].onclick = highLightLink;
                liA = liList[k].getElementsByTagName("a");
                liA[0].style.backgroundColor = "";
            }
        }
    }

    event.srcElement.style.backgroundColor = "#e9cb73";
    
    //alert(event.srcElement.style.backgroundColor);    
}

$(document).ready(function() {
    for (var i = 2; i <= 4; i++) {
        //var tabID = "#tabC" + i;
        var tabC = "tabC" + i;
        var ulList = document.getElementById(tabC).getElementsByTagName("ul");
        for (var j = 0; j < ulList.length; j++) {
            liList = ulList[j].getElementsByTagName("li");
            for (var k = 0; k < liList.length; k++) {
                //liList[k].onclick = highLightLink;
                liA = liList[k].getElementsByTagName("a");
                liA[0].onclick = highLightLink;
            }            
        }
    }
});