// JavaScript Document
<!--
isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;
lyLeft=0;
lyTop=0;

function LayerPos(){
	var rightedge = document.body.clientWidth-event.clientX;
	var bottomedge = document.body.clientHeight-event.clientY;
	if (rightedge < theLayer.offsetWidth)
	lyLeft = document.body.scrollLeft + event.clientX - theLayer.offsetWidth;
	else
	lyLeft = document.body.scrollLeft + event.clientX;
	if (bottomedge < theLayer.offsetHeight)
	lyTop = document.body.scrollTop + event.clientY - theLayer.offsetHeight;
	else
	lyTop = document.body.scrollTop + event.clientY;
	
	lyLeft = lyLeft-250;
	lyTop = lyTop-70;
}

function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");  
  hotDog=isIE ? event.srcElement : e.target;   
         	   
  while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
  }      
  if (hotDog.id=="titleBar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDog.style.left);
    nowY=parseInt(whichDog.style.top);		
	
    ddEnabled=true;
    document.onmousemove=dd;
  }
  //·¹ÀÌ¹ö À§Ä¡Àâ±â
  LayerPos();	  
}

function dd(e){
  if (!ddEnabled) return;
  whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; 
  whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;  
}

function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

function hideMe(){
  if (isIE||isNN) whichDog.style.visibility="hidden";
  else if (isN4) document.theLayer.visibility="hide";
}

function showMe(){
  whichDog.style.left=lyLeft;
  whichDog.style.top=lyTop;
  if (isIE||isNN) whichDog.style.visibility="visible";
  else if (isN4) document.theLayer.visibility="show";  
}

function Comment_Win(idx,uid) {
  var theform = document.Dis_DelForm;
  //°ªÀ» ÃÊ±âÈ­ ÇÑ´Ù.
  theform.Dis_Upwd.value = "";
  theform.Dis_Delidx.value = "";
    
  theform.Dis_Delidx.value = idx;
  theform.Dis_Upwd.value=uid;
  showMe();
  theform.Dis_Upwd.focus();
}

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");
//-->