function startDrag(obj)
{
  if(!obj) return;
  draggedBox = obj;
  xOff = 0;
  yOff = 0;
  while(obj.offsetParent){
    xOff += obj.offsetLeft;
    yOff += obj.offsetTop;
    obj = obj.offsetParent;
  }
  
  obj.onmousedown = function(evt)
  {
    coords = mousePos(evt);
    xOff = coords.x - xOff;
    yOff = coords.y - yOff; 
    offset = {x:xOff, y:yOff};
  }
}