﻿$(function () {



    //产品目录层开始

    //产品目录结束

    //二级菜单开始
    $("#li_nav1").mouseover(function () {
        $("#nav_1").show();
        $("#nav_1").css({ "left": $("#li_nav1").offset().left - 100, "top": $("#li_nav1").offset().top + $("#li_nav1").height() });
    });
    $("#li_nav1").mouseout(function () {
        $("#nav_1").hide();
    });
    $("#nav_1").mouseover(function () {
        $("#nav_1").show();
    });
    $("#nav_1").mouseout(function () {
        $("#nav_1").hide();
    });

    $("#li_nav2").mouseover(function () {
        $("#nav_2").show();
        $("#nav_2").css({ "left": $("#li_nav2").offset().left - 140, "top": $("#li_nav2").offset().top + $("#li_nav2").height() });
    });
    $("#li_nav2").mouseout(function () {
        $("#nav_2").hide();
    });
    $("#nav_2").mouseover(function () {
        $("#nav_2").show();
    });
    $("#nav_2").mouseout(function () {
        $("#nav_2").hide();
    });

    $("#li_nav3").mouseover(function () {
        $("#nav_3").show();
        $("#nav_3").css({ "left": $("#li_nav3").offset().left - 100, "top": $("#li_nav3").offset().top + $("#li_nav3").height() });
    });
    $("#li_nav3").mouseout(function () {
        $("#nav_3").hide();
    });
    $("#nav_3").mouseover(function () {
        $("#nav_3").show();
    });
    $("#nav_3").mouseout(function () {
        $("#nav_3").hide();
    });

    $("#li_nav4").mouseover(function () {
        $("#nav_4").show();
        $("#nav_4").css({ "left": $("#li_nav4").offset().left - 110, "top": $("#li_nav4").offset().top + $("#li_nav4").height() });
    });
    $("#li_nav4").mouseout(function () {
        $("#nav_4").hide();
    });
    $("#nav_4").mouseover(function () {
        $("#nav_4").show();
    });
    $("#nav_4").mouseout(function () {
        $("#nav_4").hide();
    });

    $("#li_nav5").mouseover(function () {
        $("#nav_5").show();
        $("#nav_5").css({ "left": $("#li_nav5").offset().left - 110, "top": $("#li_nav5").offset().top + $("#li_nav5").height() });

    });
    $("#li_nav5").mouseout(function () {
        $("#nav_5").hide();
    });
    $("#nav_5").mouseover(function () {
        $("#nav_5").show();
    });
    $("#nav_5").mouseout(function () {
        $("#nav_5").hide();
    });

    $("#li_nav6").mouseover(function () {
        $("#nav_6").show();
        $("#nav_6").css({ "left": $("#li_nav6").offset().left + 600, "top": $("#li_nav6").offset().top - 10 });
        document.getElementById("li_nav6").className = "li_nav66";
    });
    $("#li_nav6").mouseout(function () {
        $("#nav_6").hide();
        document.getElementById("li_nav6").className = "";
    });
    $("#nav_6").mouseover(function () {
        $("#nav_6").show();
        $("#nav_3").show();
        document.getElementById("li_nav6").className = "li_nav66";
    });
    $("#nav_6").mouseout(function () {
        $("#nav_6").hide();
        $("#nav_3").hide();
        document.getElementById("li_nav6").className = "";
    });
    //二级导航结束

    $("#womailimg").mouseover(function () {
        $("#img1select").show();
        $("#unimg1select").hide();
        $("#img2select").hide();
        $("#unimg2select").show();

        $("#womaillogin").show();
        $("#viplogin").hide();
    });

    $("#vipimg").mouseover(function () {
        $("#img2select").show();
        $("#unimg2select").hide();
        $("#img1select").hide();
        $("#unimg1select").show();

        $("#womaillogin").hide();
        $("#viplogin").show();
    });

    $("#womail").click(function () {
        document.getElementById("womaildiv").style.display = "block";
        document.getElementById("womail").className = "LOnBg";
        document.getElementById("vipdiv").style.display = "none";
        document.getElementById("vip").className = "LOffBg";
    });

    $("#vip").click(function () {
        document.getElementById("womaildiv").style.display = "none";
        document.getElementById("womail").className = "LOffBg";
        document.getElementById("vipdiv").style.display = "block";
        document.getElementById("vip").className = "LOnBg";
    });

    $("#ywtja").click(function () {
        document.getElementById("ywtjdiv").style.display = "block";
        document.getElementById("ywtja").className = "ywOn";
        document.getElementById("mfywdiv").style.display = "none";
        document.getElementById("mfywa").className = "ywOff";
        document.getElementById("dgbhdiv").style.display = "none";
        document.getElementById("dgbha").className = "ywOff";
    });

    $("#mfywa").click(function () {
        document.getElementById("ywtjdiv").style.display = "none";
        document.getElementById("ywtja").className = "ywoff1";
        document.getElementById("mfywdiv").style.display = "block";
        document.getElementById("mfywa").className = "ywOn1";
        document.getElementById("dgbhdiv").style.display = "none";
        document.getElementById("dgbha").className = "ywOff";
    });

    $("#dgbha").click(function () {
        document.getElementById("ywtjdiv").style.display = "none";
        document.getElementById("ywtja").className = "ywOff ywoff2";
        document.getElementById("mfywdiv").style.display = "none";
        document.getElementById("mfywa").className = "";
        document.getElementById("dgbhdiv").style.display = "block";
        document.getElementById("dgbha").className = "ywOn2";
    });


    //登录切换
    $("#sendmessagea").click(function () {
        document.getElementById("sendmessagediv").style.display = "block";
        document.getElementById("sendmessagea").className = "LOnBg";


        document.getElementById("mobilelogina").className = "LOffBg";
        document.getElementById("vipdiv").style.display = "none";
    });
    $("#mobilelogina").click(function () {
        document.getElementById("sendmessagediv").style.display = "none";
        document.getElementById("sendmessagea").className = "LOffBg";


        document.getElementById("mobilelogina").className = "LOnBg";
        document.getElementById("vipdiv").style.display = "block";
    });

    //登录切换


    //116114下载切换

    $("#DownLoad1a").click(function () {
        document.getElementById("DownLoadDiv1").style.display = "block";
        document.getElementById("DownLoad1a").className = "LOnBg";


        document.getElementById("DownLoad2a").className = "LOffBg";
        document.getElementById("DownLoadDiv2").style.display = "none";
        document.getElementById("DownLoad3a").className = "LOffBg";
        document.getElementById("DownLoadDiv3").style.display = "none";
    });
    $("#DownLoad2a").click(function () {
        document.getElementById("DownLoadDiv2").style.display = "block";
        document.getElementById("DownLoad2a").className = "LOnBg";


        document.getElementById("DownLoad1a").className = "LOffBg";
        document.getElementById("DownLoadDiv1").style.display = "none";
        document.getElementById("DownLoad3a").className = "LOffBg";
        document.getElementById("DownLoadDiv3").style.display = "none";
    });
    $("#DownLoad3a").click(function () {
        document.getElementById("DownLoadDiv3").style.display = "block";
        document.getElementById("DownLoad3a").className = "LOnBg";


        document.getElementById("DownLoad1a").className = "LOffBg";
        document.getElementById("DownLoadDiv1").style.display = "none";
        document.getElementById("DownLoad2a").className = "LOffBg";
        document.getElementById("DownLoadDiv2").style.display = "none";
    });


    //116114下载切换



    $searchindex = $("#search_index li");
    $KinSlideshow = $("#KinSlideshow");
    $KinSlideshow.KinSlideshow({
        moveStyle: "down",
        intervalTime: 5,
        mouseEvent: "mouseover",
        isHasTitleBar: true,
        titleFont: { TitleFont_size: 12, TitleFont_color: "#ffffff" },
        titleBar: { titleBar_height: 30, titleBar_bgColor: "#333333", titleBar_alpha: 0 },
        btn: { btn_bgColor: "#333333", btn_bgHoverColor: "#ff7200",
            btn_fontColor: "#CCCCCC", btn_fontHoverColor: "#000000", btn_fontFamily: "Verdana",
            btn_borderColor: "#999999", btn_borderHoverColor: "#FF0000",
            btn_borderWidth: 0, btn_bgAlpha: 0.7
        }
    });

    $searchindex.click(function () {
        $searchindex.each(function () {
            $(this).attr("Class", "soOff");
        });
        $(this).attr("Class", "soOn");
    });

    $("#regbtn").click(function () {
        window.open('http://mail.wo.com.cn/smsmail/register.jsp')
    });

    $("#login_btn").click(function () {
        window.open('http://mail.wo.com.cn/smsmail/j_login')
    });

    $("#bmfw").click(function () {
        window.open('http://info.10010.com/services/index.html')
    });

    $("#ltkx").click(function () {
        window.open('http://www.chinaunicom.com.cn/news/index.html')
    });

    $("#ltrt").click(function () {
        window.open('http://www.wosai3g.com/bbs/')
    });
});

