var isIE=document.all;
var whichDog;
var ddEnabled;

function ddInit(e){
	try
	{
		var topDog=isIE ? "BODY" : "HTML";
		whichDog=$("quickViewDiv");
		var hotDog=isIE ? event.srcElement : e.target;

		while (hotDog.id!="quickViewDivTitleBar"&&hotDog.tagName!=topDog){
			hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
		}

		if (hotDog.id=="quickViewDivTitleBar"){
			offsetx=isIE ? event.clientX : e.clientX;
			offsety=isIE ? event.clientY : e.clientY;
			nowX=parseInt(whichDog.style.left);
			nowY=parseInt(whichDog.style.top);

			ddEnabled=true;
			document.onmousemove=dd;
		}
	}
	catch (e)
	{
	}
	
}

function dd(e){
	if (!ddEnabled) return;

	var newX=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx;
	var newY=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
	
	whichDog.setStyle({'left': newX + 'px'});
	whichDog.setStyle({'top': newY + 'px'});
	
	return false;
}

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");