(function(a){a.fn.popupLightbox=function(b){var c=a.extend({width:560,height:340,inAnimation:"ZoomIn",},b);return this.each(function(){var w=a(this);var j=k();var r=h();var t=h();var l=h();var s=v();var q=g();var p=d();var n=a(w).find("img");var m=n.length;var f=0;var o,e;a(t).addClass("btn-next").appendTo(j);a(l).addClass("btn-prev").appendTo(j);a(r).addClass("btn-close").appendTo(j).html("×");a(s).addClass("lightbox-status").appendTo(j);a(q).addClass("img-show").appendTo(j);a(j).addClass("lightbox animated faster "+c.inAnimation).appendTo("body");for(var u=0;u620){a(j).css({width:c.width,height:c.height,position:"fixed",top:"50%",marginTop:-(c.height/2),left:"50%",marginLeft:-(c.width/2),zIndex:"999",overflow:"hidden",})}else{a(j).css({width:"100%",height:"100%",top:0,left:0,})}a(p).addClass("img-caption animated fadeInUp");a(n).click(function(){var i=a(this).clone();var x=a(this).attr("data-num")*1;var y=a(this).attr("alt");if(a(this).prop("alt")==false){y="This image has no caption"}f=x;if(x+1==m){a(t).hide();a(l).show()}else{if(x==0){a(l).hide();a(t).show()}else{a(t).show();a(l).show()}}a(s).html(x+1+" / "+m);a(q).html(i).parent().fadeIn();a(p).html(y).appendTo(q)});a(t).click(function(){var i=m-1;if(f0){f-=1}a(t).fadeIn();a(q).find("img").animate({right:"-100%",opacity:0,},200,function(){a(q).html(a(n).eq(f).clone());o=a(q).find("img");e=a(o).attr("alt");a(p).html(e).appendTo(q);a(s).html(f+1+" / "+m)});if(f==0){a(l).hide()}});function v(){return document.createElement("div")}function h(){return document.createElement("button")}function k(){return document.createElement("section")}function g(){return document.createElement("figure")}function d(){return document.createElement("figcaption")}a(".btn-close").click(function(){a(this).parent().fadeOut();f=0})})}})(jQuery);