function PreloadImages() 
{
	Images = new Array();
	for (i = 0; i < document.images.length; i++)
	{
		var Src = document.images[i].src;
		if (Src.indexOf("menu_pointer") != -1)
		{
			Images[i] = new Image();
			Images[i].src = Src.substring(0,Src.length-4)+"_selected.gif";
		}
	}
}

function Highlight(e)
{
	var targ;

	if (!e)
	{
		var e = window.event;
	}

	if (e.target)
	{
		targ = e.target;
	}
	else if (e.srcElement)
	{
		targ = e.srcElement;
	}
			
	if (targ.nodeType == 3) // defeat Safari bug
	{
		targ = targ.parentNode;
	}
			
	var tname;
	tname = targ.tagName
	tid = targ.id;

	if (tid.indexOf("to_cart_") != -1)
	{
		itemId = tid.substring(tid.lastIndexOf("_")+1,tid.length);

		if (e.type == "mouseover")
		{
			document.getElementById("to_cart_price_"+itemId).style.color = "#555555";
			document.getElementById("to_cart_"+itemId).style.color = "#555555";
		}
		else if (e.type == "mouseout")
		{
			document.getElementById("to_cart_price_"+itemId).style.color = "#68ce21";
			document.getElementById("to_cart_"+itemId).style.color = "#68ce21";
		}
	}

	if (tname = "IMG")
	{
		if ((tid == "logo") || (tid == "mail"))
		{
			var src;
			src = targ.src;				
					
			if (src != null)
			{
				targetelement = targ;
				if (e.type == "mouseover")
				{
					targetelement.src = targetelement.src.substring(0,targetelement.src.length-4)+"_selected.gif";
				}
				else if (e.type == "mouseout")
				{
					targetelement.src = targetelement.src.substring(0,targetelement.src.length-13)+".gif";
				}
			}
		}
		else if (tid.indexOf("sub_menu_") != -1)
		{
			menuId = tid.substring(tid.lastIndexOf("_")+1,tid.length);

			if (document.getElementById("sub_menu_image_"+menuId))
			{
				if (e.type == "mouseover")
				{
					Src = document.getElementById("sub_menu_image_"+menuId).src;
					document.getElementById("sub_menu_image_"+menuId).src = Src.substring(0,Src.length-4)+"_selected.gif";
				}
				else if (e.type == "mouseout")
				{
					Src = document.getElementById("sub_menu_image_"+menuId).src;
					document.getElementById("sub_menu_image_"+menuId).src = Src.substring(0,Src.length-13)+".gif";
				}
			}
			else
			{
				if (document.getElementById("sub_menu_"+menuId).style.color != "#68ce22")
				{
					if (e.type == "mouseover")
					{
						document.getElementById("sub_menu_"+menuId).style.color = "#68ce21";
					}
					else if (e.type == "mouseout")
					{
						document.getElementById("sub_menu_"+menuId).style.color = "#FFFFFF";
					}
				}	
			}
	
			if(e.type == "mousedown")
			{
				parent.top.location = document.getElementById("sub_menu_"+menuId).href;
			}
		}
		else if ( (tid.indexOf("menu_") != -1) && (tid.indexOf("sub_menu_") == -1) )
		{
			menuId = tid.substring(tid.lastIndexOf("_")+1,tid.length);

			if (e.type == "mouseover")
			{
				Src = document.getElementById("menu_image_"+menuId).src;
				document.getElementById("menu_image_"+menuId).src = Src.substring(0,Src.length-4)+"_selected.gif";
				Src = document.getElementById("menu_nickimage_"+menuId).src;
				document.getElementById("menu_nickimage_"+menuId).src = Src.substring(0,Src.length-4)+"_selected.gif";
			}
			else if (e.type == "mouseout")
			{
				Src = document.getElementById("menu_image_"+menuId).src;
				document.getElementById("menu_image_"+menuId).src = Src.substring(0,Src.length-13)+".gif";
				Src = document.getElementById("menu_nickimage_"+menuId).src;
				document.getElementById("menu_nickimage_"+menuId).src = Src.substring(0,Src.length-13)+".gif";
			}

			if(e.type == "mousedown")
			{
				parent.top.location = document.getElementById("menu_"+menuId).href;
			}
		}
	}	
}
