(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("