var obj = null;

function checkHover() {
	if (obj) {
		obj.fadeOut(100);	
	}
}

$(document).ready(function() {
	$('ul#menu li').hover(function() {
		
		if (obj) {
			obj.fadeOut(100);
			obj = null;
		}		
		$(this).children("ul").fadeIn(100);
		
	}, function() {
		
		obj = $(this).children("ul");
		setTimeout(
			"checkHover()",
			1000);
		
	});
});