").addClass("abigimage-bottomBox").appendTo(ha),ua=a("
").addClass("abigimage-bottom").appendTo(ta),va="abigimage-layout-active",wa="abigimage-layout-fadeout",xa="abigimage-layout-full",ya="abigimage-layout-zoom",za="abigimage-overlay-active",Aa="abigimage-prevBtn-hover",Ba="abigimage-nextBtn-hover",Ca="abigimage-closeBtn-hover",Da=ja[0],Ea=a(window),Fa=a("html"),Ga=a(document),Ha=a(document.body),Ia=null,Ja=null,Ka=!1,La=!1,Ma=!1,Na=Da.style,Oa=ga[0].style;a.fn.abigimage.defaults={duration:200,slideWidth:.4,slideVelocity:.4,zoomMin:1.5,zoomMax:5,zoomClose:.9,zoomMoveViewport:.9,zoomVelocity:.04,doubleTapInterval:400,prevBtnHtml:"←",nextBtnHtml:"→",zoomInBtnHtml:"+",zoomOutBtnHtml:"−",closeBtnHtml:"×",keyNext:[13,32,39,40],keyPrev:[8,37,38],keyClose:[27,35,36],onopen:null,onclose:null},a.abigimage={overlay:ga,layout:ha,wrapper:ia,box:ja,prevBtnBox:ka,closeBtnBox:la,top:ma,prevBtn:na,nextBtn:oa,zoomInBtn:sa,zoomOutBtn:ra,closeBtn:qa,counter:pa,bottomBox:ta,bottom:ua,open:function(a,b,c){(c&&c._abigimage||D||C).open(a,b)},close:function(a){(a&&a._abigimage||D||C).close()},next:function(a){(a&&a._abigimage||D||C).next()},prev:function(a){(a&&a._abigimage||D||C).prev()},unbind:function(a){(a&&a._abigimage||D||C).unbind()}},ka.click(function(a){b(a),D&&D.prev()}).hover(function(){na.addClass(Aa)},function(){na.removeClass(Aa)}),la.click(function(a){b(a),D&&D.close()}).hover(function(){qa.addClass(Ca)},function(){qa.removeClass(Ca)}),na.click(function(a){b(a),D&&D.prev()}),oa.click(function(a){b(a),D&&D.next()});var Pa=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(function(){a((new Date).getTime())},1e3/60)};return sa.mousedown(function(a){b(a),p(),U=null,V=1,Pa(c)}).mouseup(function(a){b(a),V=null}).mouseout(function(){V=null}).click(function(a){b(a),D&&B(D.zoomVelocity*D.duration,!0)}),ra.mousedown(function(a){b(a),p(),U=null,V=-1,Pa(c)}).mouseup(function(a){b(a),V=null}).mouseout(function(){V=null}).click(function(a){b(a),D&&B(-D.zoomVelocity*D.duration,!0)}),qa.click(function(a){b(a),D&&D.close()}),Da.addEventListener&&(d(Da,"touchstart",k),d(Da,"touchmove",l),d(Da,"touchend",m),d(Da,"touchcancel",m),d(Da,"webkitTransitionEnd",x),d(Da,"mozTransitionEnd",x),d(Da,"msTransitionEnd",x),d(Da,"oTransitionEnd",x),d(Da,"transitionend",x),d(Da,"wheel",y),d(Da,"mousemove",z)),e.prototype.open=function(c,d){D=this;var e;if("number"==typeof c){if(d=c,d==this.index||0>d||d>this.elements.length-1)return;e=a(this.elements[d]),c=e.data("href")||e.attr("href")}else if("number"!=typeof d)d=this.index;else if(d==this.index)return;this.index=d,this.opened=e,this.prevBtn.html(this.prevBtnHtml),this.nextBtn.html(this.nextBtnHtml),this.zoomInBtn.html(this.zoomInBtnHtml),this.zoomOutBtn.html(this.zoomOutBtnHtml),this.closeBtn.html(this.closeBtnHtml),this.bottom.html(""),this.counter.html(d>=0?d+1+" / "+this.elements.length:""),a("img",this.box).remove(),w(),this.overlay.addClass(za),this.layout.addClass(va).removeClass(wa).scrollTop(0),u(0,0,1),this.img=f("abigimage-img",c).click(function(a){b(a),D&&D.next()}).hover(function(){oa.addClass(Ba)},function(){oa.removeClass(Ba)}).one("load",function(){h()});var i=a(this.elements[this.nextIndex()]);this.imgNext=f("abigimage-imgNext",i.data("href")||i.attr("href")).hide().one("load",function(){h()});var j=a(this.elements[this.prevIndex()]);this.imgPrev=f("abigimage-imgPrev",j.data("href")||j.attr("href")).hide().one("load",function(){h()}),h(!0),Ga.unbind("keydown",g).bind("keydown",g),null===Ia&&null===Ja&&(Ia=Fa.css("padding-right"),Ja=Ha.css("overflow-y"),Fa.css("padding-right",parseInt(Ia)+window.innerWidth-Ea.width()+"px"),Ha.css("overflow-y","hidden")),this.onopen&&this.onopen.call(this,this.opened)},e.prototype.next=function(){this.distance==this.elements.length-1?this.close():(++this.distance,this.elements[this.nextIndex()].click())},e.prototype.prev=function(){this.distance==1-this.elements.length?this.close():(--this.distance,this.elements[this.prevIndex()].click())},e.prototype.close=function(){D&&(Ga.unbind("keydown",g),Fa.css("padding-right",Ia),Ha.css("overflow-y",Ja),Ia=null,Ja=null,ga.removeClass(za),ha.removeClass(va),this.onclose&&this.onclose.call(this,this.opened),this.index=-1,this.distance=0,D=null)},e.prototype.unbind=function(){this.close(),this.elements.each(function(){a(this).unbind("click.abigimage")})},e.prototype.key=function(a){if(-1!=this.keyNext.indexOf(a))this.next();else if(-1!=this.keyPrev.indexOf(a))this.prev();else{if(-1==this.keyClose.indexOf(a))return!1;this.close()}return!0},e.prototype.nextIndex=function(){var a=this.index+1;return a>=this.elements.length&&(a=0),a},e.prototype.prevIndex=function(){var a=this.index-1;return 0>a&&(a=this.elements.length-1),a},e}var d;a.fn.abigimage=function(e){d||(d=c());var f=new d(this,e);return this._abigimage=f,last=f,this.each(function(c){a(this).unbind("click.abigimage").bind("click.abigimage",function(a){b(a),f.open(c)})})}}(jQuery);