//Pause the menu from displaying for one second
function showTipBoxPause(layerName,imgName,timetopause)
{
	functioncode = "showTipBox('" + layerName + "','" + imgName + "')";
	setTimeout(functioncode,timetopause);
}
function showTipBox(layerName,imgName)
{
	if (!layerName)
	{
		return false;
	}
	img = getImage(imgName);
	menuTop = getTop(img); // get the help box top position
	menuLeft =  getLeft(img); // get the help box left position
	if (NS4 || IE4)
	{
		if (timeOn != null)
		{
			clearTimeout(timeOn)
			hideLayer(onLayer)
		}
		if (NS4 || IE4)
		{
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerVis+'"');
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top="'+menuTop+'"');
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left="'+menuLeft+'"');
		} 
		onLayer = layerName
	}
}

window.onerror = null;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS4 = (bName == "Netscape" && bVer >= 4);
var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
var NS3 = (bName == "Netscape" && bVer < 4);
var IE3 = (bName == "Microsoft Internet Explorer" && bVer < 4);
var menuActive = 0
var menuOn = 0
var onLayer
var timeOn = null // LAYER SWITCHING CODE
if (NS4 || IE4)
{
	if (navigator.appName == "Netscape")
	{
		layerStyleRef="layers.";
		layerRef="document.layers";
		styleSwitch="";
		layerVis="show";
		layerHid="hide";
	}
	else
	{
		layerStyleRef="layer.style.";
		layerRef="document.all";
		styleSwitch=".style";
		layerVis="visible";
		layerHid="hidden";
	}
}
// HIDE MENU
function hideLayer(layerName)
{
	if (menuActive == 0)
	{
		if ((NS4 || IE4) && layerName != null)
		{
			eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="'+layerHid+'"');
		}
	}
}
// timer for help box close
function linkTimer()
{
	timeOn = setTimeout("closePopup(onLayer)",1500)
}// on close
function closePopup(layerName)
{
	if (menuActive == 0)
	{
		hideLayer(onLayer)
	}
}
// get the the object that is used for positioning
function getImage(name)
{
	if (NS4)
	{
		return findImage(name, document);
	}
	if (IE4)
		return eval('document.all.' + name);
	return null;
}
//get the object that is used for positioning (netscape only)
function findImage(name, doc)
{
	var i, img;
	for (i = 0; i < doc.images.length; i++)
	if (doc.images[i].name == name)
		return doc.images[i];
	for (i = 0; i < doc.layers.length; i++)
		if ((img = findImage(name, doc.layers[i].document)) != null)
		{
			img.container = doc.layers[i];
			return img;
		}
	return null;
}
//get the y coordinate for the new popup box
function getLeft(img)
{
	var x, obj;
	if (NS4)
	{
		if (img.container != null)
			return img.container.pageX + img.x + 10;
		else
			return img.x + 10;
	}
	if (IE4)
	{
		x = 0;
		obj = img;
		while (obj.offsetParent != null)
		{
			x += obj.offsetLeft;
			obj = obj.offsetParent;
		}
		x += obj.offsetLeft;
		return x + 10;
	}
	return -1;
}
//get the x coordinate for the new popup box
function getTop(img)
{
	var y, obj;
	if (NS4)
	{
		if (img.container != null)
			return img.container.pageY + img.y - 5;
		else
			return img.y - 5;
	}
	if (IE4)
	{
		y = 0;
		obj = img;
		while (obj.offsetParent != null)
		{
			y += obj.offsetTop;
			obj = obj.offsetParent;
		}
		y += obj.offsetTop;
		return y - 5;
	}
	return -1;
}
