/*! image-scale v1.3.2 | ©2012-2013 Nicolas BADIA | Licensed under the MIT license */ !function(e){e.fn.imageScale=function(a){return this.each(function(){var b=e(this),c=b.data("imageScale");if(!c){b.css("opacity",0);var g=b[0].complete,f=e.extend({},e.fn.imageScale.defaults,"object"==typeof a&&a),h=function(){b.data("imageScale",c=new l(this,f));f.rescaleOnResize&&e(window).resize(function(a){c.scheduleScale()});c.scale(!0);var a=f.callback;"function"===typeof a?a(b,c):a&&"object"===typeof a&&a.target[a.action].apply(a.target,[b,c])};g?h.apply(b[0]):b.load(h)}else if("string"==typeof a)c[a]()})}; e.fn.imageScale.defaults={scale:"best-fill",align:"center",parent:null,hideParentOverflow:!0,fadeInDuration:0,rescaleOnResize:!0,callback:null,debug:0};var l=function(a,b){this.options=b;this.element=a;this.$element=e(a);this.elementWidth=a.naturalWidth||a.width;this.elementHeight=a.naturalHeight||a.height;this.$parent=b.parent?b.parent:e(e(a).parent()[0])};e.fn.imageScale.Constructor=l;l.prototype={NONE:"none",FILL:"fill",BEST_FILL:"best-fill",BEST_FIT:"best-fit",BEST_FIT_DOWN_ONLY:"best-fit-down", ALIGN_LEFT:"left",ALIGN_RIGHT:"right",ALIGN_CENTER:"center",ALIGN_TOP:"top",ALIGN_BOTTOM:"bottom",ALIGN_TOP_LEFT:"top-left",ALIGN_TOP_RIGHT:"top-right",ALIGN_BOTTOM_LEFT:"bottom-left",ALIGN_BOTTOM_RIGHT:"bottom-right",constructor:l,scale:function(a){if(!this._isDestroyed){var b=this.options,c=this.$parent,g=this.$element;a&&(b.hideParentOverflow&&c.css({overflow:"hidden"}),g.css({opacity:1}));this._didScheduleScale=!1;if(!b.rescaleOnResize||this._needUpdate()){var f=c.outerWidth(),h=c.outerHeight(), e=c.innerWidth(),c=c.innerHeight(),e=f-e,c=h-c,k=g.attr("data-scale"),d=g.attr("data-align"),k=k?k:b.scale,l=d?d:b.align,d=b.fadeInDuration;if(k){this._cacheDestWidth===f&&this._cacheDestHeight===h&&2k?e:k;break;case this.BEST_FIT:a=ef||g>h?e