(function(n){var u=document.body||document.documentElement,r=u.style,i,t;r.transition!==undefined?i="transition":r.WebkitTransition!==undefined?i="-webkit-transition":r.MozTransition!==undefined?i="-moz-transition":r.MsTransition!==undefined?i="-ms-transition":r.OTransition!==undefined&&(i="-o-transition");r.transform!==undefined?t="transform":r.WebkitTransform!==undefined?t="-webkit-transform":r.MozTransform!==undefined?t="-moz-transform":r.MsTransform!==undefined?t="-ms-transform":r.OTransform!==undefined&&(t="-o-transform");n.fn.gallerie=function(r){function h(r,u){var h=n(r),v=h.data("gallerie").options,l=n('<div class="gallerie-overlay"/>'),k=n('<div class="gallerie-imagebox"/>'),d=n('<img class="gallerie-image"/>'),g=n('<div class="gallerie-loading"/>'),nt=n('<div class="gallerie-captionbox"><div class="gallerie-text"><div class="gallerie-title"/><div class="gallerie-index"/><\/div><\/div>'),tt=n('<div class="gallerie-control gallerie-control-previous"><span class="fa fa-caret-left"><\/span><\/div><div class="gallerie-control gallerie-control-next"><span class="fa fa-caret-right"><\/span><\/div>'),c=n("<ul><\/ul>"),it=n('<div class="gallerie-caption">Author: <a class="gallerie-author-website" href="#" target="_blank"><span class="gallerie-author-name"><\/span><\/a>, powered by <a href="http://flickr.com" target="_blank">Flickr.com<\/a>. Under the copyright of their owners.<\/div>'),rt=n('<a href="/" class="gallerie-logo" title="Explorra"><\/a>'),y=n('<a href="#" rel="nofollow" target="_blank" class="gallerie-share-btn gallerie-twitter" title="Share on Twitter"><i class="fa fa-twitter"><\/i> Twitter<\/a>'),p=n('<a href="#" rel="nofollow" target="_blank" class="gallerie-share-btn gallerie-facebook" title="Share on Facebook"><i class="fa fa-facebook"><\/i> Facebook<\/a>'),ut=n('<span class="gallerie-close"><i class="fa fa-times-circle"><\/i><\/span>'),w=n('<div class="gallerie-thumbbox"/>'),a,b,s;y.attr("href","http://twitter.com/home?status="+encodeURIComponent(window.location.href));p.attr("href","http://www.facebook.com/sharer.php?u="+encodeURIComponent(window.location.href));n.each(u,function(t,i){b=n(i);a=n(i).find("img");a=n("<li><\/li>").append(n("<a />").attr({href:b.attr("href")}).append(n("<img/>").attr({src:a.attr("src"),alt:a.attr("alt"),"data-author-name":a.attr("data-author-name"),"data-author-website":a.attr("data-author-website")})));c.append(a)});l.append(k.append(d).append(g)).append(nt).append(w.append(c)).append(tt).append(rt).append(it).append(y).append(p).append(ut);l.on("click.gallerie",".gallerie-close",function(){h.gallerie("close")});l.on("click.gallerie",".gallerie-control-previous",function(){return h.gallerie("previous"),!1});l.on("click.gallerie",".gallerie-control-next",function(){return h.gallerie("next"),!1});n(window).on("resize",function(){h.gallerie("resize")});return s=0,w.mousemove(function(r){var u=v.thumbboxTriggerWidth,k=c.outerWidth(),l=n(window).width(),p,h,a,w,b,y;if(u<1&&(u=l*u),p=s,s=r.pageX<u?0:l-r.pageX<u?1:-1,p!=s){if(e(c),s<0)return;h=0;t!==undefined&&i!==undefined?(b=c.css(t),y=f(b),y.length>4&&(h=parseInt(y[4]))):h=parseInt(c.css("left"),10);a=-(s*k)+l*s;w=Math.abs(a-h);o(c,a,{duration:w*1/v.thumbboxSpeed,easing:"linear"})}}).mouseleave(function(){e(c);s=-1}),l.find(".gallerie-thumbbox li").on("click.gallerie",function(t){var i=n(this).find("a:first")[0];h.gallerie("open",i);t.preventDefault();t.stopPropagation()}).hover(function(){n(this).addClass("gallerie-thumbbox-hover")},function(){n(this).removeClass("gallerie-thumbbox-hover")}),h.find(".gallerie-overlay").remove(),h.append(l.hide()),l}function f(n){return n.substr(7,n.length-8).split(",")}function e(n){var r,u,e;i!==undefined?(r={},t!==undefined?(u=n.css(t),e=f(u),r[t]="translate("+e[4]+"px)",r[i]=t+" 0ms"):(r.left=n.css("left"),r[i]="left 0ms"),n.css(r)):n.clearQueue().stop()}function o(n,r,u){if(i!==undefined){u.easing==undefined&&(u.easing="ease");var f={};t!==undefined?(f[t]="translate("+r+"px)",f[i]=t+" "+u.duration+"ms "+u.easing):(f.left=r,f[i]="left "+u.duration+"ms "+u.easing);n.css(f)}else n.animate({left:r},u)}function s(t){t instanceof n.Event&&(t=t.data);var i=t.preloadImage,r=t.$image,u=r.closest(".gallerie-imagebox");($imageLoading=t.$imageLoading,maxWidth=u.width()-r.outerWidth()+r.width(),maxHeight=u.height()-r.outerHeight()+r.height(),height=0,width=0,i==r.data("preloadImage"))&&(width=i.width>maxWidth?maxWidth:i.width,height=i.height*width/i.width,height>maxHeight&&(height=maxHeight,width=i.width*height/i.height),r.prop({src:i.src,alt:i.alt}).css({width:"auto",height:"auto"}).removeClass("loading"),$imageLoading.hide())}var u={init:function(t){var t=n.extend({thumbboxTriggerWidth:.1,thumbboxSpeed:.5,imageEvent:"click",elem:"a",wrapAround:!0},t);return this.each(function(){var i=n(this),r=i.data("gallerie");r||(i.data("gallerie",{options:t,target:i}),i.gallerie("load",t.elem),i.gallerie("setImage",1))})},setImage:function(t){return this.each(function(){var h=n(this),ft=h.data("gallerie").options,p=h.find(".gallerie-overlay"),f=h.find(".gallerie-thumbbox"),c=h.find(".gallerie-captionbox"),g=h.find(".gallerie-caption"),l=f.find("ul:first"),nt=n.type(t),w,a,r,b,k,v,i,tt,d,y,e,u;nt=="number"?(t>f.find("li").length&&(t=1),t=l.find("li a")[t-1]):nt=="string"&&(t=n("<a/>").prop("href",t)[0]);w=n(t);a=p.find(".gallerie-image");b=p.find(".gallerie-loading");a.addClass("loading");r=new Image;k={preloadImage:r,$image:a,$imageLoading:b};n(r).on("load.gallerie",k,s);a.data("preloadImage",r);r.src=w.prop("href");setTimeout(function(){r.complete||(b.show(),r.complete&&s(k))},250);v=f.find(t);v.length==0&&(tt=w.prop("href"),f.find("a").each(function(t,i){if(n(i).prop("href")==tt)return v=n(i),!1}));i=v.closest("li");f.find(".gallerie-thumbbox-selected").removeClass("gallerie-thumbbox-selected");i.addClass("gallerie-thumbbox-selected");var it=f.find("li"),rt=it.index(i)+1,ut=it.length;c.find(".gallerie-title").text(i.find("img").attr("alt"));c.find(".gallerie-index").text(rt+"/"+ut);c.find(".gallerie-title").html()==""&&c.find(".gallerie-index").addClass("no-title");g.find(".gallerie-author-name").html(i.find("img").attr("data-author-name"));g.find(".gallerie-author-website").attr("href",i.find("img").attr("data-author-website"));p.is(":visible")&&(window.location.hash="#photo-"+rt);d=i.position().left+i.outerWidth(!0)/2;y=n(window).width();(i.offset().left<0||d>y)&&(e=-(y/2-d),e=Math.max(0,e),e=Math.min(l.outerWidth()-y,e),l.clearQueue(),o(l,-e,{duration:1e3}));u=setTimeout(function(){n(".gallerie-thumbbox").animate({bottom:"-70px"},400)},5e3);n(".gallerie-thumbbox").hover(function(){typeof u!="undefined"&&clearTimeout(u);u=setTimeout('$(".gallerie-thumbbox").stop().animate({ "bottom": "0px" }, 400)',50)},function(){typeof u!="undefined"&&clearTimeout(u);u=setTimeout('$(".gallerie-thumbbox").stop().animate({ "bottom": "-70px" }, 400)',200)})})},isOpen:function(){var t=n(this[0]),i=t.find(".gallerie-overlay");return i.is(":visible")},open:function(t){return this.each(function(){var i=n(this),o=i.data("gallerie").options,u=i.find(".gallerie-overlay"),r=i.find(".gallerie-imagebox"),f=i.find(".gallerie-captionbox"),e=i.find(".gallerie-thumbbox");if(u.is(":hidden")){n(document).on("keyup.gallerie",function(n){n.keyCode==13||n.keyCode==27?i.gallerie("close"):n.keyCode==37?i.gallerie("previous"):n.keyCode==39&&i.gallerie("next")});n("body").css({overflow:"hidden"});r.css({height:n(window).height()-f.outerHeight()-e.outerHeight()-parseInt(r.css("margin-bottom"),10)-parseInt(r.css("margin-top"),10)})}u.fadeIn(500,function(){t&&i.gallerie("setImage",t)})})},close:function(){return this.each(function(){n(this).find(".gallerie-overlay").hide();n(document).off("keyup.gallerie");n("body").css({overflow:"inherit"});window.location.hash=""})},resize:function(){return this.each(function(){var r=n(this),f=r.find(".gallerie-overlay"),u=r.find(".gallerie-imagebox"),t=u.find("img"),e=t.height(),i=f.height()-115;u.height(i);e>i?t.height(i).css("width","auto"):t.css("height","auto").css("width","auto")})},next:function(){return this.each(function(){var t=n(this),u=t.data("gallerie").options,r=t.find(".gallerie-thumbbox"),f=r.find(".gallerie-thumbbox-selected"),i=f.next();if(i.length==0){if(!u.wrapAround)return;i=r.find("li:first")}t.gallerie("setImage",i.find("a"))})},previous:function(){return this.each(function(){var t=n(this),u=t.data("gallerie").options,r=t.find(".gallerie-thumbbox"),f=r.find(".gallerie-thumbbox-selected"),i=f.prev();if(i.length==0){if(!u.wrapAround)return;i=r.find("li:last")}t.gallerie("setImage",i.find("a"))})},load:function(t){return this.each(function(){var i=n(this),r=i.data("gallerie").options;t===undefined&&(t=r.elem);h(this,i.find(t).toArray());n(document).on(r.imageEvent+".gallerie",t,function(n){i.gallerie("open",this);n.stopPropagation();n.preventDefault()})})},option:function(t,i){var r={};if(i===undefined&&n.type(t)!="string")r=t;else{if(i===undefined)return n(this[0]).data("gallerie").options[t];r={};r[t]=i}return this.each(function(){var i=n(this),u=i.data("gallerie"),t=u.options;n.each(r,function(r,u){if(r=="elem"||r=="imageEvent"){n(document).off(t.imageEvent+".gallerie",t.elem);t[r]=u;n(document).on(t.imageEvent+".gallerie",t.elem,function(n){i.gallerie("open",this);n.stopPropagation();n.preventDefault()})}else r in t&&(t[r]=u)});u.options=t;i.data("gallerie",u)})}};if(u[r])return u[r].apply(this,Array.prototype.slice.call(arguments,1));if(typeof r!="object"&&r)n.error("Method "+r+" does not exist on jQuery.gallerie");else return u.init.apply(this,arguments)}})(jQuery)