//获取ID
function GetObj(objName){if(document.getElementById){return eval('document.getElementById("' + objName + '")');}else if(document.layers){return eval("document.layers['" + objName +"']");}else{return eval('document.all.' + objName);}}
//载入flash
function loadflash(url,width,height) {document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ width +'" height="'+ height +'"><param name="movie" value="'+ url +'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="'+ url +'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ width +'" height="'+ height +'"></embed></object>');}
//跳转页面
function gotourl(url) {if (url!=="") {top.location = url;}}
//跳转页面2
function gotosearch(str) {if (str!=="") {top.location = "./search2.php?type=2&key=" + encodeURI(str) ;}}
//显示窗口
function openurl(url) {if (url!=="") {window.open (url);}}
//自动改变高度
function autoH(Obj,str) {if (exist(Obj)==true){GetObj(Obj).style.height = str+"px";autoWH("box_left","box_right");}}
//自动对齐高度
function autoWH(Obj,Obj2) {if (exist(Obj)==true && exist(Obj2)==true) {var left_h = GetObj(Obj).scrollHeight;var right_h = GetObj(Obj2).scrollHeight;if (left_h > right_h) {GetObj(Obj).style.height= left_h +"px";GetObj(Obj2).style.height= left_h +"px";}else{GetObj(Obj).style.height= right_h +"px";GetObj(Obj2).style.height= right_h +"px";}}}
//判断ID是否存在
function exist(id){var s=GetObj(id);if(s){return true}else{return false}}
//判断ID是否存在
//window.onload = function() {autoWH("box_left","box_right");}
//显示弹出层
function alertinfo(id,urlValue,divTitle,divWidth,divHeight){
	var obj = GetObj(id);
	//--------------------------------------------
	var pageWidth,pageHeight;
	var xScroll,yScroll;
	if(window.innerHeight&&window.scrollMaxY){
		xScroll=document.body.scrollWidth;
		yScroll=window.innerHeight+window.scrollMaxY;
	}else if(document.body.scrollHeight>document.body.offsetHeight){
		xScroll=document.body.scrollWidth;
		yScroll=document.body.scrollHeight;
	}else{
		xScroll=document.body.offsetWidth;
		yScroll=document.body.offsetHeight;
	}
	var windowWidth,windowHeight;
	if(self.innerHeight){
		windowWidth=self.innerWidth;
		windowHeight=self.innerHeight;
	}else if(document.documentElement&&document.documentElement.clientHeight){
		windowWidth=document.documentElement.clientWidth;
		windowHeight=document.documentElement.clientHeight;
	}else if(document.body){
		windowWidth=document.body.clientWidth;
		windowHeight=document.body.clientHeight;
	}
	if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
	if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
	//--------------------------------------------
	GetObj(id+"_title").innerHTML = divTitle;
	obj.style.display="block";
	obj.style.width= divWidth + "px";
	obj.style.height= divHeight + "px";
	GetObj(id+"_intro").style.height= divHeight-23 + "px";
	obj.style.left= (windowWidth/2 - (divWidth/2)) + "px";
	obj.style.top= (windowHeight/2 - (divHeight/2) -5) + "px";
	GetObj("bg").style.display="block";
	GetObj("bg").style.width=pageWidth + "px";
	GetObj("bg").style.height=pageHeight + "px";
	//--------------------------------------------
	GetObj("myIframe").src = urlValue;
}
//显示应聘些岗位层
function alertJob(id, urlValue){
	var obj = GetObj(id);
	//--------------------------------------------
	var pageWidth,pageHeight;
	var xScroll,yScroll;
	if(window.innerHeight&&window.scrollMaxY){
		xScroll=document.body.scrollWidth;
		yScroll=window.innerHeight+window.scrollMaxY;
	}else if(document.body.scrollHeight>document.body.offsetHeight){
		xScroll=document.body.scrollWidth;
		yScroll=document.body.scrollHeight;
	}else{
		xScroll=document.body.offsetWidth;
		yScroll=document.body.offsetHeight;
	}
	var windowWidth,windowHeight;
	if(self.innerHeight){
		windowWidth=self.innerWidth;
		windowHeight=self.innerHeight;
	}else if(document.documentElement&&document.documentElement.clientHeight){
		windowWidth=document.documentElement.clientWidth;
		windowHeight=document.documentElement.clientHeight;
	}else if(document.body){
		windowWidth=document.body.clientWidth;
		windowHeight=document.body.clientHeight;
	}
	if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
	if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
	//--------------------------------------------
	obj.style.display="block";
	obj.style.left= (windowWidth/2 - (obj.scrollWidth/2)) + "px";
	obj.style.top= (windowHeight/2 - (obj.scrollHeight/2)) + "px";
	GetObj("bg").style.display="block";
	GetObj("bg").style.width=pageWidth + "px";
	GetObj("bg").style.height=pageHeight + "px";
	GetObj("myIframe").src = urlValue;
}
//显示应聘些岗位层
function alertNet(id, urlValue){
	var obj = GetObj(id);
	//--------------------------------------------
	var pageWidth,pageHeight;
	var xScroll,yScroll;
	if(window.innerHeight&&window.scrollMaxY){
		xScroll=document.body.scrollWidth;
		yScroll=window.innerHeight+window.scrollMaxY;
	}else if(document.body.scrollHeight>document.body.offsetHeight){
		xScroll=document.body.scrollWidth;
		yScroll=document.body.scrollHeight;
	}else{
		xScroll=document.body.offsetWidth;
		yScroll=document.body.offsetHeight;
	}
	var windowWidth,windowHeight;
	if(self.innerHeight){
		windowWidth=self.innerWidth;
		windowHeight=self.innerHeight;
	}else if(document.documentElement&&document.documentElement.clientHeight){
		windowWidth=document.documentElement.clientWidth;
		windowHeight=document.documentElement.clientHeight;
	}else if(document.body){
		windowWidth=document.body.clientWidth;
		windowHeight=document.body.clientHeight;
	}
	if(yScroll<windowHeight){pageHeight=windowHeight;}else{pageHeight=yScroll;}
	if(xScroll<windowWidth){pageWidth=windowWidth;}else{pageWidth=xScroll;}
	//--------------------------------------------
	obj.style.display="block";
	obj.style.left= (windowWidth/2 - (obj.scrollWidth/2)) + "px";
	obj.style.top= (windowHeight/2 - (obj.scrollHeight/2)) + "px";
	GetObj("bg").style.display="block";
	GetObj("bg").style.width=pageWidth + "px";
	GetObj("bg").style.height=pageHeight + "px";
	GetObj("myIframe").src = urlValue;
}
//关闭弹出层
function closediv(id){document.getElementById(id).style.display="none";document.getElementById("bg").style.display="none";var scrollstyle = scrolls();scrollstyle.style.overflowY = "auto";scrollstyle.style.overflowX = "hidden";}
//取浏览器类型
function scrolls(){var temp_h1 = document.body.clientHeight;var temp_h2 = document.documentElement.clientHeight;var isXhtml = (temp_h2<=temp_h1&&temp_h2!=0)?true:false;var htmlbody = isXhtml?document.documentElement:document.body;return htmlbody;}


