/*
	Tooltip example, based on http://en.wikipedia.org/wiki/User:Taka/Tooltips

	Written by Michiel Hendriks <elmuerte@drunksnipers.com>
*/

// MSIE fix
//    this piece of JavaScript is required to make it work for MSIE. MSIE does not support :Hover for all elements
//    Additionally it assigns the correct className to the tool tip, so it... works in MSIE..

function ToolTipFix(comp, show)
{
	if (show) comp.className = 'toolTipHover';
	else comp.className = 'toolTip';
	
	if (!show) return;
	
	// Odd MSIE fix: this is useless but fixes the tooltip
	var spans = comp.getElementsByTagName('span');
	if (spans.length > 0)
	{
		spans[spans.length-1].className = 'toolTipHint';
	}
}

function ToolTipMSIEfix()
{
	if (!document.getElementById) return
	var span = document.getElementsByTagName('li');
	for(var i = 0; i < span.length; i++)
	{
		if (span[i].className != 'toolTip') continue;
		span[i].onmouseover = function() {ToolTipFix(this, true); }
		span[i].onmouseout = function() {ToolTipFix(this, false); }
	}
}
window.onload = ToolTipMSIEfix;
