!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","../keycode","../safe-active-element","../unique-id","../version","../widget"],t):t(jQuery)}(function(l){"use strict";var a;return l.widget("ui.tabs",{version:"1.13.3",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(a=/#.*$/,function(t){var e=t.href.replace(a,""),i=location.href.replace(a,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1<t.hash.length&&e===i}),_create:function(){var e=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),Array.isArray(t.disabled)&&(t.disabled=l.uniqueSort(t.disabled.concat(l.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(t.active):this.active=l(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var i=this.options.active,t=this.options.collapsible,a=location.hash.substring(1);return null===i&&(a&&this.tabs.each(function(t,e){if(l(e).attr("aria-controls")===a)return i=t,!1}),null!==(i=null===i?this.tabs.index(this.tabs.filter(".ui-tabs-active")):i)&&-1!==i||(i=!!this.tabs.length&&0)),!1!==i&&-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!t&&0),i=!t&&!1===i&&this.anchors.length?0:i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):l()}},_tabKeydown:function(t){var e=l(l.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(e),a=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case l.ui.keyCode.RIGHT:case l.ui.keyCode.DOWN:i++;break;case l.ui.keyCode.UP:case l.ui.keyCode.LEFT:a=!1,i--;break;case l.ui.keyCode.END:i=this.anchors.length-1;break;case l.ui.keyCode.HOME:i=0;break;case l.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case l.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,a),t.ctrlKey||t.metaKey||(e.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===l.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===l.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===l.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,e){var i=this.tabs.length-1;for(;-1!==l.inArray(t=(t=i<t?0:t)<0?i:t,this.options.disabled);)t=e?t+1:t-1;return t},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"===t?this._activate(e):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e))},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=l.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!l.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=l()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=l()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var o=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){l(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){l(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return l("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=l(),this.anchors.each(function(t,e){var i,a,s,n=l(e).uniqueId().attr("id"),h=l(e).closest("li"),r=h.attr("aria-controls");o._isLocal(e)?(s=(i=e.hash).substring(1),a=o.element.find(o._sanitizeSelector(i))):(s=h.attr("aria-controls")||l({}).uniqueId()[0].id,(a=o.element.find(i="#"+s)).length||(a=o._createPanel(s)).insertAfter(o.panels[t-1]||o.tablist),a.attr("aria-live","polite")),a.length&&(o.panels=o.panels.add(a)),r&&h.data("ui-tabs-aria-controls",r),h.attr({"aria-controls":s,"aria-labelledby":n}),a.attr("aria-labelledby",n)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return l("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(Array.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=l(e),!0===t||-1!==l.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&l.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=l(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=l(this).outerHeight(!0)}),this.panels.each(function(){l(this).height(Math.max(0,i-l(this).innerHeight()+l(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,l(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,a=l(t.currentTarget).closest("li"),s=a[0]===i[0],n=s&&e.collapsible,h=n?l():this._getPanelForTab(a),r=i.length?this._getPanelForTab(i):l(),i={oldTab:i,oldPanel:r,newTab:n?l():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||s&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!n&&this.tabs.index(a),this.active=s?l():a,this.xhr&&this.xhr.abort(),r.length||h.length||l.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,a=e.newPanel,s=e.oldPanel;function n(){i.running=!1,i._trigger("activate",t,e)}function h(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&i.options.show?i._show(a,i.options.show,n):(a.show(),n())}this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),h()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),s.hide(),h()),s.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&s.length?e.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===l(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=t.length?t:this.active).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:l.noop}))},_findActive:function(t){return!1===t?l():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+l.escapeSelector(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){l.data(this,"ui-tabs-destroy")?l(this).remove():l(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=l(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),Array.isArray(t)?l.map(t,function(t){return t!==i?t:null}):l.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==l.inArray(t,e))return;e=Array.isArray(e)?l.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,a){t=this._getIndex(t);function s(t,e){"abort"===e&&n.panels.stop(!1,!0),n._removeClass(i,"ui-tabs-loading"),h.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr}var n=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),h=this._getPanelForTab(i),r={tab:i,panel:h};this._isLocal(t[0])||(this.xhr=l.ajax(this._ajaxSettings(t,a,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),h.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){h.html(t),n._trigger("load",a,r),s(i,e)},1)}).fail(function(t,e){setTimeout(function(){s(t,e)},1)})))},_ajaxSettings:function(t,i,a){var s=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return s._trigger("beforeLoad",i,l.extend({jqXHR:t,ajaxSettings:e},a))}}},_getPanelForTab:function(t){t=l(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}}),!1!==l.uiBackCompat&&l.widget("ui.tabs",l.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),l.ui.tabs});
(function(e){var t=e.event,n,r;n=t.special.debouncedresize={setup:function(){e(this).on("resize",n.handler)},teardown:function(){e(this).off("resize",n.handler)},handler:function(e,i){var s=this,o=arguments,u=function(){e.type="debouncedresize";t.dispatch.apply(s,o)};if(r){clearTimeout(r)}i?u():r=setTimeout(u,n.threshold)},threshold:150}})(jQuery);
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery||window.Zepto)}(function(c){function e(){}function d(e,t){m.ev.on(x+e+I,t)}function p(e,t,n,o){var i=document.createElement("div");return i.className="mfp-"+e,n&&(i.innerHTML=n),o?t&&t.appendChild(i):(i=c(i),t&&i.appendTo(t)),i}function u(e,t){m.ev.triggerHandler(x+e,t),m.st.callbacks&&(e=e.charAt(0).toLowerCase()+e.slice(1),m.st.callbacks[e])&&m.st.callbacks[e].apply(m,Array.isArray(t)?t:[t])}function f(e){return e===A&&m.currTemplate.closeBtn||(m.currTemplate.closeBtn=c(m.st.closeMarkup.replace("%title%",m.st.tClose)),A=e),m.currTemplate.closeBtn}function r(){c.magnificPopup.instance||((m=new e).init(),c.magnificPopup.instance=m)}function a(){y&&(v.after(y.addClass(l)).detach(),y=null)}function i(){n&&c(document.body).removeClass(n)}function t(){i(),m.req&&m.req.abort()}var m,o,g,s,h,A,l,v,y,n,w="Close",F="BeforeClose",C="MarkupParse",b="Open",j="Change",x="mfp",I="."+x,T="mfp-ready",N="mfp-removing",k="mfp-prevent-close",P=!!window.jQuery,_=c(window),S=(c.magnificPopup={instance:null,proto:e.prototype={constructor:e,init:function(){var e=navigator.appVersion;m.isLowIE=m.isIE8=document.all&&!document.addEventListener,m.isAndroid=/android/gi.test(e),m.isIOS=/iphone|ipad|ipod/gi.test(e),m.supportsTransition=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1}(),m.probablyMobile=m.isAndroid||m.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),g=c(document),m.popupsCache={}},open:function(e){if(!1===e.isObj){m.items=e.items.toArray(),m.index=0;for(var t,n=e.items,o=0;o<n.length;o++)if((t=(t=n[o]).parsed?t.el[0]:t)===e.el[0]){m.index=o;break}}else m.items=Array.isArray(e.items)?e.items:[e.items],m.index=e.index||0;if(!m.isOpen){m.types=[],h="",e.mainEl&&e.mainEl.length?m.ev=e.mainEl.eq(0):m.ev=g,e.key?(m.popupsCache[e.key]||(m.popupsCache[e.key]={}),m.currTemplate=m.popupsCache[e.key]):m.currTemplate={},m.st=c.extend(!0,{},c.magnificPopup.defaults,e),m.fixedContentPos="auto"===m.st.fixedContentPos?!m.probablyMobile:m.st.fixedContentPos,m.st.modal&&(m.st.closeOnContentClick=!1,m.st.closeOnBgClick=!1,m.st.showCloseBtn=!1,m.st.enableEscapeKey=!1),m.bgOverlay||(m.bgOverlay=p("bg").on("click"+I,function(){m.close()}),m.wrap=p("wrap").attr("tabindex",-1).on("click"+I,function(e){m._checkIfClose(e.target)&&m.close()}),m.container=p("container",m.wrap)),m.contentContainer=p("content"),m.st.preloader&&(m.preloader=p("preloader",m.container,m.st.tLoading));var i=c.magnificPopup.modules;for(o=0;o<i.length;o++){var r=(r=i[o]).charAt(0).toUpperCase()+r.slice(1);m["init"+r].call(m)}u("BeforeOpen"),m.st.showCloseBtn&&(m.st.closeBtnInside?(d(C,function(e,t,n,o){n.close_replaceWith=f(o.type)}),h+=" mfp-close-btn-in"):m.wrap.append(f())),m.st.alignTop&&(h+=" mfp-align-top"),m.fixedContentPos?m.wrap.css({overflow:m.st.overflowY,overflowX:"hidden",overflowY:m.st.overflowY}):m.wrap.css({top:_.scrollTop(),position:"absolute"}),!1!==m.st.fixedBgPos&&("auto"!==m.st.fixedBgPos||m.fixedContentPos)||m.bgOverlay.css({height:g.height(),position:"absolute"}),m.st.enableEscapeKey&&g.on("keyup"+I,function(e){27===e.keyCode&&m.close()}),_.on("resize"+I,function(){m.updateSize()}),m.st.closeOnContentClick||(h+=" mfp-auto-cursor"),h&&m.wrap.addClass(h);var a=m.wH=_.height(),s={},l=(m.fixedContentPos&&m._hasScrollBar(a)&&(l=m._getScrollbarSize())&&(s.marginRight=l),m.fixedContentPos&&(m.isIE7?c("body, html").css("overflow","hidden"):s.overflow="hidden"),m.st.mainClass);return m.isIE7&&(l+=" mfp-ie7"),l&&m._addClassToMFP(l),m.updateItemHTML(),u("BuildControls"),c("html").css(s),m.bgOverlay.add(m.wrap).prependTo(m.st.prependTo||c(document.body)),m._lastFocusedEl=document.activeElement,setTimeout(function(){m.content?(m._addClassToMFP(T),m._setFocus()):m.bgOverlay.addClass(T),g.on("focusin"+I,m._onFocusIn)},16),m.isOpen=!0,m.updateSize(a),u(b),e}m.updateItemHTML()},close:function(){m.isOpen&&(u(F),m.isOpen=!1,m.st.removalDelay&&!m.isLowIE&&m.supportsTransition?(m._addClassToMFP(N),setTimeout(function(){m._close()},m.st.removalDelay)):m._close())},_close:function(){u(w);var e=N+" "+T+" ";m.bgOverlay.detach(),m.wrap.detach(),m.container.empty(),m.st.mainClass&&(e+=m.st.mainClass+" "),m._removeClassFromMFP(e),m.fixedContentPos&&(e={marginRight:""},m.isIE7?c("body, html").css("overflow",""):e.overflow="",c("html").css(e)),g.off("keyup.mfp focusin"+I),m.ev.off(I),m.wrap.attr("class","mfp-wrap").removeAttr("style"),m.bgOverlay.attr("class","mfp-bg"),m.container.attr("class","mfp-container"),!m.st.showCloseBtn||m.st.closeBtnInside&&!0!==m.currTemplate[m.currItem.type]||m.currTemplate.closeBtn&&m.currTemplate.closeBtn.detach(),m.st.autoFocusLast&&m._lastFocusedEl&&c(m._lastFocusedEl).trigger("focus"),m.currItem=null,m.content=null,m.currTemplate=null,m.prevHeight=0,u("AfterClose")},updateSize:function(e){var t;m.isIOS?(t=document.documentElement.clientWidth/window.innerWidth,t=window.innerHeight*t,m.wrap.css("height",t),m.wH=t):m.wH=e||_.height(),m.fixedContentPos||m.wrap.css("height",m.wH),u("Resize")},updateItemHTML:function(){var e=m.items[m.index],t=(m.contentContainer.detach(),m.content&&m.content.detach(),(e=e.parsed?e:m.parseEl(m.index)).type),n=(u("BeforeChange",[m.currItem?m.currItem.type:"",t]),m.currItem=e,m.currTemplate[t]||(n=!!m.st[t]&&m.st[t].markup,u("FirstMarkupParse",n),m.currTemplate[t]=!n||c(n)),s&&s!==e.type&&m.container.removeClass("mfp-"+s+"-holder"),m["get"+t.charAt(0).toUpperCase()+t.slice(1)](e,m.currTemplate[t]));m.appendContent(n,t),e.preloaded=!0,u(j,e),s=e.type,m.container.prepend(m.contentContainer),u("AfterChange")},appendContent:function(e,t){(m.content=e)?m.st.showCloseBtn&&m.st.closeBtnInside&&!0===m.currTemplate[t]?m.content.find(".mfp-close").length||m.content.append(f()):m.content=e:m.content="",u("BeforeAppend"),m.container.addClass("mfp-"+t+"-holder"),m.contentContainer.append(m.content)},parseEl:function(e){var t,n=m.items[e];if((n=n.tagName?{el:c(n)}:(t=n.type,{data:n,src:n.src})).el){for(var o=m.types,i=0;i<o.length;i++)if(n.el.hasClass("mfp-"+o[i])){t=o[i];break}n.src=n.el.attr("data-mfp-src"),n.src||(n.src=n.el.attr("href"))}return n.type=t||m.st.type||"inline",n.index=e,n.parsed=!0,m.items[e]=n,u("ElementParse",n),m.items[e]},addGroup:function(t,n){function e(e){e.mfpEl=this,m._openClick(e,t,n)}var o="click.magnificPopup";(n=n||{}).mainEl=t,n.items?(n.isObj=!0,t.off(o).on(o,e)):(n.isObj=!1,n.delegate?t.off(o).on(o,n.delegate,e):(n.items=t).off(o).on(o,e))},_openClick:function(e,t,n){var o=(void 0!==n.midClick?n:c.magnificPopup.defaults).midClick;if(o||!(2===e.which||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)){o=(void 0!==n.disableOn?n:c.magnificPopup.defaults).disableOn;if(o)if("function"==typeof o){if(!o.call(m))return!0}else if(_.width()<o)return!0;e.type&&(e.preventDefault(),m.isOpen)&&e.stopPropagation(),n.el=c(e.mfpEl),n.delegate&&(n.items=t.find(n.delegate)),m.open(n)}},updateStatus:function(e,t){var n;m.preloader&&(o!==e&&m.container.removeClass("mfp-s-"+o),n={status:e,text:t=t||"loading"!==e?t:m.st.tLoading},u("UpdateStatus",n),e=n.status,t=n.text,m.st.allowHTMLInStatusIndicator?m.preloader.html(t):m.preloader.text(t),m.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),m.container.addClass("mfp-s-"+e),o=e)},_checkIfClose:function(e){if(!c(e).closest("."+k).length){var t=m.st.closeOnContentClick,n=m.st.closeOnBgClick;if(t&&n)return!0;if(!m.content||c(e).closest(".mfp-close").length||m.preloader&&e===m.preloader[0])return!0;if(e===m.content[0]||c.contains(m.content[0],e)){if(t)return!0}else if(n&&c.contains(document,e))return!0;return!1}},_addClassToMFP:function(e){m.bgOverlay.addClass(e),m.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),m.wrap.removeClass(e)},_hasScrollBar:function(e){return(m.isIE7?g.height():document.body.scrollHeight)>(e||_.height())},_setFocus:function(){(m.st.focus?m.content.find(m.st.focus).eq(0):m.wrap).trigger("focus")},_onFocusIn:function(e){if(e.target!==m.wrap[0]&&!c.contains(m.wrap[0],e.target))return m._setFocus(),!1},_parseMarkup:function(i,e,t){var r;t.data&&(e=c.extend(t.data,e)),u(C,[i,e,t]),c.each(e,function(e,t){if(void 0===t||!1===t)return!0;var n,o;1<(r=e.split("_")).length?0<(n=i.find(I+"-"+r[0])).length&&("replaceWith"===(o=r[1])?n[0]!==t[0]&&n.replaceWith(t):"img"===o?n.is("img")?n.attr("src",t):n.replaceWith(c("<img>").attr("src",t).attr("class",n.attr("class"))):n.attr(r[1],t)):m.st.allowHTMLInTemplate?i.find(I+"-"+e).html(t):i.find(I+"-"+e).text(t)})},_getScrollbarSize:function(){var e;return void 0===m.scrollbarSize&&((e=document.createElement("div")).style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),m.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)),m.scrollbarSize}},modules:[],open:function(e,t){return r(),(e=e?c.extend(!0,{},e):{}).isObj=!0,e.index=t||0,this.instance.open(e)},close:function(){return c.magnificPopup.instance&&c.magnificPopup.instance.close()},registerModule:function(e,t){t.options&&(c.magnificPopup.defaults[e]=t.options),c.extend(this.proto,t.proto),this.modules.push(e)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&#215;</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0,allowHTMLInStatusIndicator:!1,allowHTMLInTemplate:!1}},c.fn.magnificPopup=function(e){r();var t,n,o,i=c(this);return"string"==typeof e?"open"===e?(t=P?i.data("magnificPopup"):i[0].magnificPopup,n=parseInt(arguments[1],10)||0,o=t.items?t.items[n]:(o=i,(o=t.delegate?o.find(t.delegate):o).eq(n)),m._openClick({mfpEl:o},i,t)):m.isOpen&&m[e].apply(m,Array.prototype.slice.call(arguments,1)):(e=c.extend(!0,{},e),P?i.data("magnificPopup",e):i[0].magnificPopup=e,m.addGroup(i,e)),i},"inline"),E=(c.magnificPopup.registerModule(S,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){m.types.push(S),d(w+"."+S,function(){a()})},getInline:function(e,t){var n,o,i;return a(),e.src?(n=m.st.inline,(o=c(e.src)).length?((i=o[0].parentNode)&&i.tagName&&(v||(l=n.hiddenClass,v=p(l),l="mfp-"+l),y=o.after(v).detach().removeClass(l)),m.updateStatus("ready")):(m.updateStatus("error",n.tNotFound),o=c("<div>")),e.inlineElement=o):(m.updateStatus("ready"),m._parseMarkup(t,{},e),t)}}}),"ajax");c.magnificPopup.registerModule(E,{options:{settings:null,cursor:"mfp-ajax-cur",tError:"The content could not be loaded."},proto:{initAjax:function(){m.types.push(E),n=m.st.ajax.cursor,d(w+"."+E,t),d("BeforeChange."+E,t)},getAjax:function(o){n&&c(document.body).addClass(n),m.updateStatus("loading");var e=c.extend({url:o.src,success:function(e,t,n){e={data:e,xhr:n};u("ParseAjax",e),m.appendContent(c(e.data),E),o.finished=!0,i(),m._setFocus(),setTimeout(function(){m.wrap.addClass(T)},16),m.updateStatus("ready"),u("AjaxContentAdded")},error:function(){i(),o.finished=o.loadError=!0,m.updateStatus("error",m.st.ajax.tError.replace("%url%",o.src))}},m.st.ajax.settings);return m.req=c.ajax(e),""}}});var z;c.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:"The image could not be loaded."},proto:{initImage:function(){var e=m.st.image,t=".image";m.types.push("image"),d(b+t,function(){"image"===m.currItem.type&&e.cursor&&c(document.body).addClass(e.cursor)}),d(w+t,function(){e.cursor&&c(document.body).removeClass(e.cursor),_.off("resize"+I)}),d("Resize"+t,m.resizeImage),m.isLowIE&&d("AfterChange",m.resizeImage)},resizeImage:function(){var e,t=m.currItem;t&&t.img&&m.st.image.verticalFit&&(e=0,m.isLowIE&&(e=parseInt(t.img.css("padding-top"),10)+parseInt(t.img.css("padding-bottom"),10)),t.img.css("max-height",m.wH-e))},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,z&&clearInterval(z),e.isCheckingImgSize=!1,u("ImageHasSize",e),e.imgHidden)&&(m.content&&m.content.removeClass("mfp-loading"),e.imgHidden=!1)},findImageSize:function(t){function n(e){z&&clearInterval(z),z=setInterval(function(){0<i.naturalWidth?m._onImageHasSize(t):(200<o&&clearInterval(z),3===++o?n(10):40===o?n(50):100===o&&n(500))},e)}var o=0,i=t.img[0];n(1)},getImage:function(e,t){function n(){e&&(e.img.off(".mfploader"),e===m.currItem&&(m._onImageHasSize(e),m.updateStatus("error",a.tError.replace("%url%",e.src))),e.hasSize=!0,e.loaded=!0,e.loadError=!0)}function o(){e&&(e.img[0].complete?(e.img.off(".mfploader"),e===m.currItem&&(m._onImageHasSize(e),m.updateStatus("ready")),e.hasSize=!0,e.loaded=!0,u("ImageLoadComplete")):++r<200?setTimeout(o,100):n())}var i,r=0,a=m.st.image,s=t.find(".mfp-img");return s.length&&((i=document.createElement("img")).className="mfp-img",e.el&&e.el.find("img").length&&(i.alt=e.el.find("img").attr("alt")),e.img=c(i).on("load.mfploader",o).on("error.mfploader",n),i.src=e.src,s.is("img")&&(e.img=e.img.clone()),0<(i=e.img[0]).naturalWidth?e.hasSize=!0:i.width||(e.hasSize=!1)),m._parseMarkup(t,{title:function(e){if(e.data&&void 0!==e.data.title)return e.data.title;var t=m.st.image.titleSrc;if(t){if("function"==typeof t)return t.call(m,e);if(e.el)return e.el.attr(t)||""}return""}(e),img_replaceWith:e.img},e),m.resizeImage(),e.hasSize?(z&&clearInterval(z),e.loadError?(t.addClass("mfp-loading"),m.updateStatus("error",a.tError.replace("%url%",e.src))):(t.removeClass("mfp-loading"),m.updateStatus("ready"))):(m.updateStatus("loading"),e.loading=!0,e.hasSize||(e.imgHidden=!0,t.addClass("mfp-loading"),m.findImageSize(e))),t}}});function O(e){var t;m.currTemplate[L]&&(t=m.currTemplate[L].find("iframe")).length&&(e||(t[0].src="//about:blank"),m.isIE8)&&t.css("display",e?"block":"none")}function M(e){var t=m.items.length;return t-1<e?e-t:e<0?t+e:e}function D(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)}c.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,t,n,o,i,r,a=m.st.zoom,s=".zoom";a.enabled&&m.supportsTransition&&(t=a.duration,n=function(e){var e=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),t="all "+a.duration/1e3+"s "+a.easing,n={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},o="transition";return n["-webkit-"+o]=n["-moz-"+o]=n["-o-"+o]=n[o]=t,e.css(n),e},o=function(){m.content.css("visibility","visible")},d("BuildControls"+s,function(){m._allowZoom()&&(clearTimeout(i),m.content.css("visibility","hidden"),(e=m._getItemToZoom())?((r=n(e)).css(m._getOffset()),m.wrap.append(r),i=setTimeout(function(){r.css(m._getOffset(!0)),i=setTimeout(function(){o(),setTimeout(function(){r.remove(),e=r=null,u("ZoomAnimationEnded")},16)},t)},16)):o())}),d(F+s,function(){if(m._allowZoom()){if(clearTimeout(i),m.st.removalDelay=t,!e){if(!(e=m._getItemToZoom()))return;r=n(e)}r.css(m._getOffset(!0)),m.wrap.append(r),m.content.css("visibility","hidden"),setTimeout(function(){r.css(m._getOffset())},16)}}),d(w+s,function(){m._allowZoom()&&(o(),r&&r.remove(),e=null)}))},_allowZoom:function(){return"image"===m.currItem.type},_getItemToZoom:function(){return!!m.currItem.hasSize&&m.currItem.img},_getOffset:function(e){var e=e?m.currItem.img:m.st.zoom.opener(m.currItem.el||m.currItem),t=e.offset(),n=parseInt(e.css("padding-top"),10),o=parseInt(e.css("padding-bottom"),10),e=(t.top-=c(window).scrollTop()-n,{width:e.width(),height:(P?e.innerHeight():e[0].offsetHeight)-o-n});return(B=void 0===B?void 0!==document.createElement("p").style.MozTransform:B)?e["-moz-transform"]=e.transform="translate("+t.left+"px,"+t.top+"px)":(e.left=t.left,e.top=t.top),e}}});var B,L="iframe",H=(c.magnificPopup.registerModule(L,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){m.types.push(L),d("BeforeChange",function(e,t,n){t!==n&&(t===L?O():n===L&&O(!0))}),d(w+"."+L,function(){O()})},getIframe:function(e,t){var n=e.src,o=m.st.iframe,i=(c.each(o.patterns,function(){if(-1<n.indexOf(this.index))return this.id&&(n="string"==typeof this.id?n.substr(n.lastIndexOf(this.id)+this.id.length,n.length):this.id.call(this,n)),n=this.src.replace("%id%",n),!1}),{});return o.srcAction&&(i[o.srcAction]=n),m._parseMarkup(t,i,e),m.updateStatus("ready"),t}}}),c.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%",langDir:null,loop:!0},proto:{initGallery:function(){var r=m.st.gallery,e=".mfp-gallery";if(m.direction=!0,!r||!r.enabled)return!1;r.langDir||(r.langDir=document.dir||"ltr"),h+=" mfp-gallery",d(b+e,function(){r.navigateByImgClick&&m.wrap.on("click"+e,".mfp-img",function(){if(1<m.items.length)return m.next(),!1}),g.on("keydown"+e,function(e){37===e.keyCode?"rtl"===r.langDir?m.next():m.prev():39===e.keyCode&&("rtl"===r.langDir?m.prev():m.next())}),m.updateGalleryButtons()}),d("UpdateStatus"+e,function(){m.updateGalleryButtons()}),d("UpdateStatus"+e,function(e,t){t.text&&(t.text=D(t.text,m.currItem.index,m.items.length))}),d(C+e,function(e,t,n,o){var i=m.items.length;n.counter=1<i?D(r.tCounter,o.index,i):""}),d("BuildControls"+e,function(){var e,t,n,o,i;1<m.items.length&&r.arrows&&!m.arrowLeft&&(t="rtl"===r.langDir?(o=r.tNext,e=r.tPrev,i="next","prev"):(o=r.tPrev,e=r.tNext,i="prev","next"),n=r.arrowMarkup,o=m.arrowLeft=c(n.replace(/%title%/gi,o).replace(/%action%/gi,i).replace(/%dir%/gi,"left")).addClass(k),i=m.arrowRight=c(n.replace(/%title%/gi,e).replace(/%action%/gi,t).replace(/%dir%/gi,"right")).addClass(k),"rtl"===r.langDir?(m.arrowNext=o,m.arrowPrev=i):(m.arrowNext=i,m.arrowPrev=o),o.on("click",function(){"rtl"===r.langDir?m.next():m.prev()}),i.on("click",function(){"rtl"===r.langDir?m.prev():m.next()}),m.container.append(o.add(i)))}),d(j+e,function(){m._preloadTimeout&&clearTimeout(m._preloadTimeout),m._preloadTimeout=setTimeout(function(){m.preloadNearbyImages(),m._preloadTimeout=null},16)}),d(w+e,function(){g.off(e),m.wrap.off("click"+e),m.arrowRight=m.arrowLeft=null})},next:function(){var e=M(m.index+1);if(!m.st.gallery.loop&&0===e)return!1;m.direction=!0,m.index=e,m.updateItemHTML()},prev:function(){var e=m.index-1;if(!m.st.gallery.loop&&e<0)return!1;m.direction=!1,m.index=M(e),m.updateItemHTML()},goTo:function(e){m.direction=e>=m.index,m.index=e,m.updateItemHTML()},preloadNearbyImages:function(){for(var e=m.st.gallery.preload,t=Math.min(e[0],m.items.length),n=Math.min(e[1],m.items.length),o=1;o<=(m.direction?n:t);o++)m._preloadItem(m.index+o);for(o=1;o<=(m.direction?t:n);o++)m._preloadItem(m.index-o)},_preloadItem:function(e){var t;e=M(e),m.items[e].preloaded||((t=m.items[e]).parsed||(t=m.parseEl(e)),u("LazyLoad",t),"image"===t.type&&(t.img=c('<img class="mfp-img" />').on("load.mfploader",function(){t.hasSize=!0}).on("error.mfploader",function(){t.hasSize=!0,t.loadError=!0,u("LazyLoadError",t)}).attr("src",t.src)),t.preloaded=!0)},updateGalleryButtons:function(){m.st.gallery.loop||"object"!=typeof m.arrowPrev||null===m.arrowPrev||(0===m.index?m.arrowPrev.hide():m.arrowPrev.show(),m.index===m.items.length-1?m.arrowNext.hide():m.arrowNext.show())}}}),"retina");c.magnificPopup.registerModule(H,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){var n,o;1<window.devicePixelRatio&&(n=m.st.retina,o=n.ratio,1<(o=isNaN(o)?o():o))&&(d("ImageHasSize."+H,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/o,width:"100%"})}),d("ElementParse."+H,function(e,t){t.src=n.replaceSrc(t,o)}))}}}),r()});
(function($){
"use strict";
$.fn.mfnMenu=function(options){
var menu=$(this);
var defaults={
addLast: false,
arrows: false,
delay: 100,
hoverClass: 'hover',
mobileInit: 768,
responsive: true
};
options=$.extend(defaults, options);
var init=function(){
$('li:has(ul)', menu).addClass('submenu');
$('li:has(ul)', menu).append('<a class="menu-toggle" href="#" aria-label="'+ mfn.accessibility.translation.toggleSubmenu +'"></a>').on('click', '.menu-toggle', function(e){
e.preventDefault();
if($('#Header_creative.dropdown.scroll').length){
$('#Header_creative').css('overflow-y','visible').css('overflow-y','hidden');
}});
menu.children('li:has(ul.mfn-megamenu)').addClass('mfn-megamenu-parent');
$('.submenu ul li:last-child', menu).addClass('last-item');
if(options.addLast){
$('> li:last-child', menu).addClass('last')
.prev().addClass('last');
}
if(options.arrows){
$('li ul li:has(ul) > a', menu).append('<i class="menu-arrow icon-right-open"></i>');
}};
var doMenu=function(){
if((window.innerWidth >=options.mobileInit)||(!options.responsive)){
$('> li, ul:not(.mfn-megamenu) li', menu).on('mouseenter', function(){
$(this).stop(true, true).addClass(options.hoverClass);
$(this).children('ul').stop(true, true).fadeIn(options.delay);
}).on('mouseleave', function(){
$(this).stop(true, true).removeClass(options.hoverClass);
$(this).children('ul').stop(true, true).fadeOut(options.delay);
});
}else{
$('li', menu).off('hover');
$('li > .menu-toggle', menu).off('click').on('click', function(e){
e.preventDefault();
var el=$(this).closest('li');
if(el.hasClass(options.hoverClass)){
el.removeClass(options.hoverClass)
.children('ul').stop(true, true).fadeOut(options.delay);
}else{
el.addClass(options.hoverClass)
.children('ul').stop(true, true).fadeIn(options.delay);
}});
}};
$(window).on('resize', doMenu);
var __constructor=function(){
init();
doMenu();
};
__constructor();
};})(jQuery);
(function(e){e.fn.visible=function(t,n,r){var i=e(this).eq(0),s=i.get(0),o=e(window),u=o.scrollTop(),a=u+o.height(),f=o.scrollLeft(),l=f+o.width(),c=i.offset().top,h=c+i.height(),p=i.offset().left,d=p+i.width(),v=t===true?h:c,m=t===true?c:h,g=t===true?d:p,y=t===true?p:d,b=n===true?s.offsetWidth*s.offsetHeight:true,r=r?r:"both";if(r==="both")return!!b&&m<=a&&v>=u&&y<=l&&g>=f;else if(r==="vertical")return!!b&&m<=a&&v>=u;else if(r==="horizontal")return!!b&&y<=l&&g>=f}})(jQuery);
function animateElement(){jQuery(".animate").each(jQuery(window).width()>=96?function(a,n){var n=jQuery(n),i=jQuery(this).attr("data-anim-type"),t=jQuery(this).attr("data-anim-delay");n.visible(!0)&&setTimeout(function(){n.addClass(i)},t)}:function(a,n){var n=jQuery(n),i=jQuery(this).attr("data-anim-type"),t=jQuery(this).attr("data-anim-delay");setTimeout(function(){n.addClass(i)},t)})}function randomClass(){var a=Math.ceil(Math.random()*classAmount);return classesArray[a]}function animateOnce(a,n){"random"==n&&(n=randomClass()),jQuery(a).removeClass("trigger infinite "+triggerClasses).addClass("trigger").addClass(n).one("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){jQuery(this).removeClass("trigger infinite "+triggerClasses)})}function animateInfinite(a,n){"random"==n&&(n=randomClass()),jQuery(a).removeClass("trigger infinite "+triggerClasses).addClass("trigger infinite").addClass(n).one("webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend",function(){jQuery(this).removeClass("trigger infinite "+triggerClasses)})}function animateEnd(a){jQuery(a).removeClass("trigger infinite "+triggerClasses)}jQuery(document).ready(function(){jQuery("html").hasClass("no-js")&&jQuery("html").removeClass("no-js").addClass("js"),animateElement()}),jQuery(window).on('resize',function(){animateElement()}),jQuery(window).on('scroll',function(){animateElement(),jQuery(window).scrollTop()+jQuery(window).height()==jQuery(document).height()&&animateElement()});var triggerClasses="flash strobe shakeH shakeV bounce tada wave spinCW spinCCW slingshotCW slingshotCCW wobble pulse pulsate heartbeat panic",classesArray=new Array,classesArray=triggerClasses.split(" "),classAmount=classesArray.length;
!function(t){"use strict";t.fn.enllax=function(r){var a=t(window).height(),n=t(document).height(),o=t.extend({ratio:0,type:"background",direction:"vertical"},r),e=t("[data-enllax-ratio]");e.each(function(){var r,e,s,i=t(this),c=i.offset().top,l=i.outerHeight(),p=i.data("enllax-ratio"),d=i.data("enllax-type"),x=i.data("enllax-direction");r=p?p:o.ratio,e=d?d:o.type,s=x?x:o.direction;var f=Math.round(c*r),u=Math.round((c-a/2+l)*r);"background"==e?"vertical"==s?i.css({"background-position":"center "+-f+"px"}):"horizontal"==s&&i.css({"background-position":-f+"px center"}):"foreground"==e&&("vertical"==s?i.css({"-webkit-transform":"translateY("+u+"px)","-moz-transform":"translateY("+u+"px)",transform:"translateY("+u+"px)"}):"horizontal"==s&&i.css({"-webkit-transform":"translateX("+u+"px)","-moz-transform":"translateX("+u+"px)",transform:"translateX("+u+"px)"})),t(window).on("scroll",function(){var o=t(this).scrollTop();f=Math.round((c-o)*r),u=Math.round((c-a/2+l-o)*r),"background"==e?"vertical"==s?i.css({"background-position":"center "+-f+"px"}):"horizontal"==s&&i.css({"background-position":-f+"px center"}):"foreground"==e&&n>o&&("vertical"==s?i.css({"-webkit-transform":"translateY("+u+"px)","-moz-transform":"translateY("+u+"px)",transform:"translateY("+u+"px)"}):"horizontal"==s&&i.css({"-webkit-transform":"translateX("+u+"px)","-moz-transform":"translateX("+u+"px)",transform:"translateX("+u+"px)"}))})})}}(jQuery);
var mfnSetup={
translate: null
};
(function($){
"use strict";
var has3d=function(){
if(!window.getComputedStyle){
return false;
}
var el=document.createElement('div'),
has3d;
document.body.insertBefore(el, null);
if(el.style.transform!==undefined){
el.style.transform="translateY(0px) translateX(-50%)";
has3d=window.getComputedStyle(el).getPropertyValue('transform');
}
document.body.removeChild(el);
return (has3d!==undefined&&has3d!==null&&has3d.length > 0&&has3d!=="none");
};
var __construct=function(){
if(has3d()){
mfnSetup.translate=function(el, x, y){
el.css('transform', 'translateY(' + y + ') translateX(-50%)');
};}else{
/*mfnSetup.translate=function(el, x, y){
el.css({
"left": x,
"top": y
});
};*/
}};
__construct();
})(jQuery);
(function($){
"use strict";
$.fn.mfnParallax=function(){
var el=$(this),
parent=el.parent(),
speed=500,
element, parentPos, windowH;
var imageSize=function(img){
var w, h, l, t;
var imageW=img.get(0).clientWidth;
var imageH=img.get(0).clientHeight;
var parentW=img.parent().outerWidth();
var parentH=img.parent().outerHeight();
var windowH=$(window).height();
if(windowH > parentH){
parentH=windowH;
}
var diff=imageW / parentW;
if((imageH / diff) < parentH){
w=imageW / (imageH / parentH);
h=parentH;
if(w > imageW){
w=imageW;
h=imageH;
}}else{
w=parentW;
h=imageH / diff;
}
l=(parentW - w) / 2;
t=(parentH - h) / 2;
return [w, h, l, t];
};
var parallax=function(){
var scrollTop=$(window).scrollTop(),
scrollDiff, ratio, translateTop;
if(parentPos!==undefined){
if(scrollTop >=parentPos.min&&scrollTop <=parentPos.max){
scrollDiff=scrollTop - parentPos.min;
ratio=scrollDiff / parentPos.height;
translateTop=windowH + (ratio * speed) - scrollDiff - (speed * (windowH / parentPos.height));
mfnSetup.translate(el, element.left + "px", -Math.round(translateTop) + "px");
}}
};
var init=function(){
windowH=$(window).height();
var initElement=function(){
var size=imageSize(el);
el.removeAttr('style').css({
});
mfnSetup.translate(el, size[2] + "px", size[3] + "px");
return {
'width': size[0],
'height': size[1],
'left': size[2],
'top': size[3]
};};
element=initElement();
var initParent=function(){
var min=parent.offset().top - $(window).height();
var max=parent.offset().top + $(parent).outerHeight();
return {
'min': min,
'max': max,
'height': max - min
};};
parentPos=initParent();
parent.css('background-image','unset');
};
var reload=function(){
setTimeout(function(){
init();
parallax();
}, 50);
};
reload();
$(window).on('scroll', parallax);
};
$(window).on('load resize', function(){
if($(".mfn-parallax").length){
$(".mfn-parallax").each(function(){
$(this).mfnParallax();
});
}});
})(jQuery);
var Mfn_livesearch={
that: this,
postsLoaded: [],
dom:{
ajaxFetchedPage: '',
get resultsFromPage(){ return this.ajaxFetchedPage; },
isItem(e){ return e.target.closest('.mfn-live-search-wrapper') },
itemAttr(attrName){
const wrapper=document.querySelector('.mfn-live-search-wrapper');
return parseInt(wrapper.getAttribute('data-'+attrName));
},
get searchForm(){
return Array.from(document.querySelectorAll('.search_wrapper .form-searchform, .top_bar_right .form-searchform, #Side_slide #side-form, .mfn-live-search-wrapper .mfn-live-searchform'));
},
get searchField(){
return Array.from(document.querySelectorAll('.search_wrapper input[type=text], .top_bar_right .form-searchform input[type=text], #Side_slide #side-form input[type=text], .mfn-live-search-wrapper input[type=text]'));
},
get liveSearchNoResults(){
return Array.from(document.querySelectorAll('.mfn-live-search-box .mfn-live-search-noresults'));
},
get liveSearchBox(){
return Array.from(document.querySelectorAll('.mfn-live-search-box'));
},
get liveSearchResultsList(){
return Array.from(document.querySelectorAll('.mfn-live-search-list'));
},
get liveSearchResultsListShop(){
return Array.from(document.querySelectorAll('.mfn-live-search-list-shop'));
},
get liveSearchResultsListBlog(){
return Array.from(document.querySelectorAll('.mfn-live-search-list-blog'));
},
get liveSearchResultsListPortfolio(){
return Array.from(document.querySelectorAll('.mfn-live-search-list-portfolio'));
},
get liveSearchResultsListPages(){
return Array.from(document.querySelectorAll('.mfn-live-search-list-pages'));
},
get liveSearchResultsListCategories(){
return Array.from(document.querySelectorAll('.mfn-live-search-list-categories'));
},
},
create: {
that: this,
linkToLivesearch: (inputValue)=> `${mfn.home_url_lang}?s=${inputValue}&mfn_livesearch`,
linkToLivesearch2: (inputValue,postType)=> `${mfn.home_url_lang}?s=${inputValue}&mfn_livesearch&searchpage${postType}`,
Li: ()=> document.createElement("li"),
Heading: (post)=> post.querySelector('.post-title'),
Link:  (post)=> post.querySelector('.post-title a'),
Excerpt: (post)=> post.querySelector('.post-excerpt p'),
WooPrice: (post)=> post.querySelector('.post-product-price'),
Image(post){
const imgDom=post.querySelector('.live-search-thumbnail');
if(imgDom){
let imgDomCreate=document.createElement('img');
imgDomCreate.src=imgDom.src;
return imgDomCreate;
}},
Category(post){
switch(true){
case post.classList.contains('product'):
return 'product';
case post.classList.contains('page'):
return 'page';
case post.classList.contains('portfolio'):
return 'portfolio';
case post.classList.contains('post'):
return 'post';
}},
Textbox(heading, link, excerpt, wooPrice){
let headingCreate=document.createElement('a');
let excerptCreate=document.createElement("p");
let wooPriceCreate=document.createElement("span");
let container=document.createElement("div");
container.classList.add("mfn-live-search-texts");
if(heading.textContent&&link.href){
headingCreate.innerHTML=heading.textContent;
headingCreate.href=link.href;
container.appendChild(headingCreate);
}
if(wooPrice){
wooPriceCreate.classList.add("mfn-ls-price");
wooPriceCreate.innerHTML=wooPrice.innerHTML;
container.appendChild(wooPriceCreate);
}
if(excerpt!=null&&excerpt.textContent.match(/\w/)){
let finalExcerpt='';
const letterLimit=90;
const sentence=excerpt.innerHTML;
if(letterLimit >=sentence.length){
finalExcerpt=sentence;
}else{
finalExcerpt=`${sentence.substr(0, sentence.lastIndexOf(' ', letterLimit))}...`;
}
excerptCreate.innerHTML=finalExcerpt;
container.appendChild(excerptCreate);
}
return container;
},
readyList(e){
var that=this.that;
let loadPostsAmount=mfn.livesearch.loadPosts;
let remotePageSource=that.Mfn_livesearch.dom.resultsFromPage;
remotePageSource=jQuery(remotePageSource).find('.posts_group');
if(remotePageSource.length){
const [{ children: posts }]=remotePageSource;
Array.from(posts).forEach(post=> {
if(loadPostsAmount > 0){
let Li=this.Li();
this.postId=post.id.match(/\d+/g).toString();
if(_.isObject(this.Image(post))) Li.appendChild(this.Image(post) );
const textbox=this.Textbox(this.Heading(post), this.Link(post), this.Excerpt(post), this.WooPrice(post));
Li.setAttribute('data-category', this.Category(post));
Li.appendChild(textbox);
that.Mfn_livesearch.postsLoaded.push(Li);
}
loadPostsAmount--;
});
}else if(e.target.value.length&&!that.Mfn_livesearch.postsLoaded.length){
jQuery(that.Mfn_livesearch.dom.liveSearchNoResults).fadeIn();
}},
categoryPills(actualInput){
var that=this.that;
if(mfn_livesearch_categories){
const regex=new RegExp(`[a-zA-Z]*${actualInput}[a-zA-Z]*`, 'gi');
const similarResults=Object.values(mfn_livesearch_categories).filter(function(category){
return category.match(regex);
});
similarResults.forEach(category=> {
let Li=this.Li();
Li.setAttribute('data-category', 'category');
let text=document.createElement('a');
text.innerHTML=category;
text.href=Object.keys(mfn_livesearch_categories).find(key=> mfn_livesearch_categories[key]===category);
Li.appendChild(text);
that.Mfn_livesearch.postsLoaded.push(Li);
});
}}
},
ajaxSearch(that, e){
let howManyChars=that.Mfn_livesearch.dom.isItem(e)!==null ? that.Mfn_livesearch.dom.itemAttr('char'):mfn.livesearch.minChar;
if(e.target.value.length >=howManyChars){
jQuery(that.Mfn_livesearch.dom.searchForm).addClass('mfn-livesearch-loading');
let trimmedSearchingSentence=e.target.value.trim();
jQuery.ajax({
url: this.Mfn_livesearch.create.linkToLivesearch(trimmedSearchingSentence),
type: "GET",
success: function (response){
that.Mfn_livesearch.dom.ajaxFetchedPage=response;
setTimeout(function(){
jQuery(that.Mfn_livesearch.dom.searchForm).removeClass('mfn-livesearch-loading');
that.Mfn_livesearch.postsLoaded=[];
jQuery(that.Mfn_livesearch.dom.liveSearchNoResults).fadeOut();
that.Mfn_livesearch.create.categoryPills(e.target.value);
that.Mfn_livesearch.create.readyList(e);
that.Mfn_livesearch.refreshCategoryContainers();
that.Mfn_livesearch.assignToProperContainer(that.Mfn_livesearch.postsLoaded);
that.Mfn_livesearch.hideNotUsedCategories();
that.Mfn_livesearch.toggleDropdown(e);
that.Mfn_livesearch.toggleMoreResultsButton(e);
}, 0);
}});
}else{
that.Mfn_livesearch.toggleDropdown(e);
}},
refreshCategoryContainers(){
const containers=this.that.Mfn_livesearch.dom;
const { pages, categories, portfolio, post, products }=mfn.livesearch.translation;
jQuery(containers.liveSearchResultsListShop).html(`<ul><li class="mfn-live-search-heading" data-category="info"> ${products} </li></ul>`);
jQuery(containers.liveSearchResultsListPages).html(`<ul><li class="mfn-live-search-heading" data-category="info"> ${pages} </li></ul>`);
jQuery(containers.liveSearchResultsListPortfolio).html(`<ul><li class="mfn-live-search-heading" data-category="info"> ${portfolio} </li></ul>`);
jQuery(containers.liveSearchResultsListBlog).html(`<ul><li class="mfn-live-search-heading" data-category="info"> ${post} </li></ul>`);
jQuery(containers.liveSearchResultsListCategories).html(`<ul><li class="mfn-live-search-heading" data-category="info"> ${categories} </li></ul>`);
},
assignToProperContainer(posts){
var that=this.that;
posts.forEach(post=>{
switch(post.getAttribute('data-category')){
case 'product':
jQuery(that.Mfn_livesearch.dom.liveSearchResultsListShop).children('ul').append(post);
break;
case 'page':
jQuery(that.Mfn_livesearch.dom.liveSearchResultsListPages).children('ul').append(post);
break;
case 'portfolio':
jQuery(that.Mfn_livesearch.dom.liveSearchResultsListPortfolio).children('ul').append(post);
break;
case 'post':
jQuery(that.Mfn_livesearch.dom.liveSearchResultsListBlog).children('ul').append(post);
break;
case 'category':
jQuery(that.Mfn_livesearch.dom.liveSearchResultsListCategories).children('ul').append(post);
break;
}});
},
hideNotUsedCategories(){
var that=this.that;
that.Mfn_livesearch.dom.liveSearchResultsList.forEach(resultsList=>{
Array.from(resultsList.children).forEach(category=> {
let content=category.querySelectorAll('ul li[data-category]');
if(content.length===1){
category.style.display="none";
}else{
category.style.display="block";
}});
});
},
toggleDropdown(e){
let focusedSearchBox;
let howManyChars=this.that.Mfn_livesearch.dom.isItem(e)!==null ? this.that.Mfn_livesearch.dom.itemAttr('char'):mfn.livesearch.minChar;
if(this.dom.isItem(e)){
focusedSearchBox=document.querySelector('.mfn-live-search-wrapper .mfn-live-search-box');
if(!this.dom.itemAttr('featured')){
const featuredImages=document.querySelectorAll('.mfn-live-search-wrapper img');
Array.from(featuredImages).forEach(image=> {
image.style.display='none';
});
}}else if(document.querySelector('#Side_slide')&&document.querySelector('#Side_slide').style.right==='0px'){
focusedSearchBox=document.querySelector('#Side_slide .mfn-live-search-box');
}else if(document.querySelector('.search_wrapper')&&document.querySelector('.search_wrapper').style.display==='block'){
focusedSearchBox=document.querySelector('.search_wrapper .mfn-live-search-box');
}else if(document.querySelector('.mfn-header-tmpl')){
focusedSearchBox=jQuery('.search_wrapper input:focus').closest('.search_wrapper').find('.mfn-live-search-box');
jQuery('.search_wrapper input:focus').closest('.mcb-wrap').css('z-index', 3);
}else{
focusedSearchBox=document.querySelector('.top_bar_right .mfn-live-search-box');
}
if(e.target.value.length < howManyChars){
return jQuery(focusedSearchBox).slideUp(300);
}
jQuery(focusedSearchBox).slideDown(300);
},
toggleMoreResultsButton(e){
this.dom.liveSearchBox.forEach(searchBox=> {
const getMoreResultsButton=searchBox.querySelector('a.button');
const howManyItems=mfn.livesearch.loadPosts;
var postType='';
if(this.postsLoaded.length >=howManyItems&&this.postsLoaded.length){
getMoreResultsButton.classList.remove('hidden');
if(e.target.parentNode.querySelector('input[name="post_type"]')){
postType='&post_type=' + e.target.parentNode.querySelector('input[name="post_type"]').value;
}
getMoreResultsButton.href=this.create.linkToLivesearch2(e.target.value, postType);
}else{
getMoreResultsButton.classList.add('hidden');
}});
},
closeBoxOnClick(){
this.dom.searchForm.forEach((x)=> {
if(jQuery(x).siblings('.mfn-live-search-box').css('display')!=='none'||jQuery(x).closest('.mfn-loaded').length){
x.setAttribute('mfn-livesearch-dropdown', true);
}else{
x.setAttribute('mfn-livesearch-dropdown', false);
}})
let item=jQuery('[mfn-livesearch-dropdown=true]');
if(item.closest('.mfn-loaded').length){
jQuery(item).find('.icon_close').click();
item.attr('mfn-livesearch-dropdown', false);
}else{
jQuery(item).find('.mfn-live-search-box').fadeOut(300);
jQuery(item).siblings('.mfn-live-search-box').fadeOut(300);
}
this.refreshCategoryContainers();
this.hideNotUsedCategories();
item.siblings('.mfn-live-search-box').find('.button').addClass('hidden');
item.closest('.mcb-wrap').css('z-index', 2);
},
events(){
var inputDebounce=_.debounce(this.ajaxSearch, 300);
this.dom.searchForm.forEach(searchForm=> {
searchForm.addEventListener("submit", (e)=> {
e.preventDefault();
var postType='';
const { value }=e.target.querySelector('.field');
if(e.target.querySelector('input[name="post_type"]')){
postType='&post_type=' + e.target.querySelector('input[name="post_type"]').value;
}
window.location.href=this.create.linkToLivesearch2(value, postType);
});
});
document.addEventListener("keyup", (e)=> {
if(e.key==='Escape'){
this.closeBoxOnClick();
e.stopPropagation();
}});
this.dom.searchField.forEach(searchField=> {
searchField.addEventListener("click", (e)=> { inputDebounce(this.that, e); });
searchField.addEventListener("input", (e)=> inputDebounce(this.that, e) );
searchField.addEventListener("click", (e)=> {
if(this.that.Mfn_livesearch.dom.isItem(e)){
jQuery(".search_wrapper .mfn-live-search-box, .top_bar_right .mfn-live-search-box, #Side_slide .mfn-live-search-box").slideUp(300);
}else{
jQuery(".mfn-live-search-wrapper .mfn-live-search-box").slideUp(300);
e.stopPropagation();
}});
});
jQuery('.mfn-live-search-box').on('click', 'li[data-category]', function(){
let a=jQuery(this).find('a');
if(a.length){
window.location.href=a.attr('href');
}});
this.dom.liveSearchBox.forEach(searchBox=> {
searchBox.addEventListener("click", (e)=> e.stopPropagation());
});
document.addEventListener("click", (e)=> {
this.closeBoxOnClick();
});
},
init(){
this.events();
}};
Mfn_livesearch.init();
function queryLoopMasonry(){
jQuery('.mfn-query-loop-masonry:not(.mfn-initialized)').each(function(){
let $masonry=jQuery(this);
$masonry.imagesLoaded(function(){
$masonry.isotope({
itemSelector: '.mfn-queryloop-item-wrapper',
layoutMode: 'masonry',
isOriginLeft: jQuery('body').hasClass('rtl') ? false:true
});
$masonry.addClass('mfn-initialized');
});
});
}
function msnryGalleryInit(){
jQuery('.gallery.equal-heights:not(.mfn-images-loaded)').each(function(){
var $el=jQuery(this);
$el.imagesLoaded(function(){
$el.addClass('mfn-images-loaded');
});
});
jQuery('.sections_group .gallery, .mcb-section .gallery, .elementor-section .gallery').each(function(){
var $el=jQuery(this);
var id=$el.attr('id');
if($el.hasClass('mfn-initialized')) return;
$el.children('br').remove();
$el.find('.gallery-icon').children('a')
.wrap('<div class="image_frame scale-with-grid"><div class="image_wrapper"></div></div>')
.prepend('<div class="mask"></div>')
.children('img')
;
if($el.hasClass('file')){
$el.find('.gallery-icon a')
.attr('rel', 'prettyphoto[' + id + ']')
.attr('data-elementor-lightbox-slideshow', id);
}
$el.find('.gallery-item').each(function(){
var title=jQuery(this).data('title');
var description=jQuery(this).data('description');
jQuery('.gallery-icon a', jQuery(this))
.attr('data-elementor-lightbox-title', title)
.attr('data-elementor-lightbox-description', description);
});
if($el.hasClass('masonry')){
$el.imagesLoaded(function(){
$el.isotope({
itemSelector: '.gallery-item',
layoutMode: 'masonry',
isOriginLeft: jQuery('body').hasClass('rtl') ? false:true
});
$el.addClass('mfn-initialized');
});
}});
}
function redrawAllRevolutionSliders(){
let slidersFound=false;
for (const prop in window){
if(prop.startsWith('revapi')&&typeof window[prop]==='object'&&window[prop]!==null){
const revapiInstance=window[prop];
if(typeof revapiInstance.revredraw==='function'){
slidersFound=true;
setTimeout(function(){
revapiInstance.revredraw();
console.log(`Revolution Slider instance (${prop}) redrawn.`);
}, 50);
}}
}}
(function($){
"use strict";
var scrollTicker, lightboxAttr, sidebar,
body=$('body'),
rtl=$('body').hasClass('rtl'),
simple=$('body').hasClass('style-simple'),
isBlocks=$('body').hasClass('builder-blocks'),
topBarTop='0',
headerH=0,
currWidth=$(window).width(),
newWidth=$(window).width(),
screen='desktop',
mobileInitW=mfn.mobileInit ? mfn.mobileInit:1240,
consents={};
if(! mfn.lightbox.disable){
if(!(mfn.lightbox.disableMobile&&(window.innerWidth < 768) )){
lightboxAttr={
title: mfn.lightbox.title ? mfn.lightbox.title:false,
};}}
var cookies={
get: function(name){
if(document.cookie!==""){
var cookies=document.cookie.split(/; */);
for (var cookie of cookies){
var [ cookieName, cookieVal ]=cookie.split("=");
if(cookieName===name){
return decodeURIComponent(cookieVal);
}}
}
return false;
},
set: function(name, value, expires){
if(navigator.cookieEnabled){
var cookieDate=new Date();
var cookieText='';
expires=expires||365;
value=encodeURIComponent(value);
cookieDate.setTime(cookieDate.getTime() + (expires * 24 * 60 * 60 * 1000));
cookieText +=name +"="+ value;
cookieText +="; expires=" + cookieDate.toUTCString() + ';';
cookieText +="; path=" + mfn.home_url + '/';
document.cookie=cookieText;
}},
};
var consent={
popup:$('#mfn-consent-mode'),
tabs:function($el, id){
var $li;
if($el){
$li=$el.closest('li');
id=$li.data('id');
}else{
$li=$('.tab[data-id="'+ id +'"]');
}
$li.addClass('is-active')
.siblings().removeClass('is-active');
$('#'+ id).addClass('is-active')
.siblings().removeClass('is-active');
$('.mfn-cookies').attr('data-tab',id);
},
open:function(){
if(! this.popup.length){
return;
}
if($('body').hasClass('mfn-ui')) return;
consents=cookies.get('mfnConsent');
try {
consents=JSON.parse(consents);
if(! consents){
throw new Error('');
}
gtag('consent', 'update', consents);
} catch (e){
consents={
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied'
}
body.addClass('mfn-cookies-open');
if(body.hasClass('gdpr2-scroll-disable')){
$('html').addClass('mfn-popup-browser-scroll-disabled');
}}
},
reopen:function(){
if($('body').hasClass('mfn-ui')) return;
body.addClass('mfn-cookies-open');
this.popup.show()
.children().show();
if(body.hasClass('gdpr2-scroll-disable')){
$('html').addClass('mfn-popup-browser-scroll-disabled');
}},
close:function(){
var closeAnimation=this.popup.attr('data-animation');
switch(true){
case 'fade'===closeAnimation:
this.popup.fadeOut(300);
break;
case 'slide'===closeAnimation:
this.popup.fadeOut(300);
this.popup.children().slideUp(300);
break;
default:
body.removeClass('mfn-cookies-open');
}
setTimeout(function(){
body.removeClass('mfn-cookies-open');
if(body.hasClass('gdpr2-scroll-disable')){
$('html').removeClass('mfn-popup-browser-scroll-disabled');
}
$(document).trigger('mfn:gdpr2:close');
}, 300);
},
set:function(){
var expires=this.popup.attr('data-expires');
expires=parseInt(expires)||365;
gtag('consent', 'update', consents);
cookies.set('mfnConsent', JSON.stringify(consents), expires);
consent.close();
},
all:function(){
consents={
'ad_storage': 'granted',
'ad_user_data': 'granted',
'ad_personalization': 'granted',
'analytics_storage': 'granted'
}
consent.set();
},
selected:function(){
if($('#cookies_analytics').is(":checked")){
consents.analytics_storage='granted';
}
if($('#cookies_marketing').is(":checked")){
consents.ad_storage='granted';
consents.ad_user_data='granted';
consents.ad_personalization='granted';
}
consent.set();
},
deny:function(){
consents={
'ad_storage': 'denied',
'ad_user_data': 'denied',
'ad_personalization': 'denied',
'analytics_storage': 'denied'
}
consent.set();
},
};
function topBarTopPosition(){
topBarTop=parseInt($('#Top_bar').css('top'), 10);
var scrollPos=$(window).scrollTop();
if(scrollPos > 0){
window.scrollTo(0, 0);
$(window).scrollTop(0);
topBarTop=parseInt($('#Top_bar').css('top'), 10);
window.scrollTo(0, scrollPos);
}
if(topBarTop < 0){
topBarTop=0;
}
topBarTop=topBarTop + 'px';
}
function adminBarH(){
var height=0;
if($('body').hasClass('admin-bar')){
var actionBarH=$('#wpadminbar').innerHeight()||0;
height +=actionBarH;
}
if($('body').hasClass('woocommerce-demo-store')){
var demoStoreH=$('body > p.demo_store').innerHeight()||0;
height +=demoStoreH;
}
return height;
}
function mfnSticky(){
if(! $('body').hasClass('sticky-header')){
return false;
}
if($('body').hasClass('header-creative')&&window.innerWidth >=768){
return false;
}
var startY=headerH;
var windowY=$(window).scrollTop();
var topBarH=$('#Top_bar').height()||0;
if(windowY > startY){
if(!($('#Top_bar').hasClass('is-sticky')) ){
$('.header_placeholder').css('height', topBarH);
$('#Top_bar')
.addClass('is-sticky')
.css('top', -60)
.animate({
'top': adminBarH() + 'px'
}, 300);
headerWidth();
$(document).trigger('mfn:header:sticky:on');
}}else{
if($('#Top_bar').hasClass('is-sticky')){
$('.header_placeholder').css('height', 0);
$('#Top_bar').stop()
.removeClass('is-sticky')
.css('top', topBarTop);
stickyLogo();
headerWidth();
$(document).trigger('mfn:header:sticky:off');
}}
}
function stickyLogo(){
if(window.devicePixelRatio <=1){
return false;
}
var parent=$('#Top_bar #logo'),
el=$('img.logo-main', parent),
height=el.data('height');
if(! parent.hasClass('retina')){
return false;
}
if($('body').hasClass('logo-overflow')){
}else if(height > parent.data('height')){
height=parent.data('height');
}
el.css('max-height', height + 'px');
}
function mfnStickyH(){
var topBarH=$('#Top_bar').innerHeight()||0;
if($('body').hasClass('header-below')){
var sliderH=$('.mfn-main-slider').innerHeight()||0;
headerH=topBarH + sliderH;
}else{
var actionBarH=$('#Action_bar').innerHeight()||0;
headerH=topBarH + actionBarH;
}}
function mfnMobileSticky(){
if(! $('body').hasClass('.mobile-sticky')){
return false;
}
if($(window).width() >=768){
return false;
}
var menuH,
windowH=$(window).height()||0,
logoH=$('#Top_bar .logo').height()||0,
offset=adminBarH() + logoH;
if(( ! $('#Top_bar').hasClass('is-sticky'))&&$('#Action_bar').is(':visible')){
offset +=$('#Action_bar').height()||0;
}
menuH=windowH - offset;
if(menuH < 176){
menuH=176;
}
$('#Top_bar #menu').css('max-height', menuH + 'px');
}
function headerWidth(){
var rightW=$('.top_bar_right').outerWidth()||0;
rightW=Math.ceil(rightW);
if($('body').hasClass('header-modern')){
rightW +=10;
}
var parentW=$('#Top_bar .one').width()||0;
var leftW=parentW - rightW;
}
function fixStickyHeaderH(){
var stickyH=0;
var topBar=$('.sticky-header #Top_bar');
if(topBar.length){
if(topBar.hasClass('is-sticky')){
stickyH=$('.sticky-header #Top_bar').innerHeight()||0;
}else{
topBar.addClass('is-sticky');
stickyH=$('.sticky-header #Top_bar').innerHeight()||0;
topBar.removeClass('is-sticky');
}}else if($('.mfn-header-tmpl-builder').length){
var height=15;
var shift=0;
if($('#mfn-header-template').hasClass('mfn-hasSticky')){
height=$('#mfn-header-template').outerHeight();
shift=parseFloat($('#mfn-header-template').css('top'));
}else if($('#mfn-header-template').hasClass('mfn-header-tmpl-fixed')){
height=$('#mfn-header-template').outerHeight();
shift=parseFloat($('#mfn-header-template').css('top'));
}else if($('#mfn-header-template').hasClass('mfn-mobile-header-tmpl-fixed')&&$(window).width() < 767){
height=$('#mfn-header-template').outerHeight();
shift=parseFloat($('#mfn-header-template').css('top'));
}
stickyH=height + shift;
return stickyH;
}
if($(window).width() < mobileInitW){
if($(window).width() < 768){
if(!$('body').hasClass('mobile-sticky')){
stickyH=0;
}}else{
if(!$('body').hasClass('tablet-sticky')){
stickyH=0;
}}
}else{
if($('body').hasClass('header-creative')){
stickyH=0;
}}
return stickyH;
}
function mfnSidebar(){
if($('.mcb-sidebar').length){
var maxH=$('#Content .sections_group').outerHeight();
$('.mcb-sidebar').each(function(){
$(this).css('min-height', 0);
if($(this).height() > maxH){
maxH=$(this).height();
}});
$('.mcb-sidebar').css('min-height', maxH + 'px');
if(sidebar){
sidebar.stickySidebar('updateSticky');
}}
}
function mfnIntroH(){
var windowH=$(window).height()||0;
var headerWrapperH=$('#Header_wrapper').height()||0;
windowH=windowH - headerWrapperH - adminBarH();
$('#Intro.full-screen').each(function(){
var el=$(this),
inner=$('.intro-inner', el),
innerH=inner.height()||0;
el.css('padding', 0).css('min-height', windowH);
var padding=(windowH - innerH) / 2;
inner.css('padding-top', padding).css('padding-bottom', padding);
});
}
function mfnFooter(){
var footerH=$('#Footer').height()||0;
if($('.footer-fixed #Footer, .footer-sliding #Footer').length){
footerH=footerH - 1;
$('#Content').css('margin-bottom', footerH + 'px');
}
if($('.footer-stick #Footer').length){
var headerWrapperH=$('#Header_wrapper').height()||0;
var headerFooterH=headerWrapperH + footerH;
var documentH=$(document).height() - adminBarH();
if(( documentH <=$(window).height())&&(headerFooterH <=$(window).height()) ){
$('#Footer').addClass('is-sticky');
}else{
$('#Footer').removeClass('is-sticky');
}}
}
function backToTopSticky(){
if($('#back_to_top.sticky.scroll').length){
var el=$('#back_to_top.sticky.scroll');
if(scrollTicker){
window.clearTimeout(scrollTicker);
scrollTicker=null;
}
el.addClass('focus');
scrollTicker=window.setTimeout(function(){
el.removeClass('focus');
}, 1500);
}}
function preloader(){
$('body.preloader').animate({
opacity: 1
}, 100, function(){
$('html').removeClass('preloading');
});
}
function hashNav(){
var hash=window.location.hash;
if(hash){
if(hash.indexOf("&") > -1||hash.indexOf("/") > -1||hash.indexOf("?") > -1){
return false;
}
if(hash.indexOf("wpcf7") > -1){
cf7popup(hash);
}
if($(hash).length){
$(window).scrollTop(0, 0);
setTimeout(function(){
var offset=0,
headerH=fixStickyHeaderH(),
tabH=$(hash).siblings('.ui-tabs-nav').innerHeight()||0;
if($('body').hasClass('mhb')){
var currentView=$('.mhb-view').filter(':visible');
headerH=currentView.height()||0;
}
offset=headerH + tabH;
$('html, body').animate({
scrollTop: $(hash).offset().top - offset
}, 500);
}, 500);
}}
}
function onePageActive(){
if($('body').hasClass('one-page')){
var stickyH=$('.sticky-header #Top_bar').innerHeight()||0;
if($('#mfn-header-template').length) stickyH=$('#mfn-header-template').innerHeight()||0;
var windowT=$(window).scrollTop();
var start=windowT + stickyH + adminBarH() + 1;
var first=false;
$('[data-id]:not(.elementor-element), section[data-id]').each(function(){
if($(this).attr('data-id')&&(-1==$(this).attr('data-id').indexOf('#')) ){
return true;
}
if($(this).visible(true)){
if(!first){
first=$(this);
}else if(($(this).offset().top < start)&&($(this).offset().top > first.offset().top)){
first=$(this);
}}
if(first){
var newActive=first.attr('data-id');
var active='[data-hash="' + newActive + '"]';
if(newActive){
var menu=$('#menu, .mhb-menu');
if($('#mfn-header-template').length) menu=$('#mfn-header-template .mfn-header-menu');
menu.find('li').removeClass('current-menu-item current-menu-parent current-menu-ancestor current_page_item current_page_parent current_page_ancestor');
$(active, menu)
.closest('li').addClass('current-menu-item')
.closest('.menu > li').addClass('current-menu-item');
}}
});
}}
function cf7popup(hash){
if(hash&&$(hash).length){
var id=$(hash).closest('.popup-content').attr('id');
$('a.popup-link[href="#' + id + '"]:not(.once)')
.addClass('once')
.trigger('click');
}}
$(document).on('mfnPopupInit', function(){
if($('.mfn-popup-tmpl.mfn-popup-active .chart:not(.mfn-initialized)').length){
$('.mfn-popup-tmpl.mfn-popup-active .chart:not(.mfn-initialized)').each(function(){
var lineW=simple ? 4:8;
$(this).addClass('mfn-initialized');
$(this).easyPieChart({
animate: 1000,
lineCap: 'circle',
lineWidth: lineW,
size: 140,
scaleColor: false
});
});
}
if($('.mfn-popup-tmpl.mfn-popup-active .before_after.twentytwenty-container:not(.mfn-initialized)').length){
$('.mfn-popup-tmpl.mfn-popup-active .before_after.twentytwenty-container:not(.mfn-initialized)').each(function(){
var el=$(this);
el.addClass('mfn-initialized');
el.imagesLoaded().done(function(instance, image){
queueMicrotask(()=> el.twentytwenty());
});
});
}
if($('.mfn-popup-tmpl.mfn-popup-active .downcount:not(.mfn-initialized)').length){
$('.mfn-popup-tmpl.mfn-popup-active .downcount:not(.mfn-initialized)').each(function(){
var el=$(this);
el.addClass('mfn-initialized');
el.downCount({
date: el.attr('data-date'),
offset: el.attr('data-offset')
});
});
}
if($('.mfn-popup-tmpl.mfn-popup-active .animate-math .number:not(.mfn-initialized)').length){
$('.mfn-popup-tmpl.mfn-popup-active .animate-math .number:not(.mfn-initialized)').each(function(){
var el=$(this);
var duration=Math.floor((Math.random() * 1000) + 1000);
var to=el.attr('data-to');
el.addClass('mfn-initialized');
$({
property: 0
}).animate({
property: to
}, {
duration: duration,
easing: 'linear',
step: function(){
el.text(Math.floor(this.property));
},
complete: function(){
el.text(this.property);
}});
});
}});
$(document).on('mfn:ajax:refresh', function(){
if($('.mfn-looped-items-slider').length){
queryLoopSlider();
}
bannerBox.init();
mfnReadMore.prepare();
mfnTabber.sliding_bg();
if($('.mfn-advanced-filters').length) mfnAdvancedFilters.prepare();
if($('.mfn-floating-placeholder').length){
$('.mfn-floating-placeholder .mfn-input-wrapper input').each(function(){
if($(this).val().length){
$(this).closest('.mfn-input-wrapper').addClass('mfn-not-empty');
}else{
$(this).closest('.mfn-input-wrapper').removeClass('mfn-not-empty');
}});
}
$('.downcount:not(.mfn-initialized)').each(function(){
var el=$(this);
el.addClass('mfn-initialized');
el.downCount({
date: el.attr('data-date'),
offset: el.attr('data-offset')
});
});
})
$(document).ready(function(){
if($('.mfn-off-canvas-sidebar').length){
offCanvasSidebar.init();
}
if($('.mfn-advanced-filters').length){
mfnAdvancedFilters.init();
}
mfnTabber.init();
if($(window).width() < 767&&!$('.mfn-off-canvas-sidebar').length){
offCanvasSidebar.mobile();
screen='mobile';
}else if($(window).width() < 959){
screen='tablet';
}
if($('.mfn-floating-placeholder').length){
$(document).on('blur change', '.mfn-floating-placeholder .mfn-input-wrapper input', function(){
if($(this).val().length){
$(this).closest('.mfn-input-wrapper').addClass('mfn-not-empty');
}else{
$(this).closest('.mfn-input-wrapper').removeClass('mfn-not-empty');
}});
$('.mfn-floating-placeholder .mfn-input-wrapper input').each(function(){
if($(this).val().length){
$(this).closest('.mfn-input-wrapper').addClass('mfn-not-empty');
}else{
$(this).closest('.mfn-input-wrapper').removeClass('mfn-not-empty');
}});
}
if($('body').hasClass('single-post')&&$('.mfn-tmp-elementor-content').length&&$('.column.column_post_content').length){
$('.column.column_post_content .mcb-item-post_content-inner').html($('.mfn-tmp-elementor-content').html());
$('.mfn-tmp-elementor-content').remove();
}
if($('.mfn-share-post-copy-link').length){
$('.mfn-share-post-copy-link').on('click', function(e){
e.preventDefault();
var $link=$(this);
navigator.clipboard.writeText(window.location.href);
$link.addClass('tooltip').attr('data-tooltip', mfn.translation.success_message);
setTimeout(function(){
$link.removeClass('tooltip').removeAttr('data-tooltip');
}, 2000);
});
}
if($('.mfn-image-hotspot').length){
mfn_hotspot.init();
}
if($('.mfn-go-to').length){
$(document).on('click', '.mfn-go-to', function(e){
e.preventDefault();
let target=$(this).attr('data-mfngoto');
let offset=0;
if(target=='last'){
offset=$('#Content .mfn-builder-content > .section').last().offset().top;
}else if(target=='prev'){
if(!$(this).closest('.section').prev('.section').length){console.error('BeTheme: Prev section doesnt exists'); return; }
offset=$(this).closest('.section').prev('.section').offset().top;
}else{
if(!$(this).closest('.section').next('.section').length){console.error('BeTheme: Next section doesnt exists'); return; }
offset=$(this).closest('.section').next('.section').offset().top;
}
offset=offset -(fixStickyHeaderH() + adminBarH());
$('html,body').animate({ scrollTop: offset }, 500);
});
}
let js_tooltip={
button: false,
offset_top: false,
offset_left: false,
init: function(){
$('.js-tooltip').on('mouseenter', function(){
js_tooltip.button=$(this);
if(typeof js_tooltip.button.attr('data-tooltip')=='undefined') return;
$('body').append('<span class="js-tooltip-txt">'+js_tooltip.button.attr('data-tooltip')+'</span>');
js_tooltip.position();
}).on('mouseleave', function(){
if($('.js-tooltip-txt').length) $('.js-tooltip-txt').remove();
js_tooltip.button=false;
});
$(window).on('scroll', function(){
if(js_tooltip.button) js_tooltip.position();
});
},
position: function(){
let offset=js_tooltip.button.offset();
js_tooltip.offset_top=offset.top - $(window).scrollTop() - 8;
js_tooltip.offset_left=offset.left + (js_tooltip.button.outerWidth()/2);
if(js_tooltip.button&&$('.js-tooltip-txt').length) $('.js-tooltip-txt').css({ top: js_tooltip.offset_top+'px', left: js_tooltip.offset_left+'px' });
}}
if($('.js-tooltip').length) js_tooltip.init();
if($('.mfn-copy-to-clipboard').length){
$(document).on('click', '.mfn-copy-to-clipboard', function(e){
e.preventDefault();
let code=$(this).attr('data-mfncopycode');
let button=$(this);
let org_label=button.find('.button_label').text();
let copied_txt=button.attr('data-mfncopyconfirm');
navigator.clipboard.writeText(code);
if(button.hasClass('js-tooltip')){
org_label=button.attr('data-tooltip');
button.attr('data-tooltip', copied_txt);
if($('.js-tooltip-txt').length) $('.js-tooltip-txt').remove();
button.trigger('mouseenter');
}else{
button.find('.button_label').text(copied_txt);
}
button.on('mouseleave', function(){
button.blur();
});
setTimeout(function(){
if(button.hasClass('js-tooltip')){
button.attr('data-tooltip', org_label);
if($('.js-tooltip-txt').length) $('.js-tooltip-txt').remove();
button.trigger('mouseenter');
}else{
button.find('.button_label').text(org_label);
}}, 2000);
});
}
if($('.mfn-language-switcher-dropdown:not(.mfn-initialized)').length){
$('.mfn-language-switcher-dropdown:not(.mfn-initialized)').each(function(){
let that=$(this);
that.addClass('mfn-initialized');
let $ul=that.find('ul');
let $current=$ul.find('li.wpml-ls-current-language');
$current.append($ul.clone());
$ul.children('li:not(.wpml-ls-current-language)').remove();
$current.find('ul li.wpml-ls-current-language').remove();
if(that.hasClass('mfn-language-switcher-dropdown-icon')){
let icon_html='';
if(that.attr('data-icon')=='image'){
icon_html='<span class="mfn-arrow-icon"><img src="'+that.attr('data-path')+'" alt=""></span>';
}else if(that.attr('data-icon')=='icon'){
icon_html='<span class="mfn-arrow-icon"><i class="'+that.attr('data-path')+'"></i></span>';
}
$current.children('a').append(icon_html);
}});
$(document).on('click', '.mfn-language-switcher-dropdown ul li.wpml-ls-current-language > a', function(e){
if($(window).width() < 1240) e.preventDefault();
$(this).parent('li').toggleClass('hover');
}).on('mouseleave', '.mfn-language-switcher-dropdown ul li.wpml-ls-current-language.hover', function(e){
$('.mfn-language-switcher-dropdown ul li.hover').removeClass('hover');
});
}
class Isotope {
constructor(){
this.runIsotopes=this.runIsotopes.bind(this);
this.itemToModify={};
this.ajaxObjects=[];
}
get getList(){
return [
{
name: 'Portfolio - Isotope',
location: '.blog_wrapper .isotope:not(.masonry), .portfolio_wrapper .isotope:not(.masonry-flat, .masonry-hover, .masonry-minimal)',
beforeActive: ()=> null,
afterActive: ()=> null,
settings: {
itemSelector: '.isotope-item',
layoutMode: 'fitRows',
isOriginLeft: rtl ? false:true
}},
{
name: 'Portfolio - Masonry Flat',
location: '.portfolio_wrapper .masonry-flat',
beforeActive: ()=> null,
afterActive: ()=> null,
settings: {
itemSelector: '.isotope-item',
percentPosition: true,
masonry: { columnWidth: 1 },
isOriginLeft: rtl ? false:true
}},
{
name: 'Blog & Portfolio & Shop - Masonry',
location: '.isotope.masonry, .isotope.masonry-hover, .isotope.masonry-minimal',
beforeActive: ()=> null,
afterActive: ()=> null,
settings: {
itemSelector: '.isotope-item',
layoutMode: 'masonry',
isOriginLeft: rtl ? false:true
}},
{
name: 'Filters - Isotope Event on Click',
location: 'body:not(.tax-portfolio-types,.archive.category,.archive.tag,.archive.author) .isotope-filters .filters_wrapper',
beforeActive: ()=> null,
afterActive: ({location})=> {
const filterButtons=$(location).find('li:not(.close) a');
filterButtons.on('click', (e)=> {
e.preventDefault();
const buttonClicked=$(e.target);
let isoWrapper=$('.isotope'),
filters=buttonClicked.closest('.isotope-filters'),
parent=filters.attr('data-parent');
if(parent){
parent=filters.closest('.' + parent);
isoWrapper=parent.find('.isotope').first();
}
filters.find('li').removeClass('current-cat');
buttonClicked.closest('li').addClass('current-cat');
this.isotopeFilter(buttonClicked, isoWrapper);
})
},
settings: 'do-not-run'
},
...this.ajaxObjects
]
}
addEventListener(onEvent, doWhat){
return $(document).on(`isotope:${onEvent}`, doWhat)
}
queryIsotopeAPI(location, apiAction, actionToPass){
return $(location).isotope(apiAction, actionToPass);
};
triggerIsotopeEvent(doWhat){
return $(document).trigger(`isotope:${doWhat}`)
}
addIsotopeLocation(payload){
if(!payload.location) return console.error('MfnIsotope Error: No Location Provided!');
this.ajaxObjects.push({
name: payload.name ? payload.name:'No name applied - Dynamic Isotope Function',
location: payload.location,
beforeActive: payload.beforeActive ? payload.beforeActive:()=> null,
afterActive: payload.afterActive ? payload.afterActive:()=> null,
settings: payload.settings ? payload.settings:{}}
);
$(payload.location).isotope(payload.settings)
}
isotopeFilter(domEl, isoWrapper){
if(!domEl||!isoWrapper) return console.error('MfnIsotope Error: isotopeFilter, missing one of the values!');
const filter=domEl.attr('data-rel');
isoWrapper.isotope({ filter });
queueMicrotask(()=> $(window).trigger('resize'));
setTimeout(function(){
mfnIsotope.triggerIsotopeEvent('arrange');
}, 500);
}
runIsotopes(resize=true){
const isotopeList=this.getList;
isotopeList.map(item=> {
if($(item.location).length){
item.beforeActive(item)
if(resize){
$(window).trigger('resize');
}
if('do-not-run'!==item.settings){
queueMicrotask(()=> $(item.location).isotope(item.settings));
}
item.afterActive(item);
}});
}}
const mfnIsotope=new Isotope;
mfnIsotope.runIsotopes();
class Waypoints {
constructor(){
this.runWaypoints=this.runWaypoints.bind(this);
}
get getList(){
return [
{
name: 'Chart',
location: '.sections_group .chart, .elementor-section .chart',
beforeActive: ()=> {},
afterActive: ()=> {},
settings: ()=> {
return {
offset: '100%',
triggerOnce: true,
handler: function(){
var el=$(this.element).length ? $(this.element):$(this);
var lineW=simple ? 4:8;
el.easyPieChart({
animate: 1000,
lineCap: 'circle',
lineWidth: lineW,
size: 140,
scaleColor: false
});
if(typeof this.destroy!=='undefined'&&$.isFunction(this.destroy)){
this.destroy();
}}
}}
},
{
name: 'Progress Icons',
location: '.progress_icons',
beforeActive: ()=> {},
afterActive: ()=> {},
settings: ()=> {
return {
offset: '100%',
triggerOnce: true,
handler: function(){
var el=$(this.element).length ? $(this.element):$(this);
var active=el.attr('data-active');
var color=el.attr('data-color');
var transparent=el.hasClass('transparent');
var icon=el.find('.progress_icon');
var timeout=200;
icon.each(function(i){
if(i < active){
var time=(i + 1) * timeout;
setTimeout(function(){
$(icon[i]).addClass('themebg');
if(transparent){
$(icon[i]).css('color', color);
}else{
$(icon[i]).css('background-color', color);
}}, time);
}});
if(typeof this.destroy!=='undefined'&&$.isFunction(this.destroy)){
this.destroy();
}}
}}
},
{
name: 'Animate Math | Counter, Quick Fact, etc.',
location: '#Wrapper .animate-math .number',
beforeActive: ()=> {},
afterActive: ()=> {},
settings: ()=> {
return {
offset: '100%',
triggerOnce: true,
handler: function(){
var el=$(this.element).length ? $(this.element):$(this);
var duration=el.attr('data-duration') * 1||Math.floor((Math.random() * 1000) + 1000);
var thousands_separator=el.attr('data-thousands-separator')||0;
var to=el.attr('data-to');
$({
property: 0
}).animate({
property: to
}, {
duration: duration,
easing: 'linear',
step: function(){
if('comma'==thousands_separator){
el.text(Math.floor(this.property).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","))
}else if('dot'==thousands_separator){
el.text(Math.floor(this.property).toString().replace(/\B(?=(\d{3})+(?!\d))/g, "."))
}else if('space'==thousands_separator){
el.text(Math.floor(this.property).toString().replace(/\B(?=(\d{3})+(?!\d))/g, " "))
}else{
el.text(Math.floor(this.property));
}},
complete: function(){
if('comma'==thousands_separator){
el.text(Math.floor(this.property).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","))
}else if('dot'==thousands_separator){
el.text(Math.floor(this.property).toString().replace(/\B(?=(\d{3})+(?!\d))/g, "."))
}else if('space'==thousands_separator){
el.text(Math.floor(this.property).toString().replace(/\B(?=(\d{3})+(?!\d))/g, " "))
}else{
el.text(Math.floor(this.property));
}}
});
if(typeof this.destroy!=='undefined'&&$.isFunction(this.destroy)){
this.destroy();
}}
}}
},
{
name: 'Infinite Scroll | Blog & Portfolio',
location: '.mfn-infinite-load-button',
infiniteLoadButton: $('.mfn-infinite-load-button a'),
beforeActive: ()=> {},
afterActive: ({infiniteLoadButton})=> {
},
settings: ({infiniteLoadButton, location})=> {
return {
handler: function(direction){
infiniteScrollFunction($(location), infiniteLoadButton, direction);
},
offset: function(){
var offsetPosition=-(($(this)[0].element.scrollHeight) - (window.innerHeight / 1.2));
return offsetPosition;
}}
}},
{
name: 'Bars List',
location: '.bars_list',
beforeActive: ()=> {},
afterActive: ({infiniteLoadButton})=> {},
settings: ()=> {
return {
offset: '100%',
triggerOnce: true,
handler: function(){
var el=$(this.element).length ? $(this.element):$(this);
el.addClass('hover');
if(typeof this.destroy!=='undefined'&&$.isFunction(this.destroy)){
this.destroy();
}}
}}
}
]
}
runWaypoints(){
const waypoints=this.getList;
waypoints.map(item=> {
if($(item.location).length){
item.beforeActive(item)
queueMicrotask(()=> $(item.location).waypoint(item.settings(item)));
item.afterActive(item);
}})
}}
const mfnWaypoints=new Waypoints;
mfnWaypoints.runWaypoints();
$(document).on('mfn:waypoints', function(){
mfnWaypoints.runWaypoints();
})
if($('.promo_bar_slider').length){
promoBarSlider();
}
if($('.mfn-looped-items-slider').length){
queryLoopSlider();
}
headerTemplate.init();
footerTemplate.init();
bannerBox.init();
mfnSideMenu.init();
mfnReadMore.init();
if($('.mfn-menu-item-megamenu').length){
headerMegamenu.init();
}
function sidebarSticky(){
var spacing=fixStickyHeaderH();
if(! mfn.sidebarSticky){
return false;
}
if($('.woocommerce-store-notice').length){
spacing +=$('.woocommerce-store-notice').outerHeight()||0;
}
sidebar=$('.mcb-sidebar .widget-area').stickySidebar({
topSpacing: spacing
});
}
sidebarSticky();
$(window).on('debouncedresize', function(){
if($(window).width() < 767){
screen='mobile';
}else if($(window).width() < 959){
screen='tablet';
}else if($(window).width() > 960){
screen='desktop';
}
bannerBox.init();
newWidth=$(window).width();
if(newWidth!=currWidth){
currWidth=$(window).width();
headerTemplate.init();
footerTemplate.init();
}
if($(window).width() < 767&&!$('.mfn-off-canvas-sidebar').length){
offCanvasSidebar.mobile();
}else{
$('html').removeClass('mfn-ofcs-opened');
}});
$('.overlay-menu-toggle').on('click',function(e){
e.preventDefault();
$(this).toggleClass('focus');
$('#Overlay').stop(true, true).fadeToggle(500);
var menuH=$('#Overlay nav').height()||0;
menuH=menuH / 2;
$('#Overlay nav').css('margin-top', '-' + menuH + 'px');
});
$('#Overlay').on('click', '.menu-item > a', function(){
$('.overlay-menu-toggle').trigger('click');
});
$('.header-overlay').on('keydown', function(event){
if(27==event.keyCode){
$('.overlay-menu-toggle.focus').trigger('click');
}});
$('.responsive-menu-toggle').on('click', function(e){
e.preventDefault();
var el=$(this);
var menu=$('#Top_bar #menu');
var menuWrap=menu.closest('.top_bar_left');
el.toggleClass('active');
if(el.hasClass('is-sticky')&&el.hasClass('active')&&(window.innerWidth < 768)){
var top=0;
if(menuWrap.length){
top=menuWrap.offset().top - adminBarH();
}
$('body,html').animate({
scrollTop: top
}, 200);
}
menu.stop(true, true).slideToggle(200);
});
$('#Top_bar #menu').on('click', 'a:not(.menu-toggle)', function(){
var $menuButton=$('.responsive-menu-toggle.active');
if($menuButton.length){
setTimeout(function(){
$menuButton.trigger('click');
},300);
}});
function sideSlide(){
var slide=$('#Side_slide');
var overlay=$('#body_overlay');
var ssMobileInitW=mobileInitW;
var pos='right';
var shiftSlide=-slide.data('width');
var shiftBody=shiftSlide / 2;
var constructor=function(){
if(!slide.hasClass('enabled')){
$('nav#menu').detach().appendTo('#Side_slide .menu_wrapper');
slide.addClass('enabled');
}};
var destructor=function(){
if(slide.hasClass('enabled')){
close();
$('nav#menu').detach().prependTo('#Top_bar .menu_wrapper');
slide.removeClass('enabled');
}};
var reload=function(){
if(window.innerWidth < ssMobileInitW){
constructor();
}else if($('body').hasClass('header-shop')){
if($('#Top_bar').hasClass('is-sticky')){
$(document).trigger('mfn:header:sticky:on');
}else{
$(document).trigger('mfn:header:sticky:off');
}}else{
destructor();
}};
var init=function(){
if(slide.hasClass('left')){
pos='left';
}
if($('body').hasClass('responsive-off')){
ssMobileInitW=0;
}
if($('body').hasClass('header-simple')){
ssMobileInitW=9999;
}
if($('#Top_bar').hasClass('is-sticky')){
$(document).trigger('mfn:header:sticky:on');
}
reload();
};
var reset=function(time){
$('.lang-active.active', slide).removeClass('active').children('i').attr('class', 'icon-down-open-mini');
$('.lang-wrapper', slide).fadeOut(0);
$('.icon.search.active', slide).removeClass('active');
$('.search-wrapper', slide).fadeOut(0);
$('.menu_wrapper, .social', slide).fadeIn(time);
};
var button=function(){
if(pos=='left'){
slide.animate({
'left': 0
}, 300);
$('body').animate({
'right': shiftBody
}, 300);
}else{
slide.animate({
'right': 0
}, 300);
$('body').animate({
'left': shiftBody
}, 300);
}
overlay.fadeIn(300);
$('body').addClass('side-slide-is-open');
reset(0);
};
var close=function(){
if(pos=='left'){
slide.animate({
'left': shiftSlide
}, 300);
$('body').animate({
'right': 0
}, 300);
}else{
slide.animate({
'right': shiftSlide
}, 300);
$('body').animate({
'left': 0
}, 300);
}
overlay.fadeOut(300);
$('body').removeClass('side-slide-is-open');
if($('body').hasClass('keyboard-support')){
$('#Side_slide').attr('aria-expanded', 'false');
}
if($('rs-module').length){
setTimeout(function(){
$(window).trigger('resize');
redrawAllRevolutionSliders();
}, 310);
}};
$('.icon.search', slide).on('click', function(e){
e.preventDefault();
var el=$(this);
if(el.hasClass('active')){
$('.search-wrapper', slide).fadeOut(0);
$('.menu_wrapper, .social', slide).fadeIn(300);
}else{
$('.search-wrapper', slide).fadeIn(300);
$('.menu_wrapper, .social', slide).fadeOut(0);
$('.lang-active.active', slide).removeClass('active').children('i').attr('class', 'icon-down-open-mini');
$('.lang-wrapper', slide).fadeOut(0);
}
el.toggleClass('active');
});
$('a.submit', slide).on('click', function(e){
e.preventDefault();
$('#side-form').submit();
});
$('.lang-active', slide).on('click', function(e){
e.preventDefault();
var el=$(this);
if(el.hasClass('active')){
$('.lang-wrapper', slide).fadeOut(0);
$('.menu_wrapper, .social', slide).fadeIn(300);
el.children('i').attr('class', 'icon-down-open-mini');
}else{
$('.lang-wrapper', slide).fadeIn(300);
$('.menu_wrapper, .social', slide).fadeOut(0);
el.children('i').attr('class', 'icon-up-open-mini');
$('.icon.search.active', slide).removeClass('active');
$('.search-wrapper', slide).fadeOut(0);
}
el.toggleClass('active');
});
$('.responsive-menu-toggle').off('click');
$('.responsive-menu-toggle').on('click', function(e){
e.preventDefault();
button();
});
overlay.on('click', function(e){
close();
});
$('.close', slide).on('click', function(e){
e.preventDefault();
close();
});
$(slide).on('click', '.menu_wrapper a:not(.menu-toggle), .action_button', function(e){
if($(this).hasClass('mega-menu-link')){
return;
}
if('#'==$(this).attr('href')){
e.preventDefault();
return;
}
setTimeout(function(){
close();
},500);
});
$(slide).on('click', function(e){
if($(e.target).is(slide)){
reset(300);
}});
$(window).on('debouncedresize', reload);
if($('body').hasClass('header-shop')){
$(document).on('mfn:header:sticky:on', function(){
if(window.innerWidth >=ssMobileInitW){
$('#Top_bar .menu_wrapper').css('min-height', '70px');
constructor();
}});
$(document).on('mfn:header:sticky:off', function(){
if(window.innerWidth >=ssMobileInitW){
destructor();
}});
}
init();
}
if($('body').hasClass('mobile-side-slide')){
sideSlide();
}
msnryGalleryInit();
$('.sections_group .wp-block-gallery').each(function(index){
var el=$(this);
var link=$('.blocks-gallery-item a, .wp-block-image a', el);
if((/\.(gif|jpg|jpeg|png)$/i).test(link.attr('href'))){
link.attr('rel', 'prettyphoto[wp5-gallery-' + index + ']');
}});
$('.widget_media_gallery .gallery').each(function(){
var el=$(this);
var id=el.attr('id');
$('.gallery-icon a', el).attr('rel', 'prettyphoto[widget-' + id + ']');
});
$('a[rel^="prettyphoto[portfolio]"]').each(function(){
var el=$(this);
var parent=el.closest('.column');
var index=$('.column').index(parent);
el.attr('rel', 'prettyphoto[portfolio-' + index + ']');
});
$('.elementor-page .woocommerce-product-gallery .woocommerce-product-gallery__image a').attr('href','');
function escapeHtml(text){
if(! text) return '';
const map={
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&#039;'
};
return text.replace(/[&<>"']/g, function(m){ return map[m]; });
}
function lightbox(){
var galleries=[];
var init=function(){
if(lightboxAttr){
compatibility();
setType();
constructor();
}};
var compatibility=function(){
$('a[rel^="prettyphoto"], a.prettyphoto, a[rel^="prettyphoto"]').each(function(){
var el=$(this);
var rel=el.attr('rel');
if(rel){
rel=rel.replace('prettyphoto', 'lightbox');
}else{
rel='lightbox';
}
el.removeClass('prettyphoto').attr('rel', rel);
});
};
var isGallery=function(rel){
if(!rel){
return false;
}
var regExp=/\[(?:.*)\]/;
var gallery=regExp.exec(rel);
if(gallery){
gallery=gallery[0];
gallery=gallery.replace('[', '').replace(']', '');
return gallery;
}
return false;
};
var setGallery=function(gallery){
if(galleries.indexOf(gallery)==-1){
galleries.push(gallery);
return true;
}
return false;
};
var getType=function(src){
if(src.match(/youtube\.com\/watch/i)||src.match(/youtube\.com\/embed/i)||src.match(/youtu\.be/i)){
return 'iframe';
}else if(src.match(/youtube-nocookie\.com/i)){
return 'iframe';
}else if(src.match(/vimeo\.com/i)){
return 'iframe';
}else if(src.match(/\biframe=true\b/i)){
return 'ajax';
}else if(src.match(/\bajax=true\b/i)){
return 'ajax';
}else if(src.match(/\.mp4/i)){
return 'mp4';
}else if(src.substr(0, 1)=='#'){
return 'inline';
}else{
return 'image';
}};
var setType=function(){
$('a[rel^="lightbox"]').each(function(){
var el=$(this);
var href=el.attr('href');
var rel=el.attr('rel');
if(el.closest('.wpb_column').length){
}
if(href){
var gallery=isGallery(rel);
if(gallery){
el.attr('data-lightbox-type', 'gallery');
setGallery(gallery);
return true;
}
el.attr('data-lightbox-type', getType(href));
if(getType(href)=='iframe'){
el.attr('href', href.replace('&rel=0', ''));
}}
});
};
var constructor=function(){
if(!galleries.length
&& !$('a[rel^="lightbox"][data-lightbox-type="image"]').length
&& !$('a[rel^="lightbox"][data-lightbox-type="iframe"]').length
&& !$('a[rel^="lightbox"][data-lightbox-type="inline"]').length
&& !$('a[rel^="lightbox"][data-lightbox-type="mp4"]').length
&& !$('a[rel^="pdf-lightbox"]').length
) return;
var attr={
autoFocusLast: false,
removalDelay: 160,
image: {
titleSrc: function(item){
var img=item.el.closest('.image_wrapper, li').find('img').first();
if(lightboxAttr.title&&img.length){
return escapeHtml(img.attr('alt'));
}else{
return false;
}}
}};
$('a[rel^="lightbox"][data-lightbox-type="image"]').magnificPopup({
autoFocusLast: attr.autoFocusLast,
removalDelay: attr.removalDelay,
type: 'image',
image: attr.image
});
$('a[rel^="lightbox"][data-lightbox-type="iframe"]').magnificPopup({
autoFocusLast: attr.autoFocusLast,
removalDelay: attr.removalDelay,
type: 'iframe',
iframe: {
patterns: {
youtube: {
index: 'youtube.com/',
id: 'v=',
src: '//www.youtube.com/embed/%id%?autoplay=1&rel=0'
},
youtu_be: {
index: 'youtu.be/',
id: '/',
src: '//www.youtube.com/embed/%id%?autoplay=1&rel=0'
},
nocookie: {
index: 'youtube-nocookie.com/embed/',
id: '/',
src: '//www.youtube-nocookie.com/embed/%id%?autoplay=1&rel=0'
}}
}});
$('a[rel^="lightbox"][data-lightbox-type="mp4"]').magnificPopup({
autoFocusLast: attr.autoFocusLast,
removalDelay: attr.removalDelay,
type: 'iframe',
iframe: {
markup: '<div class="mfp-mp4 popup-content">'+
'<video controls mute autoplay>'+
'<source class="mfp-source" type="video/mp4">'+
'</video>'+
'<div class="mfp-close"></div>'+
'</div>',
patterns: {
mp4: {
src: '%id%',
}},
srcAction: 'source_src',
}});
$('a[rel^="pdf-lightbox"]').magnificPopup({
autoFocusLast: attr.autoFocusLast,
removalDelay: attr.removalDelay,
type: 'iframe'
});
$('a[rel^="lightbox"][data-lightbox-type="inline"]').magnificPopup({
autoFocusLast: attr.autoFocusLast,
type: 'inline',
midClick: true,
callbacks: {
open: function(){
$('.mfp-content').children().addClass('mfp-inline')
},
beforeClose: function(){
$('.mfp-content').children().removeClass('mfp-inline');
}}
});
for (var i=0, len=galleries.length; i < len; i++){
var gallery='[' + galleries[i] + ']';
gallery='a[rel^="lightbox' + gallery + '"]:visible';
$(gallery).magnificPopup({
autoFocusLast: attr.autoFocusLast,
removalDelay: attr.removalDelay,
type: 'image',
image: attr.image,
gallery: {
enabled: true,
tCounter: '%curr% / %total%'
}});
}
$('.elementor-page a[rel^="lightbox"]:not(.popup-link):not(.rs-layer):not([data-lightbox-type="iframe"])').off('click');
setTimeout(function(){
var $doc=$('body');
var $events=$._data($doc[0],"events");
if($events&&$events.click){
for(var i=$events.click.length-1; i>=0; i--){
var handler=$events.click[i];
if(handler&&handler.selector&&handler.selector.indexOf('lightbox')!==-1){
$('.wpb_column a[rel^="lightbox"]:not(.popup-link)').off('click');
}}
}},0);
};
var reload=function(){
$('a[rel^="lightbox"]').off('click');
constructor();
};
init();
mfnIsotope.addEventListener('arrange', reload);
$(document).ajaxComplete(function(){
reload();
});
}
lightbox();
$(document).on('mfnPopupInit', function(){
lightbox();
});
$(document).on('mfn:tabber:open', function(){
lightbox();
});
function mainMenu(){
var mmMobileInitW=mobileInitW;
if($('body').hasClass('header-simple')||$('#Header_creative.dropdown').length){
mmMobileInitW=9999;
}
$('#menu > ul.menu').mfnMenu({
addLast: true,
arrows: true,
mobileInit: mmMobileInitW,
responsive: mfn.responsive
});
$('#secondary-menu > ul.secondary-menu').mfnMenu({
mobileInit: mmMobileInitW,
responsive: mfn.responsive
});
}
mainMenu();
function onePageScroll(){
if(!$('body').hasClass('one-page')){
var menu=$('#menu');
if(menu.find('li.scroll').length > 1){
menu.find('li.current-menu-item:not(:first)').removeClass('current-menu-item currenet-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor');
menu.on('click','a',function(){
$(this).closest('li').siblings('li').removeClass('current-menu-item currenet-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor');
$(this).closest('li').addClass('current-menu-item');
});
}}
}
onePageScroll();
function onePageMenu(){
if($('body').hasClass('one-page')){
var menu=$('#menu');
if($('#mfn-header-template').length) menu=$('#mfn-header-template .mfn-header-menu');
$('a[href]', menu).each(function(){
var url=$(this).attr('href');
if(url&&url.split('#')[1]){
var hash='#' + url.split('#')[1];
if(hash&&$(hash).length){
$(this).attr('data-hash', hash);
$(hash).attr('data-id', hash);
}
var vcHash='#' + url.split('#')[1];
var vcClass='.vc_row.' + url.split('#')[1];
if(vcClass&&$(vcClass).length){
$(this).attr('data-hash', vcHash);
$(vcClass).attr('data-id', vcHash);
}}
});
var hash;
var activeSelector='li.current-menu-item, li.current-menu-parent, li.current-menu-ancestor, li.current-page-ancestor, li.current_page_item, li.current_page_parent, li.current_page_ancestor';
var activeClasses='current-menu-item current-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor';
if($(activeSelector, menu).length){
$(activeSelector, menu)
.not(':first').removeClass(activeClasses);
hash=$(activeSelector, menu).find('a[data-hash]').attr('data-hash');
if(hash){
hash='[data-id="' + hash + '"]';
if($(hash).length&&$(hash).visible(true)){
}else{
$(activeSelector, menu).removeClass('current-menu-item current-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor')
.closest('li').removeClass('current-menu-item current-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor');
}}else{
}}else{
var first=$('li:first-child', menu);
var firstA=first.children('a');
if(firstA.attr('data-hash')){
hash=firstA.attr('data-hash');
hash='[data-id="' + hash + '"]';
if($(hash).length&&($(hash).offset().top==adminBarH())){
first.addClass('current-menu-item');
}}
}
var menu_item=$('#menu a[data-hash]');
if($('#mfn-header-template').length) menu_item=$('#mfn-header-template .mfn-header-menu a[data-hash]');
menu_item.on('click', function(e){
e.preventDefault();
if($('html').hasClass('mfn-header-tmpl-burger-sidebar-opened')){
$('html').removeClass('mfn-header-tmpl-burger-sidebar-opened scrollbar-hidden');
}
menu.find('li').removeClass('current-menu-item');
$(this)
.closest('li').addClass('current-menu-item')
.closest('.menu > li').addClass('current-menu-item');
var hash=$(this).attr('data-hash');
hash='[data-id="' + hash + '"]';
if(window.innerWidth < 768){
$('.responsive-menu-toggle').removeClass('active');
$('#Top_bar #menu').hide();
}
var headerFixedAbH=$('.header-fixed.ab-show #Action_bar').innerHeight()||0;
var tabsHeaderH=$(hash).siblings('.ui-tabs-nav').innerHeight()||0;
var offset=headerFixedAbH + tabsHeaderH + adminBarH();
var stickyH=fixStickyHeaderH();
if($('body').hasClass('header-below')&&$('#Content').length){
if($(hash).offset().top < ($('#Content').offset().top + 60)){
stickyH=-1;
}}
$('html, body').animate({
scrollTop: $(hash).offset().top - offset - stickyH
}, 500);
if($(this).closest('.column_header_burger').length){
$('body').trigger('click');
}});
}}
onePageMenu();
var cHeader='body:not(.header-open) #Header_creative',
cHeaderEl=$(cHeader),
cHeaderCurrnet;
function creativeHeader(){
$('.creative-menu-toggle').on('click', function(e){
e.preventDefault();
cHeaderEl.addClass('active');
$('.creative-menu-toggle, .creative-social', cHeaderEl).fadeOut(500);
$('#Action_bar', cHeaderEl).fadeIn(500);
});
}
creativeHeader();
$(document).on('mouseenter', cHeader, function(){
cHeaderCurrnet=1;
});
$(document).on('mouseleave', cHeader, function(){
cHeaderCurrnet=null;
setTimeout(function(){
if(!cHeaderCurrnet){
cHeaderEl.removeClass('active');
$('.creative-menu-toggle, .creative-social', cHeaderEl).fadeIn(500);
$('#Action_bar', cHeaderEl).fadeOut(500);
}}, 1000);
});
function creativeHeaderFix(){
if($('body').hasClass('header-creative')&&window.innerWidth >=768){
if($('#Top_bar').hasClass('is-sticky')){
$('#Top_bar').removeClass('is-sticky');
}}
}
$(document).on("click", ".mfn-header-tmpl .mfn-header-menu-toggle", function(e){
e.preventDefault();
if($(this).closest('.mcb-column').hasClass('mfn-header-tmpl-menu-active')){
$(document).unbind('click', hideSidebarTmplBurger);
$(this).closest('.mcb-column').removeClass('mfn-header-tmpl-menu-active');
removeBringToFront();
if($('.mfn-header-tmpl-classic-menu').length) $('.mfn-header-tmpl-classic-menu').remove();
$(this).closest('.mcb-column-inner').find('.mfn-header-tmpl-menu-sidebar').attr('aria-expanded', false);
$('html').removeClass('mfn-header-tmpl-burger-sidebar-opened scrollbar-hidden');
}else{
$(document).bind('click', hideSidebarTmplBurger);
$(this).closest('.mcb-column').addClass('mfn-header-tmpl-menu-active');
$(this).closest('.mcb-column').addClass('mfn-bring-to-front');
$(this).closest('.mcb-wrap').addClass('mfn-bring-to-front');
$(this).closest('.mcb-section').addClass('mfn-bring-to-front');
$(this).closest('.mcb-column-inner').find('.mfn-header-tmpl-menu-sidebar').attr('aria-expanded', true);
if($(this).closest('.mcb-column-inner').find('.mfn-header-classic-mobile-menu').length){
var offset_top=$(this).closest('.section').offset().top + $(this).closest('.section').outerHeight() - $(window).scrollTop();
$('body').append('<style class="mfn-header-tmpl-classic-menu">.mfn-header-tmpl-menu-sidebar.mfn-header-classic-mobile-menu{ top: '+offset_top+'px; max-height: '+($(window).height() - offset_top)+'px} .column_header_burger.mfn-header-tmpl-menu-active:before{ top: '+offset_top+'px; max-height: '+($(window).height() - offset_top)+'px}</style>');
}
$('html').addClass('mfn-header-tmpl-burger-sidebar-opened');
var htmlW=$('html').width();
if($('html').width()!=htmlW){
$('html').addClass('scrollbar-hidden');
}}
});
$(document).on("click", ".mfn-header-tmpl-menu-sidebar .mfn-header-menu .mfn-menu-li a", function (e){
if($(this).closest('#mfn-header-template').length) return;
const $a=$(this);
const href=$a.attr("href")||"";
const $html=$("html");
const $header=$(".mfn-header-tmpl.mfn-header-main");
if(href==="#"){
e.preventDefault();
$a.closest("li").toggleClass("current-menu-item");
return;
}
let hash="";
const hashIndex=href.indexOf("#");
if(hashIndex!==-1) hash=href.slice(hashIndex + 1);
if(!hash) return;
const $target=$("#" + CSS.escape(hash));
if(!$target.length) return;
e.preventDefault();
const isFixedOrSticky =
$header.hasClass("mfn-header-tmpl-fixed")||$header.hasClass("mfn-hasSticky");
const headerH=isFixedOrSticky ? $header.outerHeight():0;
const $li=$a.closest("li");
$li.closest("ul").find("li.current-menu-item").removeClass("current-menu-item");
$li.addClass("current-menu-item");
const scrollOffset=$target.offset().top - headerH;
$("html, body").stop(true).animate({ scrollTop: scrollOffset }, 500);
$(document).off("click", hideSidebarTmplBurger);
$a.closest(".mcb-column").removeClass("mfn-header-tmpl-menu-active");
removeBringToFront();
if($html.hasClass("mfn-header-tmpl-burger-sidebar-opened")){
$html.removeClass("mfn-header-tmpl-burger-sidebar-opened scrollbar-hidden");
}}
);
$(document).on("click", ".mfn-off-canvas-sidebar .widget_nav_menu ul.menu li a", function(e){
let href=$(this).attr('href');
if($(href).length&&href.startsWith("#")){
e.preventDefault();
let header_h=0;
if($('.mfn-header-tmpl.mfn-header-main').hasClass('mfn-header-tmpl-fixed')||$('.mfn-header-tmpl.mfn-header-main').hasClass('mfn-hasSticky')){
header_h=$('.mfn-header-tmpl.mfn-header-main').outerHeight();
}
$(this).closest('ul').find('li.current-menu-item').removeClass('current-menu-item');
$(this).closest('li').addClass('current-menu-item');
let scroll_offset=$(href).offset().top - header_h;
$('body, html').animate({ scrollTop: scroll_offset }, 500);
if($('html').hasClass('mfn-ofcs-opened')){
$('html').removeClass('mfn-ofcs-opened');
}}
});
function hideSidebarTmplBurger(e){
var div=$('.mfn-header-tmpl-menu-sidebar');
if(!div.is(e.target)&&div.has(e.target).length===0){
$('.mfn-header-tmpl-menu-active').removeClass('mfn-header-tmpl-menu-active');
div.attr('aria-expanded', 'false');
$(document).unbind('click', hideSidebarTmplBurger);
removeBringToFront();
if($('.mfn-header-tmpl-classic-menu').length) $('.mfn-header-tmpl-classic-menu').remove();
$('html').removeClass('mfn-header-tmpl-burger-sidebar-opened scrollbar-hidden');
}}
function removeBringToFront(){
if($('.mfn-bring-to-front').length){
$('.mfn-bring-to-front').removeClass('mfn-bring-to-front');
}}
$(document).on("click", "body:not(.mfn-ui) .mfn-sidemenu-tmpl .mfn-searchbar-toggle, body:not(.mfn-ui) .mfn-header-tmpl .mfn-searchbar-toggle, .mfn-header-tmpl .search_wrapper .mfn-close-icon, .mfn-sidemenu-tmpl .search_wrapper .mfn-close-icon", function(e){
e.preventDefault();
if($(this).closest('.mcb-column-inner').hasClass('mfn-searchbar-active')){
$(this).closest('.mcb-column-inner').removeClass('mfn-searchbar-active');
$('html').removeClass('mfn-popup-browser-scroll-disabled');
$('body').removeClass('search-overlay-opened');
removeBringToFront();
}else{
$(this).closest('.mcb-column-inner').addClass('mfn-searchbar-active');
$(this).closest('.mcb-column').addClass('mfn-bring-to-front');
$(this).closest('.mcb-wrap').addClass('mfn-bring-to-front');
$(this).closest('.mcb-section').addClass('mfn-bring-to-front');
if($(this).closest('.mcb-column-inner').find('input.field').length){
$(this).closest('.mcb-column-inner').find('input.field').focus();
}
if($('body').hasClass('search-scroll-disable')){
$('html').addClass('mfn-popup-browser-scroll-disabled');
}
$('body').addClass('search-overlay-opened');
}});
$(".search_button:not(.has-input), #Top_bar .icon_close").on('click', function(e){
e.preventDefault();
if($(this).closest('.mfn-header-tmpl').length){
$(this).closest('.mcb-column').toggleClass('mfn-searchbar-active');
}else{
const search=$('.search_wrapper')
if(search.css('display')==='none'){
search.fadeIn().find('.field').focus();
if($('body').hasClass('search-scroll-disable')){
$('html').addClass('mfn-popup-browser-scroll-disabled');
}
$('body').addClass('search-overlay-opened');
setTimeout(function(){ search.addClass('mfn-loaded') }, 300);
}else{
search.fadeOut().removeClass('mfn-loaded');
$('html').removeClass('mfn-popup-browser-scroll-disabled');
$('body').removeClass('search-overlay-opened');
}}
});
$(document).on('keydown', function(e){
if(e.key==='Escape'&&$('.search_wrapper').is(':visible')&&$('body').hasClass('search-overlay-opened')){
$('.search_wrapper .icon_close').trigger('click');
}});
function mfnWPML(){
$('#menu .menu-item-language:not(.menu-item-language-current)').each(function(){
var el=$(this).children('a');
if(!el.children('span:not(.icl_lang_sel_bracket)').length){
el.wrapInner('<span></span>');
}});
$('#menu span.icl_lang_sel_bracket').each(function(){
var el=$(this);
el.replaceWith(el.html());
});
}
mfnWPML();
function breadcrumbsRemoveLastLink(){
if(!$('.breadcrumbs.no-link').length) return;
$('.breadcrumbs.no-link').each(function(){
var el=$(this).find('li').last();
var text=el.text();
el.html(text);
});
}
breadcrumbsRemoveLastLink();
$('.downcount:not(.mfn-initialized)').each(function(){
var el=$(this);
el.addClass('mfn-initialized');
el.downCount({
date: el.attr('data-date'),
offset: el.attr('data-offset')
});
});
$('.tooltip, .hover_box')
.on('touchstart', function(){
$(this).toggleClass('hover');
})
.on('touchend', function(){
$(this).removeClass('hover');
});
$("#popup_contact .footer_button").on('click', function(e){
e.preventDefault();
$(this).parent().toggleClass('focus');
});
if($('#Header_creative.scroll').length&&window.innerWidth >=1240){
$('#Header_creative.scroll').niceScroll({
autohidemode: false,
cursorborder: 0,
cursorborderradius: 5,
cursorcolor: '#222222',
cursorwidth: 0,
horizrailenabled: false,
mousescrollstep: 40,
scrollspeed: 60
});
}
$('.sliding-top-control').on('click', function(e){
e.preventDefault();
$('#Sliding-top .widgets_wrapper').slideToggle();
$('#Sliding-top').toggleClass('active');
});
$('body').on('click', '.alert .close', function(e){
e.preventDefault();
$(this).closest('.alert').hide(300);
});
$('.fixed-nav').appendTo('body');
$('.feature_list').each(function(){
var col=$(this).attr('data-col') ? $(this).attr('data-col'):4;
$(this).find('li:nth-child(' + col + 'n):not(:last-child)').after('<hr />');
});
function checkIE(){
var ua=window.navigator.userAgent;
var msie=ua.indexOf("MSIE ");
if(msie > 0&&parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)))==9){
$("body").addClass("ie");
}}
checkIE();
var ua=navigator.userAgent,
isMobileWebkit=/WebKit/.test(ua)&&/Mobile/.test(ua);
if(! isMobileWebkit&&window.innerWidth >=768){
if(mfn.parallax=='stellar'){
$.stellar({
horizontalScrolling: false,
responsive: true
});
}else{
$(window).enllax();
}}else{
$('div[data-enllax-ratio], div[data-stellar-ratio]').css('background-attachment', 'scroll');
}
if($('.mfn-query-pagination-infiniteload .next').length){
var mfnQueryPaginationWaypoint=new Waypoint({
element: $('.mfn-query-pagination-infiniteload .next'),
handler: function(direction){
$(this.element).trigger('click');
},
offset: '100%'
})
}
if($('.mfn-query-pagination-loadmore .next').length){
$(document).on('click', '.mfn-query-pagination-loadmore .next', function(e){
e.preventDefault();
if($(this).hasClass('loading')) return;
let button=$(this);
let wrapper='.'+button.closest('.mcb-section').attr('class').replaceAll('  ', '.').replaceAll(' ', '.');
let href=button.attr('href');
button.addClass('loading');
$.get(href, function(data){
$(wrapper+' .section_wrapper').append($(wrapper+' .section_wrapper', data).html());
if($(wrapper+' .mfn-query-pagination', data).length) $(wrapper+' .mfn-query-pagination').replaceWith($(wrapper+' .mfn-query-pagination', data));
if($(wrapper+' .isotope').length){
$(wrapper+' .isotope').imagesLoaded().progress(function(){
$(wrapper+' .isotope').isotope('reloadItems');
});
}
lightbox();
if($(wrapper).find('.mfn-query-loop-masonry').length){
queryLoopMasonry();
}
if($(wrapper+' .mfn-query-pagination').hasClass('mfn-query-pagination-infiniteload')){
mfnQueryPaginationWaypoint.destroy();
$(wrapper).imagesLoaded(function(){
$(window).trigger('resize');
if($('.mfn-query-pagination-infiniteload .next').length){
mfnQueryPaginationWaypoint=new Waypoint({
element: $('.mfn-query-pagination-infiniteload .next'),
handler: function(direction){
$(this.element).trigger('click');
},
offset: '100%'
})
}});
}});
});
}
$(document).on('click', '.pager_load_more', function(e){
e.preventDefault();
var el=$(this);
var pager=el.closest('.pager_lm');
var href=el.attr('href');
var index=$('.content_wrapper .lm_wrapper').index(el.closest('.mcb-column-inner').find('.lm_wrapper'));
el.fadeOut(50);
pager.addClass('loading');
$.get(href, function(data){
var content=$('.content_wrapper .lm_wrapper', data).eq(index).html();
var $content;
if(content.indexOf('<')===-1){
$content=$('<div>').text(content);
}else{
$content=$(content);
}
href=$('.content_wrapper .lm_wrapper:eq(' + index + ')', data).next().find('.pager_load_more').attr('href');
if($('.content_wrapper .lm_wrapper:eq(' + index + ')').hasClass('isotope')){
const location='.content_wrapper .lm_wrapper:eq(' + index + ')';
$(location).append($content);
mfnIsotope.queryIsotopeAPI(location, 'appended', $content);
mfnIsotope.addIsotopeLocation({ name: 'Load More - Ajax', location });
if($(location).find('.isotope-item').length){
$(location).imagesLoaded().progress(function(){
$(location).isotope('reloadItems');
});
}}else if($('.content_wrapper .lm_wrapper:eq(' + index + ')').hasClass('mfn-woo-products')){
if(typeof href==='undefined'){
href=$('.content_wrapper .lm_wrapper:eq(' + index + ') .pager_load_more', data).attr('href');
}
$('.content_wrapper .lm_wrapper:eq(' + index + ') ul.products').append($content.html());
var $listing=$('.content_wrapper .lm_wrapper:eq(' + index + ') ul.products.isotope');
if($listing.length){
$listing.imagesLoaded().progress(function(){
$listing.isotope('reloadItems');
});
}}else{
$content.hide().appendTo('.content_wrapper .lm_wrapper:eq(' + index + ')').fadeIn(1000);
}
pager.removeClass('loading');
if(href){
el.fadeIn();
el.attr('href', href);
}
lightbox();
if($('.lm_wrapper.isotope').length){
$('.lm_wrapper.isotope').imagesLoaded().progress(function(){
mfnIsotope.queryIsotopeAPI('.lm_wrapper.isotope');
});
}});
});
$('.filters_buttons .open').on('click', function(e){
e.preventDefault();
var type=$(this).closest('li').attr('class');
$('.filters_wrapper').show(200);
$('.filters_wrapper ul.' + type).show(200);
$('.filters_wrapper ul:not(.' + type + ')').hide();
});
$('.filters_wrapper .close a').on('click', function(e){
e.preventDefault();
$('.filters_wrapper').hide(200);
});
$('.portfolio_next_js').on('click', function(e){
e.preventDefault();
var item=$(this).closest('.portfolio-item').next();
if(item.length){
$('html, body').animate({
scrollTop: item.offset().top - fixStickyHeaderH()
}, 500);
}});
$('.portfolio_prev_js').on('click', function(e){
e.preventDefault();
var item=$(this).closest('.portfolio-item').prev();
if(item.length){
$('html, body').animate({
scrollTop: item.offset().top - fixStickyHeaderH()
}, 500);
}});
$('body').on('click', '.scroll > a, a.scroll, .mcb-column.scroll a', function(e){
var urlL=location.href.replace(/#.*/, '');
var urlT=this.href.replace(/#.*/, '');
if(urlL==urlT){
e.preventDefault();
}
var hash=this.hash;
var headerFixedAbH=$('.header-fixed.ab-show #Action_bar').innerHeight()||0;
var tabsHeaderH=$(hash).siblings('.ui-tabs-nav').innerHeight()||0;
var offset=headerFixedAbH + tabsHeaderH + adminBarH();
if($(this).parents('.table_of_content').length){
offset +=30;
}
if(hash&&$(hash).length){
$('html, body').animate({
scrollTop: $(hash).offset().top - offset - fixStickyHeaderH()
}, 500);
}});
$('.jq-tabs').tabs();
$('.fake-tabs > ul').on('click', 'a', function(e){
e.preventDefault();
var $li=$(this).closest('li');
var tab=$li.data('tab');
if($li.hasClass('active')){
return;
}
$li.addClass('active')
.siblings().removeClass('active');
$('.tab-'+ tab).addClass('active').attr('tabindex', 0)
.siblings('.tab').removeClass('active').attr('tabindex', -1);
$(window).trigger('resize');
});
$('body').on('click', '.mfn-toggle .toggle-bar', function(){
var $parent=$(this).parent(),
$toggle=$(this).closest('.mfn-toggle');
var speed=100;
if($parent.hasClass('active')){
if($toggle.is('.mfn-toggle-open-all')){
return;
}
$parent.removeClass('active')
.children('.toggle-content').slideUp(speed);
}else{
$parent.addClass('active')
.children('.toggle-content').slideDown(speed);
if(! $toggle.is('.mfn-toggle-open-more')){
$parent.siblings().removeClass('active')
.children('.toggle-content').slideUp(speed);
}}
setTimeout(function(){
$(window).trigger('resize');
}, speed);
});
$('.mfn-acc').each(function(){
var el=$(this);
if(el.hasClass('openAll')||el.find('.wpb_toggle_title_active').length){
el.find('.question')
.addClass('active')
.children(".answer")
.show();
}else{
var activeTab=el.attr('data-active-tab');
if(el.hasClass('open1st')) activeTab=1;
if(activeTab){
el.find('.question').eq(activeTab - 1)
.addClass('active')
.children(".answer")
.show();
}}
});
$('.mfn-acc .question > .title').on('click', function(){
if($(this).parent().hasClass('active')){
$(this).parent().removeClass('active').children(".answer").slideToggle(100);
}else{
if(!$(this).closest('.mfn-acc').hasClass('toggle')){
$(this).parents(".mfn-acc").children().each(function(){
if($(this).hasClass('active')){
$(this).removeClass('active').children(".answer").slideToggle(100);
}});
}
$(this).parent().addClass('active');
$(this).next(".answer").slideToggle(100);
}
setTimeout(function(){
$(window).trigger('resize');
}, 50);
});
$('.wpb_wrapper .vc_tta-panel-title').on('click', 'a', function(){
setTimeout(function(){
$(window).trigger('resize');
}, 50);
});
$('.helper .link.toggle').on('click', function(e){
e.preventDefault();
var el=$(this);
var id=el.attr('data-rel');
var parent=el.closest('.helper');
if(el.hasClass('active')){
el.removeClass('active');
parent.find('.helper_content > .item-' + id).slideUp(200);
setTimeout(function(){
parent.find('.helper_content > .item-' + id).removeClass('active');
}, 200);
}else{
parent.find('.links > .link.active').removeClass('active');
parent.find('.helper_content > .item.active').slideUp(200);
el.addClass('active');
parent.find('.helper_content > .item-' + id).addClass('active').hide().slideDown(200);
}
setTimeout(function(){
$(window).trigger('resize');
}, 50);
});
$(document).on('click', '.mfn-love', function(e){
e.preventDefault();
var el=$(this);
if(el.hasClass('loved')){
return false;
}
el.addClass('loved');
var post={
action: 'mfn_love',
post_id: el.attr('data-id')
};
$.post(mfn.ajax, post, function(data){
el.find('.label').html(data);
});
return false;
});
$('#back_to_top').on('click', function(){
$('body,html').animate({
scrollTop: 0
}, 500);
return false;
});
$('.section .section-nav').on('click', function(){
var el=$(this);
var section=el.closest('.section');
var offset=fixStickyHeaderH() + adminBarH();
if(el.hasClass('prev')){
if(section.prev().length){
$('html, body').animate({
scrollTop: section.prev().offset().top - offset
}, 500);
}}else{
if(section.next().length){
$('html, body').animate({
scrollTop: section.next().offset().top - offset
}, 500);
}}
});
$('#Intro .intro-next').on('click', function(){
var intro=$(this).closest('#Intro');
if(intro.next().length){
$('html, body').animate({
scrollTop: intro.next().offset().top - fixStickyHeaderH() - adminBarH()
}, 500);
}});
$('.widget_mfn_menu ul.submenus-click, .widget_mfn_menu ul.submenus-click-mobile').each(function(){
var el=$(this);
if(el.is('.submenus-click-mobile')&&$(window).width() > 767){
return;
}
$('a', el).on('click', function(e){
var li=$(this).closest('li');
if(li.hasClass('hover')||!li.hasClass('menu-item-has-children')){
}else{
e.preventDefault();
li.siblings('li').removeClass('hover')
.find('li').removeClass('hover');
$(this).closest('li').addClass('hover');
}});
});
function addToCart(){
$('body').on('click', '.add_to_cart_button', function(){
$(this)
.closest('.product')
.addClass('adding-to-cart')
.removeClass('added-to-cart');
});
$('body').on('added_to_cart', function(){
$('.adding-to-cart')
.removeClass('adding-to-cart')
.addClass('added-to-cart');
});
}
addToCart();
$('.woocommerce-product-rating').on('click', function(){
var el;
if($('.product_tabs_wrapper.fake-tabs').length){
el=$('.product_tabs_wrapper.fake-tabs');
$('li[data-tab="reviews"] a', el).trigger('click');
}else if($('.woocommerce-content .jq-tabs').length){
el=$('.woocommerce-content .jq-tabs');
$('.ui-tabs-nav a[href="#tab-reviews"]', el).trigger('click');
}else{
el=$('.woocommerce-content .accordion');
$('#reviews').closest('.question:not(.active)').children('.title').trigger('click');
}
var actionBarH=$('.header-fixed.ab-show #Action_bar').innerHeight()||0;
var offset=actionBarH + adminBarH();
$('html, body').animate({
scrollTop: el.offset().top - offset - fixStickyHeaderH()
}, 500);
});
$('body').on('click', '.quantity-change', function(e){
e.preventDefault();
var $el=$(this),
$input=$(this).siblings('input');
var step=parseFloat($input.attr('step'))||1,
minAttr=$input.attr('min'),
min=typeof minAttr!==typeof undefined&&minAttr!==false ? parseFloat(minAttr):1,
max=parseFloat($input.attr('max'))||9999,
current=$input.val() ? parseFloat($input.val()):min,
val=0;
if($el.hasClass('plus')){
val=current + step;
if(val > max){
val=current;
}}else{
val=current - step;
if(val < min){
val=current;
}}
val=Math.round(val * 10) / 10;
$input.val(val).trigger('change');
});
$(document).ajaxComplete(function(){
setTimeout(function(){
$(window).trigger('resize');
mfnSidebar();
}, 100);
});
$(window).on('debouncedresize', function(){
mfnIsotope.runIsotopes(false);
mfnFooter();
headerWidth();
mfnSidebar();
mfnIntroH();
creativeHeaderFix();
});
$('.mfn-cookies').on('click','.cookies-tab-nav a', function(e){
e.preventDefault();
consent.tabs($(this), false);
});
$('.mfn-cookies').on('click','#consent_customize', function(e){
e.preventDefault();
consent.tabs(false, 'details');
});
$('.mfn-cookies').on('click','#consent_allow', function(e){
e.preventDefault();
consent.all();
});
$('.mfn-cookies').on('click','#consent_selected', function(e){
e.preventDefault();
consent.selected();
});
$('.mfn-cookies').on('click','#consent_deny', function(e){
e.preventDefault();
consent.deny();
});
$('.mfn-cookies-reopen').on('click', function(e){
consent.reopen();
});
mfnSliderBlog();
mfnSliderClients();
mfnSliderOffer();
mfnSliderOfferThumb();
mfnSliderShop();
sliderPortfolio();
sliderTestimonials();
mfnFooter();
headerWidth();
mfnSidebar();
mfnIntroH();
hashNav();
gdpr();
consent.open();
tableContentAttachId();
topBarTopPosition();
if(!$('body').hasClass('mfn-ui')) mfnPopup.init();
});
$(window).on('scroll', function(){
mfnSticky();
mfnMobileSticky();
backToTopSticky();
onePageActive();
});
$(window).on('load', function(){
preloader();
queryLoopMasonry();
alignHeights();
function elementorDisableOnePage(){
if(! $('body').hasClass('one-page')){
return false;
}
setTimeout(function(){
var doc=$(document),
$events=$("a[href*='#']").length ? $._data(doc[0],"events"):null;
if($events&&$events.click){
for(var i=$events.click.length-1; i>=0; i--){
var handler=$events.click[i];
if(handler&&handler.namespace!="mPS2id"&&handler.selector==='a[href*="#"]') doc.off("click",handler.handler);
}}
}, 300);
}
elementorDisableOnePage();
function liveSearchItemZindex(){
$('.column_livesearch').each(function(){
$(this).closest('.mcb-wrap').addClass('has-live-search-element')
.closest('.mcb-section').addClass('has-live-search-element');
});
}
liveSearchItemZindex();
function retinaLogo(){
if(window.devicePixelRatio <=1){
return false;
}
var el, src, height,
parent=$('#Top_bar #logo'),
parentH=parent.data('height');
var maxH={
sticky: {
init: 35,
noPadding: 60,
overflow: 110
},
mobile: {
mini: 50,
miniNoPadding: 60
},
mobileSticky: {
init: 50,
noPadding: 60,
overflow: 80
}};
$('#Top_bar #logo img').each(function(index){
el=$(this);
src=el.data('retina');
height=el.height()||0;
if(el.hasClass('logo-main')){
if($('body').hasClass('logo-overflow')){
}else if(height > parentH){
height=parentH;
}}
if(el.hasClass('logo-sticky')){
if($('body').hasClass('logo-overflow')){
if(height > maxH.sticky.overflow){
height=maxH.sticky.overflow;
}}else if($('body').hasClass('logo-no-sticky-padding')){
if(height > maxH.sticky.noPadding){
height=maxH.sticky.noPadding;
}}else if(height > maxH.sticky.init){
height=maxH.sticky.init;
}}
if(el.hasClass('logo-mobile')){
if($('body').hasClass('mobile-header-mini')){
if(parent.data('padding') > 0){
if(height > maxH.mobile.mini){
height=maxH.mobile.mini;
}}else{
if(height > maxH.mobile.miniNoPadding){
height=maxH.mobile.miniNoPadding;
}}
}}
if(el.hasClass('logo-mobile-sticky')){
if($('body').hasClass('logo-no-sticky-padding')){
if(height > maxH.mobileSticky.noPadding){
height=maxH.mobileSticky.noPadding;
}}else if(height > maxH.mobileSticky.init){
height=maxH.mobileSticky.init;
}}
if(src){
el.parent().addClass('retina');
el.attr('src', src).css('max-height', height + 'px');
}});
}
setTimeout(function(){
retinaLogo();
}, 0);
$('#Wrapper .before_after.twentytwenty-container:not(.mfn-initialized)').each(function(){
var el=$(this);
el.addClass('mfn-initialized');
el.imagesLoaded().done(function(instance, image){
queueMicrotask(()=> el.twentytwenty());
});
});
if(lightboxAttr){
$('a[data-rel^="prettyPhoto"]:not(.popup-link), a[rel^="lightbox"]:not(.popup-link)').each(function(){
$(this).off('click.prettyphoto');
});
}
mfnStickyH();
mfnSticky();
mfnMobileSticky();
mfnIntroH();
setTimeout(function(){
$(window).trigger('resize');
mfnSidebar();
sliderSlider();
}, 0);
});
$(document).on('mouseup',function(e){
if($('.widget_mfn_menu ul.submenus-click').length&&($('.widget_mfn_menu ul.submenus-click').has(e.target).length===0)){
$('.widget_mfn_menu ul.submenus-click li').removeClass('hover');
}
if($('.menu_wrapper').length&&($('.menu_wrapper').has(e.target).length===0)){
if($('.responsive-menu-toggle').hasClass('active')){
$('.responsive-menu-toggle').trigger('click');
}}
if($('#popup_contact').length&&($('#popup_contact').has(e.target).length===0)){
if($('#popup_contact').hasClass('focus')){
$('#popup_contact .footer_button').trigger('click');
}}
if($('html').hasClass('mfn-ofcs-opened')&&!$('.mfn-off-canvas-sidebar').is(e.target)&&$('.mfn-off-canvas-sidebar').has(e.target).length===0){
$('html').removeClass('mfn-ofcs-opened');
}});
function slickAutoResponsive(slider, max, size, round=false){
if(!max){
max=5;
}
if(!size){
size=380;
}
var width=slider.width()||0;
var count;
if(round){
count=Math.floor(width / size);
}else{
count=Math.ceil(width / size);
}
if(count < 1) count=1;
if(count > max) count=max;
return count;
}
function mfnSliderOfferThumb(){
var pager=function(el, i){
var img=$(el.$slides[i]).find('.thumbnail:first').html();
return '<a>' + img + '</a>';
};
$('.offer_thumb_ul').each(function(){
var slider=$(this);
slider.slick({
cssEase: 'ease-out',
arrows: false,
dots: true,
infinite: true,
touchThreshold: 10,
speed: 300,
adaptiveHeight: true,
appendDots: slider.siblings('.slider_pagination'),
customPaging: pager,
rtl: rtl ? true:false,
autoplay: mfn.slider.offer ? true:false,
autoplaySpeed: mfn.slider.offer ? mfn.slider.offer:5000,
slidesToShow: 1,
slidesToScroll: 1
});
$(window).on('debouncedresize', function(){
var height=slider.siblings('.slider_pagination').height();
slider.closest('.offer_thumb ').css('min-height',height);
});
});
}
function mfnSliderOffer(){
$('.offer_ul').each(function(){
var slider=$(this);
slider.slick({
cssEase: 'ease-out',
dots: false,
infinite: true,
touchThreshold: 10,
speed: 300,
prevArrow: '<a class="slider_prev" href="#" aria-label="previous slide"><span class="button_icon"><i class="icon-up-open-big"></i></span></a>',
nextArrow: '<a class="slider_next" href="#" aria-label="next slide"><span class="button_icon"><i class="icon-down-open-big"></i></span></a>',
adaptiveHeight: true,
rtl: rtl ? true:false,
autoplay: mfn.slider.offer ? true:false,
autoplaySpeed: mfn.slider.offer ? mfn.slider.offer:5000,
slidesToShow: 1,
slidesToScroll: 1
});
slider.siblings('.slider_pagination').addClass('show');
slider.on('afterChange', function(event, slick, currentSlide, nextSlide){
slider.siblings('.slider_pagination').find('.current').text(currentSlide + 1);
});
});
}
function mfnSliderShop(){
var pager=function(el, i){
return '<a>' + i + '</a>';
};
$('.shop_slider_ul').each(function(){
var slider=$(this);
var slidesToShow=4;
var count=slider.closest('.shop_slider').data('count');
if(slidesToShow > count){
slidesToShow=count;
if(slidesToShow < 1){
slidesToShow=1;
}}
slider.slick({
cssEase: 'ease-out',
dots: true,
infinite: true,
touchThreshold: 10,
speed: 300,
prevArrow: '<a class="button the-icon slider_prev" href="#" aria-label="previous slide"><i class="icon-left-open-big"></i></a>',
nextArrow: '<a class="button the-icon slider_next" href="#" aria-label="next slide"><i class="icon-right-open-big"></i></a>',
appendArrows: slider.siblings('.blog_slider_header').children('.slider_navigation'),
appendDots: slider.siblings('.slider_pager'),
customPaging: pager,
rtl: rtl ? true:false,
autoplay: mfn.slider.shop ? true:false,
autoplaySpeed: mfn.slider.shop ? mfn.slider.shop:5000,
slidesToShow: slickAutoResponsive(slider, slidesToShow),
slidesToScroll: slickAutoResponsive(slider, slidesToShow)
});
$(window).on('debouncedresize', function(){
slider.slick('slickSetOption', 'slidesToShow', slickAutoResponsive(slider, slidesToShow), false);
slider.slick('slickSetOption', 'slidesToScroll', slickAutoResponsive(slider, slidesToShow), true);
});
});
}
function mfnSliderBlog(){
var pager=function(el, i){
return '<a>' + i + '</a>';
};
$('.blog_slider_ul').each(function(){
var slider=$(this);
var slidesToShow=4;
var count=slider.closest('.blog_slider').data('count');
var singlePostMode=slider.closest('.blog_slider').hasClass('single_post_mode');
if(slidesToShow > count){
slidesToShow=count;
if(slidesToShow < 1){
slidesToShow=1;
}}
if(singlePostMode){
slidesToShow=1;
}
slider.slick({
cssEase: 'ease-out',
dots: true,
infinite: true,
touchThreshold: 10,
speed: 300,
prevArrow: '<a class="button the-icon slider_prev" href="#" aria-label="previous slide"><i class="icon-left-open-big"></i></a>',
nextArrow: '<a class="button the-icon slider_next" href="#" aria-label="next slide"><i class="icon-right-open-big"></i></a>',
appendArrows: slider.siblings('.blog_slider_header').children('.slider_navigation'),
appendDots: slider.siblings('.slider_pager'),
customPaging: pager,
rtl: rtl ? true:false,
autoplay: mfn.slider.blog ? true:false,
autoplaySpeed: mfn.slider.blog ? mfn.slider.blog:5000,
slidesToShow: slickAutoResponsive(slider, slidesToShow),
slidesToScroll: slickAutoResponsive(slider, slidesToShow)
});
$(window).on('debouncedresize', function(){
slider.slick('slickSetOption', 'slidesToShow', slickAutoResponsive(slider, slidesToShow), false);
slider.slick('slickSetOption', 'slidesToScroll', slickAutoResponsive(slider, slidesToShow), true);
});
});
}
function mfnSliderClients(){
$('.clients_slider_ul').each(function(){
var slider=$(this);
var clientsPerSlide=slider.closest('.clients_slider').attr('data-client-per-slide') ? parseInt(slider.closest('.clients_slider').attr('data-client-per-slide')):4;
var navigationPosition=slider.closest('.clients_slider').attr('data-navigation-position')||false;
var appendArrows=(navigationPosition=='content') ? slider:slider.siblings('.blog_slider_header').children('.slider_navigation');
var size=400;
var calc=()=> slickAutoResponsive(slider, clientsPerSlide, size - (clientsPerSlide * 40), true);
var calcScroll=calc;
var slidesToScroll=slider.closest('.clients_slider').attr('data-slides-to-scroll') ? parseInt(slider.closest('.clients_slider').attr('data-slides-to-scroll')):calc();
if(1===slidesToScroll){
calcScroll=()=> slickAutoResponsive(slider, 1, size - (clientsPerSlide * 40), true);
}
slider.slick({
cssEase: 'ease-out',
dots: false,
infinite: true,
touchThreshold: 10,
speed: 300,
prevArrow: '<a class="button the-icon slider_prev" href="#" aria-label="previous slide"><i class="icon-left-open-big"></i></a>',
nextArrow: '<a class="button the-icon slider_next" href="#" aria-label="next slide"><i class="icon-right-open-big"></i></a>',
appendArrows: appendArrows,
rtl: rtl ? true:false,
autoplay: mfn.slider.clients ? true:false,
autoplaySpeed: mfn.slider.clients ? mfn.slider.clients:5000,
slidesToShow: calc(),
slidesToScroll: calcScroll()
});
$(window).on('debouncedresize', function(){
slider.slick('slickSetOption', 'slidesToShow', calc(), false);
slider.slick('slickSetOption', 'slidesToScroll', calcScroll(), true);
});
});
}
function sliderPortfolio(){
$('.portfolio_slider_ul').each(function(){
var slider=$(this);
var size=380;
var scroll=5;
if(slider.closest('.portfolio_slider').data('size')){
size=slider.closest('.portfolio_slider').data('size');
}
if(slider.closest('.portfolio_slider').data('size')){
scroll=slider.closest('.portfolio_slider').data('scroll');
}
slider.slick({
cssEase: 'ease-out',
dots: false,
infinite: true,
touchThreshold: 10,
speed: 300,
prevArrow: '<a class="slider_nav slider_prev themebg" href="#" aria-label="previous slide"><i class="icon-left-open-big"></i></a>',
nextArrow: '<a class="slider_nav slider_next themebg" href="#" aria-label="next slide"><i class="icon-right-open-big"></i></a>',
rtl: rtl ? true:false,
autoplay: mfn.slider.portfolio ? true:false,
autoplaySpeed: mfn.slider.portfolio ? mfn.slider.portfolio:5000,
slidesToShow: slickAutoResponsive(slider, 5, size),
slidesToScroll: slickAutoResponsive(slider, scroll, size)
});
$(window).on('debouncedresize', function(){
slider.slick('slickSetOption', 'slidesToShow', slickAutoResponsive(slider, 5, size), false);
slider.slick('slickSetOption', 'slidesToScroll', slickAutoResponsive(slider, scroll, size), true);
});
});
}
function promoBarSlider(){
$('.promo_bar_slider').each(function(){
var $slider=$(this);
if($slider.hasClass('mfn-initialized')) return;
$slider.addClass('mfn-initialized');
var speedAttr=$slider.attr('data-speed');
var speed=parseInt(speedAttr, 10);
if(isNaN(speed)||speed <=0) speed=5;
speed *=1000;
var $slides=$slider.find('.pbs_one');
if(!$slides.length) return;
$slides.removeClass('pbs-active pbs-active-ends');
$slides.first().addClass('pbs-active');
var transitionDuration=300;
function changeSlide(){
var $current=$slider.find('.pbs_one.pbs-active');
var $next=$current.next('.pbs_one');
if(!$next.length) $next=$slides.first();
$current.addClass('pbs-active-ends');
setTimeout(function(){
$current.removeClass('pbs-active pbs-active-ends');
$next.addClass('pbs-active');
}, transitionDuration);
}
if($slides.length > 1){
setInterval(changeSlide, speed);
}});
}
function queryLoopSlider(){
$('body:not(.mfn-ui) .mfn-looped-items-slider').each(function(i){
const swipers=[];
var $slider=$(this);
let swiperClass='mfn-ql-slider-'+i;
$slider.addClass(swiperClass);
var swiperParams={
spaceBetween: parseInt($slider.attr('data-space_mobile')),
slidesPerView: $slider.hasClass('mfn-slider-linear') ? 'auto':parseInt($slider.attr('data-columns-mobile')),
};
if(typeof $slider.attr('data-dots')!=='undefined'&&$slider.attr('data-dots')=='1'){
$slider.parent().append('<div class="swiper-pagination mfn-swiper-pagination-'+i+'"></div>');
swiperParams['pagination']={
el: ".mfn-swiper-pagination-"+i,
clickable: true,
};
if($slider.attr('data-dots-count')=='dynamic'){
swiperParams['pagination']['dynamicBullets']=true;
}}
if($slider.closest('.mfn-looped-items').hasClass('mfn-ql-slider-wrapper-offset')&&$slider.attr('data-infinity')=='1'){
swiperParams['loop']=true;
swiperParams['centeredSlides']=true;
$slider.parent().css({ 'max-width': '100%'});
}else if($slider.attr('data-infinity')=='1'){
swiperParams['loop']=true;
}
swiperParams['speed']=parseFloat($slider.attr('data-speed'));
if($slider.attr('data-arrows')=='1'){
$slider.parent().append('<div class="swiper-button-next mfn-swiper-arrow mfn-swiper-button-next-'+i+'"><i class="'+$slider.attr('data-arrownext')+'"></i></div><div class="swiper-button-prev mfn-swiper-arrow mfn-swiper-button-prev-'+i+'"><i class="'+$slider.attr('data-arrowprev')+'"></i></div>');
swiperParams['navigation']={
nextEl: ".mfn-swiper-button-next-"+i,
prevEl: ".mfn-swiper-button-prev-"+i,
};}
if(!$('body').hasClass('mfn-ui')&&typeof $slider.attr('data-autoplay')!=='undefined'&&parseFloat($slider.attr('data-autoplay')) > 0){
swiperParams['autoplay']={
delay: $slider.hasClass('mfn-slider-linear') ? 0.1:parseFloat($slider.attr('data-autoplay')),
disableOnInteraction: true,
};
if($slider.attr('data-pausehover')=='1'){
swiperParams['autoplay']['pauseOnMouseEnter']=true;
}else{
swiperParams['autoplay']['pauseOnMouseEnter']=false;
}}
if(!$('body').hasClass('mfn-ui')&&typeof $slider.attr('data-mousewheel')!=='undefined'&&$slider.attr('data-mousewheel') > 0){
swiperParams['mousewheel']=true;
}
if($('body').hasClass('mfn-ui')){
swiperParams['allowTouchMove']=true;
}
if($slider.closest('.mfn-popup-tmpl').length){
swiperParams['observer']=true;
swiperParams['observeParents']=true;
}
swiperParams['breakpoints']={
768: {
spaceBetween: $slider.attr('data-animationtype')=='cube' ? 0:parseInt($slider.attr('data-space_desktop')),
slidesPerView: $slider.hasClass('mfn-slider-linear') ? 'auto':parseInt($slider.attr('data-columns-tablet'))
},
960: {
spaceBetween: $slider.attr('data-animationtype')=='cube' ? 0:parseInt($slider.attr('data-space_desktop')),
slidesPerView: $slider.hasClass('mfn-slider-linear') ? 'auto':parseInt($slider.attr('data-columns-laptop'))
},
1441: {
spaceBetween: $slider.attr('data-animationtype')=='cube' ? 0:parseInt($slider.attr('data-space_desktop')),
slidesPerView: $slider.hasClass('mfn-slider-linear') ? 'auto':parseInt($slider.attr('data-columns'))
}};
if($slider.attr('data-animationtype')!='slide'){
swiperParams['effect']=$slider.attr('data-animationtype');
swiperParams['grabCursor']=true;
if($slider.attr('data-animationtype')=='fade'){
swiperParams['fadeEffect']={ crossFade: true };
swiperParams['centeredSlides']=true;
}}
swipers[i]=new Swiper('.'+swiperClass, swiperParams);
swipers[i].on('slideChange', function (){
$(window).trigger('scroll');
});
if(($slider.attr('data-animationtype')=='cube'||$slider.attr('data-animationtype')=='flip'||$slider.attr('data-animationtype')=='cards')&&$slider.closest('.mfn-looped-items-slider-wrapper').hasClass('mfn-arrows-standard')){
let sw_arr_wi=$slider.closest('.mfn-looped-items-slider-wrapper').find('.mfn-swiper-arrow').outerWidth()+'px';
$('body').append('<style>.mfn-ql-slider-'+i+'{ --mfn-swiper-arrow-width: '+sw_arr_wi+' }</style>')
$(window).trigger('resize');
}});
}
function sliderSlider(){
var pager=function(el, i){
return '<a>' + i + '</a>';
};
$('.content_slider_ul').each(function(){
var slider=$(this);
var count=1;
var centerMode=false;
if(slider.closest('.content_slider').hasClass('carousel')){
count=slickAutoResponsive(slider);
$(window).on('debouncedresize', function(){
slider.slick('slickSetOption', 'slidesToShow', slickAutoResponsive(slider), false);
slider.slick('slickSetOption', 'slidesToScroll', slickAutoResponsive(slider), true);
});
}
if(slider.closest('.content_slider').hasClass('center')){
centerMode=true;
}
slider.slick({
cssEase: 'cubic-bezier(.4,0,.2,1)',
dots: true,
infinite: true,
touchThreshold: 10,
speed: 300,
centerMode: centerMode,
centerPadding: '20%',
prevArrow: '<a class="button the-icon slider_prev" href="#" aria-label="previous slide"><i class="icon-left-open-big"></i></a>',
nextArrow: '<a class="button the-icon slider_next" href="#" aria-label="next slide"><i class="icon-right-open-big"></i></a>',
adaptiveHeight: true,
appendDots: slider.siblings('.slider_pager'),
customPaging: pager,
rtl: rtl ? true:false,
autoplay: mfn.slider.slider ? true:false,
autoplaySpeed: mfn.slider.slider ? mfn.slider.slider:5000,
slidesToShow: count,
slidesToScroll: count
});
var clickEvent=false;
slider.on('dragstart', '.slick-slide a[rel="lightbox"]', function(event){
if(lightboxAttr){
var events=$._data(this,'events');
if(events&&Object.prototype.hasOwnProperty.call(events, 'click')){
clickEvent=events.click[0];
$(this).addClass('off-click').off('click');
}}
});
slider.on('afterChange', function(event, slick, currentSlide, nextSlide){
if(lightboxAttr){
$('a.off-click[rel="lightbox"]', slider).removeClass('off-click').on('click', clickEvent);
}});
});
}
function sliderTestimonials(){
var pager=function(el, i){
var img=$(el.$slides[i]).find('.single-photo-img').html();
return '<a>' + img + '</a>';
};
$('.testimonials_slider_ul').each(function(){
var slider=$(this);
slider.slick({
cssEase: 'ease-out',
dots: true,
infinite: true,
touchThreshold: 10,
speed: 300,
prevArrow: '<a class="button the-icon slider_prev" href="#" aria-label="previous slide"><i class="icon-left-open-big"></i></a>',
nextArrow: '<a class="button the-icon slider_next" href="#" aria-label="next slide"><i class="icon-right-open-big"></i></a>',
adaptiveHeight: true,
appendDots: slider.siblings('.slider_pager'),
customPaging: pager,
rtl: rtl ? true:false,
autoplay: mfn.slider.testimonials ? true:false,
autoplaySpeed: mfn.slider.testimonials ? mfn.slider.testimonials:5000,
slidesToShow: 1,
slidesToScroll: 1
});
});
}
let mfnTabber={
init: function(){
$(document).on('mouseover', '.mfn-tabber-open-on-hover .mfn-tabber-nav li a', function(e){
if(!$(this).parent('li').hasClass('active')){
let tab=$(this).attr('data-tab');
$(this).parent('li').siblings('li').removeClass('active');
$(this).closest('.mfn-section-tabber').find('.mfn-tabber-content.active').removeClass('active');
$(this).parent('li').addClass('active');
$(this).closest('.mfn-section-tabber').find(tab).addClass('active');
$(document).trigger('mfn:tabber:open');
$(window).trigger('resize');
}}).on('click', '.mfn-tabber-nav li a', function(e){
if(!$(this).parent('li').hasClass('active')){
e.preventDefault();
let tab=$(this).attr('data-tab');
$(this).parent('li').siblings('li').removeClass('active');
$(this).closest('.mfn-section-tabber').find('.mfn-tabber-content.active').removeClass('active');
$(this).parent('li').addClass('active');
$(this).closest('.mfn-section-tabber').find(tab).addClass('active');
$(document).trigger('mfn:tabber:open');
$(window).trigger('resize');
}else if($(this).attr('href')=='#'||$('body').hasClass('mfn-ui')){
e.preventDefault();
}});
if($('body').hasClass('mfn-ui')){
setTimeout(mfnTabber.sliding_bg, 800);
}else{
setTimeout(mfnTabber.sliding_bg, 300);
}},
sliding_bg: function(){
if(!$('.mfn-tabber-nav.mfn-tabber-nav-hover-sliding').length) return;
$('.mfn-tabber-nav.mfn-tabber-nav-hover-sliding').each(function(){
let wrapper=$(this);
let li=wrapper.find('li.active');
let helper=wrapper.find('.mfn-tabber-nav-slide-helper');
let offset_left=li.position().left;
let offset_top=li.position().top;
helper.css({ top: offset_top, left: offset_left, width: li.outerWidth(), height: li.outerHeight() });
});
$('.mfn-tabber-open-on-click .mfn-tabber-nav.mfn-tabber-nav-hover-sliding li').on('click', function(){
let li=$(this);
let helper=li.closest('ul').find('.mfn-tabber-nav-slide-helper');
let offset_left=li.position().left;
let offset_top=li.position().top;
helper.css({ top: offset_top, left: offset_left, width: li.outerWidth(), height: li.outerHeight() });
});
$('.mfn-tabber-open-on-hover .mfn-tabber-nav.mfn-tabber-nav-hover-sliding li').on('mouseover', function(){
let li=$(this);
let helper=li.closest('ul').find('.mfn-tabber-nav-slide-helper');
let offset_left=li.position().left;
let offset_top=li.position().top;
helper.css({ top: offset_top, left: offset_left, width: li.outerWidth(), height: li.outerHeight() });
});
if($('.mfn-tabber-nav.mfn-tabber-nav-hover-sliding li.active').length){
$('.mfn-tabber-nav.mfn-tabber-nav-hover-sliding li.active')
}}
}
let mfnAdvancedFilters={
form: false,
init: function(){
if(!$('.mfn-advanced-filters').length) return;
this.prepare();
$(document).on('click', '.mfn-advanced-filters .mfn-advanced-filters-expand', function(e){
e.preventDefault();
if($(this).hasClass('mfn-expanded')){
$(this).removeClass('mfn-expanded');
$(this).text($(this).attr('data-more'));
$(this).closest('.mfn-form-row-wrapper').find('li.mfn-opt-expandable').addClass('mfn-opt-hidden').removeClass('mfn-opt-expandable');
}else{
$(this).addClass('mfn-expanded');
$(this).text($(this).attr('data-less'));
$(this).closest('.mfn-form-row-wrapper').find('li.mfn-opt-hidden').removeClass('mfn-opt-hidden').addClass('mfn-opt-expandable');
}});
$(document).on('click', '.mfn-advanced-filters-accordion .mfn-advanced-filters-group-label', function(e){
e.preventDefault();
let row=$(this).closest('.mfn-form-row');
if(row.hasClass('open')){
row.removeClass('open');
$(this).siblings('.mfn-form-row-wrapper').slideUp(300);
}else{
row.addClass('open');
$(this).siblings('.mfn-form-row-wrapper').slideDown(300);
}})
if($('.mfn-advanced-filters .mfn-advanced-filters-rate')){
$(document).on('click', '.mfn-advanced-filters .mfn-advanced-filters-rate li', function(){
$(this).toggleClass('active');
let helper_arr=[];
$(this).closest('.mfn-advanced-filters-rate').find('li.active').each(function(el){
helper_arr.push($(this).attr('data-rate'));
});
$(this).closest('.mfn-advanced-filters-rate').find('.mfn-advanced-rate-input').val(helper_arr.join(',')).trigger('change');
});
}
$(document).on('change', 'form.mfn-active-filters input', function(e){
mfnAdvancedFilters.ajax($(this).closest('form'));
});
$(document).on('change', 'form.mfn-advanced-filters-auto-submit input, form.mfn-advanced-filters-auto-submit select', function(e){
mfnAdvancedFilters.ajax($(this).closest('form'));
}).on('submit', 'form.mfn-advanced-filters-auto-submit', function(e){
e.preventDefault();
mfnAdvancedFilters.ajax($(this));
});
$(document).on('submit', 'form.mfn-advanced-filters-ajax-submit', function(e){
e.preventDefault();
mfnAdvancedFilters.ajax($(this));
});
$(document).on('click', '.mfn-active-filters .mfn-reset-filters', function(e){
e.preventDefault();
$(this).closest('form').empty();
mfnAdvancedFilters.ajax($(this).closest('form'));
});
},
prepare: function(){
if($('.mfn-active-filters .mfn-active-filters-find-title').length){
$('.mfn-active-filters .mfn-active-filters-find-title:not(.initialized)').each(function(i, el){
$(el).addClass('initialized');
let selector='[name="'+$(el).find('input').attr('name')+'"]';
let searched_input=$('.mfn-advanced-filters '+selector);
if($(el).find('input').val().length){
let label=searched_input.closest('.mfn-form-row').find('.mfn-advanced-filters-label-name').length ? searched_input.closest('.mfn-form-row').find('.mfn-advanced-filters-label-name').first().text():'';
if(typeof searched_input.attr('placeholder')!='undefined'&&searched_input.closest('.mfn-floating-placeholder').length){
if(label.length) $(el).append(label+' ');
$(el).append(searched_input.attr('placeholder')+': '+$(el).find('input').val());
}else if(searched_input.hasClass('mfn-advanced-rate-input')&&label.length){
if(label.length) $(el).append(label+': ');
$(el).append($(el).find('input').val());
}else{
$(el).append(searched_input.closest('.mfn-form-row').find('.mfn-advanced-filters-group-label h4').first().text()+': '+$(el).find('input').val());
}}else{
$(el).remove();
}});
}
$('.mfn-advanced-filters:not(.initialized)').each(function(i, el){
mfnAdvancedFilters.form=$(el);
mfnAdvancedFilters.form.addClass('initialized');
if(mfnAdvancedFilters.form.find('.mfn-advanced-filters-slider').length){
mfnAdvancedFilters.slider();
}
if(mfnAdvancedFilters.form.find('.mfn-advanced-filters-range-slider').length){
mfnAdvancedFilters.slider_range();
}});
},
ajax: ($form)=> {
var url=$form.attr('action')||location.origin + location.pathname;
var method=($form.attr('method')||'GET').toUpperCase();
var data=$form.serialize();
if($form.closest('.mfn-sidemenu-tmpl.mfn-sidemenu-active').length){
$form.closest('.mfn-sidemenu-tmpl.mfn-sidemenu-active').find('.mfn-sidemenu-closebutton').trigger('click');
}
var $content=$('#Content');
$content.addClass('is-loading');
$form.find('input,select,button').prop('disabled', true);
$form.find('button.mfn-btn').addClass('loading disabled');
if($('.mfn-archive-product-tmpl-builder .mfn-woo-list-perpage li.active input').length&&$('.mfn-archive-product-tmpl-builder .mfn-woo-list-perpage li.active input').val().length) data +='&per_page='+$('.mfn-archive-product-tmpl-builder .mfn-woo-list-perpage li.active input').val();
if($('.mfn-archive-product-tmpl-builder .woocommerce-ordering select').length&&$('.mfn-archive-product-tmpl-builder .woocommerce-ordering select').val().length) data +='&orderby='+$('.mfn-archive-product-tmpl-builder .woocommerce-ordering select').val();
if($('.mfn-archive-product-tmpl-builder .mfn-woo-list-style li.active input').length&&$('.mfn-archive-product-tmpl-builder .mfn-woo-list-style li.active input').val().length) data +='&layout='+$('.mfn-archive-product-tmpl-builder .mfn-woo-list-style li.active input').val();
$.ajax({
url: url,
type: method,
data: data,
dataType: 'html'
}).done(function(html){
var $html=$('<div>').append($.parseHTML(html));
var $newContent=$html.find('#Content');
if($newContent.length){
$content.replaceWith($newContent);
if($('.mfn-sidemenu-tmpl').length){
$('.mfn-sidemenu-tmpl').each(function(){
let id=$(this).attr('id');
$(this).replaceWith($html.find('#'+id));
});
}
if(method==='GET'){
var newUrl=url + (url.indexOf('?')>-1 ? '&':'?') + data;
window.history.replaceState({}, '', newUrl);
}}else{
window.location.href=method==='GET' ? (url + (url.indexOf('?')>-1?'&':'?') + data):url;
}}).fail(function(){
window.location.href=method==='GET' ? (url + (url.indexOf('?')>-1?'&':'?') + data):url;
}).always(function(){
$form.find('input,select,button').prop('disabled', false);
$('#Content').removeClass('is-loading');
$form.find('button.mfn-btn').removeClass('loading disabled');
$(document).trigger('mfn:ajax:refresh');
});
},
slider: function(){
mfnAdvancedFilters.form.find('.mfn-advanced-filters-slider').each(function(i, slider){
let input=$(this).closest('.mfn-form-row-wrapper').find('input.mfn-ui-slider-input');
let min=input.attr('min').length ? input.attr('min'):'0';
let max=input.attr('max').length ? input.attr('max'):'500';
let val=input.val().length ? input.val():'';
$(this).slider({
step: 1,
min: parseFloat(min),
max: parseFloat(max),
range: "min",
value: val,
create: function (){
$(this).find(".ui-slider-handle").append('<span class="mfn-ui-tip"></span>');
$(this).find(".mfn-ui-tip").text($(this).slider("value"));
},
slide: function(event, ui){
input.val(ui.value);
if(!input.parent('.mfn-input-wrapper').hasClass('mfn-not-empty')) input.parent('.mfn-input-wrapper').addClass('mfn-not-empty');
$(this).find(".mfn-ui-tip").text(ui.value);
},
stop: function(){
input.trigger('change');
}});
});
},
slider_range: function(){
mfnAdvancedFilters.form.find('.mfn-advanced-filters-range-slider').each(function(i, slider){
let input_min=$(this).closest('.mfn-advanced-filters-slider-wrapper').find('input.mfn-ui-slider-input-min');
let input_max=$(this).closest('.mfn-advanced-filters-slider-wrapper').find('input.mfn-ui-slider-input-max');
let min=typeof input_min.attr('min')!='undefined' ? input_min.attr('min'):'0';
let max=typeof input_max.attr('max')!='undefined' ? input_max.attr('max'):'500';
let val_min=input_min.val().length ? input_min.val():min;
let val_max=input_max.val().length ? input_max.val():max;
$(this).slider({
range: true,
step: 1,
min: parseFloat(min),
max: parseFloat(max),
values: [ parseFloat(val_min), parseFloat(val_max) ],
create: function (event, ui){
$(this).find(".ui-slider-handle").append('<span class="mfn-ui-tip"></span>');
$(this).find(".mfn-ui-tip").first().text(val_min);
$(this).find(".mfn-ui-tip").last().text(val_max);
},
slide: function(event, ui){
$(ui.handle).closest('.mfn-form-row-wrapper').find('input.mfn-ui-slider-input-min').val(ui.values[ 0 ]);
$(ui.handle).closest('.mfn-form-row-wrapper').find('input.mfn-ui-slider-input-max').val(ui.values[ 1 ]);
if(!$(ui.handle).closest('.mfn-form-row-wrapper').find('.mfn-input-wrapper').hasClass('mfn-not-empty')) $(ui.handle).closest('.mfn-form-row-wrapper').find('.mfn-input-wrapper').addClass('mfn-not-empty');
$(ui.handle).find(".mfn-ui-tip").text(ui.value);
},
stop: function(){
input_min.trigger('change');
}});
});
}}
$(document).on('click', '.mfn-gdpr-button', function(){
var closeAnimation=$('.mfn-gdpr-button').attr('data-animation');
var barAligment=$('#mfn-gdpr').attr('data-aligment');
switch(true){
case 'none'===closeAnimation:
$('#mfn-gdpr').css('display', 'none');
break;
case 'fade'===closeAnimation:
$('#mfn-gdpr').fadeOut(300);
break;
case 'slide'===closeAnimation&&'top'===barAligment:
$('#mfn-gdpr').slideUp(300);
break;
default:
$('#mfn-gdpr').slideToggle(300);
break;
}
setTimeout(function(){
$('#mfn-gdpr').removeClass('show');
gdpr_set_cookie();
}, 300);
});
function gdpr_set_cookie(){
if(navigator.cookieEnabled){
var cookieDays=$('.mfn-gdpr-button').attr('data-cookiedays')||365;
var cookieDate=new Date();
var cookieText='';
cookieDate.setTime(cookieDate.getTime() + (cookieDays * 24 * 60 * 60 * 1000));
cookieText +="mfn-gdpr=1";
cookieText +="; expires=" + cookieDate.toUTCString() + ';';
cookieText +="; path=" + mfn.home_url + '/';
document.cookie=cookieText;
}}
function gdpr(){
if(document.cookie!==""){
var cookies=document.cookie.split(/; */);
for (var cookie of cookies){
var [ cookieName ]=cookie.split("=");
if(cookieName==='mfn-gdpr'){
return;
}}
}
$('#mfn-gdpr').addClass('show');
}
function infiniteScrollFunction(infiniteLoadContainer, infiniteLoadButton, scrollDirection){
var screenHeight=document.body.clientHeight;
if(infiniteLoadContainer.attr('data-attr')===$(infiniteLoadButton).attr('href')){
return;
}else if(scrollDirection==='down'){
infiniteLoadContainer.attr('data-attr', $(infiniteLoadButton).attr('href'));
infiniteLoadButton.click();
setTimeout(function(){
var heightAfterLoadDifference=(document.body.clientHeight - screenHeight);
if(heightAfterLoadDifference < 249){
infiniteScrollFunction(infiniteLoadContainer, infiniteLoadButton, scrollDirection);
}}, 500);
}}
/*  function infiniteScrollPortfolio(){
var infiniteLoadContainer=$('.mfn-infinite-load-button');
var infiniteLoadButton=$('.mfn-infinite-load-button a');
$(infiniteLoadContainer).waypoint({
handler: function(direction){
infiniteScrollFunction(infiniteLoadContainer, infiniteLoadButton, direction);
},
offset: function(){
var offsetPosition=-(($(this)[0].element.scrollHeight) - (window.innerHeight / 1.2));
return offsetPosition;
}});
} */
$('body').on('click', ".table_of_content .toggle", function(e){
e.preventDefault();
if($('.table_of_content').hasClass('hide')){
$('.table_of_content').removeClass('hide');
$('.table_of_content_wrapper').slideDown({
duration: 400,
always: function(){
$('.table_of_content').removeClass('hide_on_start');
}});
}else{
$('.table_of_content_wrapper').slideUp({
duration: 400
});
$('.table_of_content').addClass('hide');
}});
function tableContentAttachId(){
const container=$('.table_of_content');
let tags;
let anchorNumber=0;
let anchorDom=$('.table_of_content_wrapper').find('a');
if(tags=container.attr('data-tags')){
tags=tags.split(/[ ,]+/).join(',');
let columns=$('#Content .mfn-builder-content .column_column, #Content .mfn-builder-content .column_post_content, #Content .mfn-builder-content .column_heading, #Content .mfn-builder-content .column_fancy_heading, .the_content_wrapper:not(.is-elementor), .elementor-widget:not(.elementor-widget-mfn_table_of_contents)');
if($('#Content .mfn-single-post-tmpl-builder .column_post_content').length){
columns=$('#Content .mfn-single-post-tmpl-builder .column_post_content .column_column, #Content .mfn-single-post-tmpl-builder .column_post_content, #Content .mfn-single-post-tmpl-builder .column_post_content .column_heading, #Content .mfn-single-post-tmpl-builder .column_post_content .column_fancy_heading, .the_content_wrapper:not(.is-elementor), .elementor-widget:not(.elementor-widget-mfn_table_of_contents)');
}else if($('#Content .mfn-single-portfolio-tmpl-builder .column_post_content').length){
columns=$('#Content .mfn-single-portfolio-tmpl-builder .column_post_content .column_column, #Content .mfn-single-portfolio-tmpl-builder .column_post_content, #Content .mfn-single-portfolio-tmpl-builder .column_post_content .column_heading, #Content .mfn-single-portfolio-tmpl-builder .column_post_content .column_fancy_heading, .the_content_wrapper:not(.is-elementor), .elementor-widget:not(.elementor-widget-mfn_table_of_contents)');
}
$(columns).each(( index, element)=> {
let headingsNoticed=$(element).find(tags);
$(headingsNoticed).each(( index, element)=> {
if($(element).attr('id')){
const idSet='#'+$(element).attr('id');
$(anchorDom[anchorNumber]).attr('href', idSet);
}else{
let id=$(anchorDom[anchorNumber]).attr('href');
if(typeof id!=='undefined') $(element).attr('id', id.substr(1));
}
anchorNumber++;
})
})
}}
var offCanvasSidebar={
init: function(){
$(document).on('click', '.mfn-off-canvas-switcher', function(e){
e.preventDefault();
if($('html').hasClass('mfn-ofcs-opened')){
$('html').removeClass('mfn-ofcs-opened');
}else{
$('html').addClass('mfn-ofcs-opened');
}});
},
mobile: function(){
if($('.sidebar .widget-area').length&&$('body').hasClass('ofcs-mobile')){
if(!$('.mfn-off-canvas-sidebar').length){
$('body').append('<div class="mfn-off-canvas-overlay"></div><div class="mfn-off-canvas-sidebar"><div class="mfn-off-canvas-switcher"><i class="icon-list" aria-label="off-canvas sidebar toggle"></i></div><div class="mfn-off-canvas-content-wrapper"><div class="mfn-off-canvas-content"></div></div></div>');
}
if($('body').hasClass('woocommerce-shop')&&!$('.mfn-woo-filters-wrapper .mfn-off-canvas-switcher').length){
$('.mfn-woo-filters-wrapper').append('<a class="open-filters mfn-off-canvas-switcher" href="#"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" aria-label="off-canvas sidebar toggle"><defs><style>.path{fill:none;stroke:#000;stroke-miterlimit:10;}</style></defs><g><line x1="8" y1="11" x2="14" y2="11" class="path"></line><line x1="2" y1="11" x2="4" y2="11" class="path"></line><line x1="12" y1="5" x2="14" y2="5" class="path"></line><line x1="2" y1="5" x2="8" y2="5" class="path"></line><circle cx="6" cy="11" r="2" class="path"></circle><circle cx="10" cy="5" r="2" class="path"></circle></g></svg></a>');
}
var $ofcs=$('.mfn-off-canvas-sidebar .mfn-off-canvas-content-wrapper .mfn-off-canvas-content');
$ofcs.empty();
$('.sidebar .widget-area').each(function(){
$ofcs.append($(this));
});
offCanvasSidebar.init();
}}
}
function alignHeights(){
var i=0;
if(!$('.mfn-align-heights').length) return;
$('.mfn-align-heights').each(function(){
var max=0;
var newclass='mfn-align-cont-'+i;
$(this).addClass(newclass);
$("<style type='text/css'> ."+newclass+" .mfn-align-me{ height: auto;} </style>").appendTo("body");
$("."+newclass+" .mfn-align-me").each(function(){
if($(this).outerHeight() > max){max=$(this).outerHeight();}});
$("<style type='text/css'> ."+newclass+" .mfn-align-me{ height: "+max+"px;} </style>").appendTo("body");
i++;
});
}
$(window).on('debouncedresize', alignHeights);
var headerMegamenu={
init: function(){
if($('.mfn-megamenu-menu.mfn-mm-submenu-toggled li.menu-item-has-children').length){
$('.mfn-megamenu-menu.mfn-mm-submenu-toggled li.menu-item-has-children > a').on('click', function(e){
let href=$(this).attr('href');
if(!$(this).parent('li').hasClass('mfn-li-childrens-show')){
e.preventDefault();
e.stopPropagation();
$(this).siblings('ul').slideDown(300);
$(this).parent('li').addClass('mfn-li-childrens-show');
}else if(href==''||href=='#'){
e.preventDefault();
e.stopPropagation();
$(this).siblings('ul').slideUp(300);
$(this).parent('li').removeClass('mfn-li-childrens-show');
}});
}
if($('.column_megamenu_menu ul.mfn-mm-menu-horizontal.mfn-mm-submenu-on-click li').length){
$('.column_megamenu_menu ul.mfn-mm-menu-horizontal.mfn-mm-submenu-on-click li > a').on('click', function(e){
if($(this).closest('li').hasClass('menu-item-has-children')&&!$(this).closest('li').hasClass('mfn-li-hover')){
e.preventDefault();
e.stopPropagation();
$(this).closest('li').addClass('mfn-li-hover');
}});
}
if($('ul.mfn-menu-submenu-on-hover li.mfn-menu-item-has-megamenu, li.mfn-theme-options-menu.mfn-menu-item-has-megamenu').length){
$('ul.mfn-menu-submenu-on-hover li.mfn-menu-item-has-megamenu, li.mfn-theme-options-menu.mfn-menu-item-has-megamenu').on('mouseenter mousemove', function(){
if($(this).find('.mfn-megamenu-full-width').length||$(this).find('.mfn-megamenu-grid').length){
headerMegamenu.setLeft($(this));
}});
}
if($('ul.mfn-menu-submenu-on-click li.mfn-menu-item-has-megamenu').length){
$('ul.mfn-menu-submenu-on-click li.mfn-menu-item-has-megamenu > a.mfn-menu-link').on('click', function(e){
let href=$(this).attr('href');
if($(this).closest('li').find('.mfn-megamenu-full-width').length||$(this).closest('li').find('.mfn-megamenu-grid').length){
headerMegamenu.setLeft($(this).closest('li'));
}
if(href==''||href=='#'){
e.preventDefault();
e.stopPropagation();
if($(this).closest('li').hasClass('mfn-li-hover')){
$(this).closest('li').removeClass('mfn-li-hover');
$(document).unbind('click', headerTemplate.bindUnclick);
$('body').removeClass('mfn-content-gray mfn-content-blur mfn-content-overlay');
}else{
$('ul.mfn-menu-submenu-on-click li.mfn-menu-item-has-megamenu.mfn-li-hover').removeClass('mfn-li-hover');
$(this).closest('li').addClass('mfn-li-hover');
$(document).bind('click', headerTemplate.bindUnclick);
headerTemplate.animContentAddClass();
}}else if(!$(this).closest('li').hasClass('mfn-li-hover')){
e.preventDefault();
e.stopPropagation();
if(!$(this).closest('li.mfn-li-hover').length){
$('.mfn-header-tmpl ul li.mfn-li-hover').removeClass('mfn-li-hover');
}else if($(this).closest('li.mfn-li-hover').find('li.mfn-li-hover').length){
$(this).closest('li.mfn-li-hover').find('li.mfn-li-hover').removeClass('mfn-li-hover');
}
if(!$(this).closest('.mfn-megamenu-menu').length&&!$(this).closest('li.mfn-li-hover').length){
if($('.mfn-megamenu-menu.mfn-mm-submenu-toggled li.menu-item-has-children.mfn-li-childrens-show').length){
$('.mfn-megamenu-menu.mfn-mm-submenu-toggled li.menu-item-has-children.mfn-li-childrens-show ul').slideUp();
$('.mfn-megamenu-menu.mfn-mm-submenu-toggled li.menu-item-has-children.mfn-li-childrens-show').removeClass('mfn-li-childrens-show');
}}
headerTemplate.animContentAddClass();
$(this).parent('li').addClass('mfn-li-hover');
$(document).bind('click', headerTemplate.bindUnclick);
}
headerMegamenu.afterShow();
});
}},
afterShow: function(){
bannerBox.init();
$(window).trigger('resize');
},
setLeft: function($li){
var $mm=$li.find('.mfn-menu-item-megamenu');
var left=$li.offset().left;
$mm.css('width', $(window).width()+'px');
$mm.css('left', '-'+left+'px');
$mm.addClass('mfn-mm-grid-set');
}}
var footerTemplate={
init: function(){
if(!$('.mfn-footer-tmpl').length) return;
if($('body').hasClass('mfn-footer-stick')){
footerTemplate.isSticky();
}
if($('body').hasClass('mfn-footer-sliding')||$('body').hasClass('mfn-footer-fixed')){
setTimeout(footerTemplate.isSliding(), 300);
}
return;
},
isSticky: function(){
if(!$('.mfn-footer-tmpl').length) return;
var offsetTop=$('.mfn-footer-tmpl').offset().top + $('.mfn-footer-tmpl').outerHeight();
if(offsetTop < $(window).height()){
$('.mfn-footer-tmpl').addClass('is-sticky');
}else{
$('.mfn-footer-tmpl').removeClass('is-sticky');
}},
isSliding: function(){
var footer=$('.mfn-footer-tmpl').outerHeight();
$('#Content').css('margin-bottom', footer);
}}
var bannerBox={
init: function(){
setTimeout(bannerBox.set, 300);
},
set: function(){
if($('body').hasClass('mfn-ui')) return;
if(!$('.column_banner_box .hidden-desc').length) return;
if($(".mfn-banner-box .last-visible-el").length){
$(".mfn-banner-box .last-visible-el").removeClass('last-visible-el');
$('.hidden-wrapper .hidden-desc').removeAttr('style');
}
$(".mfn-banner-box").each(function(){
if($(this).find('.hidden-desc').length){
if($(this).find('.hidden-desc').prev().length) $(this).find('.hidden-desc').prev().addClass("last-visible-el");
var hd_h=$(this).find('.hidden-wrapper').outerHeight();
$(this).find('.hidden-desc').css({ '--mfn-banner-box-height': hd_h + 'px' });
}});
}};
var mfn_hotspot={
init: function(){
if($(window).width() >=960){
mfn_hotspot.hover();
}else{
mfn_hotspot.click();
}},
hover: function(e){
$('.mfn-image-hotspot .hotspot-point').on('mouseenter', function(){
$(this).addClass('is-active');
}).on('mouseleave', function(){
$(this).removeClass('is-active');
});
$('.mfn-image-hotspot').on('mouseleave', function(){
$('.mfn-image-hotspot .hotspot-point.is-active').removeClass('is-active');
});
},
click: function(){
$('.mfn-image-hotspot .hotspot-point').on('click', function(){
if($('.mfn-image-hotspot .hotspot-point.is-active').length) $('.mfn-image-hotspot .hotspot-point.is-active').removeClass('is-active');
$(this).addClass('is-active');
$(document).bind('click', mfn_hotspot.bindUnclick);
})
},
bindUnclick: function(e){
if(!$('.mfn-image-hotspot .hotspot-point').is(e.target)&&$('.mfn-image-hotspot .hotspot-point').has(e.target).length===0){
if($('.mfn-image-hotspot .hotspot-point.is-active').length) $('.mfn-image-hotspot .hotspot-point.is-active').removeClass('is-active');
$(document).unbind('click', mfn_hotspot.bindUnclick);
}}
};
var headerTemplate={
hasSticky: false,
isMobile: false,
offsetScroll: 60,
hasBodyOffset: false,
height: 0,
type: 'default',
animContentOnHover: function(){
if($('.mfn-header-tmpl.mfn-header-main .mfn-header-menu.mfn-header-mainmenu').hasClass('mfn-menu-submenu-on-hover')){
$('.mfn-header-tmpl.mfn-header-main .mfn-header-menu.mfn-header-mainmenu.mfn-menu-submenu-on-hover > li.mfn-menu-item-has-megamenu, .mfn-header-tmpl.mfn-header-main .mfn-header-menu.mfn-header-mainmenu.mfn-menu-submenu-on-hover > li.menu-item-has-children').on('mouseenter mousemove', function(){
headerTemplate.animContentAddClass();
}).on('mouseenter', function(){
$(window).trigger('resize');
});
}
$('.mfn-header-tmpl.mfn-header-main .mfn-header-menu.mfn-header-mainmenu.mfn-menu-submenu-on-hover > li.mfn-menu-item-has-megamenu, .mfn-header-tmpl.mfn-header-main .mfn-header-menu.mfn-header-mainmenu.mfn-menu-submenu-on-hover > li.menu-item-has-children').on('mouseleave', function(){
$('body').removeClass('mfn-content-gray mfn-content-blur mfn-content-overlay');
});
},
animContentAddClass: function(){
if($('.mfn-header-tmpl.mfn-header-main').hasClass('mfn-header-content-blur')){
$('body').addClass('mfn-content-blur');
}else if($('.mfn-header-tmpl.mfn-header-main').hasClass('mfn-header-content-gray')){
$('body').addClass('mfn-content-gray');
}else if($('.mfn-header-tmpl.mfn-header-main').hasClass('mfn-header-content-overlay')){
$('body').addClass('mfn-content-overlay');
}},
openOnClick: function(){
$(document).on('click', '.mfn-header-tmpl .mfn-header-menu.mfn-menu-submenu-on-click li.menu-item-has-children > a.mfn-menu-link', function(e){
let href=$(this).attr('href');
if($(this).closest('li').find('.mfn-megamenu-full-width').length||$(this).closest('li').find('.mfn-megamenu-grid').length){
headerMegamenu.setLeft($(this).closest('li'));
}
if(href==''||href=='#'){
e.preventDefault();
e.stopPropagation();
if($(this).closest('li').hasClass('mfn-li-hover')){
$(this).closest('li').removeClass('mfn-li-hover');
$(document).unbind('click', headerTemplate.bindUnclick);
$('body').removeClass('mfn-content-gray mfn-content-blur mfn-content-overlay');
}else{
$(this).closest('li').siblings('li').removeClass('mfn-li-hover');
$(this).closest('li').addClass('mfn-li-hover');
$(document).bind('click', headerTemplate.bindUnclick);
headerTemplate.animContentAddClass();
}}else if(!$(this).closest('li').hasClass('mfn-li-hover')){
e.preventDefault();
e.stopPropagation();
$(this).closest('li').siblings('li').removeClass('mfn-li-hover');
headerTemplate.animContentAddClass();
$(this).parent('li').addClass('mfn-li-hover');
$(document).bind('click', headerTemplate.bindUnclick);
}
$(window).trigger('resize')
});
},
bindUnclick: function(e){
var $li=$('.mfn-header-tmpl ul li.mfn-li-hover');
if(!$li.is(e.target)&&!$li.find(e.target).length){
$li.removeClass('mfn-li-hover');
$('body').removeClass('mfn-content-gray mfn-content-blur mfn-content-overlay');
$(document).unbind('click', headerTemplate.bindUnclick);
}},
closeable: function(){
if($('body').hasClass('mfn-ui')) return;
$('.mfn-header-tmpl .close-closeable-section').on('click', function(){
var $section=$(this).closest('.mcb-section');
$section.addClass('closeable-hidden').slideUp(300, function(){
headerTemplate.resetOffset();
headerTemplate.offset();
});
if(typeof $section.attr('data-close-days')!=='undefined'&&$section.attr('data-close-days')!='0'){
var days=$section.attr('data-close-days');
var uid=$section.attr('data-uid');
var date=new Date();
date.setTime(date.getTime()+(parseInt(days)*24*60*60*1000));
var expires="; expires="+date.toGMTString();
document.cookie="mfn_closed_section_"+uid+"=1"+expires+"; path=/"
}});
},
resetOffset: function(){
if(headerTemplate.type!='default'&&headerTemplate.hasBodyOffset){
$('#Wrapper').css({ 'padding-top': $('.mfn-header-tmpl').outerHeight() });
}},
detectHover: function(){
$('.mfn-header-tmpl .mfn-menu-submenu-on-hover .mfn-menu-item-has-megamenu.mfn-menu-li').on('mouseenter', function(){
headerMegamenu.afterShow();
});
},
offset: function(){
if(headerTemplate.hasSticky&&!headerTemplate.isMobile) return;
headerTemplate.offsetScroll=0;
var _screen='default';
if(headerTemplate.isMobile) _screen='header-mobile';
$('.mfn-header-tmpl .mfn-'+_screen+'-section.hide-on-scroll:not(.closeable-hidden)').each(function(){
headerTemplate.offsetScroll +=$(this).outerHeight();
});
},
init: function(){
headerTemplate.hasBodyOffset=false;
if(!$('body').hasClass('mfn-ui')&&$('.mfn-header-tmpl').find('.section.closeable-active').length){
$('.mfn-header-tmpl').find('.section.closeable-active').each(function(){
if(headerTemplate.readcookie('mfn_closed_section_'+$(this).attr('data-uid'))||headerTemplate.readcookie('mfn_closed_section')==$(this).attr('data-uid')){
$(this).remove();
}else{
$(this).removeClass('mfn-temporary-hidden');
}});
}
if($(window).width() < 767&&$('.mfn-header-tmpl').hasClass('mfn-hasMobile')){
headerTemplate.isMobile=true;
headerTemplate.type=$('.mfn-header-tmpl').attr('data-mobile-type');
if($('.mfn-header-tmpl').hasClass('mfn-mobile-header-body-offset')){
headerTemplate.hasBodyOffset=true;
}else{
headerTemplate.hasBodyOffset=false;
}}else{
headerTemplate.isMobile=false;
headerTemplate.type=$('.mfn-header-tmpl').attr('data-type');
if($('.mfn-header-tmpl').hasClass('mfn-header-body-offset')){
headerTemplate.hasBodyOffset=true;
}else{
headerTemplate.hasBodyOffset=false;
}}
if($('.mfn-header-tmpl .mfn-menu-submenu-on-click:not(.initialized)').length){
$('.mfn-header-tmpl .mfn-menu-submenu-on-click').addClass('initialized');
headerTemplate.openOnClick();
}
if($('.mfn-header-tmpl .mfn-menu-submenu-on-hover .mfn-menu-item-has-megamenu.mfn-menu-li').length){
headerTemplate.detectHover();
}
if($('.mfn-header-tmpl').hasClass('mfn-header-content-blur')||$('.mfn-header-tmpl').hasClass('mfn-header-content-gray')||$('.mfn-header-tmpl').hasClass('mfn-header-content-overlay')){
headerTemplate.animContentOnHover();
}
if($('.mfn-header-tmpl').hasClass('mfn-hasSticky')){
headerTemplate.hasSticky=true;
}else{
headerTemplate.hasSticky=false;
}
if($('body style.tmp-mfn-header-template').length) $('body style.tmp-mfn-header-template').remove();
if($('.mfn-header-tmpl .close-closeable-section').length) headerTemplate.closeable();
if($('body').hasClass('mfn-header-scrolled')&&!$('.mfn-builder-active').length) $('body').removeClass('mfn-header-scrolled');
headerTemplate.getHeight();
headerTemplate.offset();
headerTemplate.scroll();
if($(window).scrollTop() > 10){
$(window).trigger('scroll');
}
if($('#wpadminbar').length){
let admin_bar_h=$('#wpadminbar').outerHeight();
if($('.mfn-header-tmpl.mfn-header-tmpl-fixed').length) $('.mfn-header-tmpl.mfn-header-tmpl-fixed').css({'margin-top': admin_bar_h});
if($(window).width() < 767&&$('.mfn-header-tmpl.mfn-mobile-header-tmpl-fixed').length) $('.mfn-header-tmpl.mfn-mobile-header-tmpl-fixed').css({'margin-top': admin_bar_h});
}},
scroll: function(){
if($('.mfn-header-tmpl').hasClass('mfn-header-tmpl-default')&&headerTemplate.hasSticky&&!headerTemplate.isMobile){
$('body').append('<style class="tmp-mfn-header-template">html body.mfn-header-scrolled{padding-top: '+headerTemplate.height+'px;}</style>');
}
$(window).scroll(function(){
var scrolled=$(this).scrollTop();
var scroll_offset=headerTemplate.offsetScroll;
if(headerTemplate.hasSticky&&!headerTemplate.isMobile) scroll_offset=headerTemplate.height;
if(scrolled > scroll_offset){
$('body').addClass('mfn-header-scrolled');
if(($('.mfn-header-tmpl').hasClass('mfn-header-tmpl-fixed')&&!headerTemplate.isMobile)||($('.mfn-header-tmpl').hasClass('mfn-mobile-header-tmpl-fixed')&&headerTemplate.isMobile)&&$('.mfn-header-tmpl .hide-on-scroll:not(.closeable-hidden)').length){
if(headerTemplate.hasSticky&&!headerTemplate.isMobile){
$('.mfn-header-tmpl').css({'top': 0});
}else{
$('.mfn-header-tmpl').css({'top': '-'+headerTemplate.offsetScroll+'px'});
}}
}else{
$('body').removeClass('mfn-header-scrolled');
if(($('.mfn-header-tmpl').hasClass('mfn-header-tmpl-fixed')&&!headerTemplate.isMobile)||($('.mfn-header-tmpl').hasClass('mfn-mobile-header-tmpl-fixed')&&headerTemplate.isMobile)&&$('.mfn-header-tmpl .hide-on-scroll:not(.closeable-hidden)').length){
$('.mfn-header-tmpl').css({'top': '-'+scrolled+'px'});
}
if($('#wpadminbar').length){
let admin_bar_h=$('#wpadminbar').outerHeight();
if($('.mfn-header-tmpl.mfn-header-tmpl-fixed').length) $('.mfn-header-tmpl.mfn-header-tmpl-fixed').css({'margin-top': admin_bar_h});
if($(window).width() < 767&&$('.mfn-header-tmpl.mfn-mobile-header-tmpl-fixed').length) $('.mfn-header-tmpl.mfn-mobile-header-tmpl-fixed').css({'margin-top': admin_bar_h});
}}
});
},
getHeight: function(){
headerTemplate.height=$('.mfn-header-tmpl').outerHeight();
if(headerTemplate.type!='default'&&headerTemplate.hasBodyOffset){
$('#Wrapper').css({ 'padding-top':headerTemplate.height });
}else{
$('#Wrapper').removeAttr('style');
}
$('.mfn-header-tmpl').removeAttr('style');
},
readcookie: function(name){
var nameEQ=name+"=";
var ca=document.cookie.split(';');
for(var i=0;i<ca.length;i++){
var c=ca[i];
while(c.charAt(0)==' ')c=c.substring(1,c.length);
if(c.indexOf(nameEQ)==0) return c.substring(nameEQ.length,c.length)
}
return null
},
}
let mfnMarqueeText={
win_width: 1920,
init: function(){
if(!$('.mfn-marquee-text-wrapper').length) return;
this.win_width=$(window).width();
setTimeout(function(){
mfnMarqueeText.set();
}, 100);
},
set: function(){
$('.mfn-marquee-text-wrapper:not(.initialized)').each(function(i, el){
if(!$(this).find('.mfn-marquee-text').length) return;
$(this).addClass('initialized');
let track=$(this).find('.mfn-marquee-text');
let width=track.outerWidth();
document.body.style.display='table';
document.body.offsetHeight;
document.body.style.display='';
if(width==0) return;
let divi=Math.round((mfnMarqueeText.win_width / width)) + 1;
let iter=Math.round(Math.ceil(divi / 2) * 2);
if(iter < 2) return;
let track_html=track.html();
for (var j=1; j <=iter; j++){
track.append(track_html);
}
let count=track.find('.mfn-marquee-item').length;
if(count % 2!==0){
track.append(track_html);
}});
}}
mfnMarqueeText.init();
$(document).on('mfn:ajax:refresh', mfnMarqueeText.init);
let mfnReadMore={
init: function(){
if($('body').hasClass('mfn-ui')) return false;
if(!$('.mfn-read-more').length) return false;
mfnReadMore.prepare();
mfnReadMore.click();
},
prepare: function(){
if($('body').hasClass('mfn-ui')) return false;
$('.mfn-read-more').each(function(){
let this_wrapper=$(this).closest('.column');
let copy=this_wrapper.nextAll('.column').addClass('mfn-read-more-hidden');
if(copy.length){
$.each(copy, function(i, item){
this_wrapper.before(item);
});
}});
},
open: function($wrapper){
$wrapper.find('.mfn-read-more-hidden').each(function(){
let $el=$(this);
$el
.stop(true, true)
.addClass('showed')
.hide()
.slideDown(500, function(){
$(this).css('display', 'flex');
});
});
},
close: function($wrapper){
$wrapper.find('.mfn-read-more-hidden').each(function(){
let $el=$(this);
$el
.stop(true, true)
.css('display', 'flex')
.slideUp(500, function(){
$(this)
.removeClass('showed')
.css('display', '');
});
});
},
click: function(){
$(document).on('click', '.mfn-read-more', function(e){
e.preventDefault();
let box=$(this);
let wrapper=box.closest('.mcb-wrap');
let label1=box.attr('data-title1');
let label2=box.attr('data-title2');
let icon1=box.attr('data-icon1');
let icon2=box.attr('data-icon2');
let label=box.find(box.attr('data-label_path'));
let icon=box.find(box.attr('data-icon_path'));
if(wrapper.hasClass('mfn-read-more-expanded')){
mfnReadMore.close(wrapper);
wrapper.removeClass('mfn-read-more-expanded');
label.html(label1);
if(icon1!=''&&icon.length){
icon.html('<i class="' + icon1 + '"></i>');
}else{
icon.remove();
}}else{
mfnReadMore.open(wrapper);
wrapper.addClass('mfn-read-more-expanded');
label.html(label2);
if(icon2!=''){
if(icon.length){
icon.html('<i class="' + icon2 + '"></i>');
}else{
if(box.find('.mfn-icon-box').length){
box.find('.mfn-icon-box').prepend('<span class="' + box.attr('data-icon_path').replace('.', '') + '"><i class="' + icon2 + '"></i></span>');
}else{
box.prepend('<span class="' + box.attr('data-icon_path').replace('.', '') + '"><i class="' + icon2 + '"></i></span>');
}}
}}
$(window).trigger('resize');
setTimeout(function(){
$(window).trigger('resize');
}, 600);
});
}};
let mfnPopup={
init: function(){
if($('body').hasClass('elementor-editor-active')) return;
$(document).on('click', '.open-mfn-popup', function(e){
e.preventDefault();
let popup_id=$(this).attr('data-mfnpopup');
if(popup_id=='popup_id_required'){
alert('Popup ID id required');
}else if(!$(popup_id).length){
alert('We cannot find popup with inserted ID');
}else{
mfnPopup.showPopup($(popup_id));
}});
if(!$('body').hasClass('mfn-cookies-open')) mfnPopup.open();
$(document).on('click', '.exit-mfn-popup', function(e){
e.preventDefault();
let $popup=$(this).closest('.mfn-popup-tmpl');
mfnPopup.hidePopup($popup);
});
},
open: function(){
if($('.mfn-popup-tmpl.mfn-popup-tmpl-display-on-scroll').length) mfnPopup.showOnScroll();
if($('.mfn-popup-tmpl.mfn-popup-tmpl-display-start-delay').length) mfnPopup.showOnDelay();
if($('.mfn-popup-tmpl.mfn-popup-tmpl-display-on-exit').length) mfnPopup.showOnExit();
if($('.mfn-popup-tmpl.mfn-popup-tmpl-display-scroll-to-element').length) mfnPopup.showOnScrollToElement();
if($('.mfn-popup-tmpl.mfn-popup-tmpl-display-on-start').length) mfnPopup.showOnStart();
},
hidePopup: function($popup){
if($popup.find('video').length) $popup.find('video').get(0).pause();
if($popup.find('iframe').length){
var popup_iframe=$popup.find('iframe')[0];
var ifr_src=$(popup_iframe).attr('src');
if(typeof ifr_src!='undefined'){
if(ifr_src.includes('youtu')) popup_iframe.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
if(ifr_src.includes('vimeo')){
$(popup_iframe).attr('src', ifr_src);
}}
}
$popup.removeClass('mfn-popup-active');
$('html').removeClass('mfn-popup-browser-scroll-disabled');
if($('style.mfn-popup-tmpl-blur-'+$popup.attr('data-id')).length){
$('style.mfn-popup-tmpl-blur-'+$popup.attr('data-id')).remove();
}
if($popup.hasClass('mfn-popup-tmpl-display-cookie-based')||$popup.hasClass('mfn-popup-tmpl-display-one')){
let days=365;
if($popup.hasClass('mfn-popup-tmpl-display-cookie-based')) days=parseInt($popup.attr('data-cookie'));
let cookie_name='mfn_popup_'+$popup.attr('data-id');
mfnPopup.addCookie(days, cookie_name);
}},
showPopup: function($popup){
let cookie_name='mfn_popup_'+$popup.attr('data-id');
if(mfnPopup.checkCookie(cookie_name)) return;
if(typeof $popup.attr('data-blur')!=='undefined'){
$('body').append('<style class="mfn-popup-tmpl-blur-'+$popup.attr('data-id')+'">#Wrapper{ filter: blur('+$popup.attr('data-blur')+'px) }</style>');
}
if(!$popup.hasClass('mfn-popup-active')) $popup.addClass('mfn-popup-active mfn-popup-showed');
if($popup.hasClass('mfn-popup-tmpl-hide-automatically-delay')) mfnPopup.hideAutomatically($popup);
if($popup.hasClass('mfn-popup-tmpl-close-button-show-delay')) mfnPopup.showExitButton($popup);
if(!$('body').hasClass('mfn-ui')&&$popup.hasClass('mfn-popup-close-on-overlay-click')){
$popup.bind('click',  mfnPopup.closeOverlayClick);
}
if(!$popup.hasClass('mfn-popup-browser-scroll-enabled')){
$('html').addClass('mfn-popup-browser-scroll-disabled');
}
bannerBox.set();
if($popup.find('.slick-initialized').length){
$popup.find('.slick-initialized').slick('refresh');
}
$(document).trigger('mfnPopupInit');
},
closeOverlayClick: function(e){
var div=$(e.delegateTarget).find('.mfn-popup-tmpl-content-wrapper');
if(!div.is(e.target)&&div.has(e.target).length===0){
mfnPopup.hidePopup($(e.delegateTarget));
$(e.delegateTarget).unbind('click', mfnPopup.closeOverlayClick);
}},
hideAutomatically: function($popup){
if($('body').hasClass('mfn-ui')) return;
let delay=parseInt($popup.attr('data-hidedelay'));
setTimeout(function(){ mfnPopup.hidePopup($popup); }, delay);
},
showExitButton: function($popup){
let delay=parseInt($popup.attr('data-closebuttondelay'));
setTimeout(function(){ $popup.addClass('mfn-closebutton-active'); }, delay);
},
showOnScroll: function(){
$('.mfn-popup-tmpl.mfn-popup-tmpl-display-on-scroll').each(function(){
let $popup=$(this);
let scroll_offset=parseInt($popup.attr('data-display'));
$(window).on('scroll', function(){
if($(window).scrollTop() > scroll_offset&&!$popup.hasClass('mfn-popup-showed')) mfnPopup.showPopup($popup);
});
});
},
showOnScrollToElement: function(){
$('body').imagesLoaded(function(){
$('.mfn-popup-tmpl.mfn-popup-tmpl-display-scroll-to-element').each(function(){
let $popup=$(this);
let scroll_offset=$($popup.attr('data-display')).length ? parseInt($($popup.attr('data-display')).offset().top):100;
$(window).on('scroll', function(){
if($(window).scrollTop() > scroll_offset&&!$popup.hasClass('mfn-popup-showed')) mfnPopup.showPopup($popup);
});
});
});
},
showOnDelay: function(){
$('.mfn-popup-tmpl.mfn-popup-tmpl-display-start-delay').each(function(){
let $popup=$(this);
let delay=parseInt($popup.attr('data-display'));
setTimeout(function(){
mfnPopup.showPopup($popup)
}, delay);
});
},
showOnExit: function(){
$('.mfn-popup-tmpl.mfn-popup-tmpl-display-on-exit').each(function(){
let $popup=$(this);
$(document).on('mouseleave', function(){
mfnPopup.showPopup($popup)
});
});
},
showOnStart: function(){
$('.mfn-popup-tmpl.mfn-popup-tmpl-display-on-start').each(function(){
let $popup=$(this);
mfnPopup.showPopup($popup)
});
},
addCookie(days, cookie_name){
let date=new Date();
date.setTime(date.getTime()+(parseInt(days)*24*60*60*1000));
let expires="; expires="+date.toGMTString();
document.cookie=cookie_name+"=true"+expires+"; path=/";
},
checkCookie(cookie_name){
var nameEQ=cookie_name+"=";
var ca=document.cookie.split(';');
for(var i=0;i<ca.length;i++){
var c=ca[i];
while(c.charAt(0)==' ') c=c.substring(1,c.length);
if(c.indexOf(nameEQ)==0) return c.substring(nameEQ.length,c.length)
}
return null
}}
$(document).on('mfn:gdpr2:close', function(){
mfnPopup.open();
});
var mfnReadMoreTermDesc=function($el){
var $el=$el.closest('.mfn-desc-expandable');
var start=$el.css('max-height'),
height;
$el.css('max-height','unset');
height=$el.outerHeight();
$el.css('max-height',start);
$el.animate({
'maxHeight': height + 'px'
},500);
$el.find('.read-more').animate({
'opacity': 0
},500,function(){
$(this).hide();
});
};
$(document).on('click', '.mfn-desc-expandable .read-more .read-more-button', function(e){
e.preventDefault();
mfnReadMoreTermDesc($(this));
});
var mfnSideMenu={
id: '',
wrapper: false,
hash: false,
submenu: false,
backup: {},
init: function(){
if($('.mfn-menu-tabs-wrapper').length) mfnSideMenu.menutabs();
if($('.mfn-sidemenu-menu.mfn-menu-submenu-on.mfn-menu-submenu-toggled').length) mfnSideMenu.toggleSubmenu();
if($('.mfn-sidemenu-menu.mfn-menu-submenu-on.mfn-menu-submenu-replace').length) mfnSideMenu.replaceSubmenu();
if($('a.mfn-open-sidebar').length){
mfnSideMenu.click();
mfnSideMenu.closeClick();
}
$(document).on('click', '.mfn-sidemenu-menu li a', function(e){
var href=$(this).attr('href');
if(href=='#'&&$(this).siblings('.outer-menu-sub').length){
e.preventDefault();
$(this).siblings('.outer-menu-sub').trigger('click');
}else if(href.includes('#')){
var href_split=href.split('#');
if(!$('#'+href_split[1]).length) return;
e.preventDefault();
$(this).closest('li').addClass('current-menu-item').siblings('li').removeClass('current-menu-item');
var offset=$('#'+href_split[1]).offset().top;
offset=offset -(fixStickyHeaderH() + adminBarH());
$('body, html').animate({scrollTop: offset}, 500);
mfnSideMenu.id=$(this).closest('.mfn-sidemenu-tmpl').attr('data-id');
mfnSideMenu.hide();
}});
},
closeClick: function(){
$(document).on('click', '.mfn-sidemenu-closebutton', function(e){
e.preventDefault();
mfnSideMenu.id=$(this).closest('.mfn-sidemenu-tmpl').attr('data-id');
mfnSideMenu.hide();
});
},
hide: function(){
$('#mfn-sidemenu-tmpl-'+mfnSideMenu.id).removeClass('mfn-sidemenu-active');
$('html').addClass('mfn-closing-sidemenu-'+mfnSideMenu.id);
$('html').removeClass('mfn-sidemenu-'+mfnSideMenu.id+'-active');
$('html').removeClass('mfn-sidemenu-move-content-'+$('#mfn-sidemenu-tmpl-'+mfnSideMenu.id).attr('data-align'));
$('html').removeClass('mfn-sidemenu-bodyscroll-'+$('#mfn-sidemenu-tmpl-'+mfnSideMenu.id).attr('data-bodyscroll'));
$('html').removeClass('mfn-sidemenu-entrance-'+$('#mfn-sidemenu-tmpl-'+mfnSideMenu.id).attr('data-entrance'));
setTimeout(function(){
$('html').removeClass('mfn-closing-sidemenu-'+mfnSideMenu.id);
redrawAllRevolutionSliders();
}, 310);
if(!$('body').hasClass('mfn-ui')&&$('#mfn-sidemenu-tmpl-'+mfnSideMenu.id).hasClass('mfn-sidemenu-close-on-overlay-click')){
$(document).unbind('click', mfnSideMenu.closeOverlayClick);
}},
click: function(){
$(document).on('click', 'a.mfn-open-sidebar', function(e){
e.preventDefault();
mfnSideMenu.id=String($(this).attr('data-sidemenu'));
if(!$('#mfn-sidemenu-tmpl-'+mfnSideMenu.id).length) return;
$('#mfn-sidemenu-tmpl-'+mfnSideMenu.id).addClass('mfn-sidemenu-active');
$('html').addClass('mfn-sidemenu-entrance-'+$('#mfn-sidemenu-tmpl-'+mfnSideMenu.id).attr('data-entrance'));
$('html').addClass('mfn-sidemenu-'+mfnSideMenu.id+'-active');
if($('#mfn-sidemenu-tmpl-'+mfnSideMenu.id).attr('data-entrance')=='move-content'){
$('html').addClass('mfn-sidemenu-move-content-'+$('#mfn-sidemenu-tmpl-'+mfnSideMenu.id).attr('data-align'));
}
if(!$('body').hasClass('mfn-ui')&&$('#mfn-sidemenu-tmpl-'+mfnSideMenu.id).hasClass('mfn-sidemenu-close-on-overlay-click')){
$(document).bind('click',  mfnSideMenu.closeOverlayClick);
}
setTimeout(function(){
$('html').addClass('mfn-sidemenu-bodyscroll-'+$('#mfn-sidemenu-tmpl-'+mfnSideMenu.id).attr('data-bodyscroll'));
},300);
});
},
closeOverlayClick: function(e){
var div=$('.mfn-sidemenu-tmpl');
if(!div.is(e.target)&&div.has(e.target).length===0&&!$(e.target).closest('.mfn-menu-wrapper').length){
mfnSideMenu.hide();
}},
menutabs: function(){
$(document).on('click', '.mfn-menu-tabs-wrapper ul.mfn-menu-tabs-nav li a', function(e){
e.preventDefault();
if($(this).parent('li').hasClass('active')){
return;
}else{
$(this).closest('.mfn-menu-tabs-wrapper').find('.active').removeClass('active');
}
let id=$(this).attr('href');
$(this).parent('li').addClass('active');
$(this).closest('.mfn-menu-tabs-wrapper').find(id).addClass('active');
});
},
toggleSubmenu: function(){
$(document).on('click', '.mfn-sidemenu-menu.mfn-menu-submenu-on.mfn-menu-submenu-toggled li.menu-item-has-children .outer-menu-sub', function(e){
e.preventDefault();
if(!$(this).closest('li').hasClass('current-menu-item')&&!$(this).closest('li').hasClass('current-menu-ancestor')){
$(this).closest('li').addClass('current-menu-ancestor');
}else if($(this).closest('li').hasClass('current-menu-ancestor')){
$(this).closest('li').removeClass('current-menu-ancestor');
}else{
$(this).closest('li').toggleClass('current-menu-item');
}});
},
replaceSubmenu: function(){
$(document).on('click', '.mfn-sidemenu-menu.mfn-menu-submenu-on.mfn-menu-submenu-replace li.menu-item-has-children .outer-menu-sub', function(e){
e.preventDefault();
mfnSideMenu.wrapper=$(this).closest('.mfn-menu-wrapper');
mfnSideMenu.hash=mfnSideMenu.wrapper.attr('data-hash');
mfnSideMenu.submenu=$(this).closest('li').find('ul.sub-menu').first().html();
if(typeof mfnSideMenu.backup[mfnSideMenu.hash]==='undefined'){
mfnSideMenu.backup[mfnSideMenu.hash]=[];
}
let newest={};
newest.label=$(this).closest('li').find('a.mfn-menu-link .menu-label').html();
newest.ul=mfnSideMenu.wrapper.children('ul').html();
mfnSideMenu.backup[mfnSideMenu.hash].push(newest);
if(!mfnSideMenu.wrapper.hasClass('mfn-sidemenu-replaced')) mfnSideMenu.wrapper.addClass('mfn-sidemenu-replaced');
setTimeout(mfnSideMenu.updateMenu, 10);
});
mfnSideMenu.breadcrumbsClick();
},
updateMenu: function(){
if(mfnSideMenu.wrapper.find('.mfn-sidemenu-back').length) mfnSideMenu.wrapper.find('.mfn-sidemenu-breadcrumbs').remove();
mfnSideMenu.wrapper
.find('.mfn-sidemenu-menu').html(mfnSideMenu.submenu);
if(mfnSideMenu.backup[mfnSideMenu.hash].length > 0){
mfnSideMenu.wrapper.prepend('<div class="mfn-sidemenu-breadcrumbs"></div>');
mfnSideMenu.backup[mfnSideMenu.hash].map(function(el, i){
mfnSideMenu.wrapper.find('.mfn-sidemenu-breadcrumbs').append('<span class="mfn-sidemenu-breadcrumbs-separator"><i class="icon-left-open"></i></span><a data-index="'+i+'" class="mfn-sidemenu-back" href="#">'+el.label+'</a>');
});
}},
breadcrumbsClick: function(){
$(document).on('click', '.mfn-sidemenu-back', function(e){
e.preventDefault();
mfnSideMenu.wrapper=$(this).closest('.mfn-menu-wrapper');
mfnSideMenu.hash=mfnSideMenu.wrapper.attr('data-hash');
let index=$(this).attr('data-index');
let choosed=mfnSideMenu.backup[mfnSideMenu.hash][index];
mfnSideMenu.submenu=choosed.ul;
mfnSideMenu.backup[mfnSideMenu.hash]=mfnSideMenu.backup[mfnSideMenu.hash].filter((item,i)=> { return i < index });
setTimeout(mfnSideMenu.updateMenu, 10);
});
}}
document.addEventListener('DOMContentLoaded', ()=> {
const images=Array.from(document.querySelectorAll('img.mfn-lazy'));
if('IntersectionObserver' in window){
const imageObserver=new IntersectionObserver((entries, observer)=> {
entries.forEach(entry=> {
if(entry.isIntersecting){
const image=entry.target;
image.src=image.dataset.src;
imageObserver.unobserve(image);
window.dispatchEvent(new Event('resize'));
}});
});
images.forEach(img=> imageObserver.observe(img));
}});
})(jQuery);
(function(){
let lastZoom=1;
function getZoom(){
return window.outerWidth / window.innerWidth;
}
function checkZoomReset(){
const currentZoom=getZoom();
if(Math.abs(currentZoom - 1) < 0.02&&lastZoom!==1){
window.scrollTo({ left: 0, top: window.scrollY, behavior: 'instant' });
}
lastZoom=currentZoom;
}
window.addEventListener('resize', checkZoomReset);
})();
document.addEventListener("touchstart", function(){}, true);