!function(){var moduleFactory=function($){var module=this,exports=function(){$.fn.image=function(method){var method=$.Image[method];return method&&method.apply(this[0],$.makeArray(arguments).slice(1))},$.Image={get:function(url){var existingImage="IMG"===this.nodeName,image=$(existingImage?this:new Image),imageLoader=$.Deferred();return image.load(function(){var w,h,r,o;existingImage||image.appendTo("body"),image.css({position:"absolute",left:"-99999px"}).data({width:w=image.width(),height:h=image.height(),aspectRatio:r=w/h,orientation:o=1===r?"square":1>r?"tall":"wide"}).addClass("orientation-"+o).removeAttr("style"),existingImage||image.detach(),imageLoader.resolve(image)
}).error(function(){imageLoader.reject()}).attr("src",url),imageLoader},resizeWithin:function(sourceWidth,sourceHeight,maxWidth,maxHeight){var targetWidth=sourceWidth,targetHeight=sourceHeight,ratio=maxWidth/sourceWidth;if(targetWidth=sourceWidth*ratio,targetHeight=sourceHeight*ratio,targetHeight>maxHeight){var ratio=maxHeight/sourceHeight;targetWidth=sourceWidth*ratio,targetHeight=sourceHeight*ratio}return{width:targetWidth,height:targetHeight}},resizeToFill:function(sourceWidth,sourceHeight,maxWidth,maxHeight){var targetWidth=sourceWidth,targetHeight=sourceHeight,ratio=maxWidth/sourceWidth;
if(targetWidth=sourceWidth*ratio,targetHeight=sourceHeight*ratio,maxHeight>targetHeight){var ratio=maxHeight/sourceHeight;targetWidth=sourceWidth*ratio,targetHeight=sourceHeight*ratio}return{top:(maxHeight-targetHeight)/2,left:(maxWidth-targetWidth)/2,width:targetWidth,height:targetHeight}}}};exports(),module.resolveWith(exports)};dispatch("image").containing(moduleFactory).to("Foundry/2.1 Modules")}();