assign onclick event to function
<p>I want to call a function onclick and pass the event object to the function:</p>

<pre><code> progressBarOuter.onclick = function(e)  { 
     var x; if (!e) {
         x=window.event.clientX;
     } 
      else {
          x = e.clientX
     } 

     yt.clickedOffset = x; yt.progressBarClicked
 }
</code></pre>

<p>So i'm assigning clickedOffset to by enclosing object (yt) and then calling progressBarClicked which then uses the clickedOffset var. But what I actually would rather be doing is something like this:</p>

<pre><code>progressBarOuter.onclick = yt.progressBarClicked(e);
</code></pre>

<p>Because it's much more compact. Problem is that even if the user has clicked or not this bit of code is executed... yt.progressBarClicked(e). </p>

<p>Is there any way around this?</p>
