It it possible to attach a global handler two different objects, and then remove just one of them?
<p>Suppose I make a global handler for closing a popup :</p>

<pre><code>  mouseup_handler: function(item, mouse_is_inside){
    if(!mouse_is_inside) {
      close_box(item);
      return false;
    };
  },
</code></pre>

<p>And I attach it as so :</p>

<pre><code>$("body").bind('mouseup', function(){ mouseup_handler($popup, mouse_is_inside);  });
</code></pre>

<p>But let's say I have two objects that the <code>body</code> needs to be responsible for closing. </p>

<p>Now when I call the close of one of the objects :</p>

<pre><code> $("body").unbind('mouseup');
</code></pre>

<p>Both, or any mouseup handlers attached to the body are removed. I could be more specific and say :</p>

<pre><code>$("body").unbind('mouseup', mouseup_handler() );
</code></pre>

<p>But this would still cause the same problem with all <code>mouseup_handler()</code>'s to be removed.</p>

<p>How can I allow the <code>body</code> to differentiate between the two ( or many ) yet write the most minimal amount of code that can be shared between the two objects for the same handler?</p>
