﻿function JumpSearchLayers2(typeid,positionid,arrayid,fname,vname,tname)
{

	var objllist=document.getElementsByTagName('select');
	for(var i=0;i<objllist.length;i++)
{
		objllist[i].style.visibility="hidden";
	} 
	document.getElementById("bodyly").style.display="block";   
	document.getElementById("bodyly").style.width=document.body.clientWidth+"px"; //+"px"为了兼容FF必须加上
	document.getElementById("bodyly").style.height=document.body.clientHeight+"px"; //+"px"为了兼容FF必须加上


	//if (document.body.scrollHeight>document.body.clientHeight)//为了兼容只好取消窗口定位然后在CSS里定义了
	//{document.all.bodyly.style.height=document.body.scrollHeight}
	//else
	//{document.all.bodyly.style.height=document.body.clientHeight}
	
	document.getElementById("SearchDivhire").style.display='block';
	document.getElementById("SearchDivhire").style.top=document.documentElement.scrollTop+60+'px';  
	document.getElementById("SearchDivhire").style.left=document.body.clientWidth/2-280+'px';
	//document.all.SearchDivhire.style.top=document.documentElement.scrollTop+60+'px';  这样还是只能兼容IE7
	//document.all.SearchDivhire.style.left=document.body.clientWidth/2-280+'px';
	var onecount;
	if (arrayid==1)
	{
	onecount=positionarray.length;
	
	arraynames=positionarray;
	
	document.getElementById("wintit").innerHTML='请选择岗位类别';
	strs='<span style=line-height:24px;font-weight:bold; font-size:13px;>请选择职位</span>';
	
	}
	if (arrayid==2)
	{
	onecount=provincearray.length;
	arraynames=provincearray;
	document.getElementById("wintit").innerHTML='请选择所在地区';
	strs='<span style=line-height:24px;font-weight:bold; font-size:13px;>请选择城市</span>';
	}
	if (arrayid==3)
	{	
	onecount=positionarray.length;
	arraynames=positionarray;
	document.getElementById("wintit").innerHTML='请选择岗位类别';
	strs='<span style=line-height:24px;font-weight:bold; font-size:13px;>请选择职位</span>';
	}
	if (arrayid==4)
	{
	onecount=tradearray.length;
	arraynames=tradearray;
	document.getElementById("wintit").innerHTML='请选择行业类别';
	strs='<span style=line-height:24px;font-weight:bold; font-size:13px;>请选择行业</span>';
	}
	if (arrayid==5)
	{
	onecount=professionarray.length;
	arraynames=professionarray;
	document.getElementById("wintit").innerHTML='请选择专业类别';
	strs='<span style=line-height:24px;font-weight:bold; font-size:13px;>请选择专业</span>';
	}
	var i;
	str='';
	if (typeid==2)
	{
		str='';
	}
	else
	if (typeid==0)
	{
		str='';
	}
	else
	{
		str=strs;
		
	}
	
	for (i=0;i<onecount;i++)
	{
	if (typeid==2)
	{
		document.getElementById("hiretype").innerHTML='';
		str+='<li style="float:left;width:170px;height:20px;cursor:pointer;" onclick=document.'+fname+'.'+vname+'.value="'+arraynames[i][0]+'";document.'+fname+'.'+tname+'.value="'+arraynames[i][2]+'";unSearchLayers();>'+arraynames[i][0]+'</li>'
		document.getElementById("hiretypes").innerHTML=str;
	}
	else
		if (arraynames[i][1] == positionid)
		{
		
			if (typeid==0)
			{
				document.getElementById("hiretype").innerHTML='';
				str+='<li onclick=JumpSearchLayers(1,'+arraynames[i][2]+','+arrayid+',"'+fname+'","'+vname+'","'+tname+'"); onmouseover=this.style.background="#F1F8FC" onmouseout=this.style.background="" style="float:left;width:170px;height:20px;cursor:pointer;">'+arraynames[i][0]+'</li>'
				document.getElementById("hiretypes").innerHTML=str;
			}
			//写地区的一级城市
			else if (typeid==4)
			{
				document.getElementById("hiretype").innerHTML='';
				document.getElementById("hiretypesss").innerHTML='';
				str+='<li onclick=JumpSearchLayers(5,'+arraynames[i][2]+','+arrayid+',"'+fname+'","'+vname+'","'+tname+'"); onmouseover=this.style.background="#F1F8FC" onmouseout=this.style.background="" style="float:left;width:170px;height:20px;cursor:pointer;">'+arraynames[i][0]+'</li>'
				document.getElementById("hiretypes").innerHTML=str;
			}
			//写地区的三级城市
			else if (typeid==5)
			{
				document.getElementById("hiretype").innerHTML='';
				str+='<li onclick=JumpSearchLayers(1,'+arraynames[i][2]+','+arrayid+',"'+fname+'","'+vname+'","'+tname+'"); onmouseover=this.style.background="#F1F8FC" onmouseout=this.style.background="" style="float:left;width:170px;height:20px;cursor:pointer;">'+arraynames[i][0]+'</li>'
				document.getElementById("hiretypesss").innerHTML=str;
			}
			else
			{
		
				document.getElementById("hiretype").innerHTML='';
				str+='<li style="float:left;width:170px;height:20px;cursor:pointer;" onclick=document.'+fname+'.'+vname+'.value="'+arraynames[i][0]+'";document.'+fname+'.'+tname+'.value="'+arraynames[i][0]+","+arraynames[i][2]+'";unSearchLayers();>'+arraynames[i][0]+'</li>'
				document.getElementById("hiretypes").innerHTML=str;
				document.getElementById("city").innerHTML='';
			}
		}
	}
}
function JumpSearchDate(fname,vname,tname)
{
	var objllist=document.getElementsByTagName('select');
	for(var i=0;i<objllist.length;i++)
	{
		objllist[i].style.visibility="hidden";
	} 
document.getElementById("wintit").innerHTML='请选择查询日期';
document.getElementById("hiretypes").innerHTML='';
document.getElementById("hiretype").innerHTML='';
document.getElementById("SearchDivhire").style.display = "block";
document.all.bodyly.style.display="block";
document.all.bodyly.style.width=document.body.clientWidth;   
document.all.bodyly.style.height=document.body.clientHeight;
document.getElementById("SearchDivhire").style.display='block';
document.all.SearchDivhire.style.top=document.documentElement.scrollTop+60;   
document.all.SearchDivhire.style.left=document.body.clientWidth/2-270;
str='';
str+='<li style="float:left;width:170px;height:20px;cursor:pointer;" onmouseover=this.style.background="#F1F8FC" onmouseout=this.style.background="" onclick=document.'+fname+'.'+tname+'.value="1";document.'+fname+'.'+vname+'.value="近一天";unSearchLayers();>·近一天</li>'
str+='<li style="float:left;width:170px;height:20px;cursor:pointer;" onmouseover=this.style.background="#F1F8FC" onmouseout=this.style.background="" onclick=document.'+fname+'.'+tname+'.value="2";document.'+fname+'.'+vname+'.value="近两天";unSearchLayers();>·近两天</li>'
str+='<li style="float:left;width:170px;height:20px;cursor:pointer;" onmouseover=this.style.background="#F1F8FC" onmouseout=this.style.background="" onclick=document.'+fname+'.'+tname+'.value="3";document.'+fname+'.'+vname+'.value="近三天";unSearchLayers();>·近三天</li>'
str+='<li style="float:left;width:170px;height:20px;cursor:pointer;" onmouseover=this.style.background="#F1F8FC" onmouseout=this.style.background="" onclick=document.'+fname+'.'+tname+'.value="7";document.'+fname+'.'+vname+'.value="近一周";unSearchLayers();>·近一周</li>'
str+='<li style="float:left;width:170px;height:20px;cursor:pointer;" onmouseover=this.style.background="#F1F8FC" onmouseout=this.style.background="" onclick=document.'+fname+'.'+tname+'.value="14";document.'+fname+'.'+vname+'.value="近两周";unSearchLayers();>·近两周</li>'
str+='<li style="float:left;width:170px;height:20px;cursor:pointer;" onmouseover=this.style.background="#F1F8FC" onmouseout=this.style.background="" onclick=document.'+fname+'.'+tname+'.value="30";document.'+fname+'.'+vname+'.value="近一月";unSearchLayers();>·近一月</li>'
str+='<li style="float:left;width:170px;height:20px;cursor:pointer;" onmouseover=this.style.background="#F1F8FC" onmouseout=this.style.background="" onclick=document.'+fname+'.'+tname+'.value="42";document.'+fname+'.'+vname+'.value="近六周";unSearchLayers();>·近六周</li>'
str+='<li style="float:left;width:170px;height:20px;cursor:pointer;" onmouseover=this.style.background="#F1F8FC" onmouseout=this.style.background="" onclick=document.'+fname+'.'+tname+'.value="60";document.'+fname+'.'+vname+'.value="近两月";unSearchLayers();>·近两月</li>'
document.getElementById("hiretypes").innerHTML=str;
}
function unSearchLayers()
{
	var objllist=document.getElementsByTagName('select');
	for(var i=0;i<objllist.length;i++)
	{
		objllist[i].style.visibility="";
	} 
	document.getElementById("SearchDivhire").style.display  = "none";
	//document.all.bodyly.style.display="none";定义全局FF下才能隐藏
	document.getElementById("bodyly").style.display  = "none";
}

<!--实现层移动-->
var mmm='';
document.onmouseup=MUp;
document.onmousemove=MMove;

function MDown(Object){
mmm=Object.id;
document.all(mmm).setCapture();
pX=event.x-document.all(mmm).style.pixelLeft;
pY=event.y-document.all(mmm).style.pixelTop;
}

function MMove(){
if(mmm!=''){
document.all(mmm).style.left=event.x-pX;
document.all(mmm).style.top=event.y-pY;
}
}

function MUp(){
if(mmm!=''){
document.all(mmm).releaseCapture();
mmm='';
}
}
