Intercept javascript event
<p>Here's what I'm trying to do :</p>

<p>I have a page with some links. Most links have a function attached to them on the <em>onclick</em> event. </p>

<p>Now, I want to set a css class to some links and then whenever one of the links is clicked I want to execute a certain function - after it returns , I want the link to execute the onclick functions that were attached to it. </p>

<p>Is there a way to do what I want ? I'm using jQuery if it makes a difference.</p>

<p>Here's an attempt at an example :</p>

<pre><code>$("#link").click(function1);
$("#link").click(function2);
$("#link").click(function(){
   firstFunctionToBeCalled(function (){
      // ok, now execute function1 and function2
   });
}); // somehow this needs to be the first one that is called


function firstFunctionToBeCalled(callback){
    // here some user input is expected so function1 and function2 must not get called
    callback();

}
</code></pre>

<p>All this is because I'm asked to put some confirmation boxes (using boxy) for a lot of buttons and I really don't want to be going through every button.</p>
