﻿

try {

    var url = window.location.href;
    var index = url.indexOf(".aspx");
    var pageName = url.substring(url.lastIndexOf("/") + 1, index).toLowerCase();

    if (pageName.length > 0) {

        switch (pageName) {
            case "index":
                pageSel(1);
                break;
            case "about":
                pageSel(2);
                break;
            case "technology":
                pageSel(3);
                break;
            case "manage":
                pageSel(4);
                break;
            case "producttype":
                pageSel(5);
                break; 
            case "product":
                pageSel(5);
                break;
            case "Productinfo":
                pageSel(5);
                break; 
            case "caseinfo":
                pageSel(6);
                break;
            case "casetype":
                pageSel(6);
                break;
            case "news":
                pageSel(7);
                break;
            case "newstype":
                pageSel(7);
                break; 
                
            case "ir":
                pageSel(8);
                break;
            case "contact":
                pageSel(9);
                break; 
            default:
                $("#mainNav ul li a").removeClass("t");
                break;
        }
    }

}
catch (Exception) {

}



function pageSel(tabNum) {
   
    $("#mainNav ul li a").removeClass("t");

    $("#topindex" + tabNum).addClass("t");


}
//menu
$(document).ready(function() {
     
      
        $('li.mainlevel').mousemove(function() {
            $(this).find('ul').slideDown(200); //you can give it a speed
        });
        $('li.mainlevel').mouseleave(function() {
            $(this).find('ul').slideUp("fast");
        }); 
});


////////////////////////////

function showMav() {
    var retIndox = 0;
    for (var i = 1; i <= 8; i++) {
        retIndox = mun(i);
    }
    if (retIndox == 8)
        return true;
    return false;
}



function mun(id) {
    alert("id=" + id);
    $.ajax({//一个Ajax过程
        type: "POST", //以post方式与后台沟通
        url: "Tools/Ajax/pageAjax.ashx", //与此ashx页面沟通
        dataType: 'text', //从 返回的值以 方式 解释
        data: 'action=mun&id=' + id,
        cache: false,
        success: function(msg) {//注意msg是返回的对象，这个你可以自定义

            if (msg != null) {
                //渐渐加载 
                alert(msg);
                $("#mav" + id).append(msg);
                return id;
            }
        }
    });

}


