function hide_prouct_image(small, nid, hide)
{
	name = "hide-product-img-" + nid;
	if (hide)
	{
		document.getElementById(name).style.display = "none";
	}
	else
	{
		element = document.getElementById(name)
		stX = topX(small);
		stY = topY(small);
		sbX = bottomX(small);
		sbY = bottomY(small);
		windowX = window.innerWidth;
		windowY = window.innerHeight;
		element.style.left = sbX + 10;
		if (element.offsetHeight > (windowY - stY))
		{
			element.style.top = windowY - element.offsetHeight;
		}
		else
		{
			element.style.top = stY;
		}
		element.style.zIndex = 10;
		element.style.display = "block";
	}
}

function topX(obj)
{
	result=0;
	do
	{
		result+=obj.offsetLeft;
		obj=obj.offsetParent;
	}
	while (obj!=null)
	return result;
}

function topY(obj)
{
	result=0;
	do
	{
		result+=obj.offsetTop;
		obj=obj.offsetParent;
	}
	while (obj!=null)
	return result;
}

function bottomX(obj)
{
	return this.topX(obj)+obj.offsetWidth;
}

function bottomY(obj)
{
	return this.topY(obj)+obj.offsetHeight;
}

