
function trapEnter(iKey) {
	if (iKey == 13) {
		var buy = document.getElementById("btnBuyNow")
		if (buy != null) {
			buy.click()
		} else {
			var wish = document.getElementById("btnWishList")
			if (wish != null) {
				wish.click()
			}
		}
		event.returnValue=false;
		event.cancel=true;
	}
	return false;
}

function showImage(sender, e)
{
	var id = sender.rel;
	var a = document.getElementById(id);
	a.href = sender.href;
	a.title = sender.title;
	var img = a.childNodes[0];
	img.src = sender.rev;
	img.alt = sender.title;			

	cancelAction(e);		
}
		
function showTab(curTab, tabId, e)
{
	var navTabs = document.getElementById("navTabs");
				
	for (var i=0; i<navTabs.childNodes.length; i++)
	{
		if (navTabs.childNodes[i].id)
		{
			if (curTab.id == navTabs.childNodes[i].id)
			{
				if (!curTab.className.match("ActiveTab"))
					curTab.className += " ActiveTab";
			}
			else
			{
				navTabs.childNodes[i].className = navTabs.childNodes[i].className.replace("ActiveTab");
			}					
		}
	}
	curTab.blur();			
	showTabContent(tabId, e);		
}
		
function showTabContent(tabId, e)
{
	var navTabs = document.getElementById("navTabs");
	var tabContents = document.getElementById("tabContents");
	
	for (var i=0; i<tabContents.childNodes.length; i++)
	{
		if (tabContents.childNodes[i].id)
		{
			if (tabContents.childNodes[i].id == tabId)
			{
				tabContents.childNodes[i].className = tabContents.childNodes[i].className.replace("Hide");
			}
			else
			{
				if (!tabContents.childNodes[i].className.match("Hide"))
					tabContents.childNodes[i].className += " Hide";
			}
		}
	}	
	cancelAction(e);			
}

function cancelAction(e)
{
	if (!e) var e = window.event;
	
	if (e)
	{			
		e.cancelBubble = true;
		e.returnValue = false;
		
		if (e.stopPropagation)
		{
			e.stopPropagation();
			e.preventDefault();
		}
	}	
}
