function getList(link) {
	var it = link;
	while(it != null && it.tagName != 'UL')
		it = it.nextSibling
		
	return it;			
}

window.onload = function() {
	
	if(!document.getElementById('navlist'))
		return true;
	
	var items = document.getElementById('navlist').getElementsByTagName('a');
	for(i = 0; i < items.length; i++) {
		
		var it = getList(items[i])
			
		if(it != null) {
			
			items[i].onmouseover = function() {
				var it = getList(this);
				it.style.display = 'block';				
			}
			
			items[i].onmouseout = function() {
				var it = getList(this);
				it.style.display = 'none'
			}
			
			it.onmouseover = function() {
				this.style.display = 'block';
			}
			
			it.onmouseout = function() {
				this.style.display = 'none'
			}
			
		}
		
	}
	
}