﻿$(window).load(function() {
    //头部需求下拉框
    if ($("#li_i_require").length > 0) {
        $("#li_i_require").hover(function(e) {
            if ($(this).hasClass("a_public_PheadthreeOk")) {
            }
            else {
                $(this).removeClass("a_public_PheadthreeNo").addClass("a_public_PheadthreeOk");
            }
            //$(this).find("a").css("background", "none");
            $(this).find("dd").show();
        }, function(e) {
            if ($(".a_public_PheadthreeOk").length > 1) {
                $(this).removeClass("a_public_PheadthreeOk").addClass("a_public_PheadthreeNo");
            }
            //$(this).find("a").css("background", "url(/Images/Public/xiaot.gif) no-repeat 85px 14px");
            $(this).find("dd").hide();
        });
        var dd = $("#li_i_require").find("dd").eq(0);
        if (jQuery.GetLang() == "zh-cn") {
            dd.css("width", "135px");
        }
        else {
            dd.css("width", "150px");
        }
    }
    //搜索记录下拉框
    if ($("#a_pu_search").length > 0) {
        $("#a_pu_search").hover(function(e) {
            $(this).find("h1").addClass("topsrdt");
            $(this).find("h1 a").css("color", "#000");
            $(this).find("img").hide();
            $(this).find(".a_leipubsouxs").show();
        }, function(e) {
            $(this).find("h1").removeClass("topsrdt");
            $(this).find("h1 a").css("color", "#fff");
            $(this).find("img").show();
            $(this).find(".a_leipubsouxs").hide();
        });
    }

    //字母检索
    letterShowOrHide();
    $("#letterShow").mouseout(function() { flag = false; })
    $("#letterShow").mouseover(function() { flag = true; })
    $("body").click(function() {
        if (!flag) {
            $("#letterShow").css("display", "none");
            flag = true;
        }
    });


});

function SelectArea(act) {
    $().OpenWin.Popup(g_lang_18, '/SearchResult/AreaInfo.aspx?Act=' + act, 730, 520, true);
}
function SelectTrade(act) {
    $().OpenWin.Popup(g_lang_19, '/SearchResult/TradeInfo.aspx?Act=' + act, 730, 520, true);
}
function Head_ExecuteQuery(url) {
    var key, trade, area;
    exp = '?Exp=C:';
    key = $.trim($('#ipt_Key').val());
    if (key.toLowerCase() == 'enter keywords' || key == g_lang_20) {
        key = '';
    }
    trade = $('#hd_trade').val();
    area = $('#hd_area').val();
    /*
    exp += area.replace(/,/g, '.');
    exp += ';';
    exp += trade.replace(/,/g, '.');
    exp += ';';
    exp += ';';
    
    if (trade == "" && area == "") {
        if (key != "") {
            url =url + '?key=' + escape(key);
        }
    } else { url += exp; if (key != "") { url += '&key=' + escape(key); } }
    */
    if (key != "") { url += '?key=' + escape(key); }
    window.location = url;
}
function SendQuery(url, e) {

    if (!e) var e = window.event;
    var kc = e.which || e.keyCode;

    if (kc == 13) {
        Head_ExecuteQuery(url);
        return false;
    }
}
                                    
                                