title: Javascript mootools delay hide/show multilevel menu
body: <p>I've made a javascript menu with css and javascript. I've used some mootools (1.11 , the only version i can use).</p>
  
  <p>The script runs on domready, it fetches a dom element, and adds functions (showmenu, hidemenu) on the mouseenter and mouseleave events. The dom element is three levels of nested ul/li`s. </p>
  
  <p>Now I want to add a delay on the menu of 500 ms when one hovers over the menu for the first time, and again when the users leaves the menu (so that the user has half a second time to get back to the menu).</p>
  
  <p>I dont know how to keep track of the events, and cancel them. My knowledge of javascript is not good enough to know where to start. Can anyone give me an example how i should create this? Not really looking for cut and paste code, more pointers in the working of javascript, which native functions i could use, and what is the best way to set something like this up.</p>
  
  <p>Thanx in advance</p>
  
  <p>p.s. Maybe i want to also have a delay (100 ms or so) when the user is already using the menu for the items to show up. Will this be a lot more complex?</p>