(function(d,c){d.effects.explode=function(a){return this.queue(function(){var i=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;var p=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?(d(this).is(":visible")?"hide":"show"):a.options.mode;var j=d(this).show().css("visibility","hidden");var b=j.offset();b.top-=parseInt(j.css("marginTop"),10)||0;b.left-=parseInt(j.css("marginLeft"),10)||0;var n=j.outerWidth(true);var r=j.outerHeight(true);for(var o=0;o<i;o++){for(var q=0;q<p;q++){j.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-q*(n/p),top:-o*(r/i)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:n/p,height:r/i,left:b.left+q*(n/p)+(a.options.mode=="show"?(q-Math.floor(p/2))*(n/p):0),top:b.top+o*(r/i)+(a.options.mode=="show"?(o-Math.floor(i/2))*(r/i):0),opacity:a.options.mode=="show"?0:1}).animate({left:b.left+q*(n/p)+(a.options.mode=="show"?0:(q-Math.floor(p/2))*(n/p)),top:b.top+o*(r/i)+(a.options.mode=="show"?0:(o-Math.floor(i/2))*(r/i)),opacity:a.options.mode=="show"?1:0},a.duration||500)}}setTimeout(function(){a.options.mode=="show"?j.css({visibility:"visible"}):j.css({visibility:"visible"}).hide();if(a.callback){a.callback.apply(j[0])}j.dequeue();d("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery);