/*Smooth Zoom Pan - jQuery Image Viewer | (c) http://codecanyon.net/user/VF | v1.6.7 | 27 SEP 2012 */
(function(g,h,k){var e={width:"",height:"",initial_ZOOM:"",initial_POSITION:"",animation_SMOOTHNESS:5.5,animation_SPEED_ZOOM:5.5,animation_SPEED_PAN:5.5,zoom_MAX:800,zoom_MIN:"",zoom_SINGLE_STEP:false,zoom_OUT_TO_FIT:true,zoom_BUTTONS_SHOW:true,pan_BUTTONS_SHOW:true,pan_LIMIT_BOUNDARY:true,pan_REVERSE:false,reset_ALIGN_TO:"center center",reset_TO_ZOOM_MIN:true,button_SIZE:18,button_SIZE_TOUCH_DEVICE:30,button_COLOR:"#FFFFFF",button_BG_COLOR:"#000000",button_BG_TRANSPARENCY:55,button_AUTO_HIDE:false,button_AUTO_HIDE_DELAY:1,button_ALIGN:"bottom right",button_MARGIN:10,button_ROUND_CORNERS:true,touch_DRAG:true,mouse_DRAG:true,mouse_WHEEL:true,mouse_WHEEL_CURSOR_POS:true,mouse_DOUBLE_CLICK:true,background_COLOR:"#FFFFFF",border_SIZE:1,border_COLOR:"#000000",border_TRANSPARENCY:10,image_url:"",image_original_width:"",image_original_height:"",container:"",on_IMAGE_LOAD:"",on_ZOOM_PAN_UPDATE:"",on_ZOOM_PAN_COMPLETE:"",on_LANDMARK_STATE_CHANGE:"",use_3D_Transform:true,responsive:false,responsive_maintain_ratio:true,max_WIDTH:"",max_HEIGHT:""};function j(o,q){var n=this;this.$elem=o;var s=g.extend({},e,q);this.sW=s.width;this.sH=s.height;this.init_zoom=s.initial_ZOOM/100;this.init_pos=s.initial_POSITION.replace(/,/g," ").replace(/\s{2,}/g," ").split(" ");this.zoom_max=s.zoom_MAX/100;this.zoom_min=s.zoom_MIN/100;this.zoom_single=b(s.zoom_SINGLE_STEP);this.zoom_fit=b(s.zoom_OUT_TO_FIT);this.zoom_speed=1+(((s.animation_SPEED===0||s.animation_SPEED?s.animation_SPEED:s.animation_SPEED_ZOOM)+1)/20);this.zoom_show=b(s.zoom_BUTTONS_SHOW);this.pan_speed_o=(s.animation_SPEED===0||s.animation_SPEED?s.animation_SPEED:s.animation_SPEED_PAN);this.pan_show=b(s.pan_BUTTONS_SHOW);this.pan_limit=b(s.pan_LIMIT_BOUNDARY);this.pan_rev=b(s.pan_REVERSE);this.reset_align=s.reset_ALIGN_TO.toLowerCase().split(" ");this.reset_to_zmin=b(s.reset_TO_ZOOM_MIN);if(a){this.bu_size=parseInt(s.button_SIZE_TOUCH_DEVICE/2)*2}else{this.bu_size=parseInt(s.button_SIZE/2)*2}this.bu_color=s.button_COLOR;this.bu_bg=s.button_BG_COLOR;this.bu_bg_alpha=s.button_BG_TRANSPARENCY/100;this.bu_icon=s.button_ICON_IMAGE;this.bu_auto=b(s.button_AUTO_HIDE);this.bu_delay=s.button_AUTO_HIDE_DELAY*1000;this.bu_align=s.button_ALIGN.toLowerCase().split(" ");this.bu_margin=s.button_MARGIN;this.bu_round=b(s.button_ROUND_CORNERS);this.touch_drag=b(s.touch_DRAG);this.mouse_drag=b(s.mouse_DRAG);this.mouse_wheel=b(s.mouse_WHEEL);this.mouse_wheel_cur=b(s.mouse_WHEEL_CURSOR_POS);this.mouse_dbl_click=b(s.mouse_DOUBLE_CLICK);this.ani_smooth=Math.max(1,(s.animation_SMOOTHNESS+1)/1.45);this.bg_color=s.background_COLOR;this.bord_size=s.border_SIZE;this.bord_color=s.border_COLOR;this.bord_alpha=s.border_TRANSPARENCY/100;this.container=s.container;this.image_url=s.image_url;this.image_width=s.image_original_width;this.image_height=s.image_original_height;this.responsive=b(s.responsive);this.maintain_ratio=b(s.responsive_maintain_ratio);this.w_max=s.max_WIDTH;this.h_max=s.max_HEIGHT;this.onLOAD=s.on_IMAGE_LOAD;this.onUPDATE=s.on_ZOOM_PAN_UPDATE;this.onZOOM_PAN=s.on_ZOOM_PAN_COMPLETE;this.onLANDMARK=s.on_LANDMARK_STATE_CHANGE;this._x;this._y;this._w;this._h;this._sc=0;this.rA=1;this.rF=1;this.rR=1;this.iW=0;this.iH=0;this.tX=0;this.tY=0;this.oX=0;this.oY=0;this.fX=0;this.fY=0;this.dX=0;this.dY=0;this.cX=0;this.cY=0;this.transOffX=0;this.transOffY=0;this.focusOffX=0;this.focusOffY=0;this.offX=0;this.offY=0;this._playing=false;this._dragging=false;this._onfocus=false;this._moveCursor=false;this._wheel=false;this._recent="zoomOut";this._pinching=false;this._landmark=false;this._rA;this._centx;this._centy;this._onButton=false;this._onHitArea=false;this.cFlag={_zi:false,_zo:false,_ml:false,_mr:false,_mu:false,_md:false,_rs:false,_nd:false};this.$holder;this.$hitArea;this.$controls;this.$loc_cont;this.map_coordinates=[];this.locations=[];this.buttons=[];this.border=[];this.buttons_total=7;this.cButtId=0;this.pan_speed;this.auto_timer;this.ani_timer;this.ani_end;this.focusSpeed=this.reduction=0.5;this.orig_style;this.mapAreas;this.icons;this.show_at_zoom;this.assetsLoaded=false;this.zStep=0;this.sRed=300;this.use3D=s.use_3D_Transform&&c;if(a){this.event_down="touchstart.sz";this.event_up="touchend.sz";this.event_move="touchmove.sz"}else{this.event_down="mousedown.sz";this.event_up="mouseup.sz";this.event_move="mousemove.sz"}if(this.image_url==""){this.$image=o;this.id=this.$image.attr("id")}else{var m=new Image();if(this.image_width){m.width=this.image_width}if(this.image_height){m.height=this.image_height}m.src=this.image_url;this.$image=g(m).appendTo(o)}this.setContainer();var p;if(!this.bu_icon){var r=/url\(["']?([^'")]+)['"]?\)/;p=g('
');this.$holder.append(p);this.bu_icon=p.css("background-image").replace(r,"$1");if(this.bu_icon=="none"){this.bu_icon="zoom_assets/icons.png"}p.remove()}if(this.$image.css("-moz-transform")&&f){p=g('');this.$holder.append(p);this.fixMoz=p.position().left===1?false:true;p.remove()}else{this.fixMoz=false}this.$image.hide();this.imgList=[{loaded:false,src:this.bu_icon||"zoom_assets/icons.png"},{loaded:false,src:this.image_url==""?this.$image.attr("src"):this.image_url}];g.each(this.imgList,function(u){var t=new Image();g(t).bind("load",{id:u,self:n},n.loadComplete).bind("error",{id:u,self:n},n.loadComplete);t.src=n.imgList[u].src})}j.prototype={loadComplete:function(p){var n=p.data.self,m=true;n.imgList[p.data.id].loaded=true;for(var o=0;o
');Y.append(Q);var u=Q.find(".controlsBg");if(o.bu_round){if(i){u.css(i,(E>0?4:5)+"px").css("background-color",o.bu_bg)}else{o.roundBG(u,"cBg",m,q,E>0?4:5,375,o.bu_bg,o.bu_icon,1,E?50:0)}}else{u.css("background-color",o.bu_bg)}u.css("opacity",o.bu_bg_alpha);C[0]={_var:"_zi",l:p,t:y?(q-(L*2)-(r*2)+2)/2:p,w:L,h:L,bx:-x,by:-x-E};C[1]={_var:"_zo",l:p,t:y?((q-(L*2)-(r*2)+2)/2)+L+(r*2)-2:q-L-p,w:L,h:L,bx:-s-x,by:-x-E};C[2]={_var:o.pan_rev?"_ml":"_mr",l:B-z-r,t:A,w:z,h:z,bx:-(V/2)-s*2-x,by:-(V/2)-x-E};C[3]={_var:o.pan_rev?"_mr":"_ml",l:B+z+r,t:A,w:z,h:z,bx:-(V/2)-s*3-x,by:-(V/2)-x-E};C[4]={_var:o.pan_rev?"_md":"_mu",l:B,t:A+z+r,w:z,h:z,bx:-(V/2)-s*4-x,by:-(V/2)-x-E};C[5]={_var:o.pan_rev?"_mu":"_md",l:B,t:A-z-r,w:z,h:z,bx:-(V/2)-s*5-x,by:-(V/2)-x-E};C[6]={_var:"_rs",l:B,t:A,w:z,h:z,bx:-(V/2)-s*6-x,by:-(V/2)-x-E};for(var T=0;T<7;T++){C[T].$ob=g('
').css("opacity",0.7).bind((a?"":"mouseover.sz mouseout.sz ")+o.event_down,{id:T},function(Z){o._onfocus=false;$this=g(this);if(Z.type=="mouseover"){if($this.css("opacity")>0.5){$this.css("opacity",1)}}else{if(Z.type=="mouseout"){if($this.css("opacity")>0.5){$this.css("opacity",0.7)}}else{if(Z.type=="mousedown"||Z.type=="touchstart"){o.cButtId=Z.data.id;o._onButton=true;o._wheel=false;if($this.css("opacity")>0.5){$this.css("opacity",1);Y.find("#"+C[o.cButtId]._var+"norm").hide();Y.find("#"+C[o.cButtId]._var+"over").show();if(o.cButtId<=1&&o.zoom_single){if(!v[C[o.cButtId]._var]){o.sRed=300;v[C[o.cButtId]._var]=true}}else{if(o.cButtId<6){v[C[o.cButtId]._var]=true}else{v._rs=true;o.rA=o.rR;if(o.reset_align[0]=="top"){o.fY=(o.sH/2)*(o.rA/2)}else{if(o.reset_align[0]=="bottom"){o.fY=-(o.sH/2)*(o.rA/2)}else{o.fY=0}}if(o.reset_align[1]=="left"){o.fX=(o.sW/2)*(o.rA/2)}else{if(o.reset_align[1]=="right"){o.fX=-(o.sW/2)*(o.rA/2)}else{o.fX=0}}}}o.focusOffX=o.focusOffY=0;o.changeOffset(true,true);if(!o._playing){o.Animate()}}Z.preventDefault();Z.stopPropagation()}}}});var O=g('
');var U=g('
');var G=g('
');C[T].$ob.append(O,U,G);Q.append(C[T].$ob);if(o.bu_round){if(i){O.css(i,"2px");U.css(i,"2px")}else{o.roundBG(O,C[T]._var+"norm",C[T].w,C[T].h,2,425,o.bu_color,o.bu_icon,T+1,E?50:0);o.roundBG(U,C[T]._var+"over",C[T].w+2,C[T].h+2,2,425,o.bu_color,o.bu_icon,T+1,E?50:0)}}}g(k).bind(o.event_up+o.id,{self:o},o.mouseUp);if((o.mouse_drag&&!a)||(o.touch_drag&&a)){o.$holder.bind(o.event_down,{self:o},o.mouseDown);if(a){g(k).bind(o.event_move+o.id,{self:o},o.mouseDrag)}}if(o.mouse_dbl_click){var S,P,w=1;o.$holder.bind("dblclick.sz",function(Z){o.focusOffX=Z.pageX-Y.offset().left-(o.sW/2);o.focusOffY=Z.pageY-Y.offset().top-(o.sH/2);o.changeOffset(true,true);o._wheel=false;if(o.rA=o.zoom_max&&w==1){w=-1}if(o.rA<=o.rF&&w==-1){w=1}if(w>0){o.rA*=2;o.rA=o.rA>o.zoom_max?o.zoom_max:o.rA;v._zi=true;clearTimeout(o.ani_timer);o._playing=true;o.Animate();v._zi=false}else{o.rA/=2;o.rA=o.rA ').parent()}else{if(m.image_url==""){r=g("#"+m.container)}else{r=m.$elem}r.addClass("noSel smooth_zoom_preloader");m.locations=[];m.$loc_cont=r.find(".landmarks");if(m.$loc_cont[0]){var q=m.$loc_cont.children(".item");m.loc_clone=m.$loc_cont.clone();m.show_at_zoom=parseInt(m.$loc_cont.data("show-at-zoom"),10)/100;m.allow_scale=b(m.$loc_cont.data("allow-scale"));m.allow_drag=b(m.$loc_cont.data("allow-drag"));q.each(function(){m.setLocation(g(this))})}}r.css({position:"relative",overflow:"hidden","text-align":"left","-moz-user-select":"none","-khtml-user-select":"none","-webkit-user-select":"none","user-select":"none","-webkit-touch-callout":"none","-webkit-tap-highlight-color":"rgba(255, 255, 255, 0)","background-color":m.bg_color,"background-position":"center center","background-repeat":"no-repeat"});m.$hitArea=g('').appendTo(r);m.getContainerSize(m.sW,m.sH,r,m.w_max,m.h_max);if(m.responsive){g(h).bind("orientationchange.sz"+m.id+" resize.sz"+m.id,{self:m},m.resize)}var t=m.sW;var n=m.sH;r.css({width:t,height:n});if(s>0){o[0]=g('').css("opacity",m.bord_alpha);o[1]=g('').css("opacity",m.bord_alpha);o[2]=g('').css("opacity",m.bord_alpha);o[3]=g('').css("opacity",m.bord_alpha);r.append(o[0],o[1],o[2],o[3])}if(p.attr("usemap")!=undefined){m.mapAreas=g("map[name='"+(p.attr("usemap").split("#").join(""))+"']").children("area");m.mapAreas.each(function(u){var v=g(this);v.css("cursor","pointer");if(m.mouse_drag){v.bind(m.event_down,{self:m},m.mouseDown)}if(m.mouse_wheel){v.bind("mousewheel.sz",{self:m},m.mouseWheel)}m.map_coordinates.push(v.attr("coords").split(","))})}m.$holder=r;m.sW=t;m.sH=n},getContainerSize:function(q,n,o,m,p){if(q===""||q===0){if(this.image_url==""){q=Math.max(o.parent().width(),100)}else{q=Math.max(o.width(),100)}}else{if(!isNaN(q)||String(q).indexOf("px")>-1){q=this.oW=parseInt(q);if(this.responsive){q=Math.min(o.parent().width(),q)}}else{if(String(q).indexOf("%")>-1){q=o.parent().width()*(q.split("%")[0]/100)}else{q=100}}}if(m!==0&&m!==""){q=Math.min(q,m)}if(n===""||n===0){if(this.image_url==""){n=Math.max(o.parent().height(),100)}else{n=Math.max(o.height(),100)}}else{if(!isNaN(n)||String(n).indexOf("px")>-1){n=this.oH=parseInt(n)}else{if(String(n).indexOf("%")>-1){n=o.parent().height()*(n.split("%")[0]/100)}else{n=100}}}if(p!==0&&p!==""){n=Math.min(n,p)}if(this.oW&&q!==this.oW){if(this.oH&&this.maintain_ratio){n=q/(this.oW/this.oH)}}this.sW=q;this.sH=n},setLocation:function(m){var x=this,n=m,r,t,v,u;if(l){n.css(l,"0 0")}n.css({display:"block","z-index":2});if(x.use3D){n.css({"-webkit-backface-visibility":"hidden","-webkit-perspective":1000})}r=n.outerWidth()/2;t=n.outerHeight()/2;v=n.data("position").split(",");u=n.data("allow-scale");if(u==undefined){u=x.allow_scale}else{u=b(u)}if(n.hasClass("mark")){var o=n.find("img").css("vertical-align","bottom").width();g(n.children()[0]).css({position:"absolute",left:(-n.width()/2),bottom:parseInt(n.css("padding-bottom"))*2});var q=n.find(".text");x.locations.push({ob:n,x:parseInt(v[0]),y:parseInt(v[1]),w2:r,h2:t,w2pad:r+(q[0]?parseInt(q.css("padding-left")):0),vis:false,lab:false,lpx:"0",lpy:"0",showAt:isNaN(n.data("show-at-zoom"))?x.show_at_zoom:parseInt(n.data("show-at-zoom"),10)/100,scale:u})}else{if(n.hasClass("lable")){var p=n.data("bg-color"),s=n.data("bg-opacity"),y=g(n.eq(0).children()[0]).css({position:"absolute","z-index":2,left:-r,top:-t});x.locations.push({ob:n,x:parseInt(v[0]),y:parseInt(v[1]),w2:r,h2:t,w2pad:r,vis:false,lab:true,lpx:"0",lpy:"0",showAt:isNaN(n.data("show-at-zoom"))?x.show_at_zoom:parseInt(n.data("show-at-zoom"),10)/100,scale:u});if(p!==""){if(!p){p="#000000";s=0.7}var w=g('').appendTo(n);if(s){w.css("opacity",s)}}}}n.hide();if(f){n.css("opacity",0)}if(!x.allow_drag){n.bind(x.event_down,function(z){z.stopPropagation()})}},getStyle:function(){var m=this.$image;return{prop_origin:[l,l!==false&&l!==undefined?m.css(l):null],prop_transform:[f,f!==false&&f!==undefined?m.css(f):null],position:["position",m.css("position")],"z-index":["z-index",m.css("z-index")],cursor:["cursor",m.css("cursor")],left:["left",m.css("left")],top:["top",m.css("top")],width:["width",m.css("width")],height:["height",m.css("height")]}},checkRatio:function(r,o,m,q,p){var n;if(m==r&&q==o){n=1}else{if(mo){n=o/q}}else{if(n*qo){n=o/q}if(n1){m._pinching=true;m._rA=m.rA;m.dStart=m.getDistance(o.touches[0].pageX,o.touches[0].pageY,o.touches[1].pageX,o.touches[1].pageY)}else{m.offX=o.touches[0].pageX-m.$holder.offset().left-m.$image.position().left;m.offY=o.touches[0].pageY-m.$holder.offset().top-m.$image.position().top;m.setDraggedPos(o.touches[0].pageX-m.$holder.offset().left-m.offX,o.touches[0].pageY-m.$holder.offset().top-m.offY,m._sc);m._recent="drag";m._dragging=true}}m._onHitArea=true}if(n.type=="mousedown"){n.preventDefault()}},mouseDrag:function(o){var m=o.data.self;if(o.type=="mousemove"){m.setDraggedPos(o.pageX-m.$holder.offset().left-m.offX,o.pageY-m.$holder.offset().top-m.offY,m._sc);m._recent="drag";m._dragging=true;if(!m._playing){m.Animate()}return false}else{if(m._dragging||m._pinching){o.preventDefault()}if(m._onHitArea){var n=o.originalEvent.touches;if(m._pinching||n.length>1){if(!m._pinching){m._pinching=true;m._rA=m.rA;if(n.length>1){m.dStart=m.getDistance(n[0].pageX,n[0].pageY,n[1].pageX,n[1].pageY)}}if(n.length>1){m._centx=(n[0].pageX+n[1].pageX)/2;m._centy=(n[0].pageY+n[1].pageY)/2;m.focusOffX=m._centx-m.$holder.offset().left-(m.sW/2);m.focusOffY=m._centy-m.$holder.offset().top-(m.sH/2);m.changeOffset(true,true);m._wheel=true;m._dragging=false;if(m.zoom_single){m.sRed=300}else{m.dEnd=m.getDistance(n[0].pageX,n[0].pageY,n[1].pageX,n[1].pageY);m.rA=m._rA*(m.dEnd/m.dStart);m.rA=m.rA>m.zoom_max?m.zoom_max:m.rA;m.rA=m.rA0.5){m.buttons[m.cButtId].$ob.css("opacity",0.7)}m._onButton=false;n.stopPropagation();return false}else{if(m._onHitArea){if(m.mouse_drag||m.touch_drag){if(n.type=="mouseup"){g(k).unbind(m.event_move+m.id);if(m.stX==n.pageX&&m.stY==n.pageY){m.samePointRelease=true}m._recent="drag";m._dragging=false;if(!m._playing){m.Animate()}m._onHitArea=false}else{n.preventDefault();m._dragging=false;if(m._pinching){m._pinching=false;m._wheel=false;m.cFlag._nd=true;m.cFlag._zi=false;m.cFlag._zo=false}else{m._recent="drag";if(!m._playing){m.Animate()}}m._onHitArea=false}}}}},mouseWheel:function(n,o){var m=n.data.self;m._onfocus=m._dragging=false;if(m.mouse_wheel_cur){m.focusOffX=n.pageX-m.$holder.offset().left-(m.sW/2);m.focusOffY=n.pageY-m.$holder.offset().top-(m.sH/2);m.changeOffset(true,true)}m._dragging=false;if(o>0){if(m.rA!=m.zoom_max){if(m.zoom_single){if(!m._wheel){m.sRed=300}}else{m.rA*=o<1?1+(0.3*o):1.3;m.rA=m.rA>m.zoom_max?m.zoom_max:m.rA}m._wheel=true;m.cFlag._zi=true;clearTimeout(m.ani_timer);m._playing=true;m.Animate();m.cFlag._zi=false}}else{if(m.rA!=m.rF){if(m.zoom_single){if(!m._wheel){m.sRed=300}}else{m.rA/=o>-1?1+(0.3*-o):1.3;m.rA=m.rA0?0:m.dX;if((n*m.iW)m.sW/2?m.sW/2:m.dX}}if(p!==""){m.dY=p+m.transOffY;if(m.pan_limit){m.dY=m.dY+(n*m.iH)0?0:m.dY;if((n*m.iH)m.sH/2?m.sH/2:m.dY}}},Animate:function(){var m=this;var n=0.5;m.cFlag._nd=true;m.ani_end=false;if(m.cFlag._zi){if(!m._wheel&&!m.zoom_single){m.rA*=m.zoom_speed}if(m.rA>m.zoom_max){m.rA=m.zoom_max}m.cFlag._nd=false;m.cFlag._rs=false;m._recent="zoomIn";m._onfocus=m._dragging=false}if(m.cFlag._zo){if(!m._wheel&&!m.zoom_single){m.rA/=m.zoom_speed}if(m.zoom_min!=0){if(m.rA(m.rA*m.iW)-n&&!m.zoom_single){if(m.cFlag._nd){m.ani_end=true}m._sc=m.rA}else{if(m._w>(m.zoom_max*m.iW)-n&&m.zoom_single){if(m.cFlag._nd){m.ani_end=true}m._sc=m.rA=m.zoom_max}}if(m.ani_end){m._w=m._sc*m.iW;m._h=m._sc*m.iH}}else{if(m._recent=="zoomOut"){if(m._w<(m.rA*m.iW)+n&&!m.zoom_single){if(m.cFlag._nd){m.ani_end=true}m._sc=m.rA}else{if(m._w<(m.rF*m.iW)+n&&m.zoom_single){if(m.cFlag._nd){m.ani_end=true}m._sc=m.rA=m.rF}}if(m.ani_end){m._w=m._sc*m.iW;m._h=m._sc*m.iH}}}m.limitX=(((m._w-m.sW)/(m._w/m.sW))/2);m.limitY=(((m._h-m.sH)/(m._h/m.sH))/2);if(!m._dragging){if(m.pan_limit){if(m.oX<-m.limitX-m.focusOffX){m.oX=-m.limitX-m.focusOffX}if(m.oX>m.limitX-m.focusOffX){m.oX=m.limitX-m.focusOffX}if(m._wm.limitY-m.focusOffY){m.oY=m.limitY-m.focusOffY}if(m._hm.limitX-(m.focusOffX/m._w*m.sW)+((m.sW/2)/(m._w/m.sW))){m.oX=m.limitX-(m.focusOffX/m._w*m.sW)+((m.sW/2)/(m._w/m.sW))}if(m.oY<-m.limitY-(m.focusOffY/m._h*m.sH)-(m.sH/(m._h/m.sH*2))){m.oY=-m.limitY-(m.focusOffY/m._h*m.sH)-(m.sH/(m._h/m.sH*2))}if(m.oY>m.limitY-(m.focusOffY/m._h*m.sH)+(m.sH/(m._h/m.sH*2))){m.oY=m.limitY-(m.focusOffY/m._h*m.sH)+(m.sH/(m._h/m.sH*2))}}}if(!m._dragging&&m._recent!="drag"){m.tX=((m.sW-m._w)/2)+m.focusOffX+(m.oX*(m._w/m.sW));m.tY=((m.sH-m._h)/2)+m.focusOffY+(m.oY*(m._h/m.sH));if(m.ani_smooth===1){m.cFlag._nd=true;m.ani_end=true}}if(m._recent=="zoomIn"||m._recent=="zoomOut"||m.cFlag._rs){m._x=m.tX;m._y=m.tY}else{m._x+=(m.tX-m._x)/(m.ani_smooth/(m._onfocus?m.reduction:1));m._y+=(m.tY-m._y)/(m.ani_smooth/(m._onfocus?m.reduction:1))}if(m._recent=="left"){if(m._xm.tX-n||m.ani_smooth===1){m.cFlag._nd?m.ani_end=true:"";m._recent="";m._x=m.tX}}else{if(m._recent=="up"){if(m._ym.tY-n||m.ani_smooth===1){m.cFlag._nd?m.ani_end=true:"";m._recent="";m._y=m.tY}}else{if(m._recent=="drag"){if(m._x+n>=m.tX&&m._x-n<=m.tX&&m._y+n>=m.tY&&m._y-n<=m.tY||m.ani_smooth===1){if(m._onfocus){m._dragging=false}m.cFlag._nd?m.ani_end=true:"";m._recent="";m._x=m.tX;m._y=m.tY}}}}}}if(m.cFlag._rs&&m._w+n>=(m.rA*m.iW)&&m._w-n<=(m.rA*m.iW)&&m.oX<=m.fX+n&&m.oX>=m.fX-n&&m.oY<=m.fY+n&&m.oY>=m.fY-n){m.ani_end=true;m._recent="";m.cFlag._rs=false;m.cFlag._nd=true;m._x=m.tX;m._y=m.tY;m._sc=m.rA;m._w=m._sc*m.iW;m._h=m._sc*m.iH}if(m.rA==m.rF&&m.iW*m.rA<=m.sW&&m.iH*m.rA<=m.sH){if(m.buttons[1].$ob.css("opacity")>0.5){if(m.rA>=m.rF&&(m.init_zoom==""||m.rA0.5){m.buttons[0].$ob.css("opacity",0.4);m._wheel=false;m.$holder.find("#"+m.buttons[0]._var+"norm").show();m.$holder.find("#"+m.buttons[0]._var+"over").hide()}}else{if(m.buttons[0].$ob.css("opacity")<0.5){m.buttons[0].$ob.css("opacity",0.7)}}if(f){m.$image.css(f,"translate("+m._x.toFixed(14)+"px,"+m._y.toFixed(14)+"px) scale("+m._sc+")")}else{m.$image.css({left:m._x,top:m._y,width:m._w,height:m._h})}if(m.$loc_cont){m.updateLocations(m._x,m._y,m._sc,m.locations)}if(!f&&m.map_coordinates.length>0){m.updateMap()}if(m.ani_end&&!m._dragging&&m._recent!="drag"){m._playing=false;m._recent="";m.cX=(-m._x+(m.sW/2))/m.rA;m.cY=(-m._y+(m.sH/2))/m.rA;if(m.onUPDATE){m.onUPDATE(m.getZoomData(),false)}if(m.onZOOM_PAN){m.onZOOM_PAN(m.getZoomData())}clearTimeout(m.ani_timer)}else{m._playing=true;if(m.onUPDATE){m.onUPDATE(m.getZoomData(),true)}m.ani_timer=setTimeout(function(){m.Animate()},28)}},updateLocations:function(v,u,s,t){if(this.onLANDMARK!==""){if(s>=this.show_at_zoom){if(!this._landmark){this._landmark=true;this.onLANDMARK(true)}}else{if(this._landmark){this._landmark=false;this.onLANDMARK(false)}}}for(var n=0;n=t[n].showAt){if(t[n].scale&&f){o=t[n].w2pad*this._sc;m=t[n].h2*this._sc}else{o=t[n].w2pad;m=t[n].h2}if(r>-o&&r-m&&q0&&q '));g(".bgi"+v).css({position:"absolute",width:x,height:x,"background-image":"url("+p+")","background-repeat":"no-repeat","-ms-filter":"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)",filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)",zoom:1});g(".bgh"+v).css({position:"absolute",width:t-x*2,height:x,"background-color":s,left:x});g(".bgc"+v).css({position:"absolute",width:t,height:q-x*2,"background-color":s,top:x,left:0})},changeOffset:function(m,n){if(m){this.oX=(this.tX-((this.sW-this._w)/2)-this.focusOffX)/(this._w/this.sW)}if(n){this.oY=(this.tY-((this.sH-this._h)/2)-this.focusOffY)/(this._h/this.sH)}},updateMap:function(){var m=this,n=0;m.mapAreas.each(function(){var o=[];for(var p=0;pm.rA&&m.rA!=m.zoom_max){m.rA=n.zoom;m.rA=m.rA>m.zoom_max?m.zoom_max:m.rA}else{if(n.zoom0){this.updateLocations(this._x,this._y,this._sc,this.locations)}}},attachLandmark:function(o){if(this.$loc_cont){var n=o.length;for(var m=0;m0){this.updateLocations(this._x,this._y,this._sc,this.locations)}}},removeLandmark:function(p){if(this.$loc_cont){if(p){var o=p.length;for(var n=0;n0){this.locations[this.locations.length-1].ob.remove();this.locations.pop()}}if(o>0){this.updateLocations(this._x,this._y,this._sc,this.locations)}}},refreshAllLandmarks:function(){var m=this;var p=m.$loc_cont.children(".item");m.show_at_zoom=parseInt(m.$loc_cont.data("show-at-zoom"),10)/100;m.allow_scale=b(m.$loc_cont.data("allow-scale"));m.allow_drag=b(m.$loc_cont.data("allow-drag"));for(var n=0;n0){m.border[0].height(m.sH);m.border[1].css({height:m.sH,left:m.sW-m.bord_size});m.border[2].width(m.sW-(m.bord_size*2));m.border[3].css({width:m.sW-(m.bord_size*2),top:m.sH-m.bord_size})}if(m.bu_align[1]=="center"){m.$controls.css("left",parseInt((m.sW-m.cBW)/2))}if(m.bu_align[0]=="center"){m.$controls.css("top",parseInt((m.sH-m.cBH)/2))}m.rF=m.rR=m.checkRatio(m.sW,m.sH,m.iW,m.iH,m.zoom_fit);if(m.zoom_min==0){if(m.rA",w,""].join(""),p.id=ah,(o?p:n).innerHTML+=s,n.appendChild(p),o||(n.style.background="",ai.appendChild(n)),r=v(p,w),o?p.parentNode.removeChild(p):n.parentNode.removeChild(n),!!r},K={}.hasOwnProperty,J;!Y(K,"undefined")&&!Y(K.call,"undefined")?J=function(n,m){return K.call(n,m)}:J=function(n,m){return m in n&&Y(n.constructor.prototype[m],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(m){var p=this;if(typeof p!="function"){throw new TypeError}var o=P.call(arguments,1),n=function(){if(this instanceof n){var q=function(){};q.prototype=p.prototype;var s=new q,r=p.apply(s,o.concat(P.call(arguments)));return Object(r)===r?r:s}return p.apply(m,o.concat(P.call(arguments)))};return n});var N=function(p,o){var n=p.join(""),m=o.length;M(n,function(v,u){var t=am.styleSheets[am.styleSheets.length-1],s=t?t.cssRules&&t.cssRules[0]?t.cssRules[0].cssText:t.cssText||"":"",r=v.childNodes,q={};while(m--){q[r[m].id]=r[m]}aj.touch="ontouchstart" in an||an.DocumentTouch&&am instanceof DocumentTouch||(q.touch&&q.touch.offsetTop)===9,aj.csstransforms3d=(q.csstransforms3d&&q.csstransforms3d.offsetLeft)===9&&q.csstransforms3d.offsetHeight===3},m,o)}([,["@media (",ac.join("touch-enabled),("),ah,")","{#touch{top:9px;position:absolute}}"].join(""),["@media (",ac.join("transform-3d),("),ah,")","{#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join("")],[,"touch","csstransforms3d"]);X.touch=function(){return aj.touch},X.borderradius=function(){return Q("borderRadius")},X.csstransforms=function(){return !!Q("transform")},X.csstransforms3d=function(){var m=!!Q("perspective");return m&&"webkitPerspective" in ai.style&&(m=aj.csstransforms3d),m};for(var L in X){J(X,L)&&(O=L.toLowerCase(),aj[O]=X[L](),R.push((aj[O]?"":"no-")+O))}return I(""),ag=ae=null,aj._version=ak,aj._prefixes=ac,aj._domPrefixes=Z,aj._cssomPrefixes=aa,aj.testProp=function(m){return U([m])},aj.testAllProps=Q,aj.testStyles=M,aj.prefixed=function(n,m,o){return m?Q(n,m,o):Q(n,"pfx")},aj}(this,this.document);var f=d.prefixed("transform");var l=d.prefixed("transformOrigin");var i=d.prefixed("borderRadius");var c=d.csstransforms3d;var a=d.touch})(jQuery,window,document);
//End - smoothZoom
//...................................................................................................................
//For mouse wheel support
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.6
*
* Requires: 1.2.2+
*/
(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.remove_eventListener)for(var a=b.length;a;)this.remove_eventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery)
//...................................................................................................................