///////////首页banner 自动切换  2011-08-23 /////////////
var indexBannerChangeObject = null;
var indexBannerChangeIndex = 0;
var indexBannerChangeCount = 0;
var indexBannerChangeTimeOut = null;
var indexBannerChangeTime = 6000;

function indexBannerChange(){
	indexBannerChangeIndex++;
	if(indexBannerChangeIndex+1 > indexBannerChangeCount)
		indexBannerChangeIndex = 0;
	$('.banner_Box > div').hide();
	$('.banner_Box > div').eq(indexBannerChangeIndex).show();
	
	$('.mainnav > li').eq(indexBannerChangeIndex).click();
	indexBannerChangeTimeOut = setTimeout(indexBannerChange,indexBannerChangeTime);
}
 
 function indexBannerChanageDiy(index){
	 indexBannerChangeIndex = index;
	 clearInterval(indexBannerChangeTimeOut);
	 //indexBannerChangeTimeOut = setTimeout(indexBannerChange,indexBannerChangeTime);
 }
 ///////////// 首页banner切换///end ///

	

$(document).ready(function(){

	
	indexBannerChangeCount = $('.banner_Box > div').size();
	if(indexBannerChangeTimeOut==null)
		indexBannerChangeTimeOut = setTimeout(indexBannerChange,indexBannerChangeTime);

	$(".gzjhNav").hover(function(e){	     
		$(".gzjh_hover").show();

	},function(e){
	     var tar = e.target  || e.srcElement;
	       if(tar.tagName == "SELECT"  || tar.tagName == "OPTION"){
	           $(".gzjh_hover").css("display","block");
	        
	       }else{
	          $(".gzjh_hover").css("display","none");  
	      }		
	})
	$(".gzjh_hover").mousemove(function(e){
	       var tar = e.target  || e.srcElement;
	    
	       if(tar.tagName == "SELECT"  || tar.tagName == "OPTION"){
	           
	           $(this).css("display","block");
	       }
	    
	    });
	$(".sqddNav").hover(function(){
		$(".sqdd_hover").show();
	},function(){
		$(".sqdd_hover").hide();
	})
	$(".home").hover(function(){
		$("#home").css("background","none")
		$(".home_hover").show();
	},function(){
		$("#home").css("background","url(/images/public/header/sample_znav.gif)")
		$("#home").css("background-position","0 -28px")	
		$(".home_hover").hide();
	})
	$(".jianli").hover(function(){
		$("#jianli").css("background","none")
		$(".jianli_hover").show();
		$(".enterprisebasic").show()
	},function(){
		$("#jianli").css("background","url(/images/public/header/sample_znav.gif)")
		$("#jianli").css("background-position","0 -48px")	
		$(".jianli_hover").hide();
		$(".enterprisebasic").hide();
	})
	$(".rizhi").hover(function(){
		$("#rizhi").css("background","none")
		$(".rizhi_hover").show();
		$("#newJob").css("background","none")
		$(".newJob").show();
	},function(){
		$("#rizhi").css("background","url(/images/public/header/sample_znav.gif)")
		$("#rizhi").css("background-position","0 -68px")	
		$(".rizhi_hover").hide();
		$("#newJob").css("background","url(/images/public/header/Post.gif)")
		$("#newJob").css("background-repeat","no-repeat")			
		$(".newJob").hide();
	})
	/*
	$(".downTable").mouseout(function(){		
		$(".returnBox .downClick").hide()
		$(".downClickBox").hide();		
	})
	*/
	$(".shipin").hover(function(){
		$("#shipin").css("background","none")
		$(".shipin_hover").show();
		$("#job_Management").css("background","none")
		$(".job_Management").show();
	},function(){
		$("#shipin").css("background","url(/images/public/header/sample_znav.gif)")
		$("#shipin").css("background-position","0 -89px")	
		$(".shipin_hover").hide();
		$("#job_Management").css("background","url(/images/public/header/job_Management.gif)")
		$("#job_Management").css("background-repeat","no-repeat")	
		$(".job_Management").hide();
	})
	$(".fensi").hover(function(){
		$("#fensi").css("background","none")
		$(".fensi_hover").show();
		$("#modify").css("background","none")
		$(".modify").show();
	},function(){
		$("#fensi").css("background","url(/images/public/header/sample_znav.gif)")
		$("#fensi").css("background-position","0 -134px")	
		$(".fensi_hover").hide();
		$("#modify").css("background","url(/images/public/header/modify.gif)")
		$("#modify").css("background-repeat","no-repeat")		
		$(".modify").hide();
	})
	$(".like").hover(function(){
		$("#like").css("background","none")
		$(".like_hover").show();
	},function(){
		$("#like").css("background","url(/images/public/header/sample_znav.gif)")
		$("#like").css("background-position","0 -111px")	
		$(".like_hover").hide();
	})
	$(".shezhi").hover(function(){
		$("#shezhi").css("background","none")
		$(".shezhi_hover").show();
	},function(){
		$("#shezhi").css("background","url(/images/public/header/sample_znav.gif)")
		$("#shezhi").css("background-position","0 -155px")	
		$(".shezhi_hover").hide();
	})
	$(".tishi").hover(function(){
		$("#tishi").css("background","none")
		$(".tishi_hover").show();
		$(".tishi_hoverTop").show();
	},function(){
		$("#tishi").css("background","url(/images/public/header/xinxitishi.gif)")			
		$(".tishi_hover").hide();
		$(".tishi_hoverTop").hide();
	})
	$(".tishi").hover(function(){
		$("#tishi1").css("background","none")
		$(".tishi_hover").show();
	},function(){
		$("#tishi1").css("background","url(/images/public/header/sample_znav.gif)")	
		$("#tishi1").css("background-position","0 -175px")	
		$(".tishi_hover").hide();
	})
	$(".apps").hover(function(){
		$("#apps").css("background","none")
		$(".apps_hover").show();
	},function(){
		$("#apps").css("background","url(/images/public/header/sample_znav.gif)")
		$("#apps").css("background-position","0 -193px")	
		$(".apps_hover").hide();
	})
	$("#close").click(function(){
		$("#close").hide(100);
		$("#exlpore").hide(200);
		$("#ziApps_san").hide(300);
		$("#ziApps_si").hide(400);
		$("#ziApps_wu").hide(500);
		$("#ziApps_liu").hide(600);	
		$("#ziApps_et").hide(800);
		$("#ziApps_qi").hide(700);
		$(".apps_click").hide(900);	
	})
	$("#close").click(function(){	
		$(".apps_clickBox").slideUp(1000);
	})

	$("#apps_click").click(function(){		
		$(".apps_clickBox").slideDown(300);;
		$(".apps_clickBox").show();
		$(".apps_click").show();
		$("#ziApps_et").show(600);
		$("#ziApps_qi").show(700);
		$("#ziApps_liu").show(800);
		$("#ziApps_wu").show(900);
		$("#ziApps_si").show(1000);
		$("#ziApps_san").show(1100);
		$("#exlpore").show(1200);
		$("#close").show(1300);
	})
	$(".ziApps_san").hover(function(){
		$("#ziApps_san").css("background","url(/images/public/header/sample_appsHover.gif)");
		$("#ziApps_san").css("background-position","0 -189px");
		$(".ziApps_hoverBox").show();
	},function(){
		$("#ziApps_san").css("background","url(/images/public/header/sample_apps.gif)");
		$("#ziApps_san").css("background-position","0 -189px");
		$(".ziApps_hoverBox").hide();
	})
//他人空间导航JS
	$(".returnBox .down").click(function(){
		$(".returnBox .downClick").show()
		$(".downClickBox").show();		
	})
	$(".downTable li").hover(function(){
		$(this).css("background","#606060")
		$(this).children("div").css("opacity","1.0")
	},function(){
		$(this).css("background","none")
		$(this).children("div").css("opacity","0.5")
	})
	/*企业空间导航JS*/
	$(".crewBox").hover(function(){
		$("#crew").css("background","none")
		$(".crew").show();
	},function(){
		$("#crew").css("background","url(/images/public/header/crew.gif)")
		$("#crew").css("background-repeat","no-repeat")	
		$(".crew").hide();
	})
	$(".collection").hover(function(){
		$("#collection").css("background","none")
		$(".collectionBox").show();
	},function(){
		$("#collection").css("background","url(/images/public/header/Collection.gif)")
		$("#collection").css("background-repeat","no-repeat")	
		$(".collectionBox").hide();
	})
	/*企业logo*/
	$(".qiyeimgBox").hover(function(){
		$(".changelogo").show();	
	},function(){
		$(".changelogo").hide();	
	})
/*20110818他人空间导航变化*/
	$(".returnBox").hover(function(){
		$(this).css("background","url(/images/public/header/returnBoxHoverBg.png)")				
	},function(){
		$(this).css("background","url(/images/public/header/returnBoxBg.png)")	
	})
	/*副导演二级导航*/
	$(".talentpool").hover(function(){
		$("#talentpool").css("background","none")
		$(".talentpool_hover").show();
	},function(){
		$("#talentpool").css("background","url(/images/public/header/castingDirectorNavBg.gif)")
		$("#talentpool").css("background-position","0 -52px")	
		$(".talentpool_hover").hide();
	})
	$(".pictureGl").hover(function(){
		$("#pictureGl").css("background","none")
		$(".pictureGl_hover").show();
	},function(){
		$("#pictureGl").css("background","url(/images/public/header/castingDirectorNavBg.gif)")
		$("#pictureGl").css("background-position","0 -31px")	
		$(".pictureGl_hover").hide();
	})
	$(".jobGl").hover(function(){
		$("#jobGl").css("background","none")
		$(".jobGl_hover").show();
	},function(){
		$("#jobGl").css("background","url(/images/public/header/castingDirectorNavBg.gif)")
		$("#jobGl").css("background-position","0 -71px")	
		$(".jobGl_hover").hide();
	})
	$(".job_new").hover(function(){
		$(this).css("background-position","0 -144px")
	},function(){
		$(this).css("background-position","0 -102px")	
	})
	$(".yq_py").hover(function(){
		$(this).css("background-position","0 -228px")
	},function(){
		$(this).css("background-position","0 -186px")	
	})
/*他人看副导演二级导航*/
	$(".album").hover(function(){
		$("#album").css("background","none")
		$(".album_hover").show();
	},function(){
		$("#album").css("background","url(/images/public/header/castingDirectorNavBg.gif)")
		$("#album").css("background-position","0 -31px")	
		$(".album_hover").hide();
	})			
/*20110829企业二级导航修改*/
	$(".case").hover(function(){
		$("#case").css("background","none")
		$(".case_hover").show();
	},function(){
		$("#case").css("background","url(/images/public/header/castingDirectorNavBg.gif)")
		$("#case").css("background-position","0 -31px")	
		$(".case_hover").hide();
	})	
	
})

