var g_showInlineZoonRef = null;

function showInlineZoom(id, url, loadingUrl) {
	var img = document.getElementById('inlineZoomImgUrl');
	var productDiv = document.getElementById('productDiv1');
	if (productDiv == null) {
		productDiv = document.getElementById('productDiv2');
	}
	img.src = loadingUrl;
	var current = document.getElementById(id);
	var xOffset = 0;
	var yOffset = 0;
	while (current != null) {
		xOffset += current.offsetLeft;
		yOffset += current.offsetTop;
		current = current.offsetParent;
	}
	;
	xOffset -= 290;
	yOffset -= 200;
	yOffset += 60;
	yOffset -= productDiv.scrollTop;
	var e = document.getElementById('inlineZoom');
	e.style.visibility = 'visible';
	e.style.background = 'white';
	e.style.padding = '5px';
	e.style.position = 'absolute';
	var xOffsetLiteral = xOffset + 'px';
	var yOffsetLiteral = yOffset + 'px';
	e.style.left = xOffsetLiteral;
	e.style.top = yOffsetLiteral;
	e.style.width = '276px';
	e.style.height = '400px';
	img.src = url;
}

function scheduleShowInlineZoom(id, url, loadingUrl) {
	g_showInlineZoonRef = window.setTimeout('showInlineZoom(\'' + id + '\',\''
			+ url + '\',\'' + loadingUrl + '\')', 500);
}

function hideInlineZoom(loadingUrl) {
	if (g_showInlineZoonRef != null) {
		clearTimeout(g_showInlineZoonRef);
	}
	var img = document.getElementById('inlineZoomImgUrl');
	img.src = loadingUrl;
	var e = document.getElementById('inlineZoom');
	e.style.visibility = 'hidden';
	e.style.width = '0px';
	e.style.height = '0px';
}
