function openLayer(conId){
	
	judge_AdmCrazy(conId);
	move_AdmCrazy(conId);




}

//获取内容层内容原始尺寸
function getConSize(conId){
	var conObj=document.getElementById(conId);
	
	var arrayConSize =[conObj.clientWidth,conObj.clientHeight ];
	//conObj.style.display = "none";
	return arrayConSize;
}

//获取滚动条的高度
function getPageScroll(conId){
	var yScroll;
	if (self.pageYOffset){
		yScroll = self.pageYOffset;
	}else if(document.documentElement && document.documentElement.scrollTop){
		yScroll = document.documentElement.scrollTop;
	}else if (document.body){//IE FF
		yScroll = document.body.scrollTop;
	}
	arrayPageScroll = new Array('',yScroll)
	return arrayPageScroll;
}
//获取页面实际大小
function getPageSize(){
	var xScroll,yScroll;
	if (window.innerHeight && window.scrollMaxY){
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.clientHeight ){
		sScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else {//本人IE、Firefox执行此处
		xScroll = document.body.clientWidth;
		yScroll = document.body.clientHeight ;
	}
	var windowWidth,windowHeight;
	if (self.innerHeight) {//本人Firefox执行此处
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight){//本人IE执行此处
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) {
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}
	var pageWidth,pageHeight
	if(yScroll < windowHeight){//IE FF
		pageHeight = windowHeight;
	}else{
		pageHeight = yScroll;
	}
	if(xScroll < windowWidth) {
		pageWidth = windowWidth;
	}else{//IE FF
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}
//关闭弹出层
function closeLayer(conId){
	//clearTimeout(stimeout);
	document.getElementById("fc").innerHTML="";
	document.getElementById(conId).style.display = "none";
	document.getElementById("bodybg").style.display = "none";
	document.getElementById("fc").style.display = "none";
	return false;
}
 function   ice(parentId,conId)   {   
	//alert(conId+parentId);
 //document.getElementById(conId).style.top   =   document.body.scrollTop+100;   
  }   
function move_AdmCrazy(conId)
{
	
	judge_AdmCrazy(conId);
	//stimeout =window.setTimeout("move_AdmCrazy('"+conId+"');",500);
}

function judge_AdmCrazy(conId)
{
	
	//alert(conId);
	var w_con=document.getElementById(conId).clientWidth;
	var h_con=document.getElementById(conId).clientHeight ;
	var popupDiv=document.getElementById(conId);
	popupDiv.style.display = "none";
	if(document.body.scrollWidth <document.body.clientWidth)
	var a=document.body.clientWidth;
	else
	var a=document.body.scrollWidth;
	if(document.body.scrollHeight <document.body.clientHeight )
	var b=document.body.clientHeight;
	else
	var b=document.body.scrollHeight;
	
	if(!document.getElementById("fc"))
	{
		var fcc = document.createElement("div");
		fcc.setAttribute("id","fc");
		insertAfter(fcc,document.getElementsByTagName('body')[0].lastChild);
		//alert('ddd');
		document.getElementById("fc").innerHTML="<iframe id='ifr'    src='about:blank' scrolling='no' frameborder='0' style='position:absolute; top:0px;left:0px; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);z-index:9999;'></iframe>";
	}
	else if(document.getElementById("fc").innerHTML =="")
	{
		document.getElementById("fc").innerHTML="<iframe id='ifr'    src='about:blank' scrolling='no' frameborder='0' style='position:absolute; top:0px;left:0px; filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);z-index:9999;'></iframe>";
	}
	document.getElementById('fc').style.display="";
	document.getElementById('ifr').style.width=a;
	document.getElementById('ifr').style.height=b;
	//alert(document.body.clientHeight+"::"+document.body.offsetHeight);
//var w_parent=document.body.scrollWidth ;
//var h_parent=document.body.scrollHeight ;
var x1=document.documentElement.clientWidth||document.body.clientWidth ;
var x2=document.body.clientHeight ;
var y1=document.documentElement.scrollLeft||document.body.scrollLeft ;
var y2=document.documentElement.scrollTop||document.body.scrollTop;
//alert(document.documentElement.clientHeight+":"+document.body.clientHeight);
var w_left=(x1-w_con)/2+y1;	
//alert(document.body.scrollTop);return;
//alert(w_parent+":"+h_parent);
//alert(y1);return;


//alert(a+":"+x1);

	//alert(popupDiv.innerHTML)
				

	var arrayPageSize = getPageSize();	
	var arrayPageScroll = getPageScroll();
	
		//创建弹出内容层
		
		//给这个元素设置属性与样式
		
		
		popupDiv.style.position = "absolute";
		//	alert("ddd");
		//popupDiv.style.border = "1px solid #ccc";
		//popupDiv.style.background = "red";
		popupDiv.style.zIndex = 999999;	
		//创建弹出背景层
		if(!document.getElementById('bodybg'))
	{
		
		var bodyBack = document.createElement("div");
		insertAfter(bodyBack,document.getElementsByTagName('body')[0].lastChild);
		bodyBack.setAttribute("id","bodybg");
	}	
	else
	{
		var bodyBack = document.getElementById('bodybg');

	}	
		
		bodyBack.style.position = "absolute";
		
		//bodyBack.style.width = "102%";
		//bodyBack.style.height = (arrayPageSize[1] + 35 + 'px');
		bodyBack.style.zIndex = 900;
		
		bodyBack.style.top = 0;
		bodyBack.style.left = 0;
		
		bodyBack.style.filter = "alpha(opacity=50)";
		bodyBack.style.opacity = 0.5;
		bodyBack.style.background =" #323232";
		
		//实现弹出(插入到目标元素之后)
		//var mybody = document.getElementById(objId);
		//insertAfter(popupDiv,mybody);//执行函数insertAfter()
		//执行函数insertAfter()
	//显示背景层
	//alert(document.getElementById("bodybg").style.display);
	//显示内容层
	//var popObj=document.getElementById("popupAddr");
	//popObj.innerHTML = document.getElementById(conId).innerHTML;
	
	
	//alert(w_parent+"/"+w_con);
	var w_left=(x1-w_con)/2+y1;	
	
	var h_top=(x2-h_con)/2+y2;
//	document.getElementById('fcz').innerHTML=x1+"::"+w_con+":"+y1;
	//alert(h_parent+":"+h_con);
	//alert(h_con+":"+h_parent);
	
	//让弹出层在页面中垂直左右居中(统一)
	//	popObj.style.width  = "600px";
	//	popObj.style.height = "400px";
	//	popObj.style.top  = arrayPageScroll[1] + (arrayPageSize[3] - 35 - 400) / 2 + 'px';
	//	popObj.style.left = (arrayPageSize[0] - 20 - 600) / 2 + 'px';
	//让弹出层在页面中垂直左右居中(个性)
	var arrayConSize=getConSize(conId)
	//popupDiv.style.top  = arrayPageScroll[1] + (arrayPageSize[3] - arrayConSize[1]) / 2-50 + 'px';
	//popupDiv.style.left = (arrayPageSize[0] - arrayConSize[0]) / 2 -30 + 'px';
	//alert(h_top+":"+w_left);
	//alert(h_top);
	popupDiv.style.top= h_top;
	//popupDiv.style.left = '100' + 'px';
	popupDiv.style.left=w_left;
	//alert(w_left);
	//popupDiv.style.bottom=0;
	//alert(document.getElementById(parentId).clientHeight );
	/*
	if(document.body.scrollWidth <document.body.clientWidth)
	var a=document.body.clientWidth;
	else
	var a=document.body.scrollWidth;
	if(document.body.scrollHeight <document.body.clientHeight )
	var b=document.body.clientHeight;
	else
	var b=document.body.scrollHeight;
	*/
	//var a=document.documentElement.offsetWidth||document.body.offsetWidth ;
	//var b=document.documentElement.offsetHeight||document.body.offsetHeight ;	
	bodyBack.style.width = a;
	bodyBack.style.height = b;
	bodyBack.style.display = "block";
	popupDiv.style.display = "";

}
	
