!function($){function format(t){for(var o=1;o>0,e=d-u.offset().top-.5*a>>0;0>t?t=0:t>u.outerWidth()-n&&(t=u.outerWidth()-n),0>e?e=0:e>u.outerHeight()-a&&(e=u.outerHeight()-a),h.css({left:t,top:e}),h.css("background-position",-t+"px "+-e+"px"),b=t/u.outerWidth()*s.width>>0,x=e/u.outerHeight()*s.height>>0,z+=(b-z)/o.smoothMove,y+=(x-y)/o.smoothMove,p.css("background-position",-(z>>0)+"px "+(-(y>>0)+"px"))}v=setTimeout(function(){O.controlLoop()},30)},this.init2=function(t,o){w++,1===o&&(s=t),2===w&&this.init()},this.init=function(){$(".cloud-zoom-loading",t.parent()).remove(),$(".mousetrap").remove(),c=t.parent().append(format("
",u.outerWidth(),u.outerHeight(),0,0)).find(":last"),c.bind("mousemove",this,function(t){r=t.pageX,d=t.pageY}),c.bind("mouseleave",this,function(){return clearTimeout(v),h&&h.fadeOut(0),m&&m.fadeOut(0),f&&f.fadeOut(0),p.fadeOut(1,function(){O.fadedOut()}),!1}),c.bind("mouseenter",this,function(e){r=e.pageX,d=e.pageY,l=e.data,p&&(p.stop(!0,!1),p.remove());var i=o.adjustX,v=o.adjustY,b=u.outerWidth(),x=u.outerHeight(),y=o.zoomWidth,z=o.zoomHeight;"auto"==o.zoomWidth&&(y=b),"auto"==o.zoomHeight&&(z=x);var w=t.parent();switch(o.position){case"top":v-=z;break;case"right":i+=b;break;case"bottom":v+=x;break;case"left":i-=y;break;case"inside":y=b,z=x;break;default:w=$("#"+o.position),w.length?(y=w.innerWidth(),z=w.innerHeight()):(w=t,i+=b,v+=x)}p=w.append(format('',i,v,y,z,s.src)).find(":last"),u.attr("title")&&o.showTitle&&p.append(format('
%0
',u.attr("title"))).find(":last").css("opacity",o.titleOpacity),$.browser.msie&&$.browser.version<7&&(g=$('').css({position:"absolute",left:i,top:v,zIndex:99,width:y,height:z}).insertBefore(p)),p.fadeIn(0),h&&(h.remove(),h=null),n=u.outerWidth()/s.width*p.width(),a=u.outerHeight()/s.height*p.height(),h=t.append(format("",n,a)).find(":last"),c.css("cursor",h.css("cursor"));var O=!1;o.tint&&(h.css("background",'url("'+u.attr("src")+'")'),m=t.append(format('
',u.outerWidth(),u.outerHeight(),o.tint)).find(":last"),m.css("opacity",o.tintOpacity),O=!0,m.fadeIn(0)),o.softFocus&&(h.css("background",'url("'+u.attr("src")+'")'),f=t.append(format('
',u.outerWidth()-2,u.outerHeight()-2,o.tint)).find(":last"),f.css("background",'url("'+u.attr("src")+'")'),f.css("opacity",.5),O=!0,f.fadeIn(0)),O||h.css("opacity",o.lensOpacity),"inside"!==o.position&&h.fadeIn(0),l.controlLoop()})},e=new Image,$(e).load(function(){O.init2(this,0)}),e.src=u.attr("src"),i=new Image,$(i).load(function(){O.init2(this,1)}),i.src=t.attr("href")}$(document).ready(function(){$(".cloud-zoom, .cloud-zoom-gallery").CloudZoom()}),$.fn.CloudZoom=function(options){try{document.execCommand("BackgroundImageCache",!0,!0)}catch(e){}return this.each(function(){var relOpts,opts;eval("var a = {"+$(this).attr("rel")+"}"),relOpts=a,$(this).is(".cloud-zoom")?($(this).css({position:"relative",display:"block"}),$("img",$(this)).css({display:"block"}),"wrap"!=$(this).parent().attr("id")&&$(this).wrap('
'),opts=$.extend({},$.fn.CloudZoom.defaults,options),opts=$.extend({},opts,relOpts),$(this).data("zoom",new CloudZoom($(this),opts))):$(this).is(".cloud-zoom-gallery")&&(opts=$.extend({},relOpts,options),$(this).data("relOpts",opts),$(this).bind("mouseover",$(this),function(t){var o=t.data.data("relOpts");return $("#"+o.useZoom).data("zoom").destroy(),$("#"+o.useZoom).attr("href",t.data.attr("href")),$("#"+o.useZoom+" img").attr("src",t.data.data("relOpts").smallImage),$("#"+t.data.data("relOpts").useZoom).CloudZoom(),!1}),$(this).bind("click",$(this),function(){return!1}))}),this},$.fn.CloudZoom.defaults={zoomWidth:"auto",zoomHeight:"auto",position:"right",tint:!1,tintOpacity:.5,lensOpacity:.5,softFocus:!1,smoothMove:3,showTitle:!0,titleOpacity:.5,adjustX:0,adjustY:0}}(jQuery);