title: Using clearTimeout to cancel a timeout event
body: <p>I have the following code but the clear timeout doesn't work and I can't understand why, does anyone have any ideas? (Using the Prototype framework)</p>
  
  <pre><code>function foo() {
      $("navigation").observe('mouseover',
          function (event) {
              clearTimeout(bar);
          }
      ).observe('mouseout',
          function (event) {
              setTimeout(bar, 1000);
          }
      );
  }
  
  function bar() {
      alert("hi");
  }
  </code></pre>