function assignHoverFunction()
{
	var LIs = $(navigation_id).getElementsByTagName('LI');
	var i;
	
	for(i in LIs)
	{
		// filter out phantom LIs
		if( ! isset(LIs[i].nodeName))
		{
			continue;
		}
		
		LIs[i].onmouseover = new Function("showChildList('"+LIs[i].id+"');");
		LIs[i].onmouseout = new Function("timeOutHideChildList('"+LIs[i].id+"');");
	}
}


function showChildList(element_id)
{
	collapseSiblings(element_id);
	// cancel the collapse for the element we're still over
	clearTimeout(time_out[element_id]);
	
	$(element_id).className += " "+hover_class;
}


function hideChildList(element_id)
{
	$(element_id).className = str_replace(hover_class, "", $(element_id).className);
}

function timeOutHideChildList(element_id)
{
	time_out[element_id] = setTimeout("hideChildList('"+element_id+"')", collapse_delay)
}


function collapseSiblings(element_id)
{
	var parent = $(element_id).parentNode; // this is an UL (or the dude who wrote the HTML has no idea of his job anyway)
	var i;
	
	for(i in parent.childNodes)
	{
		if(parent.childNodes[i].nodeName == 'LI' && parent.childNodes[i].id != element_id)
		{
			hideChildList(parent.childNodes[i].id);
		}
	}
}