
Dim startX
Dim startY
Dim bMove
Dim curX
Dim curY

curX = 30
curY = 30

Sub btnMClose_OnClick()
	top.window.close()
End Sub

Sub btnMMin_OnClick()
	' top.window.moveTo 0,-4000
	top.window.moveTo screen.Width-1, screen.Height-1
End Sub


Sub Window_OnClick
    msgbox window.event.type
End Sub

Sub window_onfocus()
    top.window.moveTo curX, curY
End Sub


Sub trTitlebar_OnMouseDown()
	If window.event.srcElement.tagName <> "IMG" Then
		bMove = True
		trTitlebar.setCapture()
		startX = window.event.clientX
		startY = window.event.clientY
	End If
End Sub

Sub trTitlebar_OnMouseUp()
	bMove = False
	trTitlebar.releaseCapture()
End Sub

Sub trTitlebar_onmousemove()
	If bMove Then
		curX = (window.event.screenX - startX)
		curY = (window.event.screenY-startY)
		top.window.moveTo curX,curY  
	End If
End Sub


