function jobslist()
{
	var key=$('#key').val();
	if (key)
	{
		key_arr=key.split(" ");
		for (x in key_arr)
		{
		if (key_arr[x]) $('.striking').highlight(key_arr[x]);
		}
	}
	$(".list:odd").css("background-color","#F4F5FB");
	$(".titsub").hover(	function()	{$(this).addClass("titsub_h");},function(){$(this).removeClass("titsub_h");});
	function setlistbg()
	{
			$(".li_left_check input[type='checkbox']").each(function(i){
				if ($(this).attr("checked"))
				{
					$(this).parent().parent().addClass("seclect");
				}
				else
				{
					$(this).parent().parent().removeClass("seclect");
				}
			}); 
	 } 
 	
	//点击选择后重新加样式
	$("#formjobslist input[type='checkbox']").click(function(){setlistbg();});
	//提醒
	$(function(){
	var _wrap=$('#jobs_list_tip ul');
	var _interval=3000;
	var _moving;
	_wrap.hover(function(){
	clearInterval(_moving);
	},function(){
	_moving=setInterval(function(){
	var _field=_wrap.find('li:first');
	var _h=_field.height();
	_field.animate({marginTop:-_h+'px'},300,function(){
	_field.css('marginTop',0).appendTo(_wrap);
	})
	},_interval)
	}).trigger('mouseleave');
	});
	// 全选反选
	var che_tbody = $('#formjobslist :checkbox');
	if(che_tbody.length < 1){
		return false;
	}
	$('.bottom_but_group :checkbox').CheckboxRelated(che_tbody).CheckboxRelated("clone", '.jobs_list_title :checkbox');
	setTimeout(function(){$('.table :checkbox').CheckboxUI("refresh");},400);
}
 //投递简历
function apply_jobs(ajaxurl)
{
	$(".deliver").click(function()
	{
			var sltlength=$("#formjobslist input:checked").length;
			if (sltlength==0)
			{
				// dialog("系统提示","text:请选择职位","300px","auto");
				$.dialog.alert("请选择职位！");
				// alert("请选择职位");
			}
			else
			{
				var jidArr=new Array();
				 $("#formjobslist :checkbox[checked]").each(function(index){jidArr[index]=$(this).val();});
				dialog("投递简历","url:"+ajaxurl+"user/user_apply_jobs.php?id="+jidArr.join("-")+"&act=app","500px","auto","");
			}
	});
	//单个申请职位
	$(".app_jobs").unbind().click(function(){
	dialog("投递简历","url:"+ajaxurl+"user/user_apply_jobs.php?id="+$(this).attr("id")+"&act=app","500px","auto","");
	});
}
function favorites(ajaxurl)
{  
	$(".collect").unbind().click(function(){  
		dialog("收藏职位","url:"+ajaxurl+"user/user_favorites_job.php?id="+$(this).attr("id")+"&act=add","500px","auto","");
	});
	
	$(".add_favorites").click(function()
	{  
		var sltength = $("#formjobslist input:checked").length;   
		if (sltength==0)
			{
				$.dialog.alert("请选择职位！");
				// dialog("系统提示","text:请选择职位","300px","auto");
			}
			else
			{
				var jidArr=new Array();
				$("#formjobslist input:checkbox[checked]").each(function(index){jidArr[index]=$(this).val();});
				dialog("收藏职位","url:"+ajaxurl+"user/user_favorites_job.php?id="+jidArr.join("-")+"&act=add","500px","auto","");
			}
	});
}
//猎头 申请为职位推荐人才
function hunter_apply_jobs(ajaxurl)
{
	//单个申请职位
	$(".app_jobs").click(function(){
	dialog("申请推荐","url:"+ajaxurl+"user/user_hunter_apply_jobs.php?id="+$(this).attr("id")+"&act=app","500px","auto","");
	});
}
//猎头 申请为个人的顾问
function hunter_apply_resume(ajaxurl)
{
	//邀请关注==>(申请成为个人的顾问)
	$(".app_resume").click(function(){
	dialog("邀请关注","url:"+ajaxurl+"user/user_hunter_apply_resume.php?id="+$(this).attr("id")+"&act=app","500px","auto","");
	});
}