// JavaScript Document

$(document).ready(function () {
    $(".ss_header").children().mouseover(function () {
        var obj = this.className;
        var arr = obj.split("1");
        if (obj == arr[0] && obj != "other") {
            $(this).attr("class", obj + "1");
            $(this).children().attr("class", "link1");
            $(this).siblings().each(function (i) {
                var class1 = this.className;
                var arr1 = class1.split("1");
                $(this).attr("class", arr1[0]);
                $(this).children().attr("class", "link");
            });
        }
    });
    $(".ss_header").children().eq(0).trigger("mouseover");


    $(".jrqy .jrqy_header").children().mouseover(function () {
        var obj = this.className;
        var arr = obj.split("1");
        if (obj == arr[0] && obj != "other") {
            $(this).attr("class", obj + "1");
            $(this).children().attr("class", "hdm2_link1");
            $(this).siblings().each(function (i) {
                var class1 = this.className;
                var arr1 = class1.split("1");
                $(this).attr("class", arr1[0]);
                $(this).children().attr("class", "hdm2_link");
            });
            $(".jrqy .jrqy_main").hide();
            $("#hdm2_" + obj).show();
        }
    });


    $(".yqlj .jrqy_header").children().mouseover(function () {
        var obj = this.className;
        var arr = obj.split("1");
        if (obj == arr[0] && obj != "other") {
            $(this).attr("class", obj + "1");
            $(this).children().attr("class", "hdm2_link1");
            $(this).siblings().each(function (i) {
                var class1 = this.className;
                var arr1 = class1.split("1");
                $(this).attr("class", arr1[0]);
                $(this).children().attr("class", "hdm2_link");
            });
            $(".yqlj .jrqy_main").hide();
            $("#hdm3_" + obj).show();
        }
    });

    $("#cphdm").children().mouseover(function () {
        var obj = this.className;
        var arr = obj.split("1");
        if (obj == arr[0] && obj != "other") {
            $(this).attr("class", obj + "1");
            $(this).children().attr("class", "hdm_link1");
            $(this).siblings().each(function (i) {
                var class1 = this.className;
                var arr1 = class1.split("1");
                $(this).attr("class", arr1[0]);
                $(this).children().attr("class", "hdm_link");
            });
            $(".mainbox").hide();
            $("#" + this.id + "a").show();
        }
    });
});

function login() {
    var uname = $("#Uname").val();
    var upwd = $("#Upwd").val();
    $.post("SMman.ashx?Login", { "uname": uname, "upwd": upwd }, function (data) {
        if (data == "µÇÂ¼³É¹¦") {
            window.location.href = 'sm_manage_gr.aspx';
        }        
    });
}

function searchcontent() {
    var title = $("#search").val();
    var type = $("input[name='stype']:checked").val();
    if (title == "") {
        window.location.reload();
    }
    else {
        window.location.href = 'sm_search.aspx?key=' + title + '&type=' + type;
    }

}

function searchhq() {
    var title = $("#Text1").val();
    if (title == "") {
        window.location.reload();
    }
    else {
        window.location.href = 'sm_search_hq.aspx?key=' + title;
    }
}
