$(function(){$(".js-arrow").on("mousedown",function(t){t.preventDefault();var o=$(this),a=o.data(),n=$(a.fotorama).data("fotorama");n&&n.show({index:a.show,slow:t.altKey})})}),window.console=window.console||{log:$.noop},$(function(){var t=$(".fotorama-frontpage");t[0]&&($(window).width()>768&&$("a",t).each(function(){var t=$(this);t.attr("href",t.attr("href").replace("-lo.jpg",".jpg"))}),console.log("# Fotorama events"),t.on("fotorama:ready fotorama:show fotorama:showend fotorama:load fotorama:error fotorama:fullscreenenter fotorama:fullscreenexit ",function(t,o,a){console.log("## "+t.type),a&&a.src||console.log("active image: "+o.activeFrame.img),a&&(a.time&&console.log("transition duration: "+Math.round(a.time)+"ms"),a.src&&console.log(("fotorama:load"===t.type?"loaded":"broken")+" image: "+a.src)),console.log("")}).fotorama({spinner:{color:"rgba(255, 255, 255, .75)"}}).parent().next(".photos-by").show())}),$(function(){function t(t){for(var o={},a=t.substring(t.indexOf("?")+1).split("&"),n=0;a.length>n;n++){var e=a[n].split("="),r=decodeURIComponent(e[0]),i=decodeURIComponent(e[1]);r&&i&&(o[r]="false"!==i?"true"!==i?i:!0:!1)}return o}var o=t(location.search).domain;if(o){var a=/^[a-z]+:\/\//,n=o.match(a),e=o.replace(a,"").replace(/\/.*/,""),r=(n&&n[0]||"http://")+e;$(".js-licensee").attr({href:r}).text(e)}}),$(function(){function t(){e.$menu&&a(e.$menu.stop().css({marginTop:-10,opacity:0}).show().animate({marginTop:0,opacity:1},200))}function o(){e.$menu&&e.$menu.stop().animate({marginTop:20,opacity:0},200,function(){e.$menu.hide(),e.$menu=null,$(".js-menu-down").data({used:!1}).removeClass("active")})}function a(t){var o=t.data();o&&!o.ok&&(o.ok=!0,t.on("click",function(t){t.stopPropagation()}))}var n=$(document),e=n.data();$(".js-menu-down").on("click",function(a){a.stopPropagation();var n=$(this),r=n.data();r.used?o():(r.used=!0,n.addClass("active"),e.$menu=n.next(".menu"),t())}),n.on("click keydown",function(t){("click"===t.type||27===t.keyCode)&&o()})}),$(function(){$(".js-set-options").on("change",function(){var t=$($(this).data("fotorama")).data("fotorama"),o={};t&&($(":input",this).each(function(){var t=$(this);o[t.attr("name")]="checkbox"===t.attr("type")?t.is(":checked"):t.val()}),t.setOptions(o))})}),$(function(){$(".js-shuffle").on("click",function(t){t.preventDefault();var o=$(this),a=$(o.attr("data-fotorama")).data("fotorama");a&&a.shuffle()})}),$(function(){function t(t,o,a,n){t[0]&&$.ajax({url:o,dataType:n||"jsonp",success:function(o){var n=+t.text()||0;t.text(n+a(o)||"")}})}function o(o){t($("#twitter-counter"),"http://urls.api.twitter.com/1/urls/count.json?url="+o,function(t){return t.count})}o("fotoramajs.com"),o("fotorama.io"),t($("#github-counter"),"https://api.github.com/repos/artpolikarpov/fotorama",function(t){return t.data.watchers_count}),t($("#flattr-counter"),"https://api.flattr.com/rest/v2/things/1845948/flattrs",function(t){return t[0].thing.flattrs},"json")}),$(function(){$(".js-transition-switch").on("click",function(t){t.preventDefault();var o=$(this),a=$(o.attr("data-fotorama")).data("fotorama");a&&(o.addClass("active inverse").siblings().removeClass("active inverse"),a.setOptions({transition:o.text().toLowerCase()}))})});