/*!
 * baguetteBox.js
 * @author  feimosi
 * @version 1.11.1
 * @url https://github.com/feimosi/baguetteBox.js
 */
(function(e,t){'use strict';
if(typeof define==='function'&&define.amd){define(t)}
else if(typeof exports==='object'){module.exports=t()}
else{e.baguetteBox=t()}}(this,function(){'use strict';
var V='<svg width="44" height="60"><polyline points="30 10 10 30 30 50" stroke="rgba(255,255,255,0.5)" stroke-width="4"stroke-linecap="butt" fill="none" stroke-linejoin="round"/></svg>',U='<svg width="44" height="60"><polyline points="14 10 34 30 14 50" stroke="rgba(255,255,255,0.5)" stroke-width="4"stroke-linecap="butt" fill="none" stroke-linejoin="round"/></svg>',W='<svg width="30" height="30"><g stroke="rgb(160,160,160)" stroke-width="4"><line x1="5" y1="5" x2="25" y2="25"/><line x1="5" y1="25" x2="25" y2="5"/></g></svg>',t={},q={captions:!0,buttons:'auto',fullScreen:!1,noScrollbars:!1,bodyClass:'baguetteBox-open',titleTag:!1,async:!1,preload:2,animation:'slideIn',afterShow:null,afterHide:null,onChange:null,overlayBackgroundColor:'rgba(0,0,0,.8)'};
var r={};
var e,n,a,s,u,d=[],i=0,E=!1,o={};
var h=!1,j=/.+\.(gif|jpe?g|png|webp)/i,b={};
var g=[],x=null,L=function(e){if(e.target.id.indexOf('baguette-img')!==-1){p()}},A=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0;
w()},S=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0;
k()},P=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0;
p()},F=function(e){o.count++;
if(o.count>1){o.multitouch=!0};
o.startX=e.changedTouches[0].pageX;
o.startY=e.changedTouches[0].pageY},H=function(e){if(h||o.multitouch){return};
e.preventDefault?e.preventDefault():e.returnValue=!1;
var t=e.touches[0]||e.changedTouches[0];
if(t.pageX-o.startX>40){h=!0;
w()}
else if(t.pageX-o.startX<-40){h=!0;
k()}
else if(o.startY-t.pageY>100){p()}},C=function(){o.count--;
if(o.count<=0){o.multitouch=!1};
h=!1},I=function(){C()},Y=function(t){if(e.style.display==='block'&&(e.contains&&!e.contains(t.target))){t.stopPropagation();
O()}};
if(![].forEach){Array.prototype.forEach=function(e,t){for(var n=0;n<this.length;n++){e.call(t,this[n],n,this)}}};
if(![].filter){Array.prototype.filter=function(e,t,n,o,i){n=this;
o=[];
for(i=0;i<n.length;i++)e.call(t,n[i],i,n)&&o.push(n[i]);
return o}};
function ee(e,t){r.transforms=de();
r.svg=ge();
r.passiveEvents=be();
ie();
X(e);
return te(e,t)};
function te(e,t){var i=document.querySelectorAll(e),n={galleries:[],nodeList:i};
b[e]=n;[].forEach.call(i,function(e){if(t&&t.filter){j=t.filter};
var i=[];
if(e.tagName==='A'){i=[e]}
else{i=e.getElementsByTagName('a')};
i=[].filter.call(i,function(e){if(e.className.indexOf(t&&t.ignoreClass)===-1){return j.test(e.href)}});
if(i.length===0){return};
var o=[];[].forEach.call(i,function(e,n){var i=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1;
D(o,t);
M(n)},a={eventHandler:i,imageElement:e};
c(e,'click',i);
o.push(a)});
n.galleries.push(o)});
return n.galleries};
function ne(){for(var e in b){if(b.hasOwnProperty(e)){X(e)}}};
function X(e){if(!b.hasOwnProperty(e)){return};
var t=b[e].galleries;[].forEach.call(t,function(e){[].forEach.call(e,function(e){l(e.imageElement,'click',e.eventHandler)});
if(d===e){d=[]}});
delete b[e]};
function ie(){e=m('baguetteBox-overlay');
if(e){n=m('baguetteBox-slider');
a=m('previous-button');
s=m('next-button');
u=m('close-button');
return};
e=f('div');
e.setAttribute('role','dialog');
e.id='baguetteBox-overlay';
document.getElementsByTagName('body')[0].appendChild(e);
n=f('div');
n.id='baguetteBox-slider';
e.appendChild(n);
a=f('button');
a.setAttribute('type','button');
a.id='previous-button';
a.setAttribute('aria-label','Previous');
a.innerHTML=r.svg?V:'&lt;';
e.appendChild(a);
s=f('button');
s.setAttribute('type','button');
s.id='next-button';
s.setAttribute('aria-label','Next');
s.innerHTML=r.svg?U:'&gt;';
e.appendChild(s);
u=f('button');
u.setAttribute('type','button');
u.id='close-button';
u.setAttribute('aria-label','Close');
u.innerHTML=r.svg?W:'&times;';
e.appendChild(u);
a.className=s.className=u.className='baguetteBox-button';
oe()};
function B(e){switch(e.keyCode){case 37:w();
break;
case 39:k();
break;
case 27:p();
break;
case 36:ce(e);
break;
case 35:fe(e);
break}};
function oe(){var i=r.passiveEvents?{passive:!1}:null;
var t=r.passiveEvents?{passive:!0}:null;
c(e,'click',L);
c(a,'click',A);
c(s,'click',S);
c(u,'click',P);
c(n,'contextmenu',I);
c(e,'touchstart',F,t);
c(e,'touchmove',H,i);
c(e,'touchend',C);
c(document,'focus',Y,!0)};
function ae(){var i=r.passiveEvents?{passive:!1}:null;
var t=r.passiveEvents?{passive:!0}:null;
l(e,'click',L);
l(a,'click',A);
l(s,'click',S);
l(u,'click',P);
l(n,'contextmenu',I);
l(e,'touchstart',F,t);
l(e,'touchmove',H,i);
l(e,'touchend',C);
l(document,'focus',Y,!0)};
function D(t,i){if(d===t){return};
d=t;
re(i);
while(n.firstChild){n.removeChild(n.firstChild)};
g.length=0;
var r=[],l=[];
for(var o=0,a;o<t.length;o++){a=f('div');
a.className='full-image';
a.id='baguette-img-'+o;
g.push(a);
r.push('baguetteBox-figure-'+o);
l.push('baguetteBox-figcaption-'+o);
n.appendChild(g[o])};
e.setAttribute('aria-labelledby',r.join(' '));
e.setAttribute('aria-describedby',l.join(' '))};
function re(i){if(!i){i={}};
for(var o in q){t[o]=q[o];
if(typeof i[o]!=='undefined'){t[o]=i[o]}};
n.style.transition=n.style.webkitTransition=(t.animation==='fadeIn'?'opacity .4s ease':t.animation==='slideIn'?'':'none');
if(t.buttons==='auto'&&('ontouchstart' in window||d.length===1)){t.buttons=!1};
a.style.display=s.style.display=(t.buttons?'':'none');
try{e.style.backgroundColor=t.overlayBackgroundColor}catch(r){}};
function M(n){if(t.noScrollbars){document.documentElement.style.overflowY='hidden';
document.body.style.overflowY='scroll'};
if(e.style.display==='block'){return};
c(document,'keydown',B);
i=n;
o={count:0,startX:null,startY:null};
y(i,function(){T(i);
N(i)});
z();
e.style.display='block';
if(t.fullScreen){le()};
setTimeout(function(){e.className='visible';
if(t.bodyClass&&document.body.classList){document.body.classList.add(t.bodyClass)};
if(t.afterShow){t.afterShow()}},50);
if(t.onChange){t.onChange(i,g.length)};
x=document.activeElement;
O();
E=!0};
function O(){if(t.buttons){a.focus()}
else{u.focus()}};
function le(){if(e.requestFullscreen){e.requestFullscreen()}
else if(e.webkitRequestFullscreen){e.webkitRequestFullscreen()}
else if(e.mozRequestFullScreen){e.mozRequestFullScreen()}};
function se(){if(document.exitFullscreen){document.exitFullscreen()}
else if(document.mozCancelFullScreen){document.mozCancelFullScreen()}
else if(document.webkitExitFullscreen){document.webkitExitFullscreen()}};
function p(){if(t.noScrollbars){document.documentElement.style.overflowY='auto';
document.body.style.overflowY='auto'};
if(e.style.display==='none'){return};
l(document,'keydown',B);
e.className='';
setTimeout(function(){e.style.display='none';
if(document.fullscreen){se()};
if(t.bodyClass&&document.body.classList){document.body.classList.remove(t.bodyClass)};
if(t.afterHide){t.afterHide()};
x&&x.focus();
E=!1},500)};
function y(e,n){var s=g[e],c=d[e];
if(typeof s==='undefined'||typeof c==='undefined'){return};
if(s.getElementsByTagName('img')[0]){if(n){n()};
return};
var a=c.imageElement,u=a.getElementsByTagName('img')[0],r=typeof t.captions==='function'?t.captions.call(d,a):a.getAttribute('data-caption')||a.title,b=ue(a),i=f('figure');
i.id='baguetteBox-figure-'+e;
i.innerHTML='<div class="baguetteBox-spinner"><div class="baguetteBox-double-bounce1"></div><div class="baguetteBox-double-bounce2"></div></div>';
if(t.captions&&r){var l=f('figcaption');
l.id='baguetteBox-figcaption-'+e;
l.innerHTML=r;
i.appendChild(l)};
s.appendChild(i);
var o=f('img');
o.onload=function(){var o=document.querySelector('#baguette-img-'+e+' .baguetteBox-spinner');
i.removeChild(o);
if(!t.async&&n){n()}};
o.setAttribute('src',b);
o.alt=u?u.alt||'':'';
if(t.titleTag&&r){o.title=r};
i.appendChild(o);
if(t.async&&n){n()}};
function ue(e){var a=e.href;
if(e.dataset){var o=[];
for(var n in e.dataset){if(n.substring(0,3)==='at-'&&!isNaN(n.substring(3))){o[n.replace('at-','')]=e.dataset[n]}};
var i=Object.keys(o).sort(function(e,t){return parseInt(e,10)<parseInt(t,10)?-1:1}),r=window.innerWidth*window.devicePixelRatio,t=0;
while(t<i.length-1&&i[t]<r){t++};
a=o[i[t]]||a};
return a};
function k(){return v(i+1)};
function w(){return v(i-1)};
function ce(e){if(e){e.preventDefault()};
return v(0)};
function fe(e){if(e){e.preventDefault()};
return v(d.length-1)};
function v(e,n){n=n||d;
if(!E&&e>=0&&e<n.length){D(n,t);
M(e);
return!0};
if(e<0){if(t.animation){R('left')};
return!1};
if(e>=g.length){if(t.animation){R('right')};
return!1};
i=e;
y(i,function(){T(i);
N(i)});
z();
if(t.onChange){t.onChange(i,g.length)};
return!0};
function R(e){n.className='bounce-from-'+e;
setTimeout(function(){n.className=''},400)};
function z(){var e=-i*100+'%';
if(t.animation==='fadeIn'){n.style.opacity=0;
setTimeout(function(){r.transforms?n.style.transform=n.style.webkitTransform='translate3d('+e+',0,0)':n.style.left=e;
n.style.opacity=1},400)}
else{r.transforms?n.style.transform=n.style.webkitTransform='translate3d('+e+',0,0)':n.style.left=e}};
function de(){var e=f('div');
return typeof e.style.perspective!=='undefined'||typeof e.style.webkitPerspective!=='undefined'};
function ge(){var e=f('div');
e.innerHTML='<svg/>';
return(e.firstChild&&e.firstChild.namespaceURI)==='http://www.w3.org/2000/svg'};
function be(){var e=!1;
try{var t=Object.defineProperty({},'passive',{get:function(){e=!0}});
window.addEventListener('test',null,t)}catch(n){};
return e};
function T(e){if(e-i>=t.preload){return};
y(e+1,function(){T(e+1)})};
function N(e){if(i-e>=t.preload){return};
y(e-1,function(){N(e-1)})};
function c(e,t,n,i){if(e.addEventListener){e.addEventListener(t,n,i)}
else{e.attachEvent('on'+t,function(e){e=e||window.event;
e.target=e.target||e.srcElement;
n(e)})}};
function l(e,t,n,i){if(e.removeEventListener){e.removeEventListener(t,n,i)}
else{e.detachEvent('on'+t,n)}};
function m(e){return document.getElementById(e)};
function f(e){return document.createElement(e)};
function pe(){ae();
ne();
l(document,'keydown',B);
document.getElementsByTagName('body')[0].removeChild(document.getElementById('baguetteBox-overlay'));
b={};
d=[];
i=0};
return{run:ee,show:v,showNext:k,showPrevious:w,hide:p,destroy:pe}}));
$(function(){baguetteBox.run('.baguettebox-galeria',{async:!0,noScrollbars:!0,overlayBackgroundColor:''});
var e=$('#baguetteBox-overlay');
e.find('#previous-button').attr('aria-label',forditas('elozo'));
e.find('#next-button').attr('aria-label',forditas('kovetkezo'));
e.find('#close-button').attr('aria-label',forditas('megsem'))});