var MojoZoom=function(){function i(e,t,n){var r=function(e){return n(e||window.event)};if(e.addEventListener){e.addEventListener(t,r,false)}else if(e.attachEvent){e.attachEvent("on"+t,r)}}function s(e){var t=e.offsetLeft;var n=e.offsetTop;var r=e.offsetParent;while(r){t+=r.offsetLeft-r.scrollLeft;n+=r.offsetTop-r.scrollTop;r=r.offsetParent}return{x:t,y:n}}function o(e,t){var n=document.body.scrollLeft||document.documentElement.scrollLeft;var r=document.body.scrollTop||document.documentElement.scrollTop;if(t.currentTarget){var i=s(e);return{x:t.clientX-i.x+n,y:t.clientY-i.y+r}}return{x:t.offsetX,y:t.offsetY}}function u(e,a,f,l,c,h){if(!e.complete&&!e.__mojoZoomQueued){i(e,"load",function(){e.__mojoZoomQueued=true;setTimeout(function(){u(e,a,f,l,c,h)},1)});return}e.__mojoZoomQueued=false;setTimeout(function(){var u=!!document.all&&!!window.attachEvent&&!window.opera;var p=e.offsetWidth;var d=e.offsetHeight;var v=e.parentNode;if(v.nodeName!="A"){var m=t("a");m.setAttribute("href",a);v.replaceChild(m,e);m.appendChild(e)}else{var m=v}m.style.position="relative";m.style.display="block";m.style.width=p+"px";m.style.height=d+"px";var g=e.offsetLeft;var y=e.offsetTop;var b=t("div");b.className="mojozoom_marker";var w=t("img");w.className="mojozoom_img";w.style.position="absolute";w.style.left="-9999px";w.style.top="-9999px";w.style.maxWidth="none";w.style.maxHeight="none";w.style.zIndex=10000001;document.body.appendChild(w);var E=e.parentNode;var S=t("div");S.style.position="absolute";S.style.left=g+"px";S.style.top=y+"px";S.style.width=p+"px";S.style.height=d+"px";S.style.overflow="hidden";S.style.display="none";S.appendChild(b);E.appendChild(S);var x=E;if(e.__mojoZoomOverlay)E.removeChild(e.__mojoZoomOverlay);e.__mojoZoomOverlay=S;if(e.__mojoZoomImage&&e.__mojoZoomImage.parentNode)e.__mojoZoomImage.parentNode.removeChild(e.__mojoZoomImage);e.__mojoZoomImage=w;var T=false;if(!f){f=t("div");f.className="mojozoom_imgctr";var N=s(e);f.style.left=p+N.x+"px";f.style.top=N.y+"px";f.style.width=(l?l:n)+"px";f.style.height=(c?c:r)+"px";document.body.appendChild(f);T=true}f.style.overflow="hidden";if(!h){f.style.visibility="hidden"}i(w,"load",function(){if(!w.parentNode)return;var n=w.offsetWidth?w.offsetWidth:w.naturalWidth;var r=w.offsetHeight?w.offsetHeight:w.naturalHeight;var a=f.offsetWidth;var l=f.offsetHeight;var c=n/p;var v=r/d;var m=Math.round(a/c);var E=Math.round(l/v);document.body.removeChild(w);f.appendChild(w);var N=t("div");N.className="mojozoom_fill";b.appendChild(N);var C=t("div");C.className="mojozoom_border";b.appendChild(C);b.style.width=m+"px";b.style.height=E+"px";if(h){b.style.left="0px";b.style.top="0px";w.style.left="0px";w.style.top="0px"}var k=false;if(!h){i(x,"mouseout",function(e){var t=e.target||e.srcElement;if(!t)return;if(t.nodeName!="DIV")return;var n=e.relatedTarget||e.toElement;if(!n)return;while(n!=t&&n.nodeName!="BODY"&&n.parentNode){n=n.parentNode}if(n!=t){k=false;S.style.display="none";f.style.visibility="hidden"}});i(document.body,"mouseover",function(e){if(k&&!(e.toElement==C||e.target==C)){S.style.display="none";f.style.visibility="hidden";k=false}})}i(x,"mousemove",function(t){k=true;var n=s(e);if(T){f.style.left=p+n.x+"px";f.style.top=n.y+"px"}S.style.display="block";f.style.visibility="visible";var r=o(x,t);if(t.srcElement&&u){if(t.srcElement==b)return;if(t.srcElement!=x){var i=s(t.srcElement);r.x-=n.x-i.x;r.y-=n.y-i.y}}var h=m/2;var N=E/2;if(!u){r.x-=g;r.y-=y}if(r.xp-h)r.x=p-h;if(r.yd-N)r.y=d-N;var C=r.x-h|0;var L=r.y-N|0;b.style.left=C+"px";b.style.top=L+"px";w.style.left=-(r.x*c-a/2|0)+"px";w.style.top=-(r.y*v-l/2|0)+"px"})});setTimeout(function(){w.src=a},1)},1)}function a(){var e=document.getElementsByTagName("img");for(var t=0;t