function moveHandler(e){
    if (e == null) {
        e = window.event
    }
    if (e.button <= 1 && dragOK) {
		if (e.clientX - dragXoffset < -680) {
			savedTarget.style.left = '-680px';
		}
		else {
			savedTarget.style.left = e.clientX - dragXoffset + 'px';
		}
		
		if (e.clientY - dragYoffset < 0) {
			savedTarget.style.top = '0px';
		}
		else {
			savedTarget.style.top = e.clientY - dragYoffset + 'px';
		}
        return false;
    }
}

function cleanup(e){
    document.onmousemove = null;
    document.onmouseup = null;
    savedTarget.style.cursor = orgCursor;
    dragOK = false;
}

function dragHandler(e){
    var htype = '-moz-grabbing';
    if (e == null) {
        e = window.event;
        htype = 'move';
    }
    var target = e.target != null ? e.target : e.srcElement;
    orgCursor = target.style.cursor;
    if (target.className == "title") {
        savedTarget = document.getElementById('vidPane');
        dragOK = true;
        dragXoffset = e.clientX - parseInt(vidPaneID.style.left);
        dragYoffset = e.clientY - parseInt(vidPaneID.style.top);
        document.onmousemove = moveHandler;
        document.onmouseup = cleanup;
        return false;
    }
}

document.onmousedown = dragHandler;
