function SwapProductImage(varThisContainer, varDefaultImage, varHoverImage, bIsBlack)
	{
	//alert(varThisContainer.getElementsByTagName("img")[0].src);
	//alert(varThisContainer.style.backgroundImage);
	if (varThisContainer.getElementsByTagName("img")[0].src != "http://www.cafepress.com/content/marketplace/img/search/trans.gif")
		{
		varThisContainer.getElementsByTagName("img")[0].src = "http://www.cafepress.com/content/marketplace/img/search/trans.gif";
		varThisContainer.style.backgroundImage = "url(" + varHoverImage + ")";
		if (bIsBlack) varThisContainer.style.backgroundColor = "Black";
		}
	else
		{
		if (varThisContainer.style.backgroundImage == "url(" + varDefaultImage + ")")
			{
			varThisContainer.getElementsByTagName("img")[0].src = "http://www.cafepress.com/content/marketplace/img/search/trans.gif";
			varThisContainer.style.backgroundImage = "url(" + varHoverImage + ")";
			if (bIsBlack) varThisContainer.style.backgroundColor = "Black";
			}
		else
			{
			varThisContainer.getElementsByTagName("img")[0].src = "http://www.cafepress.com/content/marketplace/img/search/trans.gif";
			varThisContainer.style.backgroundImage = "url(" + varDefaultImage + ")"
			varThisContainer.style.backgroundColor = "White";
			}
		}
	}

function SwapHeaderImage(varThisContainer)
	{
	if (varThisContainer.getElementsByTagName("img")[0].src.indexOf("0.gif") > 0)
		{
		varThisContainer.getElementsByTagName("img")[0].src = varThisContainer.getElementsByTagName("img")[0].src.replace("0.gif", "1.gif");
		}
	else
		{
		varThisContainer.getElementsByTagName("img")[0].src = varThisContainer.getElementsByTagName("img")[0].src.replace("1.gif", "0.gif");
		}
	
	}
	
function SwapProductFrontBack(me)
	{
	if (me.style.backgroundImage.indexOf("_F") > 0)
		{
		me.style.backgroundImage = me.style.backgroundImage.replace("_F", "_B");
		}
	else
		{
		me.style.backgroundImage = me.style.backgroundImage.replace("_B", "_F");
		}
	}
	
function ToggleFloatingThumb(imgSrc)
	{
	
	var imgBlock = document.getElementById("divFloatingThumb");
	
	if (imgBlock.style.display == "none")
		{
		imgBlock.style.display = "block";
		imgBlock.style.top = event.clientY + document.body.scrollTop;
		imgBlock.style.left = event.clientX + 50;
		//imgBlock.innerText = imgBlock.style.top;
		imgBlock.getElementsByTagName("img")[0].src = imgSrc;
		//alert(imgBlock.getElementsByTagName("img")[0].src);
		}
	else
		{
		imgBlock.style.display = "none";
		//imgBlock.innerText = "";
		}
	}

function ShowHide(DivName)
	{
	
	var imgBlock = document.getElementById(DivName);
	
	if (imgBlock.style.display == "none")
		{
		imgBlock.style.display = "block";
		}
	else
		{
		imgBlock.style.display = "none";
		}
	//alert(imgBlock.style.backgroundImage);
	}

function getPosition(e)
	{
	e = e || window.event;
	var cursor = {x:0, y:0};
	if (e.pageX || e.pageY)
		{
		cursor.x = e.pageX;
		cursor.y = e.pageY;
		} 
	else
		{
		var de = document.documentElement;
		var b = document.body;
		cursor.x = e.clientX + (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
		cursor.y = e.clientY + (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
		}
	return cursor;
	//alert(cursor.x);
	}