      context.putImageData(drawingSurfaceImageData, 0, 0);
    }


    // Rubberbands...................................................

    function updateRubberbandRectangle(loc) {
        rubberbandRect.width = Math.abs(loc.x - mousedown.x);
        rubberbandRect.height = Math.abs(loc.y - mousedown.y);

        if (loc.x > mousedown.x) rubberbandRect.left = mousedown.x;
        else                     rubberbandRect.left = loc.x;

        if (loc.y > mousedown.y) rubberbandRect.top = mousedown.y;
    