﻿function search1(module) {

    var stQuery = "";
    var seprator = '&';
    var keyword = "";
    var url = "";
    if (module == "supply") {
        keyword = Trim(document.getElementById("SupplyNavigation_new1_keyword").value);

        if (keyword != "" && keyword != "在此输入搜索关键字") {
            stQuery += "keyword=" + escape(keyword) + seprator;
        }
        //zjs
        //        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaNameByBox").value != "") {
        //            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + "_" + document.getElementById("selAreaLayer").value + "_" + escape(document.getElementById("selAreaNameByBox").value) + seprator;
        //        }
        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "") {
            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + seprator;
        }
        if (document.getElementById('selSearchDate').value != "") {
            stQuery += "date=" + document.getElementById('selSearchDate').value;
        }
        if (stQuery.length > 0) {
            location.href = "/CN/Product/Supply/SupplyList.aspx?" + stQuery;
        } else {
            location.href = "/CN/Product/Supply/SupplyList.aspx";
        }
    } else if (module == "gift") {
        keyword = Trim(document.getElementById("GiftNavigation1_keyword").value);
        //商品名称
        if (keyword != "" && keyword != "在此输入搜索关键字") {
            stQuery += "keyword=" + escape(keyword) + seprator;
        }
        //价格区间
        if (document.getElementById("GiftNavigation1_minPricetxt").value != ""
            && document.getElementById("GiftNavigation1_minPricetxt").value != ""
            && document.getElementById("GiftNavigation1_maxPricetxt").value != ""
            && document.getElementById("GiftNavigation1_maxPricetxt").value != "") {
            stQuery += "minPrice=" + document.getElementById("GiftNavigation1_minPricetxt").value + seprator;
            stQuery += "maxPrice=" + document.getElementById("GiftNavigation1_maxPricetxt").value + seprator;
        }
        //品牌
        if (document.getElementById("GiftNavigation1_brandtxt").value != "" && document.getElementById("GiftNavigation1_brandtxt").value != "") {
            stQuery += "brand=" + document.getElementById("GiftNavigation1_brandtxt").value + seprator;
        }
        //地区
        if (document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaIdByBox").value != "") {
            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + seprator;
        }
        //日期
        if (document.getElementById('selSearchDate').value != "") {
            stQuery += "date=" + document.getElementById('selSearchDate').value;
        }
        if (stQuery.length > 0) {
            location.href = "/CN/Gift/GiftList.aspx?" + stQuery;
        } else {
            location.href = "/CN/Gift/GiftList.aspx";
        }
    } else if (module == "buy") {
    keyword = Trim(document.getElementById("ProductNavigation_new1_keyword").value);
        if (keyword != "" && keyword != "在此输入搜索关键字") {
            stQuery += "keyword=" + escape(keyword) + seprator;
        }
        //        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaNameByBox").value != "") {
        //            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + "_" + document.getElementById("selAreaLayer").value + "_" + escape(document.getElementById("selAreaNameByBox").value) + seprator;
        //        }

        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "") {
            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + seprator;
        }

        if (document.getElementById('selSearchDate').value != "") {
            stQuery += "date=" + document.getElementById('selSearchDate').value + seprator;
        }

        if (document.getElementById("selregion").value == "0") {
            url = "/CN/Product/Buy/BuyList.aspx";
        }
        else if (document.getElementById("selregion").value == "1")
            url = "/CN/Product/Buy/GovProDemand.aspx";
        else
            url = "/CN/Product/Buy/NewOrder.aspx";

        stQuery += "type=" + document.getElementById("selregion").value;
        if (stQuery.length > 0) {
            location.href = url + "?" + stQuery;
        } else {
            location.href = url;
        }
    }


    else if (module == "gov") {


        keyword = Trim(document.getElementById("GovTop1_keyword").value);
        if (keyword != "" && keyword != "在此输入搜索关键字") {
            stQuery += "keyword=" + escape(keyword) + seprator;
        }
        //        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaNameByBox").value != "") {
        //            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + "_" + document.getElementById("selAreaLayer").value + "_" + escape(document.getElementById("selAreaNameByBox").value) + seprator;
        //        }

        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "") {
            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + seprator;
        }

        if (document.getElementById('selSearchDate').value != "") {
            stQuery += "date=" + document.getElementById('selSearchDate').value;
        }
        if (stQuery.length > 0) {
            location.href = "/CN/Product/Buy/BuyList.aspx?" + stQuery;
        } else {
            location.href = "/CN/Product/Buy/BuyList.aspx";
        }
    }

    else if (module == "TeamBuy") {


        keyword = Trim(document.getElementById("TeamBuyNavigation1_keyword").value);
        if (keyword != "" && keyword != "在此输入搜索关键字") {
            stQuery += "keyword=" + escape(keyword) + seprator;
        }
        //        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaNameByBox").value != "") {
        //            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + "_" + document.getElementById("selAreaLayer").value + "_" + escape(document.getElementById("selAreaNameByBox").value) + seprator;
        //        }

        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "") {
            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + seprator;
        }

        if (document.getElementById('selSearchDate').value != "") {
            stQuery += "date=" + document.getElementById('selSearchDate').value;
        }
        if (stQuery.length > 0) {
            location.href = "/CN/Product/Buy/BuyList.aspx?" + stQuery;
        } else {
            location.href = "/CN/Product/Buy/BuyList.aspx";
        }
    }

    else if (module == "ent") {

        keyword = Trim(document.getElementById("EnterpriseNavigation1_keyword").value);
        if (keyword != "" && keyword != "在此输入搜索关键字") {
            stQuery += "keyword=" + escape(keyword) + seprator;
        }

        //        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaNameByBox").value != "") {
        //            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + "_" + document.getElementById("selAreaLayer").value + "_" + escape(document.getElementById("selAreaNameByBox").value) + seprator;
        //        }

        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "") {
            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + seprator;
        }

        if (document.getElementById('selSearchDate').value != "") {
            stQuery += "date=" + document.getElementById('selSearchDate').value + seprator;
        }

        if (stQuery.length > 0) {
            location.href = "/CN/Ent/Supply/SupplierList.aspx?" + stQuery;
        } else {
            location.href = "/CN/Ent/Supply/SupplierList.aspx";
        }
    }

    else if (module == "news") {

    keyword = document.getElementById("Biznavigation_new1_keyword").value;

        if (keyword != "" && keyword != "在此输入搜索关键字") {
            stQuery += "keyword=" + escape(keyword) + seprator;
        }

        if (document.getElementById('selSearchDate').value != "") {
            stQuery += "date=" + document.getElementById('selSearchDate').value + seprator;
        }

        if (stQuery.length > 0) {
            location.href = "/CN/Biz/BizList.aspx?" + stQuery;
        } else {
            location.href = "/CN/Biz/BizList.aspx";
        }
    } else if (module == "index") {
        keyword = Trim(document.getElementById("IndexNavigation1_keyword").value);

        if (keyword != "" && keyword != "在此输入搜索关键字") {
            stQuery += "keyword=" + escape(keyword) + seprator;
        }


        //        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaNameByBox").value != "") {
        //            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + "_" + document.getElementById("selAreaLayer").value + "_" + escape(document.getElementById("selAreaNameByBox").value) + seprator;
        //        }

        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "") {
            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + seprator;
        }


        if (document.getElementById('selSearchDate').value != "") {
            stQuery += "date=" + document.getElementById('selSearchDate').value + seprator;
        }

        type = document.getElementById("SelType").value;


        if (type == "supply") {
            if (stQuery.length > 0) {
                location.href = "/CN/Product/Supply/SupplyList.aspx?" + stQuery;
            } else {
                location.href = "/CN/Product/Supply/SupplyList.aspx";
            }
        } else if (type == "buy") {
            if (stQuery.length > 0) {
                location.href = "/CN/Product/Buy/BuyList.aspx?" + stQuery;
            } else {
                location.href = "/CN/Product/Buy/BuyList.aspx";
            }
        } else if (type == "enterprise") {


            if (stQuery.length > 0) {
                location.href = "/CN/Ent/Supply/SupplierList.aspx?" + stQuery;
            } else {
                location.href = "/CN/Ent/Supply/SupplierList.aspx";
            }
        } else if (type == "exposition") {
            if (stQuery.length > 0) {
                location.href = "/CN/Exp/Exposition/ExpInfo.aspx?" + stQuery;
            } else {
                location.href = "/CN/Exp/Exposition/ExpInfo.aspx";
            }
        } else if (type == "news") {
            if (stQuery.length > 0) {
                location.href = "/cn/Biz/BizList.aspx?" + stQuery;
            } else {
                location.href = "/cn/Biz/BizList.aspx";
            }
        }

    } else if (module == "index1") {
        keyword = Trim(document.getElementById("IndexNavigation_new1_keyword").value);
        if (keyword != "" && keyword != "在此输入搜索关键字") {
            stQuery += "keyword=" + escape(keyword) + seprator;
        }


        //        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaNameByBox").value != "") {
        //            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + "_" + document.getElementById("selAreaLayer").value + "_" + escape(document.getElementById("selAreaNameByBox").value) + seprator;
        //        }

        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "") {
            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + seprator;
        }


        if (document.getElementById('selSearchDate').value != "") {
            stQuery += "date=" + document.getElementById('selSearchDate').value + seprator;
        }

        type = document.getElementById("SelType").value;


        if (type == "supply") {
            if (stQuery.length > 0) {
                location.href = "/CN/Product/Supply/SupplyList.aspx?" + stQuery;
            } else {
                location.href = "/CN/Product/Supply/SupplyList.aspx";
            }
        } else if (type == "buy") {
            if (stQuery.length > 0) {
                location.href = "/CN/Product/Buy/BuyList.aspx?" + stQuery;
            } else {
                location.href = "/CN/Product/Buy/BuyList.aspx";
            }
        } else if (type == "enterprise") {


            if (stQuery.length > 0) {
                location.href = "/CN/Ent/Supply/SupplierList.aspx?" + stQuery;
            } else {
                location.href = "/CN/Ent/Supply/SupplierList.aspx";
            }
        } else if (type == "exposition") {
            if (stQuery.length > 0) {
                location.href = "/CN/Exp/Exposition/ExpInfo.aspx?" + stQuery;
            } else {
                location.href = "/CN/Exp/Exposition/ExpInfo.aspx";
            }
        } else if (type == "news") {
            if (stQuery.length > 0) {
                location.href = "/cn/Biz/BizList.aspx?" + stQuery;
            } else {
                location.href = "/cn/Biz/BizList.aspx";
            }
        }

    } else if (module == "baDaHangYe") {
        keyword = Trim(document.getElementById('DgTop_new1_keyword').value);
        if (keyword != "" && keyword != "在此输入搜索关键字") {
            stQuery += "keyword=" + escape(keyword) + seprator;
        }


        //        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaIdByBox").value != "" && document.getElementById("selAreaNameByBox").value != "") {
        //            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + "_" + document.getElementById("selAreaLayer").value + "_" + escape(document.getElementById("selAreaNameByBox").value) + seprator;
        //        }

        if (document.getElementById("selAreaIdByBox").value != "0" && document.getElementById("selAreaIdByBox").value != "") {
            stQuery += "region=" + document.getElementById("selAreaIdByBox").value + seprator;
        }


        if (document.getElementById('selSearchDate').value != "") {
            stQuery += "date=" + document.getElementById('selSearchDate').value + seprator;
        }

        type = document.getElementById("SelType").value;


        if (type == "supply") {
            if (stQuery.length > 0) {
                location.href = "/CN/Product/Supply/SupplyList.aspx?" + stQuery;
            } else {
                location.href = "/CN/Product/Supply/SupplyList.aspx";
            }
        } else if (type == "buy") {
            if (stQuery.length > 0) {
                location.href = "/CN/Product/Buy/BuyList.aspx?" + stQuery;
            } else {
                location.href = "/CN/Product/Buy/BuyList.aspx";
            }
        } else if (type == "enterprise") {


            if (stQuery.length > 0) {
                location.href = "/CN/Ent/Supply/SupplierList.aspx?" + stQuery;
            } else {
                location.href = "/CN/Ent/Supply/SupplierList.aspx";
            }
        } else if (type == "exposition") {
            if (stQuery.length > 0) {
                location.href = "/CN/Exp/Exposition/ExpInfo.aspx?" + stQuery;
            } else {
                location.href = "/CN/Exp/Exposition/ExpInfo.aspx";
            }
        } else if (type == "news") {
            if (stQuery.length > 0) {
                location.href = "/cn/Biz/BizList.aspx?" + stQuery;
            } else {
                location.href = "/cn/Biz/BizList.aspx";
            }
        }

    }
}