function switchmodTag(modtag, modcontent, modk) {
    for (i = 1; i < 3; i++) {
        if (i == modk) {
            document.getElementById(modtag + i).className = "menuOn"; document.getElementById(modcontent + i).className = "slidingList";
        }
        else {
            document.getElementById(modtag + i).className = "menuNo"; document.getElementById(modcontent + i).className = "slidingList_none";
        }
    }
}

function nTabs(thisObj, Num) {
    if (thisObj.className == "active") return;
    var tabObj = thisObj.parentNode.id;
    var tabList = document.getElementById(tabObj).getElementsByTagName("li");
    for (i = 0; i < tabList.length; i++) {
        if (i == Num) {
            thisObj.className = "active";
            document.getElementById(tabObj + "_Con" + i).style.display = "block";
        } else {
            tabList[i].className = "normal";
            document.getElementById(tabObj + "_Con" + i).style.display = "none";
        }
    }
}


/*搜索*/
//chooseOne()函式，參數為觸發該函式的元素本身   
function inputcheckedOne(cb) {
    //先取得同name的chekcBox的集合物件   
    var obj = document.getElementsByName("types");
    for (i = 0; i < obj.length; i++) {
        //判斷obj集合中的i元素是否為cb，若否則表示未被點選   
        if (obj[i] != cb) obj[i].checked = false;
        //若是 但原先未被勾選 則變成勾選；反之 則變為未勾選
        else  obj[i].checked = cb.checked;   
        //若要至少勾選一個的話，則把上面那行else拿掉，換用下面那行   
        //else obj[i].checked = true;
    }
    if (document.getElementsByName("ss_submit")[0].value != "请输入您要搜索的关键字或者选择搜索类别") {
        document.getElementsByName("ss_submit")[0].style.color = '#ccc';
        document.getElementsByName("ss_submit")[0].value = "请输入您要搜索的关键字或者选择搜索类别";
    }
}

