
function addListener(element, event, listener, bubble)
{
	if(element.addEventListener)
	{
		if(typeof(bubble) == "undefined") bubble = false;
		element.addEventListener(event, listener, bubble);
	} else if(this.attachEvent) {
		element.attachEvent("on" + event, listener);
	}
}

function ShowTooltip(e)
{
	//e.srcElement.style
	var infobox = e.srcElement.children[0];
	if(infobox && infobox.style)
		infobox.style.display = 'block';
}

function HideTooltip(e)
{
	//e.srcElement.style
	var infobox = e.srcElement.children[0];
	if(infobox && infobox.style)
		infobox.style.display = 'none';
}

// attach to table
function attacheevents()
{
	cells = window.document.getElementsByTagName("td");
	for(var nCell=0;nCell<cells.length;nCell++)
	{
		var td = cells[nCell];
		if(td.className.indexOf("hasinfo")>=0)
		{
			addListener(td,"mouseover",ShowTooltip,false);
			addListener(td,"mouseleave",HideTooltip,false);
		}
	}
}

//Attach the events to the table when the page has finished loading
if(navigator.appName == "Microsoft Internet Explorer" && parseFloat(navigator.appVersion)<7)
	addListener(window, "load", attacheevents, false);

