I used something like the following for the same issue with a jquery menubar. Perhaps this can help you as well.
$("#menu li a").click(function () {
window.location = $(this).attr('href');
return false;
});
Essentially this grabs the location from the top-level menu item link and navigates to it. The "return false" cancels further processing of the popout menu under the top-level.
Good luck.