﻿// JScript 文件
function $(id)
{
    return document.getElementById(id);
}
function Search()
{
    var Post = $("myJobName").value;
    if(Post == "不限")
    {
        Post = "";
    }
    if(Post=="0")
    {
        Post = "";
    }
    var City = $("myWorkCity").value;
    if(City == "不限")
    {
        City = "";
    }
    if(City=="0")
    {
        City = "";
    }
   
    var Industry = $("myInDName").value;
     if(Industry=="0")
    {
        Industry = "";
    }
    var WorKYY= $("myWorKYY").value;
    if(WorKYY=="0")
    {
        WorKYY="";
    }
 
    var JobNeed=$("myJobNeed").value;
    if(JobNeed=="0")
    {
        JobNeed="";
    }
    if(Post==0 &&City==0&&Industry==0&&WorKYY==0&&JobNeed==0)
    {
        alert("请至少选一项");
    }
    else
    {
        document.location=winopen("search_person_result.htmWorKExp-"+WorKYY+"|jobNeed1-"+JobNeed+"|city-"+City+"|post-"+Post+"|industry-"+Industry+"|page-1");
    }
}


//去掉空格
function JStrim(inputString) 
{ 
    if (typeof inputString != "string") 
    {
        return inputString; 
    } 
    var retValue = inputString; 
    var ch = retValue.substring(0, 1); 
    while (ch == " ") 
    {  
          //检查字符串开始部分的空格 
          retValue = retValue.substring(1, retValue.length); 
          ch = retValue.substring(0, 1); 
    } 
    ch = retValue.substring(retValue.length-1, retValue.length); 
    while (ch == " ") 
    { 
         //检查字符串结束部分的空格 
         retValue = retValue.substring(0, retValue.length-1); 
         ch = retValue.substring(retValue.length-1, retValue.length); 
    } 
    while (retValue.indexOf("  ") != -1) 
    {  
         //将文字中间多个相连的空格变为一个空格 
         retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length);  
    } 
    return retValue; 
}   
function winopen(oldUrl) 
{ 
    var newUrl,arrUrl; 
    if(typeof(oldUrl) == "undefined" || oldUrl == "") 
    { 
        retUrn ; 
    } 
    else 
    { 
        if(oldUrl.indexOf("?") == -1) 
        {  
            newUrl = oldUrl; 
        } 
        else 
        { 
            newUrl = oldUrl.substring(0,oldUrl.indexOf("?")+1); 
            arrUrl = oldUrl.substring(oldUrl.indexOf("?")+1).split("|"); 
            for(var i =0;i<arrUrl.length;i++) 
            { 
                newUrl += arrUrl[i].split("-")[0] + "-" + escape(arrUrl[i].split("-")[1]) + "|"; 
            }  
            newUrl = newUrl.substring(0,newUrl.length-1); 
        } 
    } 
    return newUrl; 
} 


