title: pass an event AND a variable to an anon function in firefox
body: <p>I come again with my inabilities to comprehend javascript.  </p>
  
  <p>I have a draggable library and it has a command that is called like so (the _ag is just namespacing stuff):</p>
  
  <pre><code>_ag.drag(event,targetDiv);  
  // targetDiv can be a string, btw - converted to an element in the function
  </code></pre>
  
  <p>so I've got code that looks like so (passing some data with a closure - a new trick to me):</p>
  
  <pre><code>header.onmousedown=function(targetDiv){
      return function(){
          _ag.drag(event,targetDiv)
      }
  
  }(aTargetDiv)
  </code></pre>
  
  <p>works great!  just great!  in...IE!  SF!  Chrome!  NOT IN FIREFOX!</p>
  
  <p>No, firefox cannot find the event.  Now normally this is easy enough with something like this (formed slightly differently - hope it's still valid):</p>
  
  <pre><code>header.onmousedown=function(event){
      alert(event.screenX)
  }
  </code></pre>
  
  <p>However if I decide to pass some parameters in, it blows away event, which I guess is some sort of invisible parameter in FF?</p>
  
  <pre><code>//broken thing 1:
  header.onmousedown=function(event){
      alert(event.screenX)    //  somethingToPass in covers event in FF
  }(somethingToPassIn)
  
  
  // broken thing 2:
  header.onmousedown=function(event){
      alert(event.screenX)    
  }(event,somethingToPassIn)  // event is undefined
  </code></pre>
  
  <p>SO FIREFOX: How do I send you events?  Here's hoping this is a very stupid question, and that hoards of SO folks have the answers!  Thanks in advance, I'll be right here banging my head against the wall.</p>