﻿
//以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);
		}
	}
	
	//以XML求取ddl_CompSubid的数据(执业资格)
	function XmlPost_CompSubid(obj)
    {
		var svalue = obj.value;
		var webFileUrl = "?competenceid=" + svalue;
		var result = "";
		var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
		xmlHttp.open("POST", webFileUrl, false);
		xmlHttp.send("");
		result = xmlHttp.responseText;
				　　
		if(result != "")
		{
			document.all("ddl_CompSubid").length=0;
			var piArray = result.split(",");
			for(var i=0;i<piArray.length;i++)
			{
				var ary = piArray[i].toString().split("|");
				document.all("ddl_CompSubid").options.add(new Option(ary[1].toString(),ary[0].toString()));
			}
			document.all("hid_CompSubid").value = document.all("ddl_CompSubid").options[document.all("ddl_CompSubid").selectedIndex].value;
		}
		else
		{
			alert(result);
		}
	}
	

//职位搜索
function Search_Quick()
{
	var Url;
	var JobType,Trade,WorkPlace,PublishDate,KeyClass,Key;
	
	JobType		= document.all.hid_JobTypeSub.value;
	WorkPlace	= document.all.hid_WorkPlaceCity.value;
	Trade		= document.all.ddl_Trade.value;
	PublishDate	= document.all.ddl_PublishDate.value;
	Key			= document.all.txt_Key.value;
	
	KeyClass	= "1";
	if(document.all.rbn_Class2.checked == true){KeyClass = "2"}
	
	if(Key == "请输入关键字")
	{
		alert("请输入搜索关键字");
		return;
	}
	
	Url = "Per_Search_Quick.aspx?JobType="+ JobType +"&Trade="+ Trade +"&WorkPlace="+ WorkPlace +"&PublishDate="+ PublishDate +"&KeyClass="+ KeyClass +"&Key="+ Key;
	
	window.open(Url);
}

//全能搜索
function Search_Advance()
{
	var Url;
	var JobType,Trade,Competence,WorkPlace,JobProperty,Degree,WorkYears,Sex,MinAge,MaxAge,MonthPay,PublishDate,Key;
	
	JobType		= document.all.hid_JobTypeSub.value;
	WorkPlace	= document.all.hid_WorkPlaceCity.value;
	Trade		= document.all.ddl_Trade.value;
	Competence  = document.all.hid_CompSubid.value;
	JobProperty = document.all.ddl_JobProperty.value; 
	Degree		= document.all.ddl_Degree.value;
	WorkYears	= document.all.ddl_WorkYears.value;
	Sex			= document.all.ddl_Sex.value;
	MinAge		= document.all.ddl_MinAge.value;
	MaxAge		= document.all.ddl_MaxAge.value;
	MonthPay	= document.all.ddl_MonthPay.value;
	PublishDate	= document.all.ddl_PublishDate.value;
	Key			= document.all.txt_Key.value;
	
	if(Key == "请输入关键字"){Key = "";}
	
	Url = "Per_Search_Advance.aspx?JobType="+ JobType +"&Trade="+ Trade +"&WorkPlace="+ WorkPlace +"&Competence="+ Competence +"&JobProperty="+ JobProperty +"&Degree="+ Degree +"&WorkYears="+WorkYears  +"&Sex="+ Sex +"&MinAge="+ MinAge +"&MaxAge="+ MaxAge +"&MonthPay="+ MonthPay +"&PublishDate="+ PublishDate +"&Key="+ Key;
	
	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('bl0"+i+"').className='a102'"); 
        eval("bbx0"+i+".style.display='none'"); 
    } 
    eval("document.getElementById('bl0"+n+"').className='a101'"); 
    eval("bbx0"+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,"")
      }
    }
