document.write("<div id=popFrame style='position:absolute;top:30px;left:200px;display:none'></div>\n")
popImgPath=alias+"img/popUp/";ns=document.getAll?0:1

mode="";fnt=""
function popUp(title,txt,np){
	spc="&nbsp;&nbsp;&nbsp;";
	var drag=" onmousedown=\"startDrag()\" onmouseover=\"this.style.cursor='move'\" onmouseout=\"this.style.cursor=null\""
	txt= "<table border=0 cellspacing=0 cellpadding=0 style='border-style:solid;border-width:1px;border-color:#130A65' bgcolor=#ffffff onmouseover='checkHeight()'>"+
			"<tr>"+
				"<td colspan=3>"+
					"<table cellspacing=0 cellpadding=0 border=0>"+
						"<td bgcolor=white valign=bottom><img src='"+popImgPath+"topLeft.gif'></td>"+
						"<td id=ttlPop background='"+popImgPath+"pix.gif' nowrap"+drag+">"+title.replace(">",">"+spc).replace("</",spc+"</")+spc+"</td>"+
						"<td valign=middle width=100% background='"+popImgPath+"pixTop.gif'"+drag+"><b>&nbsp</td>"+
						(Idx?"<td valign=middle bgcolor='#486C83' title='Ouvrir premier niveau'><div style='margin-left:6px;height:10px;background-color:white;border:1px solid navy;padding:1px'><a id=sub href=\"javascript:showSub()\" style='font-size:10px;color:#486C83;'>Sub</a></div></td>":"")+
						"<td valign=middle bgcolor='#486C83' title='Décimales'><div style='margin-left:6px;height:10px;background-color:white;border:1px solid navy;padding:1px'><a id=dec href=\"javascript:formatDec('"+fnt+"')\" style='font-size:10px;color:#486C83;'>"+(mode!=""?".00":"INT")+"</a></div></td>"+
						"<td valign=middle bgcolor='#486C83' title='Impression'><div style='margin-left:4px'><a href='javascript:impression()'><img src='"+alias+"img/print.png' border=0></a></div></td>"+
						"<td align=right><a href='javascript:closePop("+np+")' onmouseover=\"NP='"+np+"';stopDrag()\" title='Fermer'><img src='"+popImgPath+"x.gif' border=0></a></td>"+
					"</table>"+
				"</td>"+
			"</tr>"+
			"<tr>"+
				"<td background='"+popImgPath+"left.gif' width=4><img src='"+popImgPath+"left.gif' width=4></td>"+
				"<td background=''>"+
					"<div style='overflow:auto' id=tdPop>"+
						"<div id=popContent style='position:relative;padding:9px;'>"+txt+"</div>"+
					"</div>"+
				"</td>"+
				"<td align=right background='"+popImgPath+"right.gif' width=4><img src='"+popImgPath+"right.gif' width=4></td>"+
			"</tr>"+
			"<tr>"+
				"<td><img src='"+popImgPath+"btmLeft.gif'></td>"+
				"<td  background='"+popImgPath+"btm.gif'><img src='"+popImgPath+"btm.gif'></td>"+
				"<td><img src='"+popImgPath+"btmRight.gif'></td>"+
			"</tr>"+
		"</table>";
	divPop=document.getElementById("popFrame");clsP="";fnt=""
	with(divPop){
		innerHTML=txt;
		style.zIndex=5
		style.display="block"
	}
	checkHeight()
}
function checkHeight(){
	divTd=document.getElementById("tdPop")
	with(document.getElementById("popContent")){
		var k=0.9
		var ih=parseInt(innerHeight*k);ih=clientHeight>ih?ih:clientHeight;divTd.style.height=ih
//		var x=parseInt((innerHeight-ih)/2);if(x>divPop.top)divPop.top=x
//		var iw=parseInt(innerWidth*k);divTd.style.width=clientWidth>=iw?iw:clientWidth;
	}
}
function closePop(){
	divPop.style.display="none";
	eval(clsP);clsP=""
}
function startDrag(e){
	ofsObjX=divPop.offsetLeft;ofsObjY=divPop.offsetTop
	ecx0=1
	divPop.onmousemove=drag_drop
	document.onmouseup=stopDrag
}
function drag_drop(e){
	ecx=ns?e.clientX:event.clientX;ecy=ns?e.clientY:event.clientY
	if(ecx0){
		ofsObjX-=ecx;ofsObjY-=ecy
		ecx0=0
	}
	with(divPop){style.left=ecx+ofsObjX;style.top=ecy+ofsObjY}
}
function stopDrag(){
	divPop.onmousemove=null
	document.onmouseup=null
}

