
//职位搜索
function Search_Quick()
{
	var Url;
	var JobType,Trade,WorkPlace,PublishDate,Key;
	
	JobType		= document.getElementById("hid_JobTypeSub").value;
	WorkPlace	= document.getElementById("hid_WorkPlaceCity").value;
	Trade = document.getElementById("hid_trade").value;
	PublishDate	= document.getElementById("ddl_PublishDate").value;
	Key			= document.getElementById("txt_Key").value;
	
	if(Key == "请输入关键字")
	{
		alert("请输入搜索关键字");
		return;
	}
	
	Url = "Com_Search_Quick.aspx?JobType="+ JobType +"&Trade="+ Trade +"&WorkPlace="+ WorkPlace +"&PublishDate="+ PublishDate +"&Key="+ Key;
	
	window.open(Url);
}

//职位搜索
function Search_Quick2()
{
	var Url;
	var JobType,Trade,WorkPlace,PublishDate,Key;
	
	JobType		= document.getElementById("ddl_JobType").value;
	WorkPlace	= document.getElementById("ddl_WorkPlace").value;
	Trade		= "0";
	PublishDate	= document.getElementById("ddl_PublishDate").value;
	Key			= document.getElementById("txt_Key").value;
	
	if(Key == "请输入关键字")
	{
		alert("请输入搜索关键字");
		return;
	}
	
	Url = "Com_Search_Quick.aspx?JobType="+ JobType +"&Trade="+ Trade +"&WorkPlace="+ WorkPlace +"&PublishDate="+ PublishDate +"&Key="+ Key;
	
	window.open(Url);
}

//切换标签
function asecBoard(n) 
{ 
    for(i=1;i<4;i++) 
    { 
        eval("document.getElementById('al0"+i+"').className='a102'"); 
        eval("document.getElementById('abx0"+i+"').style.display='none'"); 
    } 
    eval("document.getElementById('al0"+n+"').className='a101'"); 
    eval("document.getElementById('abx0"+n+"').style.display='block'"); 
}

//邀请、收藏、浏览简历等操作按扭的事件
function ResumeFun(Param)
{
	var num = 0;
	var Text = "";
	var elem = Form1.elements;
	var Url;
	
	for(i=0;i<elem.length;i++)
	{   
	    //判断页面的控件为checkbox控件
		if(elem[i].type=='checkbox' && elem[i].id != 'chk_All')
		{
			if(elem[i].checked == true)
			{			
				Text += "," + elem[i].value;
				num += 1;
			}
		}		
	}
	
	if( num == 0 )
	{
		if( Param==1 ){ alert("请选择求职者简历！"); }
		if( Param==2 ){ alert("请选择要收藏的简历！"); }
		if( Param==3 ){ alert("请选择要浏览的简历！"); }
		
		return false;
	}
	else
	{   
		//邀请面试
		if( Param==1 )
		{ 
			Url = "../Company/Com_ToInterview.aspx?Resid="+ Text.substring(1);
			window.open(Url,'rslt','width=580,height=620,resizable=no,scrollbars=yes');
		}
		
		//收藏简历
		if( Param==2 )
		{ 
			Url = "../Company/Com_ToFavorite.aspx?Resid="+ Text.substring(1) + "&Prev=2";
			window.open(Url);
		}
		
		//浏览简历
		if( Param==3 )
		{ 
			Url = "../Resume/Browse/ResumeMultiList.aspx?Param="+ Text.substring(1);
			window.open(Url);
		}	
	}	
}

//判断浏览器
function createXMLHttp()
{
    var request = false;
    if (window.XMLHttpRequest){ request = new XMLHttpRequest(); }
    else if (window.ActiveXObject) 
    {
       try{ request = new ActiveXObject("MSXML2.XMLHTTP"); } 
       catch (e1) 
       {
         try{ request = new ActiveXObject("Microsoft.XMLHTTP"); } 
         catch (e2){ request = false; }
       }
    }
    return request;
}

//以XML求取ddl_JobTypeSub的数据
	function XmlPost_JobTypeSub(obj)
    {
		var svalue = obj.value;
		var webFileUrl = "?jobtypeid=" + svalue;
		var result = "";
		var xmlHttp = createXMLHttp();
		xmlHttp.open("POST", webFileUrl, false);
		xmlHttp.send("");
		result = xmlHttp.responseText;		　　
		if(result != "")
		{
			document.getElementById("ddl_JobTypeSub").length=0;
			var piArray = result.split(",");
			for(var i=0;i<piArray.length;i++)
			{
				var ary = piArray[i].toString().split("|");
				document.getElementById("ddl_JobTypeSub").options.add(new Option(ary[1].toString(),ary[0].toString()));
			}
			document.getElementById("hid_JobTypeSub").value = document.getElementById("ddl_JobTypeSub").options[document.getElementById("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 = createXMLHttp();
		xmlHttp.open("POST", webFileUrl, false);
		xmlHttp.send("");
		result = xmlHttp.responseText;
				　　
		if(result != "")
		{
			document.getElementById("ddl_WorkPlaceCity").length=0;
			var piArray = result.split(",");
			for(var i=0;i<piArray.length;i++)
			{
				var ary = piArray[i].toString().split("|");
				document.getElementById("ddl_WorkPlaceCity").options.add(new Option(ary[1].toString(),ary[0].toString()));
			}
			document.getElementById("hid_WorkPlaceCity").value = document.getElementById("ddl_WorkPlaceCity").options[document.getElementById("ddl_WorkPlaceCity").selectedIndex].value;
		}
		else
		{
			alert(result);
		}
	}
	//以XML求取lib_WishTrainBox的数据
	function XmlPost_WishTrainBoxs(obj) {
	    var svalue = obj.value;
	    var webFileUrl = "?wishTrainid=" + svalue;
	    var result = "";
	    var xmlHttp = createXMLHttp();
	    xmlHttp.open("POST", webFileUrl, false);
	    xmlHttp.send("");
	    result = xmlHttp.responseText;
	    if (result != "") {
	        document.getElementById("ddl_Trade").length = 0;
	        var piArray = result.split(",");
	        for (var i = 0; i < piArray.length; i++) {
	            var ary = piArray[i].toString().split("|");
	            document.getElementById("ddl_Trade").options.add(new Option(ary[1].toString(), ary[0].toString()));
	        }
	    }
	    else {
	        alert(result);
	    }
	}

//自荐搜索
function Search_Showme()
{
	var Url;
	var Trade,PublishDate,Key;

	Trade = document.getElementById("hid_trade").value;
	if (Trade == "") {
	    Trade = document.getElementById("ddl_Trade").value;
    }
	PublishDate	= document.getElementById("ddl_PublishDate").value;
	Key			= document.getElementById("txt_Key").value;
	
	if(Key == "请输入关键字")
	{
		alert("请输入搜索关键字");
		return;
	}
	
	Url = "../Company/Showme_Search.aspx?Trade="+ Trade +"&PublishDate="+ PublishDate +"&Key="+ Key;
	
	window.open(Url);
}
