

//内部弹出层的大小width:678px;height:449px;；


//调用此方法弹出div层，参数title为 div层的标题栏      content 为div层中显示的所有内容     width1 为div的长度。


var closeBack_ = null;
function testMessageBox(title,content,width1,closeBack)
{
	//closeWindow();
	var objPos = mousePosition(getEvent());
	showMessageBox(title,content,objPos,0,width1);
}
function testMessageBoxCloseBack(title,content,width1,closeBack)
{
	//closeWindow();
	closeBack_ = closeBack;
	testMessageBox(title,content,width1);
}
var isIe=(document.all)?true:false;
//设置select的可见状态״̬
function setSelectState(state){
	var objl=document.getElementsByTagName('select');
	for(var i=0;i<objl.length;i++){
		objl[i].style.visibility=state;
	}
}
function mousePosition(ev)
{
if(ev.pageX || ev.pageY)
{
return {x:ev.pageX, y:ev.pageY};
}
return {
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,y:ev.clientY + document.body.scrollTop - document.body.clientTop
};
}
//弹出方法
function showMessageBox(wTitle,content,pos,wWidth,width1)
{
//closeWindow();
var bWidth=parseInt(document.documentElement.scrollWidth);
var bHeight=parseInt(document.documentElement.scrollHeight);
if(isIe){
setSelectState('hidden');}
var back=document.createElement("div");
back.id="back";
var styleStr="top:0px;left:0px;position:absolute;background:#666;width:"+bWidth+"px;height:"+bHeight+"px;";
styleStr+=(isIe)?"filter:alpha(opacity=0);":"opacity:0;";
back.style.cssText=styleStr;
document.body.appendChild(back); 
showBackground(back,50);
var mesW=document.createElement("div");
mesW.id="mesWindow";
mesW.className="mesWindow";
mesW.innerHTML="<div class='mesWindowTop'><table id='3314' width='698' height='53' border='0' cellpadding='0' cellspacing='0'><tr><td style='background-image:url(/jp/images/div/tanchudiv_01.png);font-size:16px; color:#FFFFFF' width='648' height='53' valign='bottom'><div style='margin-bottom:20px;'>&nbsp;&nbsp;"+wTitle+"</div></td><td><img   border='0' onclick='closeWindow();' title='close' style='cursor:pointer' src='/jp/images/div/tanchudiv_02.png' width='50' height='53' ></td></tr></table></div><div  class='mesWindowContent' id='mesWindowContent'><table  style='background-image:url(/jp/images/div/tanchudiv_03.png); background-repeat:repeat-y' id='3314' width='698'  border='0' cellpadding='0' cellspacing='0'><tr><td width='8'></td><td  width='690'><div style='padding:0px 18px 0px 18px;text-align:center;width:678px;height:"+width1+"px;overflow-y:auto; '>"+content+"<br><br><img id='closeimg' onclick='guanbiimg(3);closeWindow()' onmouseover='guanbiimg(2)' onmouseout='guanbiimg(1)' src='/jp/images/index/guanbi1.png'/></div></td><td width='10'></td></tr></table><table border='0' cellpadding='0' cellspacing='0'><tr><td width='8' colspan='3'><img src='/jp/images/div/tanchudiv_05.png' ></td></tr></table></div><div class='mesWindowBottom'></div>";
var v_top=(document.body.clientHeight-mesW.clientHeight)/2;
v_top+=document.documentElement.scrollTop;
styleStr="top:"+(v_top-270)+"px;left:"+(document.body.clientWidth/2-mesW.clientWidth/2)+"px;position:absolute;width:698px;margin-left:-300px;left:50%;z-index:9999;";
mesW.style.cssText=styleStr;
document.body.appendChild(mesW);
}
//让背景渐渐变暗
function showBackground(obj,endInt)
{
if(isIe)
{
obj.filters.alpha.opacity+=5;
if(obj.filters.alpha.opacity<endInt)
{
setTimeout(function(){showBackground(obj,endInt)},5);
}
}else{
var al=parseFloat(obj.style.opacity);al+=0.05;
obj.style.opacity=al;
if(al<(endInt/100))
{setTimeout(function(){showBackground(obj,endInt)},5);}
}
}
//关闭窗口
function closeWindow()
{
	if(document.getElementById('back')!=null){
		document.getElementById('back').parentNode.removeChild(document.getElementById('back'));
	}
	if(document.getElementById('mesWindow')!=null){
		document.getElementById('mesWindow').parentNode.removeChild(document.getElementById('mesWindow'));
	}
	if(isIe){
		setSelectState('');}
	// for close
	if(closeBack_!=null&&closeBack_!=""&&closeBack_!="undefined"){
		closeBack_();
		closeBack_ = null;
	}
}
function getEvent(){ 
return window.event || arguments.callee.caller.arguments[0]; 
}


//调用此方法弹出透明的遮罩层，参数bgname为 层显示背景图地址。用于使用帮助
function helpdiv1(bgname,left,top){

	var sWidth,sHeight;
	sWidth=document.body.offsetWidth;
	sHeight=screen.height;
	var bgObj=document.createElement("div");
	bgObj.setAttribute('id','bgDiv111');
	bgObj.style.position="absolute";
	bgObj.style.top="0";
	bgObj.style.opacity="1";
	bgObj.style.left="0";
	bgObj.style.width=sWidth + "px";
	bgObj.style.height=sHeight + "px";
	bgObj.style.zIndex = "10000";
	document.body.appendChild(bgObj);
	document.getElementById('bgDiv111').innerHTML="<table align='center' style='background-image:url(/jp/images/div/"+bgname+");background-repeat:no-repeat; background-position:"+left+" "+top+";' width='1024' height='800' border='0' cellspacing='0' cellpadding='0'><tr><td align='left' valign='top'>&nbsp;&nbsp;&nbsp;&nbsp;<img  onclick='clearHelp();' src='/jp/images/div/smile1.png'/></td></tr></table>";
	bgObj.onclick=function(){
		   document.body.removeChild(bgObj);
		
	}
			
 }
function clearHelp(){
	
	 XmlHttp.call("POST", "/jp/web/doDisableHelp.do","",null);
}
function guanbiimg(flag){
	var closeimg = document.getElementById("closeimg");
	if(flag==1){//鼠标移出关闭按钮
		closeimg.src="/jp/images/index/guanbi1.png";
	}else if(flag==2){//鼠标移入关闭按钮
		closeimg.src="/jp/images/index/guanbi2.png";
	}else{//鼠标点击关闭按钮
		closeimg.src="/jp/images/index/guanbi3.png";
	}
	
	
	
}
