(function(){var e=function(e){var t=this;e.require().stylesheet("fancybox/thumbs").done(function(){var n=function(){var t=e.fancybox;t.helpers.thumbs={wrap:null,list:null,width:0,source:function(t){var n=e(t).find("img");return n.length?n.attr("src"):t.href},init:function(n){var r=this,i,s=n.width||50,o=n.height||50,u=n.source||this.source;i="";for(var a=0;a<t.group.length;a++)i+='<li><a style="width:'+s+"px;height:"+o+'px;" href="javascript:'+e.globalNamespace+".fancybox.jumpto("+a+');"></a></li>';this.wrap=e('<div id="fancybox-thumbs"></div>').addClass(n.position||"bottom").appendTo("body"),this.list=e("<ul>"+i+"</ul>").appendTo(this.wrap),e.each(t.group,function(t){e("<img />").load(function(){var n=this.width,i=this.height,u,a,f;if(!r.list||!n||!i)return;u=n/s,a=i/o,f=r.list.children().eq(t).find("a"),u>=1&&a>=1&&(u>a?(n=Math.floor(n/a),i=o):(n=s,i=Math.floor(i/u))),e(this).css({width:n,height:i,top:Math.floor(o/2-i/2),left:Math.floor(s/2-n/2)}),f.width(s).height(o),e(this).hide().appendTo(f).fadeIn(300)}).attr("src",u(this))}),this.width=this.list.children().eq(0).outerWidth(),this.list.width(this.width*(t.group.length+1)).css("left",Math.floor(e(window).width()*.5-(t.current.index*this.width+this.width*.5)))},update:function(n){this.list&&this.list.stop(!0).animate({left:Math.floor(e(window).width()*.5-(t.current.index*this.width+this.width*.5))},150)},beforeLoad:function(e){if(t.group.length<2){t.coming.helpers.thumbs=!1;return}t.coming.margin[e.position==="top"?0:2]=e.height+30},afterShow:function(e){this.list?this.update(e):this.init(e),this.list.children().removeClass("active").eq(t.current.index).addClass("active")},onUpdate:function(){this.update()},beforeClose:function(){this.wrap&&this.wrap.remove(),this.wrap=null,this.list=null,this.width=0}}};n(),t.resolveWith(n)})};dispatch("fancybox/thumbs").containing(e).to("Foundry/2.1 Modules")})();