(function(a){a.fn.jqzoom=function(u){var c={zoomType:"standard",zoomWidth:200,zoomHeight:200,xOffset:10,yOffset:0,position:"right",lens:!0,lensReset:!1,imageOpacity:0.2,title:!0,alwaysOn:!1,showEffect:"show",hideEffect:"hide",fadeinSpeed:"fast",fadeoutSpeed:"slow",preloadImages:!0,showPreload:!0,preloadText:"Loading zoom",preloadPosition:"center"};u=u||{};a.extend(c,u);return this.each(function(){var m,n;function u(){if(!w){B.findborder();w=!0;y=p.attr("title");p.removeAttr("title");z=d.attr("title"); a(d).removeAttr("title");if(!k||a.browser.safari)k=new x(d[0].href);!C||a.browser.safari?k.loadimage():("innerzoom"!=c.zoomType&&(v=new A,v.activate()),f=new q,f.activate());d[0].blur();return!1}}function q(){this.node=document.createElement("div");a(this.node).addClass("jqZoomPup");this.node.onerror=function(){a(f.node).remove();f=new q;f.activate()};this.loadlens=function(){switch(c.zoomType){case "reverse":this.image=new Image;this.image.src=B.node.src;this.node.appendChild(this.image);a(this.node).css({opacity:1}); break;case "innerzoom":this.image=new Image,this.image.src=k.node.src,this.node.appendChild(this.image),a(this.node).css({opacity:1})}switch(c.zoomType){case "innerzoom":m=b.w;n=b.h;break;default:m=c.zoomWidth/r.x,n=c.zoomHeight/r.y}a(this.node).css({width:m+"px",height:n+"px",position:"absolute",display:"none",borderWidth:"1px"});d.append(this.node)};return this}function x(e){this.url=e;this.node=new Image;this.loadimage=function(){this.node||(this.node=new Image);this.node.style.position="absolute"; this.node.style.display="none";this.node.style.left="-5000px";this.node.style.top="10px";D=new E;c.showPreload&&!H&&(D.show(),H=!0);document.body.appendChild(this.node);this.node.src=this.url};this.node.onload=function(){this.style.display="block";var e=Math.round(a(this).width()),d=Math.round(a(this).height());this.style.display="none";r.x=e/b.w;r.y=d/b.h;0").addClass("jqZoomTitle").html(""+J+"");this.loadtitle=function(){"innerzoom"==c.zoomType?a(this.node).css({position:"absolute",top:b.pos.b+3,left:b.pos.l+1,width:b.w}).appendTo("body"):a(this.node).appendTo(v.node)}}function E(){this.node=document.createElement("div");a(this.node).addClass("preload");a(this.node).html(c.preloadText);a(this.node).appendTo("body").css("visibility", "hidden");this.show=function(){switch(c.preloadPosition){case "center":loadertop=b.pos.t+(b.h-a(this.node).height())/2;loaderleft=b.pos.l+(b.w-a(this.node).width())/2;break;default:var e=this.getoffset();loadertop=isNaN(e.top)?b.pos.t+0:b.pos.t+e.top;loaderleft=isNaN(e.left)?b.pos.l+0:b.pos.l+e.left}a(this.node).css({top:loadertop,left:loaderleft,position:"absolute",visibility:"visible"})};return this}var d=a(this),z=d.attr("title");a(d).removeAttr("title");a(d).css("outline-style","none");var p= a("img",this),y=p.attr("title");p.removeAttr("title");var B=new function(e){this.node=e[0];this.loadimage=function(){this.node.src=e[0].src};this.findborder=function(){var b="",b=a(p).css("border-top-width"),c=g="",c=a(p).css("border-left-width");h="";if(b)for(i=0;3>i;i++){var e=[],e=b.substr(i,1);if(!1==isNaN(e))g=g+""+b.substr(i,1);else break}if(c)for(i=0;3>i&&!isNaN(c.substr(i,1));i++)h+=c.substr(i,1);g=0b.pos.r+h&&(e=a.browser.msie?b.w-m+h+1:b.w-m+h-1);t-(n+2)/2-gb.pos.b+g&&(l=a.browser.msie?b.h-n+g+1:b.h-n-1+g);e=parseInt(e);l=parseInt(l);a("div.jqZoomPup",d).css({top:l,left:e});"reverse"==c.zoomType&&a("div.jqZoomPup img",d).css({position:"absolute",top:-(l-g+1),left:-(e-h+1)});this.node.style.left=e+"px";this.node.style.top=l+"px";k.setposition();return this}; q.prototype.center=function(){a("div.jqZoomPup",d).css("display","none");var e=b.w/2-m/2,l=b.h/2-n/2;this.node.style.left=e+"px";this.node.style.top=l+"px";a("div.jqZoomPup",d).css({top:l,left:e});"reverse"==c.zoomType&&a("div.jqZoomPup img",d).css({position:"absolute",top:-(l-g+1),left:-(e-h+1)});k.setposition();a.browser.msie?a("div.jqZoomPup",d).show():setTimeout(function(){a("div.jqZoomPup").fadeIn("fast")},10)};q.prototype.getoffset=function(){var a={};a.left=parseInt(this.node.style.left);a.top= parseInt(this.node.style.top);return a};q.prototype.remove=function(){"innerzoom"==c.zoomType?a("div.jqZoomPup",d).fadeOut("fast",function(){a(this).remove()}):a("div.jqZoomPup",d).remove()};q.prototype.findborder=function(){var b="",b=a("div.jqZoomPup").css("borderTop"),c=lensbtop="",c=a("div.jqZoomPup").css("borderLeft");lensbleft="";if(a.browser.msie)var d=b.split(" "),b=d[1],d=c.split(" "),c=d[1];if(b)for(i=0;3>i;i++)if(d=[],d=b.substr(i,1),!1==isNaN(d))lensbtop=lensbtop+""+b.substr(i,1);else break; if(c)for(i=0;3>i&&!isNaN(c.substr(i,1));i++)lensbleft+=c.substr(i,1);lensbtop=0a.browser.version&&(this.ieframe=a('').css({position:"absolute",left:this.node.style.left,top:this.node.style.top,zIndex:99,width:c.zoomWidth,height:c.zoomHeight}).insertBefore(this.node));k.node.style.display="block"};A.prototype.remove=function(){switch(c.hideEffect){case "hide":a(".jqZoomWindow").remove(); break;case "fadeout":a(".jqZoomWindow").fadeOut(c.fadeoutSpeed);break;default:a(".jqZoomWindow").remove()}};I.prototype.remove=function(){a(".jqZoomTitle").remove()};E.prototype.getoffset=function(){var b=null;return b=a("div.preload").offset()}})}})(jQuery);function trim(a){for(;" "==a.substring(0,1);)a=a.substring(1,a.length);for(;" "==a.substring(a.length-1,a.length);)a=a.substring(0,a.length-1);return a};