/*
* VenoBox - jQuery Plugin
* version: 1.9.1
* @requires jQuery >= 1.7.0
*
* Examples at http://veno.es/venobox/
* License: MIT License
* License URI: https://github.com/nicolafranchini/VenoBox/blob/master/LICENSE
* Copyright 2013-2020 Nicola Franchini - @nicolafranchini
*
*/
!function(e){"use strict";var s,i,a,t,o,c,r,l,d,n,v,u,b,h,k,p,g,m,f,x,w,y,_,C,z,B,P,M,E,O,D,N,U,V,I,j,R,X,Y,W,q,$,T,A,H,Q,S,Z='',F='',G='',J='',K='';e.fn.extend({venobox:function(L){var ee=this,se=e.extend({arrowsColor:"#B6B6B6",autoplay:!1,bgcolor:"#fff",border:"0",closeBackground:"transparent",closeColor:"#d2d2d2",framewidth:"",frameheight:"",gallItems:!1,infinigall:!1,htmlClose:"×",htmlNext:"Next",htmlPrev:"Prev",numeratio:!1,numerationBackground:"#161617",numerationColor:"#d2d2d2",numerationPosition:"top",overlayClose:!0,overlayColor:"rgba(23,23,23,0.85)",spinner:"double-bounce",spinColor:"#d2d2d2",titleattr:"title",titleBackground:"#161617",titleColor:"#d2d2d2",titlePosition:"top",share:[],cb_pre_open:function(){return!0},cb_post_open:function(){},cb_pre_close:function(){return!0},cb_post_close:function(){},cb_post_resize:function(){},cb_after_nav:function(){},cb_content_loaded:function(){},cb_init:function(){}},L);return se.cb_init(ee),this.each(function(){if((N=e(this)).data("venobox"))return!0;function L(){C=N.data("gall"),x=N.data("numeratio"),k=N.data("gallItems"),p=N.data("infinigall"),H=N.data("share"),o.html(""),"iframe"!==N.data("vbtype")&&"inline"!==N.data("vbtype")&&"ajax"!==N.data("vbtype")&&(Q={pinterest:''+Z+"",facebook:''+F+"",twitter:''+G+"",linkedin:''+J+"",download:''+K+""},e.each(H,function(e,s){o.append(Q[s])})),(g=k||e('.vbox-item[data-gall="'+C+'"]')).length<2&&(p=!1,x=!1),z=g.eq(g.index(N)+1),B=g.eq(g.index(N)-1),z.length||!0!==p||(z=g.eq(0)),g.length>=1?(U=g.index(N)+1,t.html(U+" / "+g.length)):U=1,!0===x?t.show():t.hide(),""!==_?c.show():c.hide(),z.length||!0===p?(e(".vbox-next").css("display","block"),P=!0):(e(".vbox-next").css("display","none"),P=!1),g.index(N)>0||!0===p?(e(".vbox-prev").css("display","block"),M=!0):(e(".vbox-prev").css("display","none"),M=!1),!0!==M&&!0!==P||(n.on(de.DOWN,ce),n.on(de.MOVE,re),n.on(de.UP,le))}function ie(e){return!(e.length<1)&&(!m&&(m=!0,w=e.data("overlay")||e.data("overlaycolor"),b=e.data("framewidth"),h=e.data("frameheight"),r=e.data("border"),i=e.data("bgcolor"),v=e.data("href")||e.attr("href"),s=e.data("autoplay"),_=e.data("titleattr")&&e.attr(e.data("titleattr"))||"",e===B&&n.addClass("vbox-animated").addClass("swipe-right"),e===z&&n.addClass("vbox-animated").addClass("swipe-left"),O.show(),void n.animate({opacity:0},500,function(){y.css("background",w),n.removeClass("vbox-animated").removeClass("swipe-left").removeClass("swipe-right").css({"margin-left":0,"margin-right":0}),"iframe"==e.data("vbtype")?he():"inline"==e.data("vbtype")?pe():"ajax"==e.data("vbtype")?be():"video"==e.data("vbtype")?ke(s):(n.html(''),ge()),N=e,L(),m=!1,se.cb_after_nav(N,U,z,B)})))}function ae(e){27===e.keyCode&&te(),37==e.keyCode&&!0===M&&ie(B),39==e.keyCode&&!0===P&&ie(z)}function te(){if(!1===se.cb_pre_close(N,U,z,B))return!1;e("body").off("keydown",ae).removeClass("vbox-open"),N.focus(),y.animate({opacity:0},500,function(){y.remove(),m=!1,se.cb_post_close()})}ee.VBclose=function(){te()},N.addClass("vbox-item"),N.data("framewidth",se.framewidth),N.data("frameheight",se.frameheight),N.data("border",se.border),N.data("bgcolor",se.bgcolor),N.data("numeratio",se.numeratio),N.data("gallItems",se.gallItems),N.data("infinigall",se.infinigall),N.data("overlaycolor",se.overlayColor),N.data("titleattr",se.titleattr),N.data("share",se.share),N.data("venobox",!0),N.on("click",function(k){if(k.preventDefault(),N=e(this),!1===se.cb_pre_open(N))return!1;switch(ee.VBnext=function(){ie(z)},ee.VBprev=function(){ie(B)},w=N.data("overlay")||N.data("overlaycolor"),b=N.data("framewidth"),h=N.data("frameheight"),s=N.data("autoplay")||se.autoplay,r=N.data("border"),i=N.data("bgcolor"),P=!1,M=!1,m=!1,v=N.data("href")||N.attr("href"),u=N.data("css")||"",_=N.attr(N.data("titleattr"))||"",H=N.data("share"),E='
',se.spinner){case"rotating-plane":E+='
';break;case"double-bounce":E+='
';break;case"wave":E+='
';break;case"wandering-cubes":E+='
';break;case"spinner-pulse":E+='
';break;case"chasing-dots":E+='
';break;case"three-bounce":E+='
';break;case"circle":E+='
';break;case"cube-grid":E+='
';break;case"fading-circle":E+='
';break;case"folding-cube":E+='
'}return E+="
",D=''+se.htmlNext+''+se.htmlPrev+"",I=''+se.htmlClose+"
",'',l='',e("body").append(l).addClass("vbox-open"),e(".vbox-preloader div:not(.sk-circle) .sk-child, .vbox-preloader .sk-rotating-plane, .vbox-preloader .sk-rect, .vbox-preloader div:not(.sk-folding-cube) .sk-cube, .vbox-preloader .sk-spinner-pulse").css("background-color",se.spinColor),y=e(".vbox-overlay"),d=e(".vbox-container"),n=e(".vbox-content"),a=e(".vbox-left"),t=e(".vbox-num"),o=e(".vbox-share"),c=e(".vbox-title"),(O=e(".vbox-preloader")).show(),S="top"==se.titlePosition?"bottom":"top",o.css(S,"-1px"),o.css({color:se.titleColor,fill:se.titleColor,"background-color":se.titleBackground}),c.css(se.titlePosition,"-1px"),c.css({color:se.titleColor,"background-color":se.titleBackground}),e(".vbox-close").css({color:se.closeColor,"background-color":se.closeBackground}),a.css(se.numerationPosition,"-1px"),a.css({color:se.numerationColor,"background-color":se.numerationBackground}),e(".vbox-next span, .vbox-prev span").css({"border-top-color":se.arrowsColor,"border-right-color":se.arrowsColor}),n.html(""),n.css("opacity","0"),y.css("opacity","0"),L(),y.animate({opacity:1},250,function(){"iframe"==N.data("vbtype")?he():"inline"==N.data("vbtype")?pe():"ajax"==N.data("vbtype")?be():"video"==N.data("vbtype")?ke(s):(n.html(''),ge()),se.cb_post_open(N,U,z,B)}),e("body").keydown(ae),e(".vbox-prev").on("click",function(){ie(B)}),e(".vbox-next").on("click",function(){ie(z)}),!1});var oe=".vbox-overlay";function ce(e){n.addClass("vbox-animated"),R=Y=e.pageY,X=W=e.pageX,V=!0}function re(e){if(!0===V){W=e.pageX,Y=e.pageY,$=W-X,T=Y-R;var s=Math.abs($);s>Math.abs(T)&&s<=100&&(e.preventDefault(),n.css("margin-left",$))}}function le(e){if(!0===V){V=!1;var s=N,i=!1;(q=W-X)<0&&!0===P&&(s=z,i=!0),q>0&&!0===M&&(s=B,i=!0),Math.abs(q)>=A&&!0===i?ie(s):n.css({"margin-left":0,"margin-right":0})}}se.overlayClose||(oe=".vbox-close"),e("body").on("click touchstart",oe,function(s){(e(s.target).is(".vbox-overlay")||e(s.target).is(".vbox-content")||e(s.target).is(".vbox-close")||e(s.target).is(".vbox-preloader")||e(s.target).is(".vbox-container"))&&te()}),X=0,W=0,q=0,A=50,V=!1;var de={DOWN:"touchmousedown",UP:"touchmouseup",MOVE:"touchmousemove"},ne=function(s){var i;switch(s.type){case"mousedown":i=de.DOWN;break;case"mouseup":case"mouseout":i=de.UP;break;case"mousemove":i=de.MOVE;break;default:return}var a=ue(i,s,s.pageX,s.pageY);e(s.target).trigger(a)},ve=function(s){var i;switch(s.type){case"touchstart":i=de.DOWN;break;case"touchend":i=de.UP;break;case"touchmove":i=de.MOVE;break;default:return}var a,t=s.originalEvent.touches[0];a=i==de.UP?ue(i,s,null,null):ue(i,s,t.pageX,t.pageY),e(s.target).trigger(a)},ue=function(s,i,a,t){return e.Event(s,{pageX:a,pageY:t,originalEvent:i})};function be(){e.ajax({url:v,cache:!1}).done(function(e){n.html(''+e+"
"),ge()}).fail(function(){n.html('Error retrieving contents, please retry
'),me()})}function he(){n.html(''),me()}function ke(e){var s,i=function(e){var s;e.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),RegExp.$3.indexOf("youtu")>-1?s="youtube":RegExp.$3.indexOf("vimeo")>-1&&(s="vimeo");return{type:s,id:RegExp.$6}}(v),a=(e?"?rel=0&autoplay=1":"?rel=0")+function(e){var s="",i=decodeURIComponent(e).split("?");if(void 0!==i[1]){var a,t,o=i[1].split("&");for(t=0;t'),me()}function pe(){n.html(''+e(v).html()+"
"),me()}function ge(){(j=n.find("img")).length?j.each(function(){e(this).one("load",function(){me()})}):me()}function me(){c.html(_),n.find(">:first-child").addClass("vbox-figlio").css({width:b,height:h,padding:r,background:i}),e("img.vbox-figlio").on("dragstart",function(e){e.preventDefault()}),d.scrollTop(0),fe(),n.animate({opacity:"1"},"slow",function(){O.hide()}),se.cb_content_loaded(N,U,z,B)}function fe(){var s=n.outerHeight(),i=e(window).height();f=s+60