// JavaScript Document
//出现蒙版效果
function msg(divid){
var p=document.createElement("DIV");
p.id="p";
p.style.position="absolute";
p.style.width=document.body.scrollWidth+"px";
p.style.height=(document.body.offsetHeight>document.body.scrollHeight)?'100%':(document.body.scrollHeight+100)+"px";
p.style.zIndex='998';
p.style.top='0px';
  p.style.left='0%';
p.style.backgroundColor="gray";
p.style.opacity='0.5';
p.style.filter="alpha(opacity=80)";
document.body.appendChild(p);
//var p1=document.createElement("DIV");
var top=parseInt(parseInt(document.body.scrollHeight)*0.25)+document.body.scrollTop;
var condiv=document.getElementById(divid);
var p1=condiv;
p1.style.position="absolute";
p1.style.width=condiv.style.width;
//p1.id="p1";
var left=Math.ceil(((document.body.scrollWidth)-parseInt(p1.style.width.replace('px','')))/2)+document.body.scrollLeft;
p1.style.height=condiv.style.height;
p1.style.zIndex='999';
p1.style.top=top+'px';
  p1.style.left=left+'px';
p1.style.border="0px solid red";
p1.style.display="block";
var html="";
html=condiv.innerHTML;
//document.body.appendChild(p1);
//p1.innerHTML=html;
this.cancle=function(){
document.body.removeChild(document.getElementById('p'));
document.getElementById(divid). style.display="none";
//var arr=document.getElementsByTagName("select");
 // var i=0;
  //while(i<arr.length){
 // arr[i].style.visibility='visible';
 // i++;
 // }
}
}
//头部状态选择
function showsetup()
{
    var  setdiv=document.getElementById("setup_out");
   if(setdiv.style.display=="none")
   {
      setdiv.style.display="block"
   }
   else
   {
      setdiv.style.display="none"
   }

}
function selectshowup(obj,num)
{
  var arrow=document.getElementById("arrow1");
  var sptext=document.getElementById("sptext");
   var  setdiv=document.getElementById("setup_out");

     arrow.setAttribute("class","arrow1"+num);
	 arrow.setAttribute("classname","arrow"+num);

	 sptext.innerHTML="["+obj.innerHTML+"]";
	setdiv.style.display="none"


}
function closediv(divid)
{
	$("#"+divid).attr("style","display:none;");
}
function goto(url)
{
	window.location.href=url;
}
//------------------------------------
//职位左侧的树状结构的展开合并
function hindxueke(divid,imgid,type)
{
     if(divid=="zhiyediv")
    {
          document.getElementById("xuekediv").style.display="none";
          document.getElementById("xuekeimg").src="Theme/Type_blue/Images/database/xuekedh_up.gif";
    }else if (divid=="xuekediv"){
         document.getElementById("zhiyediv").style.display="none";
         document.getElementById("zhiyeimg").src="Theme/Type_blue/Images/database/zyfldh_up.gif";
    }else if (divid=="bkdiv"){
    	document.getElementById("zkdiv").style.display="none";
    	document.getElementById("zkimg").src="Theme/Type_blue/Images/database/add.gif";
    }else if (divid=="zkdiv"){
    	document.getElementById("bkdiv").style.display="none";
    	document.getElementById("bkimg").src="Theme/Type_blue/Images/database/add.gif";

    }
	var hinddiv=document.getElementById(divid);
	var img=document.getElementById(imgid);
	if(hinddiv.style.display=="block"||hinddiv.style.display=="")
	{
		hinddiv.style.display="none";
		if(type=="up")
		{
		img.src="Theme/Type_blue/Images/database/arrowdown.png";
		}
	    else	if(type=="add")
		{
		 img.src="Theme/Type_blue/Images/database/add.gif";
		}
	   else	if(type=="xukeup")
		{
		img.src="Theme/Type_blue/Images/database/xuekedh_down.gif";
		}
		else if(type=="zyup")
		{
			img.src="Theme/Type_blue/Images/database/zyfldh_down.gif";
		}
	}
	else
	{
		hinddiv.style.display="block";
		if(type=="up")
		{
		img.src="Theme/Type_blue/Images/database/arrowup.png";
		}
		else if(type=="add")
		{
		 img.src="Theme/Type_blue/Images/database/sub.gif";
		}
		 else	if(type=="xukeup")
		{
		img.src="Theme/Type_blue/Images/database/xuekedh_up.gif";
		}
		else if(type=="zyup")
		{
			img.src="Theme/Type_blue/Images/database/zyfldh_up.gif";
		}
	}
}
function yxzy(objli)
{
	if(objli=="zyli1")
	{
	  $("#zyli1").attr("class","select_ss");
	  $("#zyli2").attr("class","");
	  document.getElementById("xl_select").style.display="none";
	  document.getElementById("ss_input").style.width="495px";
	  document.getElementById("ss_input").value="输入您感兴趣的职业";
	}
	else
	{
	  $("#zyli2").attr("class","select_ss");
	  $("#zyli1").attr("class","");
	  document.getElementById("xl_select").style.display="block";
	   document.getElementById("ss_input").style.width="385px";
	   document.getElementById("ss_input").value="输入您的专业，匹配相关职业";
	}

}
function showdpdown(id,inputid)
{
     $("#"+id).toggle();
     $("#"+id).find("li").bind('click', function() {
       $("#"+id).attr("style","display:none;");
	  $("#"+inputid).attr("value",this.innerHTML);
	       });
	  $("#"+id).find("li").bind('mousemove',function() {
	 if(this.innerHTML!="")
	  this.style.backgroundColor="#dadada";
	       });
	 $("#"+id).find("li").bind('mouseout',function() {
	  if(this.innerHTML!="")
	  this.style.backgroundColor="";
	       });
}
///----------------------
function  showinfo(infoid,title)
{
var p=document.createElement("DIV");
p.id="infpp";
p.style.position="absolute";
p.style.width=document.body.scrollWidth+"px";
p.style.height=(document.body.offsetHeight>document.body.scrollHeight)?'100%':(document.body.scrollHeight+100)+"px";
p.style.zIndex='998';
p.style.top='0px';
  p.style.left='0%';
p.style.backgroundColor="gray";
p.style.opacity='0.5';
p.style.filter="alpha(opacity=80)";
document.body.appendChild(p);

var showdivid="infodiv";
var contentid="conid";
var infortitid="infotit";
var condiv=document.getElementById(showdivid);
var p1=condiv;
p1.style.position="absolute";
p1.style.width=condiv.style.width;
//------------------------------------------parseInt(parseInt(document.body.scrollHeight)*0.5)+
var top=250+document.body.scrollTop + document.documentElement.scrollTop;
var left=Math.ceil(((document.body.scrollWidth)-parseInt(693))/2)+document.body.scrollLeft;
//------------------------------------------
//alert(top);
p1.style.top=top+'px';
p1.style.left=left+'px';
p1.style.zIndex='999';
//p1.style.border="0px solid red";
p1.style.display="block";
var infotit=document.getElementById(infortitid);
var infocon=document.getElementById(contentid);
var yinfocon=document.getElementById(infoid);
infocon.innerHTML=yinfocon.innerHTML;
infotit.innerHTML=title;
this.cancle=function(){
document.body.removeChild(document.getElementById('infpp'));
document.getElementById(showdivid). style.display="none";

}

}
function showdiv(divid,val)
{
	//增加蒙版
	var p=document.createElement("DIV");
	p.id="sd123";
	p.style.position="absolute";
	p.style.width=document.body.scrollWidth+"px";
	p.style.height=(document.body.offsetHeight>document.body.scrollHeight)?'100%':(document.body.scrollHeight+100)+"px";
	p.style.zIndex='998';
	p.style.top='0px';
	  p.style.left='0%';
	p.style.backgroundColor="gray";
	p.style.opacity='0.5';
	p.style.filter="alpha(opacity=80)";
	document.body.appendChild(p);
	//显示弹出div块

	var tcdiv=document.getElementById(divid);
	tcdiv.style.display="block";
	var windheight=(window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body.offsetHeight);
	var topdiff=10;
	if(windheight>tcdiv.offsetHeight)
	{
		topdiff=(windheight-tcdiv.offsetHeight)/2;
	}
	var top=(document.body.scrollTop + document.documentElement.scrollTop)+topdiff;
	var left=Math.ceil(((document.body.scrollWidth)-parseInt(tcdiv.offsetWidth))/2)+document.body.scrollLeft;


	tcdiv.style.position="absolute";
	tcdiv.style.zIndex="999";
	tcdiv.style.top=top+'px';
	tcdiv.style.left=left+'px';

   setTab('one',val,12);
	this.cancle=function()
	{ tcdiv. style.display="none";
	document.body.removeChild(document.getElementById('sd123'));};
}
//ajax 专业，行业的自动提示脚本
function showssdiv(show,id,inputid)
{
	var type="zhuanye";
	if(show==1)
    {
		type="zhuanye";
    }
	if(show==2)
    {
		type="zhiye";
    }
	if(show==3)
    {
		type="hangye";
    }

	var inputstr=$("#"+inputid).attr("value").replace(/(^\s*)|(\s*$)/g, "");
	if(inputstr=="")
    {
		 $("#"+id).attr("style","display:none;");
    }
	else
	{
		$.ajax({
			   type: "POST",
			   url: "search_zy.php",
			   data: "name="+inputstr+"&type="+type,
			   success: function(data){
				     if(data.length >0) {
			            	$("#"+id).html("<div class=\"jobajax\">"+data+"</div");
			            	 $("#"+id).attr("style","display:block;");
			                 $("#"+id).find("a").bind('click', function() {
			                 $("#"+id).attr("style","display:none;");
			     	         $("#"+inputid).attr("value",this.innerHTML);
			     	          });
			            }
			   }
			});

	}
}
//function fill(obj)
//{
//	 $("#zy_s").attr("style","display:none;");
//     $("#Sname").attr("value",obj.innerHTML);
//}
function closediv(divid)
{
	$("#"+divid).attr("style","display:none;");
}
function goto(url)
{
	window.location.href=url;
}



