function Hover()
{
	var nav = document.getElementById('mainnav');
	var stubs = new Array();
	var a = nav.getElementsByTagName('a');
			
	for(var i=0; i<a.length; i++)
	{
		if(a[i].className == 'stub') { stubs[stubs.length] = a[i]; }
	}
	
	for(var x=0; x<stubs.length; x++)
	{
		var li = stubs[x].parentNode;
		
		if(li && li.lastChild.style) 
		{
			li.onmouseover = function(event) { HoverShow(event, this); }
			li.onmouseout = function(event) { HoverHide(event, this); }
			li.action = null;
		}
	}
}

function HoverShow(e, o)
{
	if(o.action) clearTimeout(o.action);
	o.action = setTimeout(function() { o.lastChild.style.visibility = 'visible'; }, 350);
}

function HoverHide(e, o)
{
	if(o.action) clearTimeout(o.action);
	o.action = setTimeout(function() { o.lastChild.style.visibility = 'hidden'; }, 350);
}

function RemoveWhiteSpaceNodes(node) 
{
    for (var x = 0; x < node.childNodes.length; x++) 
    {
        var childNode = node.childNodes[x];
        
        if (childNode.nodeType == 3 && !/\S/.test(childNode.nodeValue)) 
        {
            node.removeChild(node.childNodes[x]);
            x--;
        }
        
        if (childNode.nodeType == 1)
            RemoveWhiteSpaceNodes(childNode);
    }
}