мое окно в виде таблице
<body onmousemove="pip()">
<table id="table1" border="1" cellpadding="10" width=500 height=300 style="position:absolute;left:100;top:50">
<tr height=25 bgcolor="blue" onmousedown="flagon()" onmouseup="flagoff()" onmousemove="pip()">
<td></td>
</tr>
<tr>
<td id="td4"> </td>
</tr>
</table>
<script type="text/javascript">
var flag=0, tx=100, ty=50, mx, my;
function flagon(){
flag=1;
mx = event.clientX-tx;
my = event.clientY-ty;
}
function flagoff(){
flag=0;
}
function pip(){
if (flag == 1){
status = flag.toString(10);
document.getElementById('table1').style.left=event.clientX-mx;
document.getElementById('table1').style.top=event.clientY-my;
tx=event.clientX-mx;
ty=event.clientY-my;
}
}
</script>
</body>