var popupParent = null;

function checkHover() {
	if (popupParent) { popupParent.find('div.popup').fadeOut('fast'); } 
}

$(document).ready(
	function() {
		$('#menu > ul > li').hover(
			function() {
				checkHover();
				popupParent = null;
				$(this).find('div.popup').fadeIn('fast');
			}, 
			function() {
				popupParent = $(this);
				setTimeout("checkHover()",400);
			}
		);
	}
);
