Automatically unfolding jquery ui menu structure

Automatically unfolding jquery ui menu structure

We have an application that uses a jquery ui menu structure with a top menubar.  We had hoped to establish clickable menu paths in our documentation that would allow our users to see the location of certain features.  Something like Menu > SubMenu > SubSubMenu > Feature when clicked would unfold the menus to show where Feature is located.  We have tried to achieve this by triggering mouseenter and click events on the menu items but nothing seems to work.  As a simple example, the code below is designed to unfold and show the JWindow option when the page loads.  At this point, there is only a brief flash of focus on the Swing item.  Any ideas?

<!doctype html>
<html lang="en">
   <head>
      <meta charset="utf-8">
      <title>jQuery UI Menu functionality</title>
      <!-- CSS -->
      <style>
         .ui-menu {
            width: 200px;
         }
      </style>
      <!-- Javascript -->
      <script>
         $(function() {
         setTimeout(function(){$( "#menu-4" ).menu().find( "#java" ).mouseenter();},1000);
         setTimeout(function(){$( "#menu-4" ).menu().find( "#swing" ).mouseenter();},2000);
 setTimeout(function(){$( "#menu-4" ).menu("focus", null, $( "#menu-4" ).menu().find( "#jwindow" ))},3000);
         });
      </script>
   </head>
   <body>
      <!-- HTML --> 
      <ul id="menu-4">
         <li><a href="#">Spring</a></li>
         <li><a href="#">Hibernate</a></li>
         <li><a href="#">JSF</a></li>
         <li><a href="#">HTML5</a></li>
         <li><a href="#">Java</a>
            <ul>
               <li><a href="#">Java IO</a></li>
               <li><a id=swing href="#">Swing</a>
                <ul>
                <li><a href="#">JDialog</a></li>
                <li><a id=jwindow href="#">JWindow</a></li>
                <li><a href="#">JButton</a></li>
            </ul>
               </li>
               <li><a href="#">Jaspr Reports</a></li>
            </ul>
         </li>
      </ul>
   </body>
</html>