function header_searchjob()
{
	var sex = $("input[name='sex']:checked").val();
	var key = $("input[name='keywords']").val();
	var q = 'sok=y';
	if(sex!='' && sex!=undefined)
	q += '&sex='+sex;
	//职位类别
	var typeid_header=$("select[name='typeidheader_1']").val();
	//地区
	var area_header=$("select[name='areaheader_1']").val();
	
	q+='&area='+area_header;
	if(key!='' && key!=undefined && key!='搜索')
	q+='&key='+key;
	if(typeid_header!='' && typeid_header!=undefined)
	q += '&typeid='+typeid_header;
	window.document.location.href='/job/search.php?'+q;
}
function edit_jobtype(s_type){
	var s_type;
	$("#topSearchType").val(s_type);
}
function top_search(){
	var t = $("input[name='topKeywords']").val();
	var topSearchType=$("#topSearchType").val();
	if(topSearchType==undefined || t==undefined)return;
	if(t==lanJobMsg1){
		alert(lanJobMsg1);
		return;
	}
		
	if(topSearchType=='user')
	window.location.href='/passport/search.php?key='+t;
	else
	window.location.href='/job/search.php?key='+t;
	} 
/////////高级搜索/////////////////
function topAdvSearch(){
	var topSearchType=$("#topSearchType").val();
	if(typeof(topSearchType)=='undefined')window.location.href='/job/search.php';
	if(topSearchType=='user')
	window.location.href='/passport/search.php';
	else
	window.location.href='/job/search.php';
} 

/*--------------------友缘人-----------*/
function removeTj(id){
	if($("#numtj").val()>2){
		$('#'+id).fadeOut('slow',function() { $('#'+id).remove();});
		$("#numtj").val($("#numtj").val()-1);
	}else{
		openURL('/passport/index.php?act=youyuan_alert','',250,100)
		//_alert(LanLastOne);
	}
}


function goToThisUrl(t)
{
	var _url = $(t).attr('url');
	$.ajax({url:_url,type:'GET',
	success:function(){
		window.location.href = _url;
	},
	error:function(e){alert(e)}
	})
}





