﻿var defSearchKey = "请输入职位、公司名称关键字";
var defAreaKey = "全国";
function goSearch(IsTest) {
    var keyObj = document.getElementById("txtKeyWord");
    var keyAreaObj = document.getElementById("filterArea");
    var inputKeyWord = keyObj.value;
    if (inputKeyWord == defSearchKey) {
        inputKeyWord = "";
    }
    top.window.location = "/zhiwei/PostList.aspx?q=" + escape(inputKeyWord) + " area:" + escape(keyAreaObj.value);
    return false;
}

function showAlert() {
    var vObj = document.getElementById("txtKeyWord");
    if (vObj.value == "") {
        vObj.value = defSearchKey;
    }
}
function hiddenAlert() {
    var vObj = document.getElementById("txtKeyWord");
    if (vObj.value == defSearchKey) {
        vObj.value = "";
        focusType = 0;
    }
}
function selectAllInputCity() {
    var areaObj = document.getElementById("filterArea");
    if (areaObj.value == defAreaKey)
        areaObj.select();
}
function inputKeyEnter(event) {
    if (event.keyCode == 13) {
        goSearch();
        return false;
    }
}
function showProvinceSelPanel() {
    var planDiv = $("#selProvincePanel");
    var btnProvinceSel = $("#btnSelProvince");
    planDiv.css("left", (getPageX(btnProvinceSel[0]) - 130) + "px");
    planDiv.css("top", (getPageY(btnProvinceSel[0]) + 30) + "px");
    planDiv.show("fast", null);
}

function hideProvinceSelPanel() {
    var planDiv = $("#selProvincePanel");
    planDiv.hide("fast", null);
}

function toListAllProvince() {
    var provinceListObj = $("#provinceLinkArea");
    var listHtml = "";
    for (var i = 0; i < arrProvinceName.length; i++) {
        listHtml += "<a href='javascript:selectAProvince(\"" + arrProvinceName[i] + "\")'>" + arrProvinceName[i] + "</a> ";
    }
    provinceListObj.html(listHtml);
}

function selectAProvince(proName) {
    $("#filterArea").val(proName);
    hideProvinceSelPanel();
    goSearch("true");
}