var bMovingObj = false;
var objMoving = null;
var mouseX = 0;
var mouseY = 0;
var offsetX = 0;
var offsetY = 0;

if (!is_ie) document.captureEvents(Event.MOUSEMOVE)

document.onmousemove = getMouseXY;
document.onmouseup = function() { 
	moveOff(document.getElementById('dvDialogBox'));
}

function getMouseXY(e) {
	if (is_ie) { 
		mouseX = event.clientX + document.body.scrollLeft;
		mouseY = event.clientY + document.body.scrollTop;
	} else {  
		mouseX = e.pageX;
		mouseY = e.pageY;
	}  
	if (mouseX < 0){mouseX = 0}
	if (mouseY < 0){mouseY = 0}  


	if (bMovingObj) {
		objMoving.style.left = mouseX - offsetX;
		objMoving.style.top = mouseY - offsetY;
	}
	
	return true
}

function movePrompt() { 
	if (document.getElementById('dvDragBar')) { document.getElementById('dvDragBar').style.cursor = 'move'; }
}

function moveRest() { 
}	

function moveOn() {
	offsetX = mouseX - objMoving.offsetLeft;
	offsetY = mouseY - objMoving.offsetTop;
	bMovingObj = true;
	if (document.getElementById('dvDragBar')) { document.getElementById('dvDragBar').className = 'Ready'; }
}

function moveOff() {
	bMovingObj = false;
	if (document.getElementById('dvDragBar')) { document.getElementById('dvDragBar').className = 'Rest'; }
}
