(function(){var e=function(e){var t=this,n=function(){e.fn.image=function(t){var t=e.Image[t];return t&&t.apply(this[0],e.makeArray(arguments).slice(1))},e.Image={get:function(t){var n=this.nodeName==="IMG",r=e(n?this:new Image),i=e.Deferred();return r.load(function(){var e,t,s,o;n||r.appendTo("body"),r.css({position:"absolute",left:"-99999px"}).data({width:e=r.width(),height:t=r.height(),aspectRatio:s=e/t,orientation:o=s===1?"square":s<1?"tall":"wide"}).addClass("orientation-"+o).removeAttr("style"),n||r.detach(),i.resolve(r)}).error(function(){i.reject()}).attr("src",t),i},resizeWithin:function(e,t,n,r){var i=e,s=t,o=n/e;i=e*o,s=t*o;if(s>r){var o=r/t;i=e*o,s=t*o}return{width:i,height:s}},resizeToFill:function(e,t,n,r){var i=e,s=t,o=n/e;i=e*o,s=t*o;if(s<r){var o=r/t;i=e*o,s=t*o}return{top:(r-s)/2,left:(n-i)/2,width:i,height:s}}}};n(),t.resolveWith(n)};dispatch("image").containing(e).to("Foundry/2.1 Modules")})();