title: Binding and triggering native and custom events in Prototype
body: <p>I'm having a bit of issue with events in prototype.</p>
  
  <p>I'm trying to bind and fire the native events: <code>onhashchange</code>, and <code>onpopstate</code>. As well as my custom events: <code>statechange</code> and <code>anchorchange</code>. All these events are for the <code>window</code> element.</p>
  
  <p>Here's the code I've already tried with no luck:</p>
  
  <pre><code>Element.observe(window,eventName,eventHandler);
  Element.fire(window,eventName);
  </code></pre>
  
  <p>Any help would be appreciated. </p>