(function(a){a.fn.zoomi=function(){a(this).filter("img").each(function(){if(!this.z){a(this).zoom1().mouseover(function(){a(this).zoom2().fadeIn(600)});a(this.z).mouseout(function(){a(this).fadeOut(600)})}});return this};a.fn.zoom1=function(){a(this).each(function(){var b=this;a(b).css({position:"relative","z-index":"8"}).after('<img class="'+b.className+'">');b.z=b.nextSibling;a(b.z).removeClass("zoomi").addClass("zoom2").attr("src",b.alt||b.src).css({position:"absolute","z-index":"10"});a(b.z).hide()});return this};a.fn.zoom2=function(){var b=[];this.each(function(){var c=this;if(!c.z){c=a(c).zoom1()[0]}b.push(c.z);if(!c.z.complete){return}if(!c.z.width){a(c.z).show();c.z.width=c.z.width;a(c.z).hide()}a(c.z).css({left:a(c).offsetLeft()-(c.z.width-c.scrollWidth)/2+"px",top:a(c).offsetTop()-(c.z.height-c.scrollHeight)/2+"px"})});return this.pushStack(b)};a.fn.offsetLeft=function(){var b=this[0];if(!b.offsetParent){return b.offsetLeft}return b.offsetLeft+a(b.offsetParent).offsetLeft()};a.fn.offsetTop=function(){var b=this[0];if(!b.offsetParent){return b.offsetTop}return b.offsetTop+a(b.offsetParent).offsetTop()};a(function(){a("img.zoomi").zoomi()})})(jQuery);
