/*! zoom v1.7.11 - 2013-11-12 enlarge images on click or mouseover. (c) 2013 jack moore - http://www.jacklmoore.com/zoom license: http://www.opensource.org/licenses/mit-license.php */ (function(o){var t={url:!1,callback:!1,target:!1,duration:120,on:"mouseover",touch:!0,onzoomin:!1,onzoomout:!1,magnify:1};o.zoom=function(t,n,e,i){var u,c,a,m,r,l,s,f=o(t).css("position");return o(t).css({position:/(absolute|fixed)/.test(f)?f:"relative",overflow:"hidden"}),e.style.width=e.style.height="",o(e).addclass("zoomimg").css({position:"absolute",top:0,left:0,opacity:0,width:e.width*i,height:e.height*i,border:"none",maxwidth:"none"}).appendto(t),{init:function(){c=o(t).outerwidth(),u=o(t).outerheight(),n===t?(m=c,a=u):(m=o(n).outerwidth(),a=o(n).outerheight()),r=(e.width-c)/m,l=(e.height-u)/a,s=o(n).offset()},move:function(o){var t=o.pagex-s.left,n=o.pagey-s.top;n=math.max(math.min(n,a),0),t=math.max(math.min(t,m),0),e.style.left=t*-r+"px",e.style.top=n*-l+"px"}}},o.fn.zoom=function(n){return this.each(function(){var e,i=o.extend({},t,n||{}),u=i.target||this,c=this,a=document.createelement("img"),m=o(a),r="mousemove.zoom",l=!1,s=!1;(i.url||(e=o(c).find("img"),e[0]&&(i.url=e.data("src")||e.attr("src")),i.url))&&(a.onload=function(){function t(t){e.init(),e.move(t),m.stop().fadeto(o.support.opacity?i.duration:0,1,o.isfunction(i.onzoomin)?i.onzoomin.call(a):!1)}function n(){m.stop().fadeto(i.duration,0,o.isfunction(i.onzoomout)?i.onzoomout.call(a):!1)}var e=o.zoom(u,c,a,i.magnify);"grab"===i.on?o(c).on("mousedown.zoom",function(i){1===i.which&&(o(document).one("mouseup.zoom",function(){n(),o(document).off(r,e.move)}),t(i),o(document).on(r,e.move),i.preventdefault())}):"click"===i.on?o(c).on("click.zoom",function(i){return l?void 0:(l=!0,t(i),o(document).on(r,e.move),o(document).one("click.zoom",function(){n(),l=!1,o(document).off(r,e.move)}),!1)}):"toggle"===i.on?o(c).on("click.zoom",function(o){l?n():t(o),l=!l}):"mouseover"===i.on&&(e.init(),o(c).on("mouseenter.zoom",t).on("mouseleave.zoom",n).on(r,e.move)),i.touch&&o(c).on("touchstart.zoom",function(o){o.preventdefault(),s?(s=!1,n()):(s=!0,t(o.originalevent.touches[0]||o.originalevent.changedtouches[0]))}).on("touchmove.zoom",function(o){o.preventdefault(),e.move(o.originalevent.touches[0]||o.originalevent.changedtouches[0])}),o.isfunction(i.callback)&&i.callback.call(a)},a.src=i.url,o(c).one("zoom.destroy",function(){o(c).off(".zoom"),m.remove()}))})},o.fn.zoom.defaults=t})(window.jquery);