(function(b){b.fn.animate_from_to=function(d,c){return this.each(function(){a(this,d,c)})};b.extend({animate_from_to:a});function a(d,i,n){var c=b(d).eq(0),h=b(i).eq(0);var f={pixels_per_second:1000,initial_css:{opacity:0.8,position:"absolute",top:c.offset().top,left:c.offset().left,height:c.height(),width:c.width(),"z-index":100000},callback:function(){return},targetHeight:0,targetWidth:0};if(n&&n.initial_css){n.initial_css=b.extend({},f.initial_css,n.initial_css)}n=b.extend({},f,n);if(n.targetHeight===0){n.targetHeight=h.innerHeight()}if(n.targetWidth===0){n.targetWidth=h.innerWidth()}var k="<div></div>";if(c.attr("src")){k='<div style="background-image:url('+c.attr("src")+');background-repeat:no-repeat;"></div>'}var l=c.offset().top+c.width()/2-h.offset().top,m=c.offset().left+c.height()/2-h.offset().left,g=Math.floor(Math.sqrt(Math.pow(m,2)+Math.pow(l,2))),e=(g/n.pixels_per_second)*1000,j=b(k).css(n.initial_css).appendTo("body").animate({top:h.offset().top,left:h.offset().left,height:n.targetHeight,width:n.targetWidth},{duration:e}).animate({opacity:0},{duration:100,complete:function(){j.remove();return n.callback()}})}})(jQuery);