/**
 * delegate - simple event delegation; useful for ajax updated content to avoid eval or attaching new event handlers.
 *   http://actingthemaggot.com/projects/jquery/delegate
 *
 * Copyright (c) 2008 Michael Manning (http://actingthemaggot.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 */
(function($){
	$.fn.extend({
		delegate: function(type,r,s){
			return this.bind(type, function(e) {
				if(!s){e.preventDefault();} 
				var target = $(e.target);
				for (var f in r){
				  if (target.is(f)){ return r[f].apply(this, $.makeArray(arguments));}  
				}	
			});
		}
	});
})(jQuery);


