var move=false; 
function StartDrag(obj)                       
{
// if(event.button==1&&obj.srcElement.tagName.toUpperCase()=="DIV")
 if(event.button==1)
 {
  obj.setCapture();
  obj.style.background="#999";
  move=true;
  } 
}

function Drag(obj)                   
{
 if(move)
 {
  var oldwin=obj.parentNode;
  oldwin.style.left=event.clientX-50;
  oldwin.style.top=event.clientY-10;
 }
 
 }

function StopDrag(obj)
{
  obj.style.background="#000";
  obj.releaseCapture();
  move=false;
  } 