function setCookie( name, value, expiredays,f ) { 
	var todayDate = new Date(); 
	todayDate.setDate( todayDate.getDate() + expiredays ); 
	document.cookie = name + f + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
} 

function closeWin(f,d) {
	form = eval("document.pupFrm"+f);
	//var sck = eval("maindiv"+f);
	if ( form.chkbox.checked ){ 
			setCookie("maindiv", "done" , 1 ,f ); 
	} 
	var divname = eval("document.all['"+d+"']");
	divname.style.visibility = "hidden";
}

//¸¶¿ì½º µå·¡±×
D_curX = D_curY = 0;
        D_now = null;
        D_prev = null;
        D_1stmv = 1;
        lrs = null;
        dtm = null;
        stm = null;

        document.onmouseup = FinishDrag;

        function FinishDrag() {
                if(document.onmousemove == OnDragMove) {
                        if(D_now.style.pixelLeft < 0) D_now.style.pixelLeft = 1;
                        if(D_now.style.pixelTop < 0) D_now.style.pixelTop = 1;
                        
                        /*
                        l = document.body.clientWidth - D_now.style.pixelWidth;
                        l = document.body.clientHeight-D_now.style.pixelHeight;
                        */

                }

                if(document.onmousemove == OnResizeMove) lrs.Finish();
                document.onmousemove = null;
                D_now = null;
        }
function BeginDragging(lyr) {
    D_now = lyr;
    D_1stmv = 1;
   document.onmousemove = OnDragMove;
}
  function OnDragMove() {
                if(D_now == null) return true;
                if(D_1stmv) {
                        D_curX = event.clientX;
                        D_curY = event.clientY;
                        D_1stmv = 0;
                        if(D_prev != D_now) D_now.style.zIndex = D_now.style.zIndex + 1;
                        D_prev = D_now;
                        return false;
                }
                D_now.style.pixelLeft += (event.clientX - D_curX);
                D_now.style.pixelTop += (event.clientY - D_curY);
                D_curX = event.clientX;
                D_curY = event.clientY;
                event.returnValue = false;
        }
function diOnMouseDown(i) {
    if(event.button == 1) BeginDragging(i);
       event.returnValue = false;
}

function OnResizeMove() {
                if(D_1stmv) {
                        D_curX = event.clientX;
                        D_curY = event.clientY;
                        D_1stmv = 0;
                        return false;
                }
                lrs.AddSize(event.clientX - D_curX, event.clientY - D_curY);
                D_curX = event.clientX;
                D_curY = event.clientY;
                event.returnValue = false;
        }
