

	$.navigation =
	({
			openSub : null
		,	openSubTimer : 0
		,	build : function()
			{
				$("li.topic a[@href*=openSub]").click(function()
				{
					$.navigation.openSub = $(this);
					$(this).parent().find("ul").show();
					
					return false;
				});

				$("ul.sub").bind("mouseenter", function(){ clearTimeout($.navigation.openSubTimer); });
				$("ul.sub").bind("mouseleave", function(){ $.navigation.openSubTimer = setTimeout( function() { $.navigation.closeSub() } , 10); });

				$("li.topic").bind("mouseleave", function(){ $(this).removeClass("topic-hover"); $.navigation.openSubTimer = setTimeout( function() { $.navigation.closeSub() } , 10); })
				$("li.topic").bind("mouseenter", function()
				{
					if($.navigation.openSub && $(this).html() != $.navigation.openSub.html())
						$.navigation.closeSub();
					else
						clearTimeout($.navigation.openSubTimer);

					$(this).addClass("topic-hover"); 
				});
			}
			
		,	closeSub : function ()
			{
				if($.navigation.openSub)
					$.navigation.openSub.parent().find("ul").hide();
			
				$.navigation.openSub = null;
			}
	 });


	$.fn.extend
	({
			navigation : $.navigation.build
	});
