var mainMenuId = "mainMenu";
var hoverClassName = "jshover";

var addHoverHandlers = function() {
	var menuItems = document.getElementById(mainMenuId).getElementsByTagName("td");
	for (var i = 0, len = menuItems.length; i < len; i++)
	{
		menuItems[i].onmouseover = function()
		{ 
			this.className += (" " + hoverClassName);
		}
		menuItems[i].onmouseout = function()
		{
			this.className = this.className.replace((" " + hoverClassName), "");
		}
	}
}

if (window.attachEvent && navigator.userAgent.indexOf("Opera") == -1)
{
	window.attachEvent("onload", addHoverHandlers);
}

function goToProduct(productId)
{
	if (movie.PercentLoaded() == 100)
	{
		movie.SetVariable("pic_cur", productId);
		movie.TGotoFrame("/screen", 1); 
		movie.TPlay("/screen");
		movie.TSetProperty("/txt_featured", 7, 0);
	}
}

function loadImage(imageId, imageURL)
{
	document.getElementById(imageId).src = imageURL;
}

function openBigPreview(imageURL)
{
	var bigPreviewWindow = window.open();
	with (bigPreviewWindow.document)
	{
		write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
		write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">');
		write('<head>');
		write('<title>Zoomed View</title>');
		write('</head>');
		write('<body>');
		write('<img src="' + imageURL + '" alt="" />');	
		write('</body>');
		write('</html>');
	}
}