'/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
'// ¿ë µµ : ÆË¾÷À» ¸¶¿ì½º·Î ÀÌµ¿ ½ÃÅ´
'// »ç¿ë¹ý : Body¿¡ onmouseup="PopMouseUp(window.event)" onmousemove="PopMouseMove(window.event)" Ãß°¡.
'// ¸¶¿ì½º´Ù¿îºÎºÐ 'onmousedown="PopMouseDown(window.event)" style="CURSOR: move" Ãß°¡.
'////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Dim goLeft, goTop
goLeft = 0
goTop = 0

Function PopMouseDown(e)
	goLeft = e.clientx
	goTop = e.clienty
End Function

Function PopMouseMove(e)
	If goLeft < 1 or goTop < 1 Then Exit Function

	Dim mGap, mLeft, mTop

	mGap = goLeft - replace(document.all.item("PopPanel").style.left,"px","")
	mLeft = e.clientx - mGap

	mGap = goTop - replace(document.all.item("PopPanel").style.top,"px","")
	mTop = e.clienty - mGap

	'¿ÞÂÊ°ú ¿À¸¥ÂÊ¿¡ ÀÚµ¿ ºÙ±â
	If mLeft < 1 Then mLeft = -20
	If mTop < 20 Then mTop = 0

	document.all.item("PopPanel").style.left = mLeft & "px"
	document.all.item("PopPanel").style.top = mTop & "px"

	goLeft = e.clientx
	goTop = e.clienty
End Function

Function PopMouseUp(e)
	if goLeft < 1 or goTop < 1 Then Exit Function

	Dim mGap, mLeft, mTop

	mGap = goLeft - replace(document.all.item("PopPanel").style.left,"px","")
	mLeft = e.clientx - mGap

	mGap = goTop - replace(document.all.item("PopPanel").style.top,"px","")
	mTop = e.clienty - mGap

	'¿ÞÂÊ°ú ¿À¸¥ÂÊ¿¡ ÀÚµ¿ ºÙ±â
	If mLeft < 1 Then mLeft = -20
	If mTop < 20 Then mTop = 0

	document.all.item("PopPanel").style.left = mLeft & "px"
	document.all.item("PopPanel").style.top = mTop & "px"

	goLeft = 0
	goTop = 0
End Function

