(function(e){function s(a){var b=a.zoom,c=a.Q,g=a.R,k=a.e,f=a.g;this.data=a;this.U=this.b=null;this.za=0;this.zoom=b;this.V=!0;this.r=this.interval=this.t=this.p=0;var q=this,m;q.b=e("
");var p=e("");b.options.variableMagnification&&p.bind("mousewheel",function(a,b){q.zoom.ia(0.1*b);return!1});q.U=p;p.width(q.zoom.e);p.height(q.zoom.g);d.Ja&&q.U.css("-webkit-transform","perspective(400px)");var l=q.b;l.append(p);var h=e("
");a.caption?("html"==b.options.captionType?m=a.caption:"attr"==b.options.captionType&&(m=e("
"+a.caption+"
")),m.css("display","block"),h.css({width:k}),l.append(h),h.append(m),e("body").append(l),this.r=m.outerHeight(),"bottom"==b.options.captionPosition?h.css("top",f):(h.css("top",0),this.za=this.r)):e("body").append(l);l.css({opacity:0,width:k,height:f+this.r});this.zoom.C="auto"===b.options.minMagnification?Math.max(k/b.a.width(),f/b.a.height()):b.options.minMagnification;this.zoom.B="auto"===b.options.maxMagnification?p.width()/b.a.width():b.options.maxMagnification;a=l.height();this.V=!1;b.options.zoomFlyOut?(f=b.a.offset(),f.left+=b.d/2,f.top+=b.c/2,l.offset(f),l.width(0),l.height(0),l.animate({left:c,top:g,width:k,height:a,opacity:1},{duration:b.options.animationTime,complete:function(){q.V=!0}})):(l.offset({left:c,top:g}),l.width(k),l.height(a),l.animate({opacity:1},{duration:b.options.animationTime,complete:function(){q.V=!0}}))} function x(a,b,c){this.a=a;this.ba=a[0];this.Ca=c;this.va=!0;var g=this;this.interval=setInterval(function(){0b.easing&&(b.easing=1);f=a.parent();f.is("a")&&""==b.zoomImage&&(b.zoomImage=f.attr("href"),f.removeAttr("href"));f=e("
");e("body").append(f);this.Z=f.width();this.Y=f.height();b.zoomWidth&&(this.Z=b.zoomWidth,this.Y=b.zoomHeight);f.remove();this.options=b;this.a=a;this.g=this.e=this.d=this.c=0;this.H=this.m=null;this.j=this.n=0;this.D={x:0,y:0};this.Ua=this.caption="";this.ea={x:0,y:0};this.k=[];this.pa=0;this.oa="";this.b=this.v=this.u=null;this.T="";this.L=this.S=this.aa=!1;this.G=null;this.ha=this.Oa=!1;this.l=null;this.id=++d.id;this.I=this.ua=this.ta=0;this.o=this.h=null;this.wa=this.B=this.C=this.f=this.i=this.ja=0;this.na(a);this.ma=!1;this.N=this.A=this.da=this.ca=0;if(a.is(":hidden"))var q=setInterval(function(){a.is(":hidden")||(clearInterval(q),g())},100);else g();c()} function v(a,b){var c=b.uriEscapeMethod;return "escape"==c?escape(a):"encodeURI"==c?encodeURI(a):a} function h(a){for(var b="",c,g=C("charCodeAt"),d=a[g](0)-32,e=1;eMath.abs(this.f-this.i)&&(this.i=this.f),this.Na()),a.update())};d.id=0;d.prototype.Ha=function(a){var b=this.T.replace(/^\/|\/$/g,"");if(0==this.k.length)return{href:this.options.zoomImage,title:this.a.attr("title")};if(void 0!=a)return this.k;a=[];for(var c=0;c=this.k.length&&(c=0);return a};d.prototype.getGalleryList=d.prototype.Ha;d.prototype.P=function(){clearTimeout(this.ja);null!=this.o&&this.o.remove()};d.prototype.sa=function(){var a=this;this.Oa||this.a.bind("mouseover.prehov mousemove.prehov mouseout.prehov",function(b){a.G="mouseout"==b.type?null:{pageX:b.pageX,pageY:b.pageY}})};d.prototype.Ea=function(){this.G=null;this.a.unbind("mouseover.prehov mousemove.prehov mouseout.prehov")};d.prototype.O=function(a,b){var c=this;c.a.unbind("touchstart.preload "+c.options.mouseTriggerEvent+".preload");c.sa();this.P();e("body").children(".cloudzoom-fade-"+c.id).remove();null!=this.v&&(this.v.cancel(),this.v=null);null!=this.u&&(this.u.cancel(),this.u=null);this.T=""!=b&&void 0!=b?b:a;this.L=this.S=!1;!c.options.galleryFade||!c.aa||c.J()&&null!=c.h||(c.l=e(new Image).css({position:"absolute"}),c.l.attr("src",c.a.attr("src")),c.l.width(c.a.width()),c.l.height(c.a.height()),c.l.offset(c.a.offset()),c.l.addClass("cloudzoom-fade-"+c.id),e("body").append(c.l));this.Ma();var g=e(new Image);this.u=new x(g,a,function(a,b){c.u=null;c.L=!0;c.a.attr("src",g.attr("src"));e("body").children(".cloudzoom-fade-"+c.id).fadeOut(c.options.fadeTime,function(){e(this).remove();c.l=null});void 0!==b?(c.P(),c.options.errorCallback({$element:c.a,type:"IMAGE_NOT_FOUND",data:b.Ga})):c.ra()})};d.prototype.Ma=function(){var a=this;a.ja=setTimeout(function(){a.o=e("
");e("body").append(a.o);var b=a.o.width(),g=a.o.height(),b=a.a.offset().left+a.a.width()/2-b/2,g=a.a.offset().top+a.a.height()/2-g/2;a.o.offset({left:b,top:g})},250);var b=e(new Image);this.v=new x(b,this.T,function(c,g){a.v=null;a.S=!0;a.e=b[0].width;a.g=b[0].height;void 0!==g?(a.P(),a.options.errorCallback({$element:a.a,type:"IMAGE_NOT_FOUND",data:g.Ga})):a.ra()})};d.prototype.loadImage=d.prototype.O;d.prototype.Ba=function(){alert("Cloud Zoom API OK")};d.prototype.apiTest=d.prototype.Ba;d.prototype.s=function(){null!=this.h&&(this.a.trigger("cloudzoom_end_zoom"),this.h.$());this.h=null};d.prototype.$=function(){e(document).unbind("mousemove."+this.id);this.a.unbind();null!=this.b&&(this.b.unbind(),this.s());this.a.removeData("CloudZoom");e("body").children(".cloudzoom-fade-"+this.id).remove();this.ma=!0};d.prototype.destroy=d.prototype.$;d.prototype.Da=function(a){if(!this.options.hoverIntentDelay)return!1;0===this.A&&(this.A=(new Date).getTime(),this.ca=a.pageX,this.da=a.pageY);var b=a.pageX-this.ca,c=a.pageY-this.da,b=Math.sqrt(b*b+c*c);this.ca=a.pageX;this.da=a.pageY;a=(new Date).getTime();b<=this.options.hoverIntentDistance?this.N+=a-this.A:this.A=a;if(this.N=this.e)return!0} return!1};d.prototype.ra=function(){var a=this;if(a.S&&a.L){this.la();a.e=a.a.width()*this.i;a.g=a.a.height()*this.i;this.P();this.ga();null!=a.h&&(a.s(),a.w(),a.H.attr("src",v(this.a.attr("src"),this.options)),a.q(a.ea,0));if(!a.aa){a.aa=!0;e(document).bind("MSPointerUp."+this.id+" mousemove."+this.id,function(b){if(null!=a.b){var c=a.a.offset(),g=!0,c=new d.F(b.pageX-Math.floor(c.left),b.pageY-Math.floor(c.top));if(-1>c.x||c.x>a.d||0>c.y||c.y>a.c)g=!1,a.options.permaZoom||(a.b.remove(),a.s(),a.b=null);a.ha=!1;"MSPointerUp"===b.type&&(a.ha=!0);g&&(a.D=c)}});a.W();var b=0,c=0,g=0,k=function(a,b){return Math.sqrt((a.pageX-b.pageX)*(a.pageX-b.pageX)+(a.pageY-b.pageY)*(a.pageY-b.pageY))};a.a.css({"-ms-touch-action":"none","-ms-user-select":"none"});a.a.bind("touchstart touchmove touchend",function(e){if(a.X())return!0;var f=a.a.offset(),h=e.originalEvent,l={x:0,y:0},r=h.type;if("touchend"==r&&0==h.touches.length)return a.fa(r,l),!1;l=new d.F(h.touches[0].pageX-Math.floor(f.left),h.touches[0].pageY-Math.floor(f.top));a.D=l;if("touchstart"==r&&1==h.touches.length&&null==a.b)return a.fa(r,l),!1;2>b&&2==h.touches.length&&(c=a.f,g=k(h.touches[0],h.touches[1]));b=h.touches.length;2==b&&a.options.variableMagnification&&(f=k(h.touches[0],h.touches[1])/g,a.f=a.J()?c*f:c/f,a.fa.B&&(a.f=a.B));a.fa("touchmove",l);e.preventDefault();e.stopPropagation();return e.returnValue=!1});if(null!=a.G){if(this.X())return;var f=a.a.offset(),f=new d.F(a.G.pageX-f.left,a.G.pageY-f.top);a.M();a.w();a.q(f,0);a.D=f}} a.Ea();a.a.trigger("cloudzoom_ready")}};d.prototype.fa=function(a,b){var c=this;switch(a){case "touchstart":if(null!=c.b)break;clearTimeout(c.interval);c.interval=setTimeout(function(){c.M();c.w();c.q(b,c.j/2);c.update()},150);break;case "touchend":clearTimeout(c.interval);null==c.b?c.ya():c.options.permaZoom||(c.b.remove(),c.b=null,c.s());break;case "touchmove":null==c.b&&(clearTimeout(c.interval),c.M(),c.w())}};d.prototype.Na=function(){var a=this.i;if(null!=this.b){var b=this.h;this.n=b.b.width()/(this.a.width()*a)*this.a.width();this.j=b.b.height()/(this.a.height()*a)*this.a.height();this.j-=b.r/a;this.m.width(this.n);this.m.height(this.j);this.q(this.ea,0)}};d.prototype.ia=function(a){this.f+=a;this.fc&&(r=c);n>g&&(n=g);b.width(r);b.height(n)} d*=b.width()/c;f*=b.height()/g;r=a.options.zoomSizeMode;if(a.options.zoomFullSize||"full"==r)d=a.e,f=a.g,b.width(a.d),b.height(a.c),b.css("display","none"),l=!0;else if(a.options.zoomMatchSize||"image"==r)b.width(a.d/a.e*a.d),b.height(a.c/a.g*a.c),d=a.d,f=a.c;else if("zoom"===r||this.options.zoomWidth)b.width(a.Z/a.e*a.d),b.height(a.Y/a.g*a.c),d=a.Z,f=a.Y;c=[[c/2-d/2,-f],[c-d,-f],[c,-f],[c,0],[c,g/2-f/2],[c,g-f],[c,g],[c-d,g],[c/2-d/2,g],[0,g],[-d,g],[-d,g-f],[-d,g/2-f/2],[-d,0],[-d,-f],[0,-f]];m+=c[a.options.zoomPosition][0];p+=c[a.options.zoomPosition][1];l||b.fadeIn(a.options.fadeTime);a.h=new s({zoom:a,Q:a.a.offset().left+m,R:a.a.offset().top+p,e:d,g:f,caption:h,K:a.options.zoomClass})} a.h.p=void 0;a.n=b.width();a.j=b.height();this.options.variableMagnification&&a.m.bind("mousewheel",function(b,c){a.ia(0.1*c);return!1})};d.prototype.La=function(){return this.h?!0:!1};d.prototype.isZoomOpen=d.prototype.La;d.prototype.Fa=function(){this.a.unbind(this.options.mouseTriggerEvent+".trigger");var a=this;null!=this.b&&(this.b.remove(),this.b=null);this.s();setTimeout(function(){a.W()},1)};d.prototype.closeZoom=d.prototype.Fa;d.prototype.ya=function(){var a=this;this.a.unbind(a.options.mouseTriggerEvent+".trigger");this.a.trigger("click");setTimeout(function(){a.W()},1)};d.prototype.ka=function(a){var b=this;a.bind("mousedown."+b.id+" mouseup."+b.id,function(a){"mousedown"===a.type?b.wa=(new Date).getTime():(b.ha&&(b.b&&b.b.remove(),b.s(),b.b=null),250>=(new Date).getTime()-b.wa&&b.ya())})};d.prototype.M=function(){5==F.length&&!1==E&&(u=!0);var a=this,b;a.ga();a.m=e("