#wkorb { position: absolute; left: 250; top: 200; width: 500px; height: 300px; border: 1px solid black; text-align: left } #header { height: 12px; background-color: #EEEEEE; font-family: Lucida Console; font-size: 12px; font-weight: 700; margin: 2px; cursor: move } #x { height: 12px; background-color: #5782FF; color: white; font-size: 12px; font-weight: 700; float: right; } #content { height: 282px; background-color: white; margin: 2px; overflow: auto } .wktxt { font-family: Lucida Console; font-size: 10px; } var drag = false; initevent(); var korbx = 250; var korby = 200; function startdrag() { drag= true; document.getElementById('wkorb').style.border = '1px solid #AE0000'; if (navigator.appName == 'Microsoft Internet Explorer') { clickx = event.clientX; clicky = event.clientY; } else { clickx = MyEvent.screenX; clicky = MyEvent.screenY; } } function stopdrag() { drag = false; document.getElementById('wkorb').style.border = '1px solid black'; if (navigator.appName == 'Microsoft Internet Explorer') { korbx += event.clientX - clickx; korby += event.clientY - clicky; } else { korbx += MyEvent.screenX - clickx; korby += MyEvent.screenY - clicky; } } function initevent() { if (navigator.appName == 'Microsoft Internet Explorer') { document.body.onmousemove=MShandleMove; document.write (''); } if (navigator.appName == 'Netscape') { // document.CaptureEvents(Event.MOUSEMOVE); document.onmousemove=NShandleMove; document.write (''); } } function MShandleMove() { if (drag == true) { document.getElementById('wkorb').style.left = korbx + window.event.clientX - clickx; document.getElementById('wkorb').style.top = korby + window.event.clientY - clicky; } } function NShandleMove(ev) { MyEvent = ev; if (drag == true) { document.getElementById('wkorb').style.left = korbx + MyEvent.screenX - clickx// - 350; //- 50 document.getElementById('wkorb').style.top = korby + MyEvent.screenY - clicky// - 120; //- 150 } }