/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate$
 * $Rev$
 */

(function($){$.fn.extend({copyEvents:function(from){$.event.copy(from,this);return this;},copyEventsTo:function(to){$.event.copy(this,to);return this;},cloneWithEvents:function(deep){return this.clone(deep).copyEvents(this);}});$.event.copy=function(from,to){from=(from.jquery)?from:$(from);to=(to.jquery)?to:$(to);var events;if(!from.size()||!(events=from[0].events||from[0].$events)||!to.size())return;to.each(function(){for(var type in events)
for(var handler in events[type])
$.event.add(this,type,events[type][handler],events[type][handler].data);});};})(jQuery);