var menuindex = 1;
var menuin = 1;

$(document).ready(function () {
    $("#t1").mousemove(function () { checktip(1); });
    $("#t2").mousemove(function () { checktip(2); });
    $("#t3").mousemove(function () { checktip(3); });
    $("#t4").mousemove(function () { checktip(4); });
    $("#t5").mousemove(function () { checktip(5); });
    $("#t6").mousemove(function () { checktip(6); });
    $("#t7").mousemove(function () { checktip(7); });
    $("#t8").mousemove(function () { checktip(8); });
    $("#t1").click(function () { location.href = "/index.asp"; });
    $("#t2").click(function () { location.href = "/about.asp"; });
    $("#t3").click(function () { location.href = "/news.asp"; });
    $("#t4").click(function () { location.href = "/products.asp"; });
    $("#t5").click(function () { location.href = "/equipment.asp"; });
    $("#t6").click(function () { location.href = "/join.asp"; });
    $("#t7").click(function () { location.href = "/order.asp"; });
    $("#t8").click(function () { location.href = "/contact.asp"; });

    //$(".top_menu_m").mouseout(function () { nowurl(); });
    $(".top").hover(function () { }, function () { nowurl(); });
    $(".top_banner").hover(function () { nowurl(); });
    nowindex();
    nowurl();
});

function checktip(index) {
    $("#tip" + menuin).hide();
    $("#t" + menuin).css("background-image", "");
    $("#t" + menuin).css("color", "#000");
    $("#t" + index).css("background-image", "url(/images/menufocus.gif)");
    $("#t" + index).css("color", "#fff");
    $("#tip" + index).css("margin-left", 100*index);
    $("#tip" + index).css("display", "block");
    $("#tip" + index).show();
    menuin = index;
}

function distip(index) {
    $("#t" + index).css("background-image", "");
    $("#tip" + index).css("display", "none");
    nowurl();
}

function nowurl() {
	
    checktip(menuindex);
	
}

function nowindex() {
	
    var url = window.location.href;
    if (url.indexOf("index.asp") > -1) {
        menuindex = 1;
    }
   else if (url.indexOf("about.asp") > -1 || url.indexOf("ldzc.asp") > -1 || url.indexOf("culture.asp") > -1 || url.indexOf("honor.asp") > -1 || url.indexOf("fzlc.asp") > -1 || url.indexOf("job.asp") > -1 || url.indexOf("human.asp") > -1) {
        menuindex = 2;
    }
    else if (url.indexOf("news.asp") > -1 ) {
        menuindex = 3;
    }
    else if (url.indexOf("products.asp") > -1 || url.indexOf("cpzt.asp") > -1 || url.indexOf("down.asp") > -1  ) {
        menuindex = 4;
    }
    else if (url.indexOf("equipment.asp") > -1 || url.indexOf("Quility.asp") > -1  ) {
        menuindex = 5;
    }
    else if (url.indexOf("join.asp") > -1 ) {
        menuindex = 6;
    }
    else if (url.indexOf("order.asp") > -1) {
        menuindex = 7;
    }
    else if (url.indexOf("contact.asp") > -1) {
        menuindex = 8;
    }
	distip(menuindex);
    menuin = menuindex;
}


