Dragging div does not work in IE 7 & 8
<p>I am using the following function to drag a div by a handle:</p>

<pre><code>function enableDragging(ele) {
    var dragging = dragging || false,
        x, y, Ox, Oy,
        current;
        enableDragging.z = enableDragging.z || 1;
    var grabber = document.getElementById("myHandelDiv");
    grabber.onmousedown = function(ev) {
        current = ev.target.parentNode;
        dragging = true;
        x = ev.clientX;
        y = ev.clientY;
        Ox = current.offsetLeft;
        Oy = current.offsetTop;
        current.style.zIndex = ++enableDragging.z;
        console.log(dragging);

        window.onmousemove = function(ev) {
            pauseEvent(ev);         
            if (dragging == true) {
                var Sx = ev.clientX - x + Ox,
                    Sy = ev.clientY - y + Oy;
                current.style.top = Sy + "px";
                current.style.left = Sx + "px";
                document.body.focus();
                // prevent text selection in IE
                document.onselectstart = function () { return false; };
                // prevent IE from trying to drag an image
                ev.ondragstart = function() { return false; };                  
                return false;   
            }
        };
        window.onmouseup = function(ev) {
            dragging &amp;&amp; (dragging = false);
        }
    };
}    

function pauseEvent(e){
    if(e.stopPropagation) e.stopPropagation();
    if(e.preventDefault) e.preventDefault();
    e.cancelBubble=true;
    e.returnValue=false;
    return false;
}
</code></pre>

<blockquote>
  <p>I have two problems:</p>
  
  <ol>
  <li>Does not work in IE 7 &amp; 8, for some reason i get no errors whatsoever.</li>
  <li>Text is selected on some browsers while dragging causing the drag to appear laggy</li>
  </ol>
</blockquote>

<p>I initiate the drag like this:</p>

<pre><code>var ele = document.getElementById("divDragWrapper");
enableDragging(ele);
</code></pre>

<blockquote>
  <p>Update, am now getting this error in IE:</p>
  
  <p>SCRIPT5007: Unable to get value of the property 'target': object is
  null or undefined </p>
  
  <p>On this line: current = ev.target.parentNode;</p>
</blockquote>
