/* imagesloaded packaged v4.1.3 */ !function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.evemitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return-1==n.indexof(t)&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceevents=this._onceevents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexof(t);return-1!=n&&i.splice(n,1),this}},t.emitevent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=0,o=i[n];t=t||[];for(var r=this._onceevents&&this._onceevents[e];o;){var s=r&&r[o];s&&(this.off(e,o),delete r[o]),o.apply(this,t),n+=s?0:1,o=i[n]}return this}},t.alloff=t.removealllisteners=function(){delete this._events,delete this._onceevents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesloaded=t(e,e.evemitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){var t=[];if(array.isarray(e))t=e;else if("number"==typeof e.length)for(var i=0;ib.$items.length&&(b.s.preload=b.$items.length);var c=window.location.hash;c.indexof("lg="+this.s.galleryid)>0&&(b.index=parseint(c.split("&slide=")[1],10),a("body").addclass("lg-from-hash"),a("body").hasclass("lg-on")||(settimeout(function(){b.build(b.index)}),a("body").addclass("lg-on"))),b.s.dynamic?(b.$el.trigger("onbeforeopen.lg"),b.index=b.s.index||0,a("body").hasclass("lg-on")||settimeout(function(){b.build(b.index),a("body").addclass("lg-on")})):b.$items.on("click.lgcustom",function(c){try{c.preventdefault(),c.preventdefault()}catch(a){c.returnvalue=!1}b.$el.trigger("onbeforeopen.lg"),b.index=b.s.index||b.$items.index(this),a("body").hasclass("lg-on")||(b.build(b.index),a("body").addclass("lg-on"))})},b.prototype.build=function(b){var c=this;c.structure(),a.each(a.fn.lightgallery.modules,function(b){c.modules[b]=new a.fn.lightgallery.modules[b](c.el)}),c.slide(b,!1,!1,!1),c.s.keypress&&c.keypress(),c.$items.length>1?(c.arrow(),settimeout(function(){c.enabledrag(),c.enableswipe()},50),c.s.mousewheel&&c.mousewheel()):c.$slide.on("click.lg",function(){c.$el.trigger("onslideclick.lg")}),c.counter(),c.closegallery(),c.$el.trigger("onafteropen.lg"),c.$outer.on("mousemove.lg click.lg touchstart.lg",function(){c.$outer.removeclass("lg-hide-items"),cleartimeout(c.hidebartimeout),c.hidebartimeout=settimeout(function(){c.$outer.addclass("lg-hide-items")},c.s.hidebarsdelay)}),c.$outer.trigger("mousemove.lg")},b.prototype.structure=function(){var b,c="",d="",e=0,f="",g=this;for(a("body").append('
'),a(".lg-backdrop").css("transition-duration",this.s.backdropduration+"ms"),e=0;e';if(this.s.controls&&this.$items.length>1&&(d='
"),".lg-sub-html"===this.s.appendsubhtmlto&&(f='
'),b='
'+c+'
'+d+f+"
",a("body").append(b),this.$outer=a(".lg-outer"),this.$slide=this.$outer.find(".lg-item"),this.s.useleft?(this.$outer.addclass("lg-use-left"),this.s.mode="lg-slide"):this.$outer.addclass("lg-use-css3"),g.settop(),a(window).on("resize.lg orientationchange.lg",function(){settimeout(function(){g.settop()},100)}),this.$slide.eq(this.index).addclass("lg-current"),this.docss()?this.$outer.addclass("lg-css3"):(this.$outer.addclass("lg-css"),this.s.speed=0),this.$outer.addclass(this.s.mode),this.s.enabledrag&&this.$items.length>1&&this.$outer.addclass("lg-grab"),this.s.showafterload&&this.$outer.addclass("lg-show-after-load"),this.docss()){var h=this.$outer.find(".lg-inner");h.css("transition-timing-function",this.s.csseasing),h.css("transition-duration",this.s.speed+"ms")}settimeout(function(){a(".lg-backdrop").addclass("in")}),settimeout(function(){g.$outer.addclass("lg-visible")},this.s.backdropduration),this.s.download&&this.$outer.find(".lg-toolbar").append(''),this.prevscrolltop=a(window).scrolltop()},b.prototype.settop=function(){if("100%"!==this.s.height){var b=a(window).height(),c=(b-parseint(this.s.height,10))/2,d=this.$outer.find(".lg");b>=parseint(this.s.height,10)?d.css("top",c+"px"):d.css("top","0px")}},b.prototype.docss=function(){return!!function(){var a=["transition","moztransition","webkittransition","otransition","mstransition","khtmltransition"],b=document.documentelement,c=0;for(c=0;c'+(parseint(this.index,10)+1)+' / '+this.$items.length+"")},b.prototype.addhtml=function(b){var c,d,e=null;if(this.s.dynamic?this.s.dynamicel[b].subhtmlurl?c=this.s.dynamicel[b].subhtmlurl:e=this.s.dynamicel[b].subhtml:(d=this.$items.eq(b),d.attr("data-sub-html-url")?c=d.attr("data-sub-html-url"):(e=d.attr("data-sub-html"),this.s.getcaptionfromtitleoralt&&!e&&(e=d.attr("title")||d.find("img").first().attr("alt")))),!c)if(void 0!==e&&null!==e){var f=e.substring(0,1);"."!==f&&"#"!==f||(e=this.s.subhtmlselectorrelative&&!this.s.dynamic?d.find(e).html():a(e).html())}else e="";".lg-sub-html"===this.s.appendsubhtmlto?c?this.$outer.find(this.s.appendsubhtmlto).load(c):this.$outer.find(this.s.appendsubhtmlto).html(e):c?this.$slide.eq(b).load(c):this.$slide.eq(b).append(e),void 0!==e&&null!==e&&(""===e?this.$outer.find(this.s.appendsubhtmlto).addclass("lg-empty-html"):this.$outer.find(this.s.appendsubhtmlto).removeclass("lg-empty-html")),this.$el.trigger("onafterappendsubhtml.lg",[b])},b.prototype.preload=function(a){var b=1,c=1;for(b=1;b<=this.s.preload&&!(b>=this.$items.length-a);b++)this.loadcontent(a+b,!1,0);for(c=1;c<=this.s.preload&&!(a-c<0);c++)this.loadcontent(a-c,!1,0)},b.prototype.loadcontent=function(b,c,d){var e,f,g,h,i,j,k=this,l=!1,m=function(b){for(var c=[],d=[],e=0;eh){f=d[i];break}};if(k.s.dynamic){if(k.s.dynamicel[b].poster&&(l=!0,g=k.s.dynamicel[b].poster),j=k.s.dynamicel[b].html,f=k.s.dynamicel[b].src,k.s.dynamicel[b].responsive){m(k.s.dynamicel[b].responsive.split(","))}h=k.s.dynamicel[b].srcset,i=k.s.dynamicel[b].sizes}else{if(k.$items.eq(b).attr("data-poster")&&(l=!0,g=k.$items.eq(b).attr("data-poster")),j=k.$items.eq(b).attr("data-html"),f=k.$items.eq(b).attr("href")||k.$items.eq(b).attr("data-src"),k.$items.eq(b).attr("data-responsive")){m(k.$items.eq(b).attr("data-responsive").split(","))}h=k.$items.eq(b).attr("data-srcset"),i=k.$items.eq(b).attr("data-sizes")}var n=!1;k.s.dynamic?k.s.dynamicel[b].iframe&&(n=!0):"true"===k.$items.eq(b).attr("data-iframe")&&(n=!0);var o=k.isvideo(f,b);if(!k.$slide.eq(b).hasclass("lg-loaded")){if(n)k.$slide.eq(b).prepend('
');else if(l){var p="";p=o&&o.youtube?"lg-has-youtube":o&&o.vimeo?"lg-has-vimeo":"lg-has-html5",k.$slide.eq(b).prepend('
')}else o?(k.$slide.eq(b).prepend('
'),k.$el.trigger("hasvideo.lg",[b,f,j])):k.$slide.eq(b).prepend('
');if(k.$el.trigger("onaferappendslide.lg",[b]),e=k.$slide.eq(b).find(".lg-object"),i&&e.attr("sizes",i),h){e.attr("srcset",h);try{picturefill({elements:[e[0]]})}catch(a){console.warn("lightgallery :- if you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.")}}".lg-sub-html"!==this.s.appendsubhtmlto&&k.addhtml(b),k.$slide.eq(b).addclass("lg-loaded")}k.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){var c=0;d&&!a("body").hasclass("lg-from-hash")&&(c=d),settimeout(function(){k.$slide.eq(b).addclass("lg-complete"),k.$el.trigger("onslideitemload.lg",[b,d||0])},c)}),o&&o.html5&&!l&&k.$slide.eq(b).addclass("lg-complete"),!0===c&&(k.$slide.eq(b).hasclass("lg-complete")?k.preload(b):k.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){k.preload(b)}))},b.prototype.slide=function(b,c,d,e){var f=this.$outer.find(".lg-current").index(),g=this;if(!g.lgalleryon||f!==b){var h=this.$slide.length,i=g.lgalleryon?this.s.speed:0;if(!g.lgbusy){if(this.s.download){var j;j=g.s.dynamic?!1!==g.s.dynamicel[b].downloadurl&&(g.s.dynamicel[b].downloadurl||g.s.dynamicel[b].src):"false"!==g.$items.eq(b).attr("data-download-url")&&(g.$items.eq(b).attr("data-download-url")||g.$items.eq(b).attr("href")||g.$items.eq(b).attr("data-src")),j?(a("#lg-download").attr("href",j),g.$outer.removeclass("lg-hide-download")):g.$outer.addclass("lg-hide-download")}if(this.$el.trigger("onbeforeslide.lg",[f,b,c,d]),g.lgbusy=!0,cleartimeout(g.hidebartimeout),".lg-sub-html"===this.s.appendsubhtmlto&&settimeout(function(){g.addhtml(b)},i),this.arrowdisable(b),e||(bf&&(e="next")),c){this.$slide.removeclass("lg-prev-slide lg-current lg-next-slide");var k,l;h>2?(k=b-1,l=b+1,0===b&&f===h-1?(l=0,k=h-1):b===h-1&&0===f&&(l=0,k=h-1)):(k=0,l=1),"prev"===e?g.$slide.eq(l).addclass("lg-next-slide"):g.$slide.eq(k).addclass("lg-prev-slide"),g.$slide.eq(b).addclass("lg-current")}else g.$outer.addclass("lg-no-trans"),this.$slide.removeclass("lg-prev-slide lg-next-slide"),"prev"===e?(this.$slide.eq(b).addclass("lg-prev-slide"),this.$slide.eq(f).addclass("lg-next-slide")):(this.$slide.eq(b).addclass("lg-next-slide"),this.$slide.eq(f).addclass("lg-prev-slide")),settimeout(function(){g.$slide.removeclass("lg-current"),g.$slide.eq(b).addclass("lg-current"),g.$outer.removeclass("lg-no-trans")},50);g.lgalleryon?(settimeout(function(){g.loadcontent(b,!0,0)},this.s.speed+50),settimeout(function(){g.lgbusy=!1,g.$el.trigger("onafterslide.lg",[f,b,c,d])},this.s.speed)):(g.loadcontent(b,!0,g.s.backdropduration),g.lgbusy=!1,g.$el.trigger("onafterslide.lg",[f,b,c,d])),g.lgalleryon=!0,this.s.counter&&a("#lg-counter-current").text(b+1)}g.index=b}},b.prototype.gotonextslide=function(a){var b=this,c=b.s.loop;a&&b.$slide.length<3&&(c=!1),b.lgbusy||(b.index+10?(b.index--,b.$el.trigger("onbeforeprevslide.lg",[b.index,a]),b.slide(b.index,a,!1,"prev")):c?(b.index=b.$items.length-1,b.$el.trigger("onbeforeprevslide.lg",[b.index,a]),b.slide(b.index,a,!1,"prev")):b.s.slideendanimatoin&&!a&&(b.$outer.addclass("lg-left-end"),settimeout(function(){b.$outer.removeclass("lg-left-end")},400)))},b.prototype.keypress=function(){var b=this;this.$items.length>1&&a(window).on("keyup.lg",function(a){b.$items.length>1&&(37===a.keycode&&(a.preventdefault(),b.gotoprevslide()),39===a.keycode&&(a.preventdefault(),b.gotonextslide()))}),a(window).on("keydown.lg",function(a){!0===b.s.esckey&&27===a.keycode&&(a.preventdefault(),b.$outer.hasclass("lg-thumb-open")?b.$outer.removeclass("lg-thumb-open"):b.destroy())})},b.prototype.arrow=function(){var a=this;this.$outer.find(".lg-prev").on("click.lg",function(){a.gotoprevslide()}),this.$outer.find(".lg-next").on("click.lg",function(){a.gotonextslide()})},b.prototype.arrowdisable=function(a){!this.s.loop&&this.s.hidecontrolonend&&(a+10?this.$outer.find(".lg-prev").removeattr("disabled").removeclass("disabled"):this.$outer.find(".lg-prev").attr("disabled","disabled").addclass("disabled"))},b.prototype.settranslate=function(a,b,c){this.s.useleft?a.css("left",b):a.css({transform:"translate3d("+b+"px, "+c+"px, 0px)"})},b.prototype.touchmove=function(b,c){var d=c-b;math.abs(d)>15&&(this.$outer.addclass("lg-dragging"),this.settranslate(this.$slide.eq(this.index),d,0),this.settranslate(a(".lg-prev-slide"),-this.$slide.eq(this.index).width()+d,0),this.settranslate(a(".lg-next-slide"),this.$slide.eq(this.index).width()+d,0))},b.prototype.touchend=function(a){var b=this;"lg-slide"!==b.s.mode&&b.$outer.addclass("lg-slide"),this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity","0"),settimeout(function(){b.$outer.removeclass("lg-dragging"),a<0&&math.abs(a)>b.s.swipethreshold?b.gotonextslide(!0):a>0&&math.abs(a)>b.s.swipethreshold?b.gotoprevslide(!0):math.abs(a)<5&&b.$el.trigger("onslideclick.lg"),b.$slide.removeattr("style")}),settimeout(function(){b.$outer.hasclass("lg-dragging")||"lg-slide"===b.s.mode||b.$outer.removeclass("lg-slide")},b.s.speed+100)},b.prototype.enableswipe=function(){var a=this,b=0,c=0,d=!1;a.s.enableswipe&&a.docss()&&(a.$slide.on("touchstart.lg",function(c){a.$outer.hasclass("lg-zoomed")||a.lgbusy||(c.preventdefault(),a.manageswipeclass(),b=c.originalevent.targettouches[0].pagex)}),a.$slide.on("touchmove.lg",function(e){a.$outer.hasclass("lg-zoomed")||(e.preventdefault(),c=e.originalevent.targettouches[0].pagex,a.touchmove(b,c),d=!0)}),a.$slide.on("touchend.lg",function(){a.$outer.hasclass("lg-zoomed")||(d?(d=!1,a.touchend(c-b)):a.$el.trigger("onslideclick.lg"))}))},b.prototype.enabledrag=function(){var b=this,c=0,d=0,e=!1,f=!1;b.s.enabledrag&&b.docss()&&(b.$slide.on("mousedown.lg",function(d){b.$outer.hasclass("lg-zoomed")||b.lgbusy||a(d.target).text().trim()||(d.preventdefault(),b.manageswipeclass(),c=d.pagex,e=!0,b.$outer.scrollleft+=1,b.$outer.scrollleft-=1,b.$outer.removeclass("lg-grab").addclass("lg-grabbing"),b.$el.trigger("ondragstart.lg"))}),a(window).on("mousemove.lg",function(a){e&&(f=!0,d=a.pagex,b.touchmove(c,d),b.$el.trigger("ondragmove.lg"))}),a(window).on("mouseup.lg",function(g){f?(f=!1,b.touchend(d-c),b.$el.trigger("ondragend.lg")):(a(g.target).hasclass("lg-object")||a(g.target).hasclass("lg-video-play"))&&b.$el.trigger("onslideclick.lg"),e&&(e=!1,b.$outer.removeclass("lg-grabbing").addclass("lg-grab"))}))},b.prototype.manageswipeclass=function(){var a=this.index+1,b=this.index-1;this.s.loop&&this.$slide.length>2&&(0===this.index?b=this.$slide.length-1:this.index===this.$slide.length-1&&(a=0)),this.$slide.removeclass("lg-next-slide lg-prev-slide"),b>-1&&this.$slide.eq(b).addclass("lg-prev-slide"),this.$slide.eq(a).addclass("lg-next-slide")},b.prototype.mousewheel=function(){var a=this;a.$outer.on("mousewheel.lg",function(b){b.deltay&&(b.deltay>0?a.gotoprevslide():a.gotonextslide(),b.preventdefault())})},b.prototype.closegallery=function(){var b=this,c=!1;this.$outer.find(".lg-close").on("click.lg",function(){b.destroy()}),b.s.closable&&(b.$outer.on("mousedown.lg",function(b){c=!!(a(b.target).is(".lg-outer")||a(b.target).is(".lg-item ")||a(b.target).is(".lg-img-wrap"))}),b.$outer.on("mousemove.lg",function(){c=!1}),b.$outer.on("mouseup.lg",function(d){(a(d.target).is(".lg-outer")||a(d.target).is(".lg-item ")||a(d.target).is(".lg-img-wrap")&&c)&&(b.$outer.hasclass("lg-dragging")||b.destroy())}))},b.prototype.destroy=function(b){var c=this;b||(c.$el.trigger("onbeforeclose.lg"),a(window).scrolltop(c.prevscrolltop)),b&&(c.s.dynamic||this.$items.off("click.lg click.lgcustom"),a.removedata(c.el,"lightgallery")),this.$el.off(".lg.tm"),a.each(a.fn.lightgallery.modules,function(a){c.modules[a]&&c.modules[a].destroy()}),this.lgalleryon=!1,cleartimeout(c.hidebartimeout),this.hidebartimeout=!1,a(window).off(".lg"),a("body").removeclass("lg-on lg-from-hash"),c.$outer&&c.$outer.removeclass("lg-visible"),a(".lg-backdrop").removeclass("in"),settimeout(function(){c.$outer&&c.$outer.remove(),a(".lg-backdrop").remove(),b||c.$el.trigger("oncloseafter.lg")},c.s.backdropduration+50)},a.fn.lightgallery=function(c){return this.each(function(){if(a.data(this,"lightgallery"))try{a(this).data("lightgallery").init()}catch(a){console.error("lightgallery has not initiated properly")}else a.data(this,"lightgallery",new b(this,c))})},a.fn.lightgallery.modules={}}()}); !function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(jquery)}(this,function(a){!function(){"use strict";var b=function(){var a=!1,b=navigator.useragent.match(/chrom(e|ium)\/([0-9]+)\./);return b&&parseint(b[2],10)<54&&(a=!0),a},c={scale:1,zoom:!0,actualsize:!0,enablezoomafter:300,useleftforzoom:b()},d=function(b){return this.core=a(b).data("lightgallery"),this.core.s=a.extend({},c,this.core.s),this.core.s.zoom&&this.core.docss()&&(this.init(),this.zoomabletimeout=!1,this.pagex=a(window).width()/2,this.pagey=a(window).height()/2+a(window).scrolltop()),this};d.prototype.init=function(){var b=this,c='';b.core.s.actualsize&&(c+=''),b.core.s.useleftforzoom?b.core.$outer.addclass("lg-use-left-for-zoom"):b.core.$outer.addclass("lg-use-transition-for-zoom"),this.core.$outer.find(".lg-toolbar").append(c),b.core.$el.on("onslideitemload.lg.tm.zoom",function(c,d,e){var f=b.core.s.enablezoomafter+e;a("body").hasclass("lg-from-hash")&&e?f=0:a("body").removeclass("lg-from-hash"),b.zoomabletimeout=settimeout(function(){b.core.$slide.eq(d).addclass("lg-zoomable")},f+30)});var d=1,e=function(c){var d,e,f=b.core.$outer.find(".lg-current .lg-image"),g=(a(window).width()-f.prop("offsetwidth"))/2,h=(a(window).height()-f.prop("offsetheight"))/2+a(window).scrolltop();d=b.pagex-g,e=b.pagey-h;var i=(c-1)*d,j=(c-1)*e;f.css("transform","scale3d("+c+", "+c+", 1)").attr("data-scale",c),b.core.s.useleftforzoom?f.parent().css({left:-i+"px",top:-j+"px"}).attr("data-x",i).attr("data-y",j):f.parent().css("transform","translate3d(-"+i+"px, -"+j+"px, 0)").attr("data-x",i).attr("data-y",j)},f=function(){d>1?b.core.$outer.addclass("lg-zoomed"):b.resetzoom(),d<1&&(d=1),e(d)},g=function(c,e,g,h){var i,j=e.prop("offsetwidth");i=b.core.s.dynamic?b.core.s.dynamicel[g].width||e[0].naturalwidth||j:b.core.$items.eq(g).attr("data-width")||e[0].naturalwidth||j;var k;b.core.$outer.hasclass("lg-zoomed")?d=1:i>j&&(k=i/j,d=k||2),h?(b.pagex=a(window).width()/2,b.pagey=a(window).height()/2+a(window).scrolltop()):(b.pagex=c.pagex||c.originalevent.targettouches[0].pagex,b.pagey=c.pagey||c.originalevent.targettouches[0].pagey),f(),settimeout(function(){b.core.$outer.removeclass("lg-grabbing").addclass("lg-grab")},10)},h=!1;b.core.$el.on("onaferappendslide.lg.tm.zoom",function(a,c){var d=b.core.$slide.eq(c).find(".lg-image");d.on("dblclick",function(a){g(a,d,c)}),d.on("touchstart",function(a){h?(cleartimeout(h),h=null,g(a,d,c)):h=settimeout(function(){h=null},300),a.preventdefault()})}),a(window).on("resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom",function(){b.pagex=a(window).width()/2,b.pagey=a(window).height()/2+a(window).scrolltop(),e(d)}),a("#lg-zoom-out").on("click.lg",function(){b.core.$outer.find(".lg-current .lg-image").length&&(d-=b.core.s.scale,f())}),a("#lg-zoom-in").on("click.lg",function(){b.core.$outer.find(".lg-current .lg-image").length&&(d+=b.core.s.scale,f())}),a("#lg-actual-size").on("click.lg",function(a){g(a,b.core.$slide.eq(b.core.index).find(".lg-image"),b.core.index,!0)}),b.core.$el.on("onbeforeslide.lg.tm",function(){d=1,b.resetzoom()}),b.zoomdrag(),b.zoomswipe()},d.prototype.resetzoom=function(){this.core.$outer.removeclass("lg-zoomed"),this.core.$slide.find(".lg-img-wrap").removeattr("style data-x data-y"),this.core.$slide.find(".lg-image").removeattr("style data-scale"),this.pagex=a(window).width()/2,this.pagey=a(window).height()/2+a(window).scrolltop()},d.prototype.zoomswipe=function(){var a=this,b={},c={},d=!1,e=!1,f=!1;a.core.$slide.on("touchstart.lg",function(c){if(a.core.$outer.hasclass("lg-zoomed")){var d=a.core.$slide.eq(a.core.index).find(".lg-object");f=d.prop("offsetheight")*d.attr("data-scale")>a.core.$outer.find(".lg").height(),e=d.prop("offsetwidth")*d.attr("data-scale")>a.core.$outer.find(".lg").width(),(e||f)&&(c.preventdefault(),b={x:c.originalevent.targettouches[0].pagex,y:c.originalevent.targettouches[0].pagey})}}),a.core.$slide.on("touchmove.lg",function(g){if(a.core.$outer.hasclass("lg-zoomed")){var h,i,j=a.core.$slide.eq(a.core.index).find(".lg-img-wrap");g.preventdefault(),d=!0,c={x:g.originalevent.targettouches[0].pagex,y:g.originalevent.targettouches[0].pagey},a.core.$outer.addclass("lg-zoom-dragging"),i=f?-math.abs(j.attr("data-y"))+(c.y-b.y):-math.abs(j.attr("data-y")),h=e?-math.abs(j.attr("data-x"))+(c.x-b.x):-math.abs(j.attr("data-x")),(math.abs(c.x-b.x)>15||math.abs(c.y-b.y)>15)&&(a.core.s.useleftforzoom?j.css({left:h+"px",top:i+"px"}):j.css("transform","translate3d("+h+"px, "+i+"px, 0)"))}}),a.core.$slide.on("touchend.lg",function(){a.core.$outer.hasclass("lg-zoomed")&&d&&(d=!1,a.core.$outer.removeclass("lg-zoom-dragging"),a.touchendzoom(b,c,e,f))})},d.prototype.zoomdrag=function(){var b=this,c={},d={},e=!1,f=!1,g=!1,h=!1;b.core.$slide.on("mousedown.lg.zoom",function(d){var f=b.core.$slide.eq(b.core.index).find(".lg-object");h=f.prop("offsetheight")*f.attr("data-scale")>b.core.$outer.find(".lg").height(),g=f.prop("offsetwidth")*f.attr("data-scale")>b.core.$outer.find(".lg").width(),b.core.$outer.hasclass("lg-zoomed")&&a(d.target).hasclass("lg-object")&&(g||h)&&(d.preventdefault(),c={x:d.pagex,y:d.pagey},e=!0,b.core.$outer.scrollleft+=1,b.core.$outer.scrollleft-=1,b.core.$outer.removeclass("lg-grab").addclass("lg-grabbing"))}),a(window).on("mousemove.lg.zoom",function(a){if(e){var i,j,k=b.core.$slide.eq(b.core.index).find(".lg-img-wrap");f=!0,d={x:a.pagex,y:a.pagey},b.core.$outer.addclass("lg-zoom-dragging"),j=h?-math.abs(k.attr("data-y"))+(d.y-c.y):-math.abs(k.attr("data-y")),i=g?-math.abs(k.attr("data-x"))+(d.x-c.x):-math.abs(k.attr("data-x")),b.core.s.useleftforzoom?k.css({left:i+"px",top:j+"px"}):k.css("transform","translate3d("+i+"px, "+j+"px, 0)")}}),a(window).on("mouseup.lg.zoom",function(a){e&&(e=!1,b.core.$outer.removeclass("lg-zoom-dragging"),!f||c.x===d.x&&c.y===d.y||(d={x:a.pagex,y:a.pagey},b.touchendzoom(c,d,g,h)),f=!1),b.core.$outer.removeclass("lg-grabbing").addclass("lg-grab")})},d.prototype.touchendzoom=function(a,b,c,d){var e=this,f=e.core.$slide.eq(e.core.index).find(".lg-img-wrap"),g=e.core.$slide.eq(e.core.index).find(".lg-object"),h=-math.abs(f.attr("data-x"))+(b.x-a.x),i=-math.abs(f.attr("data-y"))+(b.y-a.y),j=(e.core.$outer.find(".lg").height()-g.prop("offsetheight"))/2,k=math.abs(g.prop("offsetheight")*math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").height()+j),l=(e.core.$outer.find(".lg").width()-g.prop("offsetwidth"))/2,m=math.abs(g.prop("offsetwidth")*math.abs(g.attr("data-scale"))-e.core.$outer.find(".lg").width()+l);(math.abs(b.x-a.x)>15||math.abs(b.y-a.y)>15)&&(d&&(i<=-k?i=-k:i>=-j&&(i=-j)),c&&(h<=-m?h=-m:h>=-l&&(h=-l)),d?f.attr("data-y",math.abs(i)):i=-math.abs(f.attr("data-y")),c?f.attr("data-x",math.abs(h)):h=-math.abs(f.attr("data-x")),e.core.s.useleftforzoom?f.css({left:h+"px",top:i+"px"}):f.css("transform","translate3d("+h+"px, "+i+"px, 0)"))},d.prototype.destroy=function(){var b=this;b.core.$el.off(".lg.zoom"),a(window).off(".lg.zoom"),b.core.$slide.off(".lg.zoom"),b.core.$el.off(".lg.tm.zoom"),b.resetzoom(),cleartimeout(b.zoomabletimeout),b.zoomabletimeout=!1},a.fn.lightgallery.modules.zoom=d}()}); !function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jquery)}(this,function(a){!function(){"use strict";function b(a,b,c,d){var e=this;if(e.core.$slide.eq(b).find(".lg-video").append(e.loadvideo(c,"lg-object",!0,b,d)),d)if(e.core.s.videojs)try{videojs(e.core.$slide.eq(b).find(".lg-html5").get(0),e.core.s.videojsoptions,function(){!e.videoloaded&&e.core.s.autoplayfirstvideo&&this.play()})}catch(a){console.error("make sure you have included videojs")}else!e.videoloaded&&e.core.s.autoplayfirstvideo&&e.core.$slide.eq(b).find(".lg-html5").get(0).play()}function c(a,b){var c=this.core.$slide.eq(b).find(".lg-video-cont");c.hasclass("lg-has-iframe")||(c.css("max-width",this.core.s.videomaxwidth),this.videoloaded=!0)}function d(b,c,d){var e=this,f=e.core.$slide.eq(c),g=f.find(".lg-youtube").get(0),h=f.find(".lg-vimeo").get(0),i=f.find(".lg-dailymotion").get(0),j=f.find(".lg-vk").get(0),k=f.find(".lg-html5").get(0);if(g)g.contentwindow.postmessage('{"event":"command","func":"pausevideo","args":""}',"*");else if(h)try{$f(h).api("pause")}catch(a){console.error("make sure you have included froogaloop2 js")}else if(i)i.contentwindow.postmessage("pause","*");else if(k)if(e.core.s.videojs)try{videojs(k).pause()}catch(a){console.error("make sure you have included videojs")}else k.pause();j&&a(j).attr("src",a(j).attr("src").replace("&autoplay","&noplay"));var l;l=e.core.s.dynamic?e.core.s.dynamicel[d].src:e.core.$items.eq(d).attr("href")||e.core.$items.eq(d).attr("data-src");var m=e.core.isvideo(l,d)||{};(m.youtube||m.vimeo||m.dailymotion||m.vk)&&e.core.$outer.addclass("lg-hide-download")}var e={videomaxwidth:"855px",autoplayfirstvideo:!0,youtubeplayerparams:!1,vimeoplayerparams:!1,dailymotionplayerparams:!1,vkplayerparams:!1,videojs:!1,videojsoptions:{}},f=function(b){return this.core=a(b).data("lightgallery"),this.$el=a(b),this.core.s=a.extend({},e,this.core.s),this.videoloaded=!1,this.init(),this};f.prototype.init=function(){var e=this;e.core.$el.on("hasvideo.lg.tm",b.bind(this)),e.core.$el.on("onaferappendslide.lg.tm",c.bind(this)),e.core.docss()&&e.core.$items.length>1&&(e.core.s.enableswipe||e.core.s.enabledrag)?e.core.$el.on("onslideclick.lg.tm",function(){var a=e.core.$slide.eq(e.core.index);e.loadvideoonclick(a)}):e.core.$slide.on("click.lg",function(){e.loadvideoonclick(a(this))}),e.core.$el.on("onbeforeslide.lg.tm",d.bind(this)),e.core.$el.on("onafterslide.lg.tm",function(a,b){e.core.$slide.eq(b).removeclass("lg-video-playing")}),e.core.s.autoplayfirstvideo&&e.core.$el.on("onaferappendslide.lg.tm",function(a,b){if(!e.core.lgalleryon){var c=e.core.$slide.eq(b);settimeout(function(){e.loadvideoonclick(c)},100)}})},f.prototype.loadvideo=function(b,c,d,e,f){var g="",h=1,i="",j=this.core.isvideo(b,e)||{};if(d&&(h=this.videoloaded?0:this.core.s.autoplayfirstvideo?1:0),j.youtube)i="?wmode=opaque&autoplay="+h+"&enablejsapi=1",this.core.s.youtubeplayerparams&&(i=i+"&"+a.param(this.core.s.youtubeplayerparams)),g='';else if(j.vimeo)i="?autoplay="+h+"&api=1",this.core.s.vimeoplayerparams&&(i=i+"&"+a.param(this.core.s.vimeoplayerparams)),g='';else if(j.dailymotion)i="?wmode=opaque&autoplay="+h+"&api=postmessage",this.core.s.dailymotionplayerparams&&(i=i+"&"+a.param(this.core.s.dailymotionplayerparams)),g='';else if(j.html5){var k=f.substring(0,1);"."!==k&&"#"!==k||(f=a(f).html()),g=f}else j.vk&&(i="&autoplay="+h,this.core.s.vkplayerparams&&(i=i+"&"+a.param(this.core.s.vkplayerparams)),g='');return g},f.prototype.loadvideoonclick=function(a){var b=this;if(a.find(".lg-object").hasclass("lg-has-poster")&&a.find(".lg-object").is(":visible"))if(a.hasclass("lg-has-video")){var c=a.find(".lg-youtube").get(0),d=a.find(".lg-vimeo").get(0),e=a.find(".lg-dailymotion").get(0),f=a.find(".lg-html5").get(0);if(c)c.contentwindow.postmessage('{"event":"command","func":"playvideo","args":""}',"*");else if(d)try{$f(d).api("play")}catch(a){console.error("make sure you have included froogaloop2 js")}else if(e)e.contentwindow.postmessage("play","*");else if(f)if(b.core.s.videojs)try{videojs(f).play()}catch(a){console.error("make sure you have included videojs")}else f.play();a.addclass("lg-video-playing")}else{a.addclass("lg-video-playing lg-has-video");var g,h,i=function(c,d){if(a.find(".lg-video").append(b.loadvideo(c,"",!1,b.core.index,d)),d)if(b.core.s.videojs)try{videojs(b.core.$slide.eq(b.core.index).find(".lg-html5").get(0),b.core.s.videojsoptions,function(){this.play()})}catch(a){console.error("make sure you have included videojs")}else b.core.$slide.eq(b.core.index).find(".lg-html5").get(0).play()};b.core.s.dynamic?(g=b.core.s.dynamicel[b.core.index].src,h=b.core.s.dynamicel[b.core.index].html,i(g,h)):(g=b.core.$items.eq(b.core.index).attr("href")||b.core.$items.eq(b.core.index).attr("data-src"),h=b.core.$items.eq(b.core.index).attr("data-html"),i(g,h));var j=a.find(".lg-object");a.find(".lg-video").append(j),a.find(".lg-video-object").hasclass("lg-html5")||(a.removeclass("lg-complete"),a.find(".lg-video-object").on("load.lg error.lg",function(){a.addclass("lg-complete")}))}},f.prototype.destroy=function(){this.videoloaded=!1},a.fn.lightgallery.modules.video=f}()}); } /* tilt.js 1.1.21 */ !function(t){"use strict";var _typeof="function"==typeof symbol&&"symbol"==typeof symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof symbol&&t.constructor===symbol&&t!==symbol.prototype?"symbol":typeof t};!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=function(i,s){return void 0===s&&(s="undefined"!=typeof window?require("jquery"):require("jquery")(i)),t(s),s}:t(jquery)}(function(t){return t.fn.tilt=function(i){var s=function(){this.ticking||(requestanimationframe(g.bind(this)),this.ticking=!0)},e=function(){var i=this;t(this).on("mousemove",o),t(this).on("mouseenter",a),this.settings.reset&&t(this).on("mouseleave",h),this.settings.glare&&t(window).on("resize",u.bind(i))},n=function(){var i=this;void 0!==this.timeout&&cleartimeout(this.timeout),t(this).css({transition:this.settings.speed+"ms "+this.settings.easing}),this.settings.glare&&this.glareelement.css({transition:"opacity "+this.settings.speed+"ms "+this.settings.easing}),this.timeout=settimeout(function(){t(i).css({transition:""}),i.settings.glare&&i.glareelement.css({transition:""})},this.settings.speed)},a=function(i){this.ticking=!1,t(this).css({"will-change":"transform"}),n.call(this),t(this).trigger("tilt.mouseenter")},r=function(i){return"undefined"==typeof i&&(i={pagex:t(this).offset().left+t(this).outerwidth()/2,pagey:t(this).offset().top+t(this).outerheight()/2}),{x:i.pagex,y:i.pagey}},o=function(t){this.mousepositions=r(t),s.call(this)},h=function(){n.call(this),this.reset=!0,s.call(this),t(this).trigger("tilt.mouseleave")},l=function(){var i=t(this).outerwidth(),s=t(this).outerheight(),e=t(this).offset().left,n=t(this).offset().top,a=(this.mousepositions.x-e)/i,r=(this.mousepositions.y-n)/s,o=(this.settings.maxtilt/2-a*this.settings.maxtilt).tofixed(2),h=(r*this.settings.maxtilt-this.settings.maxtilt/2).tofixed(2),l=math.atan2(this.mousepositions.x-(e+i/2),-(this.mousepositions.y-(n+s/2)))*(180/math.pi);return{tiltx:o,tilty:h,percentagex:100*a,percentagey:100*r,angle:l}},g=function(){return this.transforms=l.call(this),this.reset?(this.reset=!1,t(this).css("transform","perspective("+this.settings.perspective+"px) rotatex(0deg) rotatey(0deg)"),void(this.settings.glare&&(this.glareelement.css("transform","rotate(180deg) translate(-50%, -50%)"),this.glareelement.css("opacity","0")))):(t(this).css("transform","perspective("+this.settings.perspective+"px) rotatex("+("x"===this.settings.axis?0:this.transforms.tilty)+"deg) rotatey("+("y"===this.settings.axis?0:this.transforms.tiltx)+"deg) scale3d("+this.settings.scale+","+this.settings.scale+","+this.settings.scale+")"),this.settings.glare&&(this.glareelement.css("transform","rotate("+this.transforms.angle+"deg) translate(-50%, -50%)"),this.glareelement.css("opacity",""+this.transforms.percentagey*this.settings.maxglare/100)),t(this).trigger("change",[this.transforms]),void(this.ticking=!1))},c=function(){var i=this.settings.glareprerender;if(i||t(this).append('
'),this.glareelementwrapper=t(this).find(".js-tilt-glare"),this.glareelement=t(this).find(".js-tilt-glare-inner"),!i){var s={position:"absolute",top:"0",left:"0",width:"100%",height:"100%"};this.glareelementwrapper.css(s).css({overflow:"hidden"}),this.glareelement.css({position:"absolute",top:"50%",left:"50%","pointer-events":"none","background-image":"linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)",width:""+2*t(this).outerwidth(),height:""+2*t(this).outerwidth(),transform:"rotate(180deg) translate(-50%, -50%)","transform-origin":"0% 0%",opacity:"0"})}},u=function(){this.glareelement.css({width:""+2*t(this).outerwidth(),height:""+2*t(this).outerwidth()})};return t.fn.tilt.destroy=function(){t(this).each(function(){t(this).find(".js-tilt-glare").remove(),t(this).css({"will-change":"",transform:""}),t(this).off("mousemove mouseenter mouseleave")})},t.fn.tilt.getvalues=function(){var i=[];return t(this).each(function(){this.mousepositions=r.call(this),i.push(l.call(this))}),i},t.fn.tilt.reset=function(){t(this).each(function(){var i=this;this.mousepositions=r.call(this),this.settings=t(this).data("settings"),h.call(this),settimeout(function(){i.reset=!1},this.settings.transition)})},this.each(function(){var s=this;this.settings=t.extend({maxtilt:t(this).is("[data-tilt-max]")?t(this).data("tilt-max"):20,perspective:t(this).is("[data-tilt-perspective]")?t(this).data("tilt-perspective"):300,easing:t(this).is("[data-tilt-easing]")?t(this).data("tilt-easing"):"cubic-bezier(.03,.98,.52,.99)",scale:t(this).is("[data-tilt-scale]")?t(this).data("tilt-scale"):"1",speed:t(this).is("[data-tilt-speed]")?t(this).data("tilt-speed"):"400",transition:!t(this).is("[data-tilt-transition]")||t(this).data("tilt-transition"),axis:t(this).is("[data-tilt-axis]")?t(this).data("tilt-axis"):null,reset:!t(this).is("[data-tilt-reset]")||t(this).data("tilt-reset"),glare:!!t(this).is("[data-tilt-glare]")&&t(this).data("tilt-glare"),maxglare:t(this).is("[data-tilt-maxglare]")?t(this).data("tilt-maxglare"):1},i),this.init=function(){t(s).data("settings",s.settings),s.settings.glare&&c.call(s),e.call(s)},this.init()})},t("[data-tilt]").tilt(),!0});}(jquery); /* theia sticky 1.6.0 */ !function(i){"use strict";i.fn.theiastickysidebar=function(t){function e(t,e){var a=o(t,e);a||(console.log("tss: body width smaller than options.minwidth. init is delayed."),i(document).on("scroll."+t.namespace,function(t,e){return function(a){var n=o(t,e);n&&i(this).unbind(a)}}(t,e)),i(window).on("resize."+t.namespace,function(t,e){return function(a){var n=o(t,e);n&&i(this).unbind(a)}}(t,e)))}function o(t,e){return t.initialized===!0||!(i("body").width().theiastickysidebar:after {content: ""; display: table; clear: both;}')),e.each(function(){function e(){a.fixedscrolltop=0,a.sidebar.css({"min-height":"1px"}),a.stickysidebar.css({position:"static",width:"",transform:"none"})}function o(t){var e=t.height();return t.children().each(function(){e=math.max(e,i(this).height())}),e}var a={};if(a.sidebar=i(this),a.options=t||{},a.container=i(a.options.containerselector),0==a.container.length&&(a.container=a.sidebar.parent()),a.sidebar.parents().css("-webkit-transform","none"),a.sidebar.css({position:a.options.defaultposition,overflow:"visible","-webkit-box-sizing":"border-box","-moz-box-sizing":"border-box","box-sizing":"border-box"}),a.stickysidebar=a.sidebar.find(".theiastickysidebar"),0==a.stickysidebar.length){var s=/(?:text|application)\/(?:x-)?(?:javascript|ecmascript)/i;a.sidebar.find("script").filter(function(i,t){return 0===t.type.length||t.type.match(s)}).remove(),a.stickysidebar=i("
").addclass("theiastickysidebar").append(a.sidebar.children()),a.sidebar.append(a.stickysidebar)}a.marginbottom=parseint(a.sidebar.css("margin-bottom")),a.paddingtop=parseint(a.sidebar.css("padding-top")),a.paddingbottom=parseint(a.sidebar.css("padding-bottom"));var r=a.stickysidebar.offset().top,d=a.stickysidebar.outerheight();a.stickysidebar.css("padding-top",1),a.stickysidebar.css("padding-bottom",1),r-=a.stickysidebar.offset().top,d=a.stickysidebar.outerheight()-d-r,0==r?(a.stickysidebar.css("padding-top",0),a.stickysidebarpaddingtop=0):a.stickysidebarpaddingtop=1,0==d?(a.stickysidebar.css("padding-bottom",0),a.stickysidebarpaddingbottom=0):a.stickysidebarpaddingbottom=1,a.previousscrolltop=null,a.fixedscrolltop=0,e(),a.onscroll=function(a){if(a.stickysidebar.is(":visible")){if(i("body").width()a.container.width())return void e()}var r=i(document).scrolltop(),d="static";if(r>=a.sidebar.offset().top+(a.paddingtop-a.options.additionalmargintop)){var c,p=a.paddingtop+t.additionalmargintop,b=a.paddingbottom+a.marginbottom+t.additionalmarginbottom,l=a.sidebar.offset().top,f=a.sidebar.offset().top+o(a.container),h=0+t.additionalmargintop,g=a.stickysidebar.outerheight()+p+b0?math.min(y,h):math.max(y,c-a.stickysidebar.outerheight()),y=math.max(y,u),y=math.min(y,s-a.stickysidebar.outerheight());var k=a.container.height()==a.stickysidebar.outerheight();d=(k||y!=h)&&(k||y!=c-a.stickysidebar.outerheight())?r+y-a.sidebar.offset().top-a.paddingtop<=t.additionalmargintop?"static":"absolute":"fixed"}if("fixed"==d){var v=i(document).scrollleft();a.stickysidebar.css({position:"fixed",width:n(a.stickysidebar)+"px",transform:"translatey("+y+"px)",left:a.sidebar.offset().left+parseint(a.sidebar.css("padding-left"))-v+"px",top:"0px"})}else if("absolute"==d){var x={};"absolute"!=a.stickysidebar.css("position")&&(x.position="absolute",x.transform="translatey("+(r+y-a.sidebar.offset().top-a.stickysidebarpaddingtop-a.stickysidebarpaddingbottom)+"px)",x.top="0px"),x.width=n(a.stickysidebar)+"px",x.left="",a.stickysidebar.css(x)}else"static"==d&&e();"static"!=d&&1==a.options.updatesidebarheight&&a.sidebar.css({"min-height":a.stickysidebar.outerheight()+a.stickysidebar.offset().top-a.sidebar.offset().top+a.paddingbottom}),a.previousscrolltop=r}},a.onscroll(a),i(document).on("scroll."+a.options.namespace,function(i){return function(){i.onscroll(i)}}(a)),i(window).on("resize."+a.options.namespace,function(i){return function(){i.stickysidebar.css({position:"static"}),i.onscroll(i)}}(a)),"undefined"!=typeof resizesensor&&new resizesensor(a.stickysidebar[0],function(i){return function(){i.onscroll(i)}}(a))})}function n(i){var t;try{t=i[0].getboundingclientrect().width}catch(i){}return"undefined"==typeof t&&(t=i.width()),t}var s={containerselector:"",additionalmargintop:0,additionalmarginbottom:0,updatesidebarheight:!0,minwidth:0,disableonresponsivelayouts:!0,sidebarbehavior:"modern",defaultposition:"relative",namespace:"tss"};return t=i.extend(s,t),t.additionalmargintop=parseint(t.additionalmargintop)||0,t.additionalmarginbottom=parseint(t.additionalmarginbottom)||0,e(t,this),this}}(jquery); /* codevz watch 1.1 */ !function(n,t){"use strict";var e=function(n,t,e){var r;return function(){var u=this,i=arguments;r?cleartimeout(r):e&&n.apply(u,i),r=settimeout(function(){e||n.apply(u,i),r=null},t||100)}};jquery.fn[t]=function(n){return n?this.on("domnodeinserted domnoderemoved",e(n)):this.trigger(t)}}(jquery,"codevzwatch"); /* codevz plus */ var codevz_plus = (function($) { "use strict"; // custom easing. $.extend( $.easing, { def: 'easeinoutexpo', easeinoutexpo: function(x) { return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? math.pow( 2, 20 * x - 10 ) / 2 : ( 2 - math.pow( 2, -20 * x + 10 ) ) / 2; } }); if ( ! $.fn.codevz ) { $.fn.codevz = function( n, i ) { $( this ).each(function( a ) { var e = $( this ); if ( e.data( 'codevz' ) !== n || $( '.vc_editor' ).length ) { i.apply( e.data( 'codevz', n ), [a] ); } }); } } var body = $( 'body' ), wind = $( window ), lightbox_exclude = '.cz_disable_lightbox,.cz_disable_lightbox a,.xtra-share a,.entry-summary a,.esgbox,.jg-entry,.prettyphoto,.cz_grid_title,.ngg-fancybox,.fancybox,.lightbox,.kraut-lightbox-slickslider', lightbox_selector = '.cz_lightbox:not(.cz_no_lightbox),.cz_a_lightbox:not(.cz_no_lightbox) a:not(.cz_no_lightbox),a[href*="youtube.com/watch?"]:not(.cz_no_lightbox),a[href*="youtu.be/watch?"]:not(.cz_no_lightbox),a[href*="vimeo.com/"]:not(.cz_no_lightbox),a[href*=".jpg"]:not(' + lightbox_exclude + '),a[href*=".jpeg"]:not(' + lightbox_exclude + '),a[href*=".png"]:not(' + lightbox_exclude + '),a[href*=".gif"]:not(' + lightbox_exclude + ')', ajaxurl = $( '#intro' ).data( 'ajax' ) || ajaxurl, runscrolltime = 0; return { init: function() { this.popup(); this.css(); this.tabs(); this.tilt(); this.menus(); this.login(); this.share(); this.counter(); this.lazyload(); this.parallax(); this.accordion(); this.countdown(); this.backtotop(); this.separator(); this.image_zoom(); this.content_box(); this.extra_panel(); this.woocommerce(); this.team_tooltip(); this.lightgallery(); this.progress_bar(); this.inline_video(); this.before_after(); this.sticky_columns(); this.show_more_less(); this.responsive_text(); this.dwqa_textarea_lh(); this.load_google_map_js(); this.working_hours_line(); this.fix_wp_editor_google_fonts(); this.fix_header_icon_text_2(); this.runscroll(); }, /* * trigger scroll */ runscroll: function() { cleartimeout( runscrolltime ); runscrolltime = settimeout(function() { codevz_plus.wpbakery_fix_full_row(); if ( ! $( '.compose-mode').length ) { wind.trigger( 'resize' ); } wind.trigger( 'scroll' ); }, 500 ); }, /* * check element in viewport */ inview: function( e, i ) { var docviewtop = wind.scrolltop(), docviewbottom = docviewtop + wind.height(), elemtop = e.offset().top, elembottom = elemtop + e.height(); i = i ? 750 : 0; return ( ( elemtop <= docviewbottom + i ) && ( elembottom >= docviewtop - i ) ); }, /* * fix vc stretch row for boxed layouts */ wpbakery_fix_full_row: function() { if ( $( '.layout_1, .layout_2' ).length ) { if ( $( '[data-vc-stretch-content]' ).length || $( '.compose-mode' ).length ) { wind.off( 'resize.cz_fix_row' ).on( 'resize.cz_fix_row', function() { settimeout(function() { $( '[data-vc-stretch-content]' ).each(function() { var la = $( '.inner_layout' ), eh = ( la.width() - la.find( '.page_content > .row' ).width() ) / 2; $( this ).css({ 'width': la.width(), 'left': body.hasclass( 'rtl' ) ? eh : -eh, 'margin-left': 0, 'margin-right': 0, }); }); }, 200 ); }); // fix front-end if ( $( '.compose-mode' ).length ) { settimeout(function() { wind.trigger( 'resize' ); }, 100 ); } } } // fix fixed side and wpbakery stretch row in rtl mode if ( $( '.is_fixed_side' ).length && body.hasclass( 'rtl' ) ) { wind.on( 'resize', function() { $( '[data-vc-full-width="true"]' ).each(function() { var en = $( this ), offset = $( '.page_content > .row > section' ).offset(); if ( $( '.fixed_side_left' ).length ) { en.css( 'padding-left', offset.left ); } else if ( $( '.fixed_side_right' ).length ) { en.css( 'padding-left', offset.left ); } }); }); } }, /* * fix icon and text 2 in header on windows width changes. */ fix_header_icon_text_2: function() { var icon_text = $( 'header .cz_elm_info_box' ), breakpoint = 960; icon_text.each(function() { if ( $( this ).parent().parent().find( '.cz_elm_info_box' ).length ) { breakpoint = 1024; } }); wind.off( 'resize.cz_fix_row' ).on( 'resize.cz_fix_row', function() { if ( wind.width() < breakpoint ) { icon_text.addclass( 'xtra-hide-text' ); } else { icon_text.removeclass( 'xtra-hide-text' ); } }); }, /* * responsive smart font size */ responsive_text: function() { var px_to_vw = function( s, w ) { var n = s.match(/\d+/) - 2, v = ( n / (w / 100 )); return v > 2 ? v + 'vw' : n + 'px'; }, elms = $( '.cz_smart_fs' ).find( '.cz_wpe_content [style*="font-size"]' ), winwidth, cz = 'resize.cz_responsive_text'; if ( elms.length ) { wind.off( cz ).on( cz, function() { winwidth = wind.width(); if ( winwidth <= 1170 ) { elms.removeclass( 'js_smart_fs' ).codevz( 'smart_fs', function() { var en = $( this ), style, match; if ( en.attr( 'data-ori-style' ) ) { return; } if ( ! en.attr( 'data-ori-style' ) ) { style = en.attr( 'style' ); en.attr( 'data-ori-style', style ); } match = style.match( /font-size: \d+.\w+px|font-size: \w+px/ ); if ( match ) { var nu = match[0].match( /\d+/ ); if ( nu && nu[0] > 18 ) { var vw = px_to_vw( match[0], winwidth ), cw = en.closest( '.cz_wpe_content' ).width(), pw = en.closest( '.cz_smart_fs' ).parent().width(); if ( cw > pw ) { var tt = pw / cw; vw = vw.match(/\d+/) * tt; if ( winwidth == pw ) { vw = vw - 2; } vw = ( vw - 2 ) + 'vw'; } vw && en.attr( 'style', style.replace( match[0], 'font-size: ' + vw ) ); } } }); } else { $( '[data-ori-style]' ).each(function() { var en = $( this ); en.attr( 'style', en.attr( 'data-ori-style' ) ).removeattr( 'data-ori-style' ); }); } }); } }, /* * move all data styles to head */ css: function() { $( '[data-cz-style]' ).codevz( 'data_style', function() { var d = $( this ), s = d.data( 'cz-style' ); if ( ! $( '#xtra_inline_css' ).length ) { $( 'head' ).append( '' ); } $( '#xtra_inline_css' ).append( s ); settimeout(function() { d.removeattr( 'data-cz-style' ); }, 500 ); }); }, /* * lightgallery */ lightgallery: function() { if ( $.fn.lightgallery && ! body.hasclass( 'no_lightbox' ) ) { var d = body.data( 'lightgallery' ); // destroy old. d && d.destroy( true ); // each gallery. $( '.cz_grid' ).each(function( i ) { $( this ).lightgallery({ selector: lightbox_selector, galleryid: i + 1 }); }); // public images. var $lg = body.attr( 'data-lightgallery', 1 ).lightgallery({ selector: lightbox_selector }); // load video. $lg.on( 'onbeforeopen.lg', function( event, href ) { $( '.lg-video-object' ).attr( 'preload', 'metadata' ); }); } }, /* * sticky columns */ sticky_columns: function() { // fixed side $( '.fixed_side' ).codevz( 'fixed_side', function() { var en = $( this ), ff_pos = en.hasclass( 'fixed_side_left' ) ? 'left' : 'right', inla = $( '.inner_layout' ); // sticky en.theiastickysidebar({additionalmargintop: 0,updatesidebarheight: false}); // size's wind.on( 'resize', function() { if ( en.css( 'display' ) === 'none' ) { inla.css( 'width', '100%' ); } else { en.css( 'height', wind.height() - parseint( $( '#layout' ).css( 'margintop' ) + body.css( 'margintop' ) ) ); inla.css( 'width', 'calc( 100% - ' + en.outerwidth() + 'px )' ); } }); }); // woo $( '.xtra-single-product .woocommerce-product-gallery' ).addclass( 'cz_sticky_col' ); // sticky sidebars & content $( '.cz_sticky .row > aside, .cz_sticky_col' ).codevz( 'sticky', function() { $( this ).theiastickysidebar({additionalmargintop: ( $( '.header_is_sticky:not(.smart_sticky)' ).height() + 60 ),updatesidebarheight: false}); }); }, /* * back to top button */ backtotop: function() { $( '.backtotop, a[href*="#top"]' ).codevz( 'backtotop', function() { var en = $( this ); en.on( 'click', function( e ) { e.preventdefault(); $( 'html, body' ).animate({scrolltop: 0}, 1200, 'easeinoutexpo' ); }); if ( en.hasclass( 'backtotop' ) ) { wind.on( 'scroll', function() { if ( $( this ).scrolltop() < 600 ) { en.fadeout( 'fast' ).next( '.fixed_contact' ).css({right: 30}); } else { en.fadein( 'fast' ).next( '.fixed_contact' ).css({right: ( en.outerheight() + 34 )}); // jivochat fix. var jch = $( '#jvlabelwrap' ); if ( jch.length ) { var jchv = jch.height() - 20; en.css( 'marginbottom', jchv ).next( '.fixed_contact' ).css( 'marginbottom', jchv ); if ( $( '.footer_2 .elms_right' ).length ) { if ( wind.scrolltop() + wind.height() > $(document).height() - 40 ) { jch.hide(); } else { jch.show(); } } } else if ( $( '.__jivomobilebutton' ).length ) { jch = $( '.__jivomobilebutton' ).height() - 10; en.css( 'marginbottom', jch ).next( '.fixed_contact' ).css( 'marginbottom', jch ); } } }); } }); // fixed contact form $( '.fixed_contact' ).codevz( 'fixed_contact', function() { $( this ).on( 'click', function(e) { $( this ).next('.fixed_contact').fadetoggle( 'fast' ).css({bottom: $( this ).height() + parseint( $( this ).css('margin-bottom') ) + 40 }); e.stoppropagation(); }); body.on( 'click', function (e) { if ( $( 'div.fixed_contact' ).is(':visible') ) { $( 'div.fixed_contact' ).fadeout( 'fast' ); } }); }); }, /* * line between working hours content */ working_hours_line: function( fix ) { var whl = function() { $( '.cz_wh_line_between .cz_wh_line' ).codevz( 'whlb', function() { var en = $( this ), pa = en.parent(), ic = pa.find( 'span i' ), ll = pa.find( '.cz_wh_left b' ).outerwidth( true ) + ( ic.length ? ic.outerwidth( true ) + 8 : 0 ) + 12 + 'px', rr = pa.find( '.cz_wh_right' ).outerwidth( true ) + 12 + 'px', is_rtl = body.hasclass( 'rtl' ); en.attr( 'style', en.attr( 'style' ) ).css({ 'left': ( is_rtl ? rr : ll ), 'right': ( is_rtl ? ll : rr ) }); }); }; if ( fix ) { $( '.cz_wh_line_between .cz_wh_line' ).removedata( 'codevz' ); whl(); } else { wind.off( 'resize.cz_whlb' ).on( 'resize.cz_whlb', function() { whl(); }); } }, /* * team members tooltip */ team_tooltip: function() { body.on({ mouseenter: function () { $( '.cz_team_content', this ).fadein( 100 ); }, mouseleave: function () { $( '.cz_team_content', this ).fadeout( 100 ); }, mousemove: function (e) { var w = $( '.cz_team_content', this ).width() / 2, x = e.offsetx, y = e.offsety + 30; $( '.cz_team_content', this ).css({top: y, left: x}); } }, '.cz_team_6 .cz_team_img, .cz_team_7 .cz_team_img' ); }, /* * string to slug */ stringtoslug: function( str ) { var s = '', t = $.trim( str ); s = t.replace(/[^a-z0-9-]/gi, '-').replace(/-+/g, '_').replace(/^-|-$/g, ''); return s.tolowercase(); }, // load editor google fonts. fix_wp_editor_google_fonts: function() { var fonts = []; // find all inline font families. $( '.wpb_text_column, .cz_wpe_content' ).find( '[style*="font-family"]' ).not( 'i' ).codevz( 'fonts', function() { var en = $( this ), font = en.css( 'font-family' ).replace( /'|"/g, '' ); if ( ! xtra_ignore_fonts[ font ] ) { fonts.push( font ); } }); // load missing google fonts. $.each( fonts, function( key, font ) { if ( ! $( 'link[href*="' + font + '"]' ).length ) { var url = 'https://fonts.googleapis.com/css?family=' + font + ':300,400,500,700'; $( 'head' ).append( '' ); } }); }, // popup modal box. popup: function( i ) { $( '.cz_popup_modal' ).codevz( 'popup_clone', function() { var en = $( this ), outer = en.parent(); // move popup to footer if ( outer.length && ! en.closest( '.vc_cz_popup' ).length ) { body.append( outer[0].outerhtml); outer.remove(); } }); // reset wpb bar if ( $( '.compose-mode' ).length ) { $( '.cz_edit_popup_link', parent.document.body ).remove(); } // each popup. $( '.cz_popup_modal' ).each(function() { var dis = $( this ), idd = dis.attr( 'id' ), ovl = dis.data( 'overlay-bg' ), dly = dis.data( 'settimeout' ), scr = dis.data( 'after-scroll' ), par = $( '#' + idd ).closest( '.vc_cz_popup' ), show_popup = function() { par.fadein( 'fast' ); $( '.vc_cz_popup, #' + idd ).fadein( 'fast' ).delay( 1000 ).addclass( 'cz_show_popup' ); $( '.cz_overlay', dis ).css( 'background', ovl ).fadein( 'fast' ); if ( typeof codevz_plus.slick != 'undefined' ) { codevz_plus.slick(); } }; // fix cf7 pro inside popup if ( ! par.length && typeof wpcf7 != 'undefined' && dis.find( '.wpcf7' ).length ) { dis.find( 'div.wpcf7 > form' ).each( function() { var $form = $( this ); wpcf7.initform( $form ); if ( wpcf7.cached ) { wpcf7.refill( $form ); } } ); } // fix lightbox if ( $.fn.lightgallery ) { $( '#' + idd ).lightgallery({selector: lightbox_selector}); } // open popup $( "a[href*='#" + idd + "']" ).off().on( 'click', function(e) { show_popup(); e.preventdefault(); }); // fix multiple same popup dis.attr( 'data-popup', idd ); // start if ( $( '#' + idd ).length ) { // wpbakery frontend if ( par.length ) { // add popup link to wpb bar $( '#' + idd ).each(function() { $( '.vc_navbar-nav', parent.document.body ).append( '' ); }); // set popup styling par.attr( 'style', $( '#' + idd ).attr( 'style' ) ); // open popup $( '.edit_' + idd, parent.document.body ).off().on( 'click', function(e) { show_popup(); e.preventdefault(); }); // delete popup $( "#" + idd + " .cz_close_popup, #cz_close_popup, .cz_overlay, a[href*='#cz_close_popup']" ).off(); $( '.vc_control-btn-delete', par ).on('click', function() { $( '.edit_' + idd, parent.document.body ).closest( 'li' ).remove(); }); } // close popup $( "#" + idd + " .cz_close_popup, #cz_close_popup, .cz_overlay, a[href*='#cz_close_popup']" ).on( 'click', function(e) { $( '.cz_overlay' ).fadeout( 'fast' ).removeclass( 'cz_show_popup' ).css( 'background', '' ); $( '.vc_cz_popup, .vc_cz_popup, #' + idd ).hide().removeclass( 'cz_show_popup' ); // check session for future visits if ( dis.hasclass( 'cz_popup_show_once' ) ) { localstorage.setitem( idd, 1 ); } }); // if popup is always show, then remove session if ( dis.hasclass( 'cz_popup_show_always' ) && localstorage.getitem( idd ) ) { localstorage.removeitem( idd ); } // check visibility mode on page load if ( dis.hasclass( 'cz_popup_page_start' ) && ! localstorage.getitem( idd ) ) { show_popup(); } else if ( dis.hasclass( 'cz_popup_page_loaded' ) && ! localstorage.getitem( idd ) ) { wind.on( 'load', function() { show_popup(); }); } // auto open after delay. if ( dly ) { settimeout(function() { show_popup(); }, dly ); } // auto open after specific scroll position. if ( scr ) { wind.on( 'scroll.popup_scroll', function() { var scrollpercent = 100 * $(window).scrolltop() / ($(document).height() - $(window).height()); if ( scrollpercent >= scr ) { show_popup(); wind.off( 'scroll.popup_scroll' ); } }); } } else { console.log( 'popup not found, id: #' + idd ); } }); }, /* * tabs */ tabs: function() { $( '.compose-mode' ).length && $( '.cz_tabs' ).data( 'js_tabs', 0 ); $( '.cz_tabs' ).codevz( 'tabs', function() { var dis = $( this ), nav = dis.hasclass( 'cz_tabs_nav_after' ) ? 'append' : 'prepend'; // convert tabs nav if ( ! $( '.cz_tabs_nav', dis ).length ) { dis[nav]( '
' ); } $( '.cz_tabs_nav div', dis ).html(''); $( '.cz_tab_a', dis ).each(function() { $( '.cz_tabs_nav div', dis ).prepend( $( this ).removeclass( 'vc_empty-element' ).clone() ); }); // mobile dropdown. if ( ! dis.find( '> select' ).length ) { dis.prepend( '' ); $tabs.find( 'li' ).each( function() { var $this = $( this ); $( '.xtra-woo-tabs' ).append( '' ); }); $( '.xtra-woo-tabs' ).on( 'change', function() { $tabs.find( '#' + this.value + ' > a' ).trigger( 'click' ); }); } // disable product page lightbox $( '.woo-disable-lightbox .woocommerce-product-gallery__wrapper > div:first-child a' ).removeattr( 'href' ).css( 'cursor', 'default' ); }, /* * extra panel */ extra_panel: function() { var h_top_bar = $( '.hidden_top_bar' ), c_overlay = '.cz_overlay'; if ( h_top_bar.length ) { h_top_bar.on( 'click', function(e) { e.stoppropagation(); }); $( '> i', h_top_bar ).on( 'click', function (e) { $( c_overlay ).fadetoggle( 'fast' ); $( this ).toggleclass( 'fa-angle-down fa-angle-up' ); h_top_bar.toggleclass( 'show_hidden_top_bar' ); e.stoppropagation(); }); body.on( 'click', function (e) { if ( $( '.show_hidden_top_bar' ).length ) { $( '> i', h_top_bar ).addclass( 'fa-angle-down' ).removeclass( 'fa-angle-up' ); h_top_bar.removeclass( 'show_hidden_top_bar' ); $( c_overlay ).fadeout( 'fast' ); } }); } }, /* * show more and show less */ show_more_less: function() { $( '.cz_sml' ).codevz( 'sml', function() { var dis = $( this ), h = $( '.cz_sml_inner', dis ).css( 'height' ); $( '> a', dis ).off().on( 'click', function(e) { dis.toggleclass( 'cz_sml_open' ); $( '.cz_sml_inner', dis ).animate({ 'height': dis.hasclass( 'cz_sml_open' ) ? $( '.cz_sml_inner div:first-child', dis ).outerheight( true ) : h }); e.preventdefault(); return false; }); }); }, /* * ajax login, register and pasword recovery */ login: function() { $( 'input, form' ).codevz( 'form', function() { $( this ).attr( 'autocomplete', 'off' ); }); // forms slides $( '.cz_lrpr' ).codevz( 'lrpr', function() { var en = $( this ); $( 'a[href*="#"]', en ).on( 'click', function(e) { $( this.hash, en ).slidedown().siblings().slideup(); e.preventdefault(); return false; }); }); // ajax submit form $( '.cz_lrpr form' ).codevz( 'lrprform', function() { var form = $( this ), check = false, inputs = form.find( 'input' ); form.off().on( 'submit', function() { inputs.css( 'animation', 'none' ).each(function() { if ( ! $( this ).val() ) { $( this ).select().css( 'animation', 'btnfxabsorber .8s forwards' ); check = false; return false; } else { check = true; } }); if ( $( '.cz_loader', form ).length ) { return false; } if ( check ) { var btn = form.find( 'input[type="submit"]' ); btn.attr( 'disabled', 'disabled' ).addclass( 'cz_loader' ); form.find( '.cz_msg' ).slideup( 100 ); $.post( ajaxurl, form.serialize(), function( msg ) { if ( msg ) { form.find( '.cz_msg' ).html( msg ).slidedown( 100 ); btn.removeclass( 'cz_loader' ); } else { var redirect = form.closest( '.cz_lrpr' ).data( 'redirect' ); if ( redirect ) { window.location = redirect; } else { window.location.reload( true ); } } btn.removeattr( 'disabled' ); }); } return false; }); }); }, /* * social share icons iframe. */ share: function() { body.on( 'click', '.xtra-share a', function() { var $this = $( this ), href = $this.attr( 'href' ); // copy shortlink. if ( $this.find( '.fa-copy' ).length ) { var $temp = $( '' ); body.append( $temp ); $temp.val( href ).select(); document.execcommand( 'copy' ); $temp.remove(); var title = $this.attr( 'data-title' ); $this.attr( 'style', 'animation: btnfxabsorber .8s forwards;' ).attr( 'data-title', $this.attr( 'data-copied' ) ).delay( 2000 ).queue( function(){ $this.removeattr( 'style' ).attr( 'data-title', title ); }); return false; // print modal. } else if ( href.indexof( 'http' ) === 0 ) { window.open( href, "null", "height=300, width=600, top=200, left=200" ); return false; } }); }, /* * for visual composer draggable element */ front_end_draggable: function( s ) { settimeout(function() { $( s ).codevz( 'vc_dde', function() { var en = $( this ), inner = $( '.cz_free_position_element, .cz_hotspot', en ); en.css({'top': inner.data( 'top' ), 'left': inner.data( 'left' )}).draggable({ drag: function() { var pos = $( this ).position(), col = $( this ).closest(".wpb_column"); if ( ! $( ".ui-draggable", parent.document.body ).hasclass( 'vc_active' ) ) { $( '> .vc_controls .vc-c-icon-mode_edit', en ).trigger( 'click' ); } $( ".css_top", parent.document.body ).val( pos.top / col.height() * 100 + "%" ); $( ".css_left", parent.document.body ).val( pos.left / col.width() * 100 + "%" ); } }); inner.css({'top': 'auto', 'left': 'auto'}); }); }, 500 ); }, /* * click on image to view inline video */ inline_video: function() { $( '.cz_video_inline' ).codevz( 'video', function() { var en = $( this ); $( '.cz_no_lightbox', en ).on('click', function(e) { var height = $( 'img', en ).height(); if ( ! $( 'iframe', en ).length ) { var url = $( this ).attr( 'href' ), src = url.substr( url.indexof( "=" ) + 1 ), src = url.indexof( "youtube" ) > 0 ? 'https://www.youtube-nocookie.com/embed/' + src + '?autoplay=1&rel=0&showinfo=0' : 'https://player.vimeo.com/video/' + url.match( /\d+/ ) + '?autoplay=1', iframe = ''; $( this ).fadeout( 'fast' ).css( 'position','absolute' ); en.append( iframe ); en.find( 'iframe' ).css({ 'position': 'relative', 'width': '100%', 'height': height }); } if ( ! $( this ).parent().find('.close_inline_video').length ) { en.append(''); $( '.close_inline_video' ).on('click', function(e) { $( this ).parent().find('iframe').detach(); $( this ).parent().find('.cz_no_lightbox').fadein( 'fast' ).css('position','relative'); $( this ).detach(); }); } e.preventdefault(); }); }); }, /* * lazyload */ lazyload: function() { var time, $isotope, lazy = function() { cleartimeout( time ); time = settimeout(function() { $( 'img[data-src]' ).not( '.sf-menu ul img' ).each(function() { var en = $( this ), check = ( en.closest( '.cz_grid' ).length && ! en.closest( '.cz_tabs' ).length ) ? en.is( ':visible' ) : 1; if ( ! en.hasclass( 'lazydone' ) && codevz_plus.inview( en, 1 ) && check ) { en.attr( 'src', en.data( 'src' ) ).attr( 'data-src', '' ); if ( en.closest( '.cz_grid' ).data( 'isotope' ) ) { $isotope = en.closest( '.cz_grid' ); en.parent().imagesloaded().progress(function( imgload, image ) { $isotope.isotope( 'layout' ); en.addclass( 'lazydone' ).attr( 'srcset', en.data( 'srcset' ) ).attr( 'sizes', en.data( 'sizes' ) ).removeattr( 'data-srcset data-sizes data-czlz' ); }); } else { en.parent().imagesloaded().progress(function( imgload, image ) { en.addclass( 'lazydone' ).attr( 'srcset', en.data( 'srcset' ) ).attr( 'sizes', en.data( 'sizes' ) ).removeattr( 'data-srcset data-sizes data-czlz' ); }); } } }); }, 50 ); if ( ! $( '[data-czlz]' ).length ) { wind.off( 'scroll.cz_lazyload' ); } }; wind.on( 'scroll.cz_lazyload', lazy ); }, /* * parallax elements on scroll and mousemove */ parallax: function() { // on mouse move var mparallax = $( '[class^="cz_mparallax_"], [class*=" cz_mparallax_"]' ); if ( mparallax.length ) { wind.off( 'mousemove.mparallax' ).on( 'mousemove.mparallax', function(e) { var w = $(window).width(), h = $(window).height(), x = e.pagex, y = e.pagey; mparallax.each(function() { if ( codevz_plus.inview( $( this ) ) ) { var en = $( this ), cl = en.attr( "class" ), sp = -( ( parseint( cl.replace(/[^\d-]/g, "") ) || 50 ) * 10 ), xx = parseint( x - en.offset().left - ( parseint( en.width() / 2 ) ) ), yy = parseint( y - en.offset().top - ( parseint( en.height() / 2 ) ) ), xx = xx / w, yy = yy / h, tr = "translate3d(" + math.round( xx * sp ) + "px," + math.round( yy * sp ) + "px, 0px)"; en.css({'transform': tr}); } }); }); } // on scroll var all = $( '[class^="cz_parallax_"], [class*=" cz_parallax_"]' ).not( '.js_parallax' ).length; $( '[class^="cz_parallax_"], [class*=" cz_parallax_"]' ).codevz( 'parallax', function( index ) { var b = $( this ), c = b.attr( "class" ), d = wind.height(), f = c ? c.replace(/[^\d-]/g, "") : "undefined"; b.css({}); "undefined" !== f && f && (f = parseint(c.replace(/[^\d-]/g, "")) / 100); var g, h, j, k = b, l = ($(document).height(), k.offset().top), m = (k.outerheight(), f), n = "foreground", i = ( c.indexof("_v_") >= 0 ) ? 'v' : 'h', p = k.data("offset"); g = m ? m : 0, h = n, j = p ? p : 0; wind.on("scroll.cz_parallax", function() { var b = $(document).height(), c = k.offset().top, e = (k.outerheight(), $(this).scrolltop()) + 250, q = math.round((c - e) * g), r = math.round((c - d / 2 - e) * g - j); if ( k.hasclass( 'cz_parallax_stop' ) ) { r = r<0 ? 0 : r; } "background" == h ? "v" == i && k.is(":in-viewport") ? k.css({ "background-position": "center " + -q + "px" }) : "h" == i && k.css({ "background-position": -q + "px center" }) : "foreground" == h && e < b && ("v" == i ? k.css({ transform: "translatey(" + r + "px)" }) : "h" == i && k.css({ transform: "translatex(" + r + "px)" })) }); // front if ( all == ( index + 1 ) ) { codevz_plus.runscroll(); } }); }, /* * convert persian/arabic numbers to english. */ convertnumbers: function( number, topersian ) { var persian = [ '۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹' ]; number = number.tolocalestring(); if ( topersian ) { return number.replace( /[0-9]/g, function( i ) { return persian[ +i ] }); } return number.replace( /[۰-۹]/g, function ( i ) { return persian.indexof( i ); }); }, /* * counter */ counter: function() { var all = $( '.cz_counter' ).length; $( '.cz_counter' ).codevz( 'counter', function(i) { var dis = $( this ), del = wind.width() <= 480 ? 0 : parseint( dis.data( 'delay' ) ) || 0, eln = $( '.cz_counter_num', dis ), org = eln.text(), per = math.ceil( org ).tolocalestring() == 'nan' ? true : false, num = parseint( codevz_plus.convertnumbers( org ) ), dur = parseint( dis.data( 'duration' ) ), com = !dis.data( 'disable-comma' ), tls = com ? math.ceil( num ).tolocalestring() : math.ceil( num ); // if duration is 0 if ( dur == 0 || wind.width() <= 768 ) { eln.html( per ? codevz_plus.convertnumbers( tls, true ) : tls ); return; } // if once done if ( dis.hasclass( 'done' ) ) { if ( num == '0' ) { dis.removeclass( 'done' ); } else { return; } } eln.html( per ? codevz_plus.convertnumbers( '0', true ) : '0' ); // on page scrolling wind.on( 'scroll.cz_counter', function() { if ( codevz_plus.inview( dis ) && ! dis.hasclass( 'done' ) ) { dis.addclass( 'done' ).delay( del ).prop( 'counter', 0 ).animate( { counter: num }, { duration: dur, easing: 'swing', step: function () { num = com ? math.ceil( this.counter ).tolocalestring() : math.ceil( this.counter ); eln.text( per ? codevz_plus.convertnumbers( num, true ) : num ); }, complete: function() { eln.text( per ? codevz_plus.convertnumbers( tls, true ) : tls ); } } ); } if ( ! $( '.cz_counter:not(.done)' ).length ) { wind.off( 'scroll.cz_counter' ); } }); // front if ( all == ( i + 1 ) ) { codevz_plus.runscroll(); } }); }, /* * accordion and toggle */ accordion: function() { $( '.cz_acc' ).codevz( 'acc', function() { var acc = $( this ), arrows = acc.data( 'arrows' ); // add arrows $( '.cz_acc_open_icon, .cz_acc_close_icon', acc ).remove(); $( '.cz_acc_child', acc ).append( '' ); // first open if ( acc.hasclass( 'cz_acc_first_open' ) ) { $( '> div > div:first', acc ).addclass( 'cz_isopen' ).find( '.cz_acc_child_content' ).show(); $( '> div > div:first .cz_acc_open_icon', acc ).hide().next('i').show(); } }); // onclick $( '.cz_acc_child' ).codevz( 'acc_child', function() { $( this ).off().on( 'click', function() { var dis = $( this ), clo = dis.closest('.cz_acc'), con = dis.next(); if ( con.is(':visible') ) { $( '.cz_acc_open_icon', dis ).show().next('i').hide(); con.slideup().parent().removeclass( 'cz_isopen' ); return; } if ( ! clo.hasclass( 'cz_acc_toggle' ) ) { $( '.cz_acc_open_icon', clo ).show().next('i').hide(); clo.find('.cz_acc_child_content').slideup().parent().removeclass( 'cz_isopen' ); } $( '.cz_acc_open_icon', dis ).hide().next('i').show(); con.slidetoggle().parent().toggleclass( 'cz_isopen' ); // fix grid if ( con.find( '.cz_grid' ).data( 'isotope' ) ) { settimeout(function() { con.find( '.cz_grid' ).isotope( 'layout' ); }, 250 ); } return false; }); }); }, /* * split content box to two section */ content_box: function() { $( '.cz_split_box_left, .cz_split_box_right' ).codevz( 'split_box', function() { var dis = $( this ), fnc = function() { $( '.cz_split_box', dis ).css( 'height', $( '.cz_box_front', dis ).height() ); }; dis.parent().find( '.cz_box_front_inner' ).off().codevzwatch( function() { fnc(); }); wind.on( 'resize.cz_split_box', function() { fnc(); }); }); // flip box live if ( $( '.compose-mode' ).length && $( '.cz_box_backed' ).length && ! $( '.cz_vc_disable_flipbox', parent.document.body ).length ) { $( '.cz_vc_preview', parent.document.body ).after( '
  • disable flip box
  • ' ); $( '.cz_vc_disable_flipbox', parent.document.body ).on( 'click', function() { $( this ).toggleclass( 'cz_vc_disable_flipbox_disabled' ); $( '.cz_box_backed, .cz_box_backed_disabled' ).toggleclass( 'cz_box_backed cz_box_backed_disabled' ); }); } }, /* * count down, count up and loop timer */ countdown: function() { $( '[data-countdown]' ).codevz( 'countdown', function() { var dis = $( this ), o = dis.data( 'countdown' ), d = new date( new date().valueof() + o.date * 1000 ), day_of = o.elapse ? '%n' : '%d', html_y = ( o.y !== '' ) ? '
  • %-y

    ' + o.y + '%!y:' + o.p + ';

  • ' : '', html_d = ( o.d !== '' && html_y ) ? '
  • ' + day_of + '

    ' + o.d + '%!n:' + o.p + ';

  • ' : ( ( o.d !== '' ) ? '
  • %d

    ' + o.d + '%!d:' + o.p + ';

  • ' : '' ), html_h = ( o.h !== '' ) ? '
  • %-h

    ' + o.h + '%!h:' + o.p + ';

  • ' : '', html_m = ( o.m !== '' ) ? '
  • %-m

    ' + o.m + '%!m:' + o.p + ';

  • ' : '', html_s = ( o.s !== '' ) ? '
  • %-s

    ' + o.s + '%!s:' + o.p + ';

  • ' : ''; // loop fix for local time. if ( o.type === 'loop' ) { // get old saved time. var save = localstorage.getitem( 'xtracountdownloop' + o.date ), now = new date( new date().valueof() + o.date * 1000 ), expr = dis.hasclass( 'xtra-off' ) ? 21600 : o.date; // fix page builder time field changes. if ( o.date != localstorage.getitem( 'xtracountdownloopold' + o.date ) ) { save = null; localstorage.setitem( 'xtracountdownloopold' + o.date, o.date ); } // reset. if ( ( new date( now ).gettime() - new date( save ).gettime() ) > ( expr * 1000 ) ) { save = null; localstorage.removeitem( 'xtracountdownloop' + o.date ); } if ( ! save ) { localstorage.setitem( 'xtracountdownloop' + o.date, now ); } else { d = new date( save ); } } dis.countdown( d, { elapse: o.elapse } ).on( 'update.countdown', function( e ) { dis.html( e.strftime( html_y + html_d + html_h + html_m + html_s ) ); }).on('finish.countdown', function( e ) { dis.html( e.strftime( '
  • 0
  • 0
  • 0
  • 0
  • ' ) ); dis.addclass( 'ended' ).append( '
  • ' + o.ex + '
  • ' ); }); }); }, /* * progress bar and inforgraphic icons */ progress_bar: function() { $( '.progress_bar' ).codevz( 'pbar', function(i) { var dis = $( this ), num = $( 'b', dis ).html(), del = i * 100; if ( wind.width() <= 768 ) { dis.addclass('done').find('span').css( 'width', num ); $( 'b', dis ).show().html( num ); return; } wind.on( 'scroll.cz_progress', function() { if ( codevz_plus.inview( dis ) && ! dis.hasclass( 'done' ) ) { dis.addclass('done').find('span').delay( del ).animate({width: parseint( num ) + '%'}, 400 ); $( 'b', dis ).delay( del ).prop( 'counter', 0 ).animate({ counter: parseint( num ) }, { duration: 2000, easing: 'swing', step: function() { $( 'b', dis ).show().text( math.ceil( this.counter ).tolocalestring() + '%' ); } }); } if ( ! $( '.progress_bar:not(.done)' ).length ) { wind.off( 'scroll.cz_progress' ); } }); }); $( '.cz_progress_bar_icon' ).codevz( 'pbar_icon', function() { var dis = $( this ), num = dis.data('number'); wind.on( 'scroll.cz_pbar_icon', function() { if ( codevz_plus.inview( dis ) && ! dis.hasclass( 'done' ) ) { dis.addclass('done').find('> div').animate({width: parseint( num ) + '%'}, 400 ); } if ( ! $( '.cz_progress_bar_icon:not(.done)' ).length ) { wind.off( 'scroll.cz_pbar_icon' ); } }); }); }, /* * image zoom on mouse hover */ image_zoom: function() { var all = $( '.cz_image_hover_zoom' ).length; $( '.cz_image_hover_zoom' ).codevz( 'zoom', function() { var dis = $( this ), img = $( 'a', dis ).attr('href'), big; wind.on( 'scroll.cz_zoom', function() { if ( codevz_plus.inview( dis, 1 ) && ! big ) { $( '.cz_img_for_zoom', dis ).detach(); $( 'img', dis ).addclass('cz_dimg'); $( 'a', dis ).append(''); big = $( '.cz_img_for_zoom', dis ); $( 'a', dis ).off().on({ mouseenter: function() { big.fadein( 'fast' ); }, mouseleave: function() { big.fadeout( 'fast' ); }, mousemove: function(e) { var y = e.pagey - $( e.currenttarget ).offset().top, x = e.pagex - $( e.currenttarget ).offset().left, ii = $( '.cz_dimg', dis ), yy = ( big.height() - ii.height() ) / ii.height(), xx = ( big.width() - ii.width() ) / ii.width(); big.css({ 'top': - ( y * yy ), 'left': - ( x * xx ) }); } }); } if ( all == $( '.cz_img_for_zoom' ).length ) { wind.off( 'scroll.cz_zoom' ); } }).scroll(); }); }, /* * google maps */ load_google_map_js: function() { var gmap = $( '.gmap' ), timeout = 0; if ( gmap.length && ! $( '#cz_google_map_api_js' ).length ) { var ak = gmap.data("api-key"); var sc = document.createelement( 'script' ); sc.setattribute( 'id','cz_google_map_api_js' ); sc.setattribute( 'src','https://maps.google.com/maps/api/js?key='+ak+'&callback=codevz_plus.load_google_map_js' ); document.head.appendchild(sc); } wind.on( 'scroll.xtra_gmap', function() { cleartimeout( timeout ); timeout = settimeout(function() { if ( gmap.length && codevz_plus.inview( gmap, 1 ) ) { if ( typeof google != 'undefined' ) { gmap.not( '.done' ).html( '' ).each(function() { var dis = $( this ); var id = dis.attr('id') ; var f = 'mapfucntion_'+id+ '();'; try{eval(f);}catch(e){console.log(e);} dis.addclass('done'); }); if ( $( '.gmap.done' ).length === gmap.length ) { wind.off( 'scroll.xtra_gmap' ); } } else { wind.trigger( 'scroll' ); } } }, 100 ); }); }, /* * tilt fx */ tilt: function() { $( '[data-tilt]' ).codevz( 'tilt', function() { var tilt = $( this ).tilt({ maxtilt: 6 }); tilt.on('tilt.mouseenter', function() { $( this ).css({ 'animation-name': 'none' }); }); }); }, /* * menus hover fx */ menus: function() { $( '.cz-menu-hover-text .sf-menu > .cz > a > span' ).codevz( 'mht', function() { $( this ).after( $( this ).clone().addclass( 'cz-menu-hover-span' ) ); }); }, separator: function() { // width related to vc full width $( '[data-vc-full-width] .cz_sep, [data-vc-full-width] .cz_sep2' ).codevz( 'cz_sep', function() { var en = $( this ), vc = en.closest( '[data-vc-full-width]' ), sc = vc.data( 'vc-stretch-content' ); if ( vc.length ) { wind.on( 'resize.cz_separator', function() { settimeout(function() { var is_s2 = en.closest( '.cz_sep2' ).length ? true : false, rtl = body.hasclass( 'rtl' ), left = sc ? '0' : ( parseint( vc.css( 'left' ) ) + ( rtl ? 15 : -16 ) ) + 'px', left = ( is_s2 && rtl ) ? '-' + left : left; en.css( 'width', sc ? '' : parseint( vc.css( 'width' ) ) + 1 ); en.css( 'left', left ); }, 250 ); }); } }); if ( ! $( '#cz_sep_style' ).length ) { $( 'head' ).append( '' ); } $( '.cz_separator' ).codevz( 'separator', function() { var dis = $( this ); var id = dis.attr( 'id'); var bc = dis.data( 'before-color' ); var ac = dis.data( 'after-color' ); var cc = $( 'style#cz_sep_style' ).html(); if ( typeof ac != "undefined" ) {ac='#'+id+ac}else{ac='';} $( 'style#cz_sep_style' ).html(cc+'#'+id+bc+ac); }); } }; })(jquery); /* codevz_plus */ jquery(document).ready(function() { codevz_plus.init(); });