var ie=document.all
var ns6=document.getElementById&&!document.all
var moveObj = null;
var moveX, moveY, temp1, temp2;

function mouseMove(e){
	if (moveObj != null)  {
		moveObj.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-moveX
		moveObj.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-moveY
		return false
	}
}

function mouseDown(e){
	if (!ie&&!ns6) return;
	var firedobj=ns6? e.target : event.srcElement
	var topelement=ns6? "HTML" : "BODY"

	while (firedobj.tagName!=topelement&&firedobj.className!="dragButton")  {
		firedobj=ns6? firedobj.parentNode : firedobj.parentElement
	}
	if (firedobj.className!="dragButton") return;

	while (firedobj.tagName!=topelement&&firedobj.className!="drag")  {
		firedobj=ns6? firedobj.parentNode : firedobj.parentElement
	}
	
	if (firedobj.className=="drag")  {
		dragapproved=true;
		moveObj=firedobj;
		temp1=parseInt(moveObj.style.left+0);
		temp2=parseInt(moveObj.style.top+0);
		moveX=ns6? e.clientX: event.clientX;
		moveY=ns6? e.clientY: event.clientY;
		return false
	}
}

document.onmousedown=mouseDown
document.onmousemove=mouseMove
document.onmouseup=new Function("moveObj=null")

function setCookie(name,value,expireDays) 
{
	var eDate = new Date();
	eDate.setDate(eDate.getDate() + expireDays);
	document.cookie=name + "=" + escape(value) + "; path=/ "+ ((expireDays == null)? "" : (" ;expires=" + eDate.toGMTString())); 
}

function getCookie(name){

	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
        
	while(i< clen){
		var j = i + alen;
		if(document.cookie.substring(i,j)==arg){
			var end = document.cookie.indexOf(";",j);
			if(end == -1)
				end = document.cookie.length;
			return unescape(document.cookie.substring(j,end));
		}
		i=document.cookie.indexOf(" ",i)+1;
		if (i==0) break;
	}
	return null;
}
function closePopup(no)
{
	document.all['span_popup_'+no].style.display="none";
	
        if ( document.all['popup_btn_'+no].checked ) 
             setCookie( "popup_" + no, "ok" , 1);
}
function drawPopup(no, width, height, title, str)
{
	var content = (str != null) ? str.replace(/_-N-_/g,"\n") : "";

	document.write('<div style="position:absolute; top:245; left:850;  z-index:1000;"><div id=span_popup_'+no+' style=position:absolute class=drag>');
//	document.write('<div style="position:absolute; top:490; left:870;  z-index:1000;"><div id=span_popup_'+no+' style=position:absolute class=drag>');
	document.write('<div style="position:absolute; z-index:999"><iframe width='+(width+4)+' height='+(height+36)+' marginwidth=0 marginheight=0 scrolling=no frameborder=0 style="margin: 2 0 0 0"></iframe></div>');
	document.write('<div style="position:absolute; z-index:999"><iframe width='+(width)+' height='+(height+40)+' marginwidth=0 marginheight=0 scrolling=no frameborder=0 style="margin: 0 0 0 2"></iframe></div>');
	document.write('<div style="position:absolute; z-index:999"><table width='+(width+4)+' height='+(height+40)+' border=0 cellpadding=0 cellspacing=0>');
	
	document.write('<tr><td width=4 height=20><img src=/images/ptl.gif width=4 height=20></td>');
	document.write('<td width='+(width)+' bgcolor=#333333 style=cursor:hand class=dragButton>');
	document.write('<table width=100% height=20 border=0 cellspacing=0 cellpadding=0><tr><td height=20 align=center><font color=white>'+title+'</font></td>');
	document.write('<td width=50 height=20 bgcolor=#333333 align=right><span onclick=closePopup('+no+') style=color:white>close <img src=/images/ptx.gif align=absmiddle></span></td>');
	document.write('</tr></table></td>');
	document.write('<td width=4 height=20><img src=/images/ptr.gif width=4 height=20></td></tr>');
	
	document.write('<tr><td colspan=3 bgcolor=#21446C><table width=100% height='+height+' border=0 cellpadding=0 cellspacing=0 style="border-left:2 solid #21446C; border-right:2 solid #21446C">');
	document.write('<tr><td align=center bgcolor=white>' +content + '</td></tr>');
	document.write('</table></td></tr>');

	document.write('<tr height=20><td width=4 height=20 valign=bottom><img src=/images/pbl.gif width=4 height=20></td>');
	document.write('<td align=right bgcolor=#333333 nowrap><input name="popup_btn_'+no+'" type="checkbox"  onClick="closePopup('+no+')" style="margin:-2 0 -1 0"><font color=white>¿À´ÃÀº ±×¸¸º¸±â</font></td>')
	document.write('<td width=4 height=20><img src=/images/pbr.gif width=4 height=20></td></tr>');
	
	document.write('</table>');
	document.write('</div></div></div>');
}
//21446C
      function MM_swapImgRestore() { //v3.0
        var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
      }
      function MM_swapImage() { //v3.0
        var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
        if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
      }

function drawPopup2(no, width, height, title, str)
{
	var content = (str != null) ? str.replace(/_-N-_/g,"\n") : "";

	document.write('<div style="position:absolute; top:100; left:870;  z-index:1000;"><div id=span_popup_'+no+' style=position:absolute class=drag>');
	document.write('<div style="position:absolute; z-index:999"><iframe width='+(width+4)+' height='+(height+36)+' marginwidth=0 marginheight=0 scrolling=no frameborder=0 style="margin: 2 0 0 0"></iframe></div>');
	document.write('<div style="position:absolute; z-index:999"><iframe width='+(width)+' height='+(height+40)+' marginwidth=0 marginheight=0 scrolling=no frameborder=0 style="margin: 0 0 0 2"></iframe></div>');
	document.write('<div style="position:absolute; z-index:999"><table width='+(width+4)+' height='+(height+40)+' border=0 cellpadding=0 cellspacing=0>');
	
	document.write('<tr><td width=4 height=20><img src=/images/ptl.gif width=4 height=20></td>');
	document.write('<td width='+(width)+' bgcolor=#333333 style=cursor:hand class=dragButton>');
	document.write('<table width=100% height=20 border=0 cellspacing=0 cellpadding=0><tr><td height=20 align=center><font color=white>'+title+'</font></td>');
	document.write('<td width=50 height=20 bgcolor=#333333 align=right><span onclick=closePopup('+no+') style=color:white>close <img src=/images/ptx.gif align=absmiddle></span></td>');
	document.write('</tr></table></td>');
	document.write('<td width=4 height=20><img src=/images/ptr.gif width=4 height=20></td></tr>');
	
	document.write('<tr><td colspan=3 bgcolor=#21446C><table width=100% height='+height+' border=0 cellpadding=0 cellspacing=0 style="border-left:2 solid #21446C; border-right:2 solid #21446C">');
	document.write('<tr><td align=center bgcolor=white>' +content + '</td></tr>');
	document.write('</table></td></tr>');

	document.write('<tr height=20><td width=4 height=20 valign=bottom><img src=/images/pbl.gif width=4 height=20></td>');
	document.write('<td align=right bgcolor=#333333 nowrap><input name="popup_btn_'+no+'" type="checkbox"  onClick="closePopup('+no+')" style="margin:-2 0 -1 0"><font color=white>¿À´ÃÀº ±×¸¸º¸±â</font></td>')
	document.write('<td width=4 height=20><img src=/images/pbr.gif width=4 height=20></td></tr>');
	
	document.write('</table>');
	document.write('</div></div></div>');
}