function inputOne(cb) {
    //先取得同name的chekcBox的集合物件   
    var obj = document.getElementsByName("types");
    for (i = 0; i < obj.length; i++) {
        //判斷obj集合中的i元素是否為cb，若否則表示未被點選   
        if (obj[i] != cb) obj[i].checked = false;
        //若是 但原先未被勾選 則變成勾選；反之 則變為未勾選
        else obj[i].checked = cb.checked;
        //若要至少勾選一個的話，則把上面那行else拿掉，換用下面那行   
        //else obj[i].checked = true;
    }
} 

function ss_open() {
    var sg;
    var jc;
    var sw;
    var yl;
    var qt;
    var search = document.getElementsByName("ss_submit")[0].value;
    if (search != "请输入您要搜索的关键字或者选择搜索类别") {
        window.open('http://live.wosai3g.com/search.aspx?search=' + search);
        document.getElementsByName("ss_submit")[0].style.color = '#ccc';
        document.getElementsByName("ss_submit")[0].value = "请输入您要搜索的关键字或者选择搜索类别";
        return;
    }
    
    if (document.getElementById("sg").checked == true) {
        sg = document.getElementById("sg").value;
        window.open('http://live.wosai3g.com/search.aspx?tid=' + sg);
        return;
    }
    if (document.getElementById("jc").checked == true) {
        jc = document.getElementById("jc").value;
        window.open('http://live.wosai3g.com/search.aspx?tid=' + jc);
        return;
    }
    if (document.getElementById("sw").checked == true) {
        sw = document.getElementById("sw").value;
        window.open('http://live.wosai3g.com/search.aspx?tid=' + sw);
        return;
    }
    if (document.getElementById("yl").checked == true) {
        yl = document.getElementById("yl").value;
        window.open('http://live.wosai3g.com/search.aspx?tid=' + yl);
        return;
    }
    if (document.getElementById("qt").checked == true) {
        qt = document.getElementById("qt").value;
        window.open('http://live.wosai3g.com/search.aspx?tid=' + qt);
        return;
    }
    
}

 function The_date() {
     var Today = new Date();
     var year = Today.getYear();
     year = (year < 1900 ? (1900 + year) : year);
     var month = Today.getMonth();
     var date = Today.getDate();
     var day = Today.getDay();

     switch (day) {
         case 1: day = "星期一"; break;
         case 2: day = "星期二"; break;
         case 3: day = "星期三"; break;
         case 4: day = "星期四"; break;
         case 5: day = "星期五"; break;
         case 6: day = "星期六"; break;
         case 0: day = "星期日"; break;
     }
     document.write(year + "年");
     document.write(month + 1);
     document.write("月" + date + "日");
     document.write("&nbsp;&nbsp;" + day);
 }



