

//以XML求取ddl_JobTypeSub的数据
function XmlPost_JobTypeSub(obj) {
    var svalue = obj.value;
    var webFileUrl = "?jobtypeid=" + svalue;
    var result = "";
    var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
    xmlHttp.open("POST", webFileUrl, false);
    xmlHttp.send("");
    result = xmlHttp.responseText;
    if (result != "") {
        document.all("ddl_JobTypeSub").length = 0;
        var piArray = result.split(",");
        for (var i = 0; i < piArray.length; i++) {
            var ary = piArray[i].toString().split("|");
            document.all("ddl_JobTypeSub").options.add(new Option(ary[1].toString(), ary[0].toString()));
        }
        document.all("hid_JobTypeSub").value = document.all("ddl_JobTypeSub").options[document.all("ddl_JobTypeSub").selectedIndex].value;
    }
    else {
        alert(result);
    }
}

//以XML求取ddl_WorkPlaceCity的数据
function XmlPost_WorkPlaceCity(obj) {
    var svalue = obj.value;
    var webFileUrl = "?provinceid=" + svalue;
    var result = "";
    var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
    xmlHttp.open("POST", webFileUrl, false);
    xmlHttp.send("");
    result = xmlHttp.responseText;
    if (result != "") {
        document.all("ddl_WorkPlaceCity").length = 0;
        var piArray = result.split(",");
        for (var i = 0; i < piArray.length; i++) {
            var ary = piArray[i].toString().split("|");
            document.all("ddl_WorkPlaceCity").options.add(new Option(ary[1].toString(), ary[0].toString()));
        }
        document.all("hid_WorkPlaceCity").value = document.all("ddl_WorkPlaceCity").options[document.all("ddl_WorkPlaceCity").selectedIndex].value;
    }
    else {
        alert(result);
    }
}


//职位搜索
function Search_Quick() {
    var Url, FunctionType, JobType, WorkPlace, PublishDate, Keywords;

    FunctionType = document.all.funtype_big.value;
    JobType = document.all.funtype.value;
    WorkPlace = document.all.jobarea.value;
    PublishDate = document.all.issuedate.value;
    Keywords = document.all.strKeyWord.value.replace(/(^\s*)|(\s*$)/g, "");
    var k = encodeURI("请输入关键字");
    if (Keywords == "请输入关键字") {
        Keywords = "";
    }
    Url = "/job/search-result.aspx?funtype=" + FunctionType + "&jobtype=" + JobType + "&workplace=" + WorkPlace + "&pubdate=" + PublishDate + "&key=" + encodeURI(Keywords);

    window.open(Url);
}

//全能搜索
function Search_Advance() {
    var Url;
    var FunctionType, JobType, PublishDate, WorkPlace, MonthPay, Degree, WorkYears, JobProperty, Keyword;

    FunctionType = document.all.funtype_big.value;
    JobType = document.all.funtype.value;
    WorkPlace = document.all.jobarea.value;
    PublishDate = document.all.issuedate.value;
    MonthPay = document.all.Salary.value;
    Degree = document.all.Degree.value;
    WorkYears = document.all.WorkYear.value;
    JobProperty = document.all.WorkForce.value;
    Keyword = document.all.Keyword.value.replace(/(^\s*)|(\s*$)/g, "");

    if (Keyword == "请输入关键字") { Keyword = ""; }

    Url = "/job/search-result.aspx?funtype=" + FunctionType + "&jobtype=" + JobType + "&workplace=" + WorkPlace + "&pubdate=" + PublishDate + "&monthpay=" + MonthPay + "&degree=" + Degree + "&workyears=" + WorkYears + "&jobpro=" + JobProperty + "&key=" + escape(Keyword);

    window.open(Url);
}

//关键字搜索
function Search_Keys(objstr) {
    var Url;
    var Keyword = encodeURI(objstr.replace(/(^\s*)|(\s*$)/g, ""));
    Url = "/job/search-result.aspx?key=" + Keyword;
    window.open(Url);
}

//关键字搜索
function Search_KeysAarea() {
    var Url;
    var WorkPlace = document.all.jobarea.value;
    var Keyword = document.all.keyWords.value.replace(/(^\s*)|(\s*$)/g, "");
    Url = "/job/search-result.aspx?key=" + encodeURI(Keyword) + "&workplace=" + WorkPlace + "&funtype=0&jobtype=0&pubdate=0";
    window.open(Url);
}


//切换急聘/热门职位
function asecBoard(n) {
    for (i = 1; i < 3; i++) {
        eval("document.getElementById('al0" + i + "').className='a102'");
        eval("abx0" + i + ".style.display='none'");
    }
    eval("document.getElementById('al0" + n + "').className='a101'");
    eval("abx0" + n + ".style.display='block'");
}

//切换分类搜索
function bsecBoard(n) {
    for (i = 1; i < 4; i++) {
        eval("document.getElementById('img" + i + "').src='/images/tabs0" + i + "0.gif'");
        eval("div" + i + ".style.display='none'");
    }
    eval("document.getElementById('img" + n + "').src='/images/tabs0" + n + ".gif'");
    eval("div" + n + ".style.display='block'");
}
//切换分类搜索
function bsecBoard2(n) {
    for (i = 1; i < 5; i++) {
        eval("document.getElementById('img" + i + "').src='/images/tabs0" + i + "0.gif'");
        //        eval("div" + i + ".style.display='none'");
    }
    eval("document.getElementById('img" + n + "').src='/images/tabs0" + n + ".gif'");
    //    eval("div" + n + ".style.display='block'");
}


//检测用户名
function CheckAccount(username) {
    var re, r;

    re = /\S/;
    r = username.match(re);
    if (!r) {
        alert("请输入用户帐号！");
        return false;
    }
    else {
        window.open("Register_Check.aspx?type=username&value=" + username, "")
    }
}

//检测邮箱地址
function CheckMail(email) {
    var re, r;

    re = /\S/;
    r = email.match(re);
    if (!r) {
        alert("请输入邮箱地址！");
        return false;
    }
    else {
        window.open("Register_Check.aspx?type=email&value=" + email, "")
    }
}

