!function(e,t,$){"use strict";function r(){var t=e.location.hash.substr(1),r=t.split("-"),a=r.length>1&&/^\+?\d+$/.test(r[r.length-1])&&parseInt(r.pop(-1),10)||1;return{hash:t,index:a<1?1:a,gallery:r.join("-")}}function a(e){""!==e.gallery&&$("[data-fancybox='"+$.escapeSelector(e.gallery)+"']").eq(e.index-1).focus().trigger("click.fb-start")}function n(e){var t,r;return!!e&&(""!==(r=(t=e.current?e.current.opts:e.opts).hash||(t.$orig?t.$orig.data("fancybox")||t.$orig.data("fancybox-trigger"):""))&&r)}$.escapeSelector||($.escapeSelector=function(e){return(e+"").replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,(function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}))}),$((function(){!1!==$.fancybox.defaults.hash&&($(t).on({"onInit.fb":function(e,t){var a,o;!1!==t.group[t.currIndex].opts.hash&&(a=r(),(o=n(t))&&a.gallery&&o==a.gallery&&(t.currIndex=a.index-1))},"beforeShow.fb":function(r,a,o,c){var h;o&&!1!==o.opts.hash&&(h=n(a))&&(a.currentHash=h+(a.group.length>1?"-"+(o.index+1):""),e.location.hash!=="#"+a.currentHash&&(c&&!a.origHash&&(a.origHash=e.location.hash),a.hashTimer&&clearTimeout(a.hashTimer),a.hashTimer=setTimeout((function(){"replaceState"in e.history?(e.history[c?"pushState":"replaceState"]({},t.title,e.location.pathname+e.location.search+"#"+a.currentHash),c&&(a.hasCreatedHistory=!0)):e.location.hash=a.currentHash,a.hashTimer=null}),300)))},"beforeClose.fb":function(r,a,n){n&&!1!==n.opts.hash&&(clearTimeout(a.hashTimer),a.currentHash&&a.hasCreatedHistory?e.history.back():a.currentHash&&("replaceState"in e.history?e.history.replaceState({},t.title,e.location.pathname+e.location.search+(a.origHash||"")):e.location.hash=a.origHash),a.currentHash=null)}}),$(e).on("hashchange.fb",(function(){var e=r(),t=null;$.each($(".fancybox-container").get().reverse(),(function(e,r){var a=$(r).data("FancyBox");if(a&&a.currentHash)return t=a,!1})),t?t.currentHash===e.gallery+"-"+e.index||1===e.index&&t.currentHash==e.gallery||(t.currentHash=null,t.close()):""!==e.gallery&&a(e)})),setTimeout((function(){$.fancybox.getInstance()||a(r())}),50))}))}(window,document,jQuery);