ED_isIE=document.all;
ED_isNN=!document.all&&document.getElementById;
ED_isHot=false;
EDDivMove = "";

EDDivPop=ED_isIE ? document.all.movePopup : document.getElementById("movePopup");

EDDivPop_head=ED_isIE ? document.all.movePopup_head : document.getElementById("movePopup_head");

function EDPopupLayerSet(str,c_name){ // 레이어 팝업

	if (document.cookie.indexOf(c_name + "=no")== -1){

	EDDivPop.style.display = "block" ;
	sw=document.body.clientWidth ;
	sh=document.body.clientHeight ;

	div_left = (sw-374)/2 ;
	div_top = (sh-284)/2 ;

	EDDivPop.style.left = div_left ;
	EDDivPop.style.top = div_top ;
	}
}


function EDPopupLayerMove(div_left,div_top){ // 레이어 이동
	if(div_left > 0 && div_top > 0)
	{
		EDDivPop.style.left = div_left ;
		EDDivPop.style.top = div_top ;
	}
	EDDivMove = "y";
}

function EDPopMove3(){

	sw=document.body.clientWidth ;
	sh=document.body.clientHeight ;
	div_left = (sw-374)/2 ;
	div_top = (sh-484)/2 ;
	if(EDDivMove!="y"){
		EDDivPop.style.left = div_left ;
		EDDivPop.style.top = div_top ;
	}
}

function EDPopMove2(e){
    offsetx=ED_isIE ? event.clientX : e.clientX;
    offsety=ED_isIE ? event.clientY : e.clientY;
    nowX=parseInt(EDDivPop.style.left);
    nowY=parseInt(EDDivPop.style.top);
	oldx = ED_isIE ? event.clientX-nowX : e.clientX-nowX
	oldy = ED_isIE ? event.clientY-nowY : e.clientY-nowY
    MoveEnabled=true;
    document.onmousemove=EDPopMove;
}

function EDPopMove(e){
  if (!MoveEnabled) return;
  EDDivPop.style.left=ED_isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; 
  EDDivPop.style.top=ED_isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;  
}

EDDivPop_head.onmousedown=EDPopMove2;
EDDivPop_head.onmouseup=Function("MoveEnabled=false");
window.onresize=EDPopMove3;


/*
 *	사용예제
 *	넷마블참조
 */
//EDPopupLayerSet(document.getElementById("movePopup").getElementsByTagName("div")[0].id,'pop_1125');
//EDPopupLayerMove(100,100); // 팝업 위치