﻿///<reference path="jquery/jquery-1.3.2.js"/>

//页面初始化
function default_onload() {
    if ($.browser.msie == true && $.browser.version == 6) correctPNG();
    bindChildNav();
    $(".NewsScroll").marquee();
}
function page_onload() {
    if ($.browser.msie == true && $.browser.version == 6) correctPNG();
    $(".NewsScroll").marquee();
}
/*产品*/
function bindChildNav() {
    var i = 0;
    var obj = $(".left_div ul li");
    for (i = 1; i <= obj.length; i++) {
        //obj[i - 1].onmouseover = new Function('showContent(this,' + i + ')');
        if (i % 8 == 0) continue;
        obj[i - 1].onclick = new Function('showContent(this,' + i + ')');
    }
    obj = $(".showFloatDiv_dd input");
    for (i = 1; i <= obj.length; i++) {
        if (i % 8 == 0) continue;
        if (i < 9) { obj[i - 1].onclick = new Function('showFloatDiv(' + i + ',1)'); }
        else { obj[i - 1].onclick = new Function('showFloatDiv(' + i + ',2)'); }
    }
}

function showChildNav(obj, value) {
    $(".rightMid .caption ul li").removeClass("hover");
    obj.className = "hover";
    $(".left_div ul").removeClass("hover");
    $("#childNav" + value).addClass("hover");
    //$("#childNav" + value + " .hover").mouseover();

    var obj = $("#childNav" + value + " li")[0];
    value = (value - 1) * 8 + 1;
    document.getElementById("#showContent" + value);
    showContent(obj, value);
}

function showContent(obj, value) {
    $(".left_div ul li").removeClass("hover");
    obj.className = "hover";
    $(".right_div dl").removeClass("hover");
    $("#showContent" + value).addClass("hover");
}
/*End产品*/

/*弹出层*/
function showFloatDiv(value, type) {
    $(".floatDivBG").width($("html").width());
    $(".floatDivBG").height($("body").height());
    $(".floatDivBG").css("display", "block");
    $(".floatDiv").css("left", 150 + ($("html").width() - 1024) / 2);
    $(".floatDiv").css("top", 130 + ($("html").scrollTop() | $("body").scrollTop()));
    $(".floatDiv").css("display", "block");
    $(".floatDiv table tbody tr").css("display", "none");
    if ($.browser.msie == true) { $(".floatDiv #tableShowContent" + value).css("display", "block"); }
    else { $(".floatDiv #tableShowContent" + value).css("display", "table-row"); }

    $("#userNum").val(value); //  .attr("value",value);
    if (type == null || type == undefined || type == 0) { $("#mailType").val(0); }
    else { $("#mailType").val(type); }
}
function hideFloatDiv() {
    $(".floatDivBG").css("display", "none");
    $(".floatDiv").css("display", "none");
}
function submitBtn() {
    var str = "不能为空";
    if ($("#companyName").val() == "") { alert("公司名称空" + str); return false; }
    if ($("#tel").val() == "") { alert("联系电话" + str); return false; }
    if ($("#domainName").val() == "") { alert("公司网址" + str); return false; }
    if ($("#email").val() == "") { alert("联系邮箱" + str); return false; }
    if ($("#linkName").val() == "") { alert("联系人" + str); return false; }
    if ($("#QQ").val() == "") { alert("QQ/MSN" + str); return false; }
    return true;
}

/*End弹出层*/

/*下拉框*/
function show(value) {
    var display = $(".content ._6s ." + value + " dd").css("display");

    if (display == "none") {
        $(".content ._6s ." + value + " dd").slideDown("fast");
        $("." + value + " .spanopen").text("点击收缩");
    }
    else {
        $(".content ._6s ." + value + " dd").hide();
        $("." + value + " .spanopen").text("点击展开");
    }


}
function show1(value) {
    var display = $(".content .youShi ." + value + " .hide").css("display");

    if (display == "none") {
        $(".content .youShi ." + value + " .hide").slideDown("fast");
        $("." + value + " .spanopen").text("点击收缩");
    }
    else {
        $(".content .youShi ." + value + " .hide").hide();
        $("." + value + " .spanopen").text("点击展开");
    }


}
/*End下拉框*/

function back() { history.go(-1); }

function changePage(obj) {
    var url = window.location;
    //静态页使用
    var patrn = /[_,\d]*.html/;
    if (patrn.exec(url)) {
        var str = url.pathname;
        str = str.replace(patrn, "_" + obj + ".html");
        url.pathname = str;
    }
    //End静态页使用
    else {
        var url = window.location.search;
        var patrn = /[\?,&]*page=\d+/;
        url = url.replace(patrn, "");
        if (url == "" || url == undefined || url == null) { url += 'page='; }
        else { url += '&page='; }

        if (obj.value == undefined || obj.value == null)
        { url += obj; }
        else
        { url += obj.value; }
        window.location.search = url;
    }
}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
    var arVersion = navigator.appVersion.split("MSIE")
    var version = parseFloat(arVersion[1])
    if ((version >= 5.5) && (document.body.filters)) {
        //alert("别再使用古董浏览器了，升级吧～～")
        for (var j = 0; j < document.images.length; j++) {
            var img = document.images[j]
            var imgName = img.src.toUpperCase()
            if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
                var imgID = (img.id) ? "id='" + img.id + "' " : ""
                var imgClass = (img.className) ? "class='" + img.className + "' " : ""
                var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
                var imgStyle = "display:inline-block;" + img.style.cssText
                if (img.align == "left") imgStyle = "float:left;" + imgStyle
                if (img.align == "right") imgStyle = "float:right;" + imgStyle
                if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
                var strNewHTML = "<span " + imgID + imgClass + imgTitle
             + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
             + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
                img.outerHTML = strNewHTML
                j = j - 1
            }
        }
    }
}
