startList = function() {
	$("#nav",$("#navTop")).children("li").each(function(){
		var li = this;
		$(this).children("a").each(function(){
			$(this).hover(function(){
				var ul = this.parentNode.getElementsByTagName('ul')[0];
				if (ul) ul.style.display = 'block';
			})
		});
		$(this).children("ul").children("li").children("ul").each(function(){
			$(this).prev().hover(function(){
				$(this).next().find("ul").css("display","block").end().css("display","block");
				$(this).next().find("ul").hover(function(){
					$(this).css("display","block");
				})
			}, 
				function(){
					$(this).next().find("ul").css("display","none");
				}
			);
		});
	});
}

function resetOpened(){
	$("li",$("#navTop")).each(function(){
		var li = this;
		$(this).children("a").each(function(){
			var ul = this.parentNode.getElementsByTagName('ul')[0];
			if (ul) ul.style.display = 'none';
		});
	});
}
window.onload=startList;
