﻿//通用Tab切换
function __setTab(tabId, n) {
    var tli = $("li > a", document.getElementById(tabId));
    var containerTagName = "ul";
    var hoverClassName = "current";

    if (arguments.length > 2) {
        containerTagName = arguments[2];
    }

    if (arguments.length > 3) {//4个参数
        hoverClassName = arguments[3];
    }

    var mli = document.getElementById(tabId + "-div").getElementsByTagName(containerTagName);

    try {
        for (i = 0; i < tli.length; i++) {
            tli[i].className = i == n ? hoverClassName : "";
            mli[i].style.display = i == n ? "block" : "none";
        }
    } catch (e) {
        //alert(e.Message);
    }
}

//顶部导航菜单默认选中项函数
function __setInitMenuTab() {
    if (typeof (__currMenuIdentityKey) == 'undefined' || __currMenuIdentityKey == '') {
        __currMenuIdentityKey = 'default';
    }
    $("#" + __currMenuIdentityKey).attr("class", "upDef");
    $("#" + __currMenuIdentityKey + "-div").attr("style", "display:block");
}

//输出顶部Flash
function __writeHeaderFlash(headerDivId) {
    var so = new SWFObject("/_Layouts/Styles/Common/header.swf", "sotester","960", "160", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0", "#ffffff");
    so.addParam("quality", "high");
    so.addParam("wmode", "transparent");
    so.addParam("scale", "noborder");
    so.write(headerDivId);
}

//首页搜索-------------
function __bingosoftclearkeyword(obj) {
    var keyword = obj.value;
    if (keyword != undefined && keyword == "请输入关键字...") {
        obj.value = "";
    }
}

function __bingosoftsetkeyword(obj) {
    var keyword = obj.value;
    if (keyword != undefined && keyword == "") {
        obj.value = "请输入关键字...";
    }
}

function __bingosoftsearch(inputId) {
    var keyword = document.getElementById(inputId);
    if (keyword != undefined && (keyword.value == "" || keyword.value == "请输入关键字...")) {
        alert("请输入关键字!");
        return false;
    }
    window.open("/_layouts/ApplicationPages/Modules/Search/SearchIndex.aspx?q=" + encodeURI(keyword.value), "_bank");
}

function __bingosoftonsearch(obj) {
    if (event.keyCode == 13) {
        if (obj) {
            __bingosoftsearch(obj.id);
        }
    }
}
//首页搜索End--------------------------

//网上办事查询控件
function __srvSearchOpen() {
    var acceptNo = document.getElementById("txtAcceptNo");
    var acceptPwd = document.getElementById("txtAcceptPassword");

    if (acceptNo.value == "" || acceptNo.value == "请输入查询编号") {
        window.alert("请输入查询编号");
        return;
    }
    if (acceptPwd.value == "" || acceptPwd.value == "请输入查询密码") {
        window.alert("请输入查询密码");
        return;
    }

    window.open("http://xzfw.zhanjiang.gov.cn/outportal/login/BusinessView.aspx?close=true&ShouLiBianHao=" + acceptNo.value + "&ShouLiMiMa=" + acceptPwd.value, "", "height=400,width=500,toolbar=no, menubar=no,scrollbars=yes, resizable=yes,location=no, status=no");

    acceptNo.value = "请输入查询编号";
    acceptPwd.value = "请输入查询密码"
}
