/**
 * jQuery.Intercept - Event Delegation with jQuery 
 * Copyright (c) 2008 Ariel Flesler aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/9/2008
 *
 * @projectDescription Easily make DOM elements, watch for events from its descendants.
 * @author Ariel Flesler
 * @version 1.1.2
 *
 * @id jQuery.fn.intercept
 * @method
 * @param {String} eventname The name of the event to watch for.
 * @param {Hash} handler Hash of functions, where each key is a simple selector, and the value, a handler.
 * @return {jQuery} Returns the same jQuery object, for chaining.
 *
 * @see http://icant.co.uk/sandbox/eventdelegation/
 *
 * Notes:
 * - The hash can receive a "self" selector that will match the DOM element, intercepting the events,
 * - Handlers are checked in the order the are added to the hash, several calls to the plugin
 *   add new handlers, which are added to the bottom, thus they will be checked last.
 */
(function(B){var A=B.intercept=function(E,C,D){B("html").intercept(E,C,D);
};B.fn.intercept=function(H,D,G){var C,F,E;if(G){C={};C[D]=G;D=C;}return this.each(function(){F=this;
B.each(H.split(" "),function(J,I){E=B.data(F,I+".intercept");if(!E){B.data(F,I+".intercept",B.extend({},D));
B.event.add(F,I,A.handle);}else{B.extend(E,D);}});});};A.absolute=/[\s>+~]/;A.handle=function(H){var E=B.data(this,H.type+".intercept"),G=H.target,D=B(G),C,F;
if(!E){return;}for(C in E){if(C=="self"&&G==this||A.absolute.test(C)?B(C).index(G)!=-1:D.is(C)){F=E[C].apply(G,arguments)!==false&&F;
}}return F;};})(jQuery);
