(function($){
"use strict";
var animating=false,
methods={
switchMag: function(clicked, _self){
var current=$(clicked);
if(current.is('.active_sort')||animating){
return;
}
var filter=current.data('filter'),
oldContainer=_self.container.filter(':visible'),
newContainer=_self.container.filter('.' + filter);
animating=true;
_self.sort_buttons.removeClass('active_sort');
current.addClass('active_sort');
_self.magazine.height(_self.magazine.outerHeight());
oldContainer.avia_animate({opacity:0}, 200, function(){
oldContainer.css({display:'none'});
newContainer.css({opacity:0, display:'block'}).avia_animate({opacity:1}, 150, function(){
_self.magazine.avia_animate({height: (newContainer.outerHeight() + _self.sort_bar.outerHeight())}, 150, function(){
_self.magazine.height('auto');
animating=false;
});
});
});
}};
$.fn.aviaMagazine=function(options){
if(! this.length){
return;
}
return this.each(function(){
var _self={};
_self.magazine=$(this),
_self.sort_buttons=_self.magazine.find('.av-magazine-sort a');
_self.container=_self.magazine.find('.av-magazine-group');
_self.sort_bar=_self.magazine.find('.av-magazine-top-bar');
_self.sort_buttons.each(function (i){
var current=$(this),
filter=current.data('filter'),
entry=_self.container.filter('.' + filter);
if(entry.length==0||entry.html().trim()==''){
current.hide();
current.prev('span.text-sep').hide();
}});
_self.sort_buttons.on('click', function(e){
e.preventDefault();
methods.switchMag(this, _self);
});
});
};}(jQuery));
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,s,a){function u(t,e,o){var n,s="$()."+i+'("'+e+'")';return t.each(function(t,u){var h=a.data(u,i);if(!h)return void r(i+" not initialized. Cannot call methods, i.e. "+s);var d=h[e];if(!d||"_"==e.charAt(0))return void r(s+" is not a valid method");var l=d.apply(h,o);n=void 0===n?l:n}),void 0!==n?n:t}function h(t,e){t.each(function(t,o){var n=a.data(o,i);n?(n.option(e),n._init()):(n=new s(o,e),a.data(o,i,n))})}a=a||e||t.jQuery,a&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=n.call(arguments,1);return u(this,t,e)}return h(this,t),this},o(a))}function o(t){!t||t&&t.bridget||(t.bridget=i)}var n=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return o(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},o=i[t]=i[t]||[];return o.indexOf(e)==-1&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},o=i[t]=i[t]||{};return o[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return o!=-1&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var o=this._onceEvents&&this._onceEvents[t],n=0;n<i.length;n++){var s=i[n],r=o&&o[s];r&&(this.off(t,s),delete o[s]),s.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<h;e++){var i=u[e];t[i]=0}return t}function o(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function n(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var n=o(e);r=200==Math.round(t(n.width)),s.isBoxSizeOuter=r,i.removeChild(e)}}function s(e){if(n(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var s=o(e);if("none"==s.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==s.boxSizing,l=0;l<h;l++){var f=u[l],c=s[f],m=parseFloat(c);a[f]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,y=a.paddingTop+a.paddingBottom,g=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,I=d&&r,x=t(s.width);x!==!1&&(a.width=x+(I?0:p+_));var S=t(s.height);return S!==!1&&(a.height=S+(I?0:y+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(y+z),a.outerWidth=a.width+g,a.outerHeight=a.height+v,a}}var r,a="undefined"==typeof console?e:function(t){console.error(t)},u=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],h=u.length,d=!1;return s}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var o=e[i],n=o+"MatchesSelector";if(t[n])return n}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var o=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?o.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);i!=-1&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,o){t=i.makeArray(t);var n=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!o)return void n.push(t);e(t,o)&&n.push(t);for(var i=t.querySelectorAll(o),s=0;s<i.length;s++)n.push(i[s])}}),n},i.debounceMethod=function(t,e,i){i=i||100;var o=t.prototype[e],n=e+"Timeout";t.prototype[e]=function(){var t=this[n];clearTimeout(t);var e=arguments,s=this;this[n]=setTimeout(function(){o.apply(s,e),delete s[n]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var n=t.console;return i.htmlInit=function(e,o){i.docReady(function(){var s=i.toDashed(o),r="data-"+s,a=document.querySelectorAll("["+r+"]"),u=document.querySelectorAll(".js-"+s),h=i.makeArray(a).concat(i.makeArray(u)),d=r+"-options",l=t.jQuery;h.forEach(function(t){var i,s=t.getAttribute(r)||t.getAttribute(d);try{i=s&&JSON.parse(s)}catch(a){return void(n&&n.error("Error parsing "+r+" on "+t.className+": "+a))}var u=new e(t,i);l&&l.data(t,o,u)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function o(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function n(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var s=document.documentElement.style,r="string"==typeof s.transition?"transition":"WebkitTransition",a="string"==typeof s.transform?"transform":"WebkitTransform",u={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[r],h={transform:a,transition:r,transitionDuration:r+"Duration",transitionProperty:r+"Property",transitionDelay:r+"Delay"},d=o.prototype=Object.create(t.prototype);d.constructor=o,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var o=h[i]||i;e[o]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),o=t[e?"left":"right"],n=t[i?"top":"bottom"],s=parseFloat(o),r=parseFloat(n),a=this.layout.size;o.indexOf("%")!=-1&&(s=s/100*a.width),n.indexOf("%")!=-1&&(r=r/100*a.height),s=isNaN(s)?0:s,r=isNaN(r)?0:r,s-=e?a.paddingLeft:a.paddingRight,r-=i?a.paddingTop:a.paddingBottom,this.position.x=s,this.position.y=r},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),o=this.layout._getOption("originTop"),n=i?"paddingLeft":"paddingRight",s=i?"left":"right",r=i?"right":"left",a=this.position.x+t[n];e[s]=this.getXValue(a),e[r]="";var u=o?"paddingTop":"paddingBottom",h=o?"top":"bottom",d=o?"bottom":"top",l=this.position.y+t[u];e[h]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,o=this.position.y,n=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),n&&!this.isTransitioning)return void this.layoutPosition();var s=t-i,r=e-o,a={};a.transform=this.getTranslate(s,r),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),o=this.layout._getOption("originTop");return t=i?t:-t,e=o?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var o=this.element.offsetHeight;o=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+n(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(u,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var f={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,o=f[t.propertyName]||t.propertyName;if(delete e.ingProperties[o],i(e.ingProperties)&&this.disableTransition(),o in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[o]),o in e.onEnd){var n=e.onEnd[o];n.call(this),delete e.onEnd[o]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(u,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var c={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(c)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return r&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},o}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,o,n,s){return e(t,i,o,n,s)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,o,n){"use strict";function s(t,e){var i=o.getQueryElement(t);if(!i)return void(u&&u.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,h&&(this.$element=h(this.element)),this.options=o.extend({},this.constructor.defaults),this.option(e);var n=++l;this.element.outlayerGUID=n,f[n]=this,this._create();var s=this._getOption("initLayout");s&&this.layout()}function r(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],o=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var n=m[o]||1;return i*n}var u=t.console,h=t.jQuery,d=function(){},l=0,f={};s.namespace="outlayer",s.Item=n,s.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var c=s.prototype;o.extend(c,e.prototype),c.option=function(t){o.extend(this.options,t)},c._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},s.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},c._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),o.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},c.reloadItems=function(){this.items=this._itemize(this.element.children)},c._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,o=[],n=0;n<e.length;n++){var s=e[n],r=new i(s,this);o.push(r)}return o},c._filterFindItemElements=function(t){return o.filterFindElements(t,this.options.itemSelector)},c.getItemElements=function(){return this.items.map(function(t){return t.element})},c.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},c._init=c.layout,c._resetLayout=function(){this.getSize()},c.getSize=function(){this.size=i(this.element)},c._getMeasurement=function(t,e){var o,n=this.options[t];n?("string"==typeof n?o=this.element.querySelector(n):n instanceof HTMLElement&&(o=n),this[t]=o?i(o)[e]:n):this[t]=0},c.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},c._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},c._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var o=this._getItemLayoutPosition(t);o.item=t,o.isInstant=e||t.isLayoutInstant,i.push(o)},this),this._processLayoutQueue(i)}},c._getItemLayoutPosition=function(){return{x:0,y:0}},c._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},c.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},c._positionItem=function(t,e,i,o,n){o?t.goTo(e,i):(t.stagger(n*this.stagger),t.moveTo(e,i))},c._postLayout=function(){this.resizeContainer()},c.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},c._getContainerSize=d,c._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},c._emitCompleteOnItems=function(t,e){function i(){n.dispatchEvent(t+"Complete",null,[e])}function o(){r++,r==s&&i()}var n=this,s=e.length;if(!e||!s)return void i();var r=0;e.forEach(function(e){e.once(t,o)})},c.dispatchEvent=function(t,e,i){var o=e?[e].concat(i):i;if(this.emitEvent(t,o),h)if(this.$element=this.$element||h(this.element),e){var n=h.Event(e);n.type=t,this.$element.trigger(n,i)}else this.$element.trigger(t,i)},c.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},c.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},c.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},c.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){o.removeFrom(this.stamps,t),this.unignore(t)},this)},c._find=function(t){if(t)return"string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o.makeArray(t)},c._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},c._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},c._manageStamp=d,c._getElementOffset=function(t){var e=t.getBoundingClientRect(),o=this._boundingRect,n=i(t),s={left:e.left-o.left-n.marginLeft,top:e.top-o.top-n.marginTop,right:o.right-e.right-n.marginRight,bottom:o.bottom-e.bottom-n.marginBottom};return s},c.handleEvent=o.handleEvent,c.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},c.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},c.onresize=function(){this.resize()},o.debounceMethod(s,"onresize",100),c.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},c.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},c.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},c.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},c.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},c.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},c.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},c.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},c.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},c.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},c.getItems=function(t){t=o.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},c.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),o.removeFrom(this.items,t)},this)},c.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete f[e],delete this.element.outlayerGUID,h&&h.removeData(this.element,this.constructor.namespace)},s.data=function(t){t=o.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&f[e]},s.create=function(t,e){var i=r(s);return i.defaults=o.extend({},s.defaults),o.extend(i.defaults,e),i.compatOptions=o.extend({},s.compatOptions),i.namespace=t,i.data=s.data,i.Item=r(n),o.htmlInit(i,t),h&&h.bridget&&h.bridget(t,i),i};var m={ms:1,s:1e3};return s.Item=n,s}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/item",["outlayer/outlayer"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.Item=e(t.Outlayer))}(window,function(t){"use strict";function e(){t.Item.apply(this,arguments)}var i=e.prototype=Object.create(t.Item.prototype),o=i._create;i._create=function(){this.id=this.layout.itemGUID++,o.call(this),this.sortData={}},i.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var t=this.layout.options.getSortData,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortData[i]=o(this.element,this)}}};var n=i.destroy;return i.destroy=function(){n.apply(this,arguments),this.css({display:""})},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):"object"==typeof module&&module.exports?module.exports=e(require("get-size"),require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.LayoutMode=e(t.getSize,t.Outlayer))}(window,function(t,e){"use strict";function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filteredItems,this.size=t.size)}var o=i.prototype,n=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout","_getOption"];return n.forEach(function(t){o[t]=function(){return e.prototype[t].apply(this.isotope,arguments)}}),o.needsVerticalResizeLayout=function(){var e=t(this.isotope.element),i=this.isotope.size&&e;return i&&e.innerHeight!=this.isotope.size.innerHeight},o._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},o.getColumnWidth=function(){this.getSegmentSize("column","Width")},o.getRowHeight=function(){this.getSegmentSize("row","Height")},o.getSegmentSize=function(t,e){var i=t+e,o="outer"+e;if(this._getMeasurement(i,o),!this[i]){var n=this.getFirstItemSize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},o.getFirstItemSize=function(){var e=this.isotope.filteredItems[0];return e&&e.element&&t(e.element)},o.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},o.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function n(){i.apply(this,arguments)}return n.prototype=Object.create(o),n.prototype.constructor=n,e&&(n.options=e),n.prototype.namespace=t,i.modes[t]=n,n},i}),function(t,e){"function"==typeof define&&define.amd?define("masonry-layout/masonry",["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var o=i.prototype;return o._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},o.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var o=this.columnWidth+=this.gutter,n=this.containerWidth+this.gutter,s=n/o,r=o-n%o,a=r&&r<1?"round":"floor";s=Math[a](s),this.cols=Math.max(s,1)},o.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,o=e(i);this.containerWidth=o&&o.innerWidth},o._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&e<1?"round":"ceil",o=Math[i](t.size.outerWidth/this.columnWidth);o=Math.min(o,this.cols);for(var n=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",s=this[n](o,t),r={x:this.columnWidth*s.col,y:s.y},a=s.y+t.size.outerHeight,u=o+s.col,h=s.col;h<u;h++)this.colYs[h]=a;return r},o._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},o._getTopColGroup=function(t){if(t<2)return this.colYs;for(var e=[],i=this.cols+1-t,o=0;o<i;o++)e[o]=this._getColGroupY(o,t);return e},o._getColGroupY=function(t,e){if(e<2)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},o._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,o=t>1&&i+t>this.cols;i=o?0:i;var n=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=n?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},o._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this._getOption("originLeft"),s=n?o.left:o.right,r=s+i.outerWidth,a=Math.floor(s/this.columnWidth);a=Math.max(0,a);var u=Math.floor(r/this.columnWidth);u-=r%this.columnWidth?0:1,u=Math.min(this.cols-1,u);for(var h=this._getOption("originTop"),d=(h?o.top:o.bottom)+i.outerHeight,l=a;l<=u;l++)this.colYs[l]=Math.max(d,this.colYs[l])},o._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},o._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/masonry",["../layout-mode","masonry-layout/masonry"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode"),require("masonry-layout")):e(t.Isotope.LayoutMode,t.Masonry)}(window,function(t,e){"use strict";var i=t.create("masonry"),o=i.prototype,n={_getElementOffset:!0,layout:!0,_getMeasurement:!0};for(var s in e.prototype)n[s]||(o[s]=e.prototype[s]);var r=o.measureColumns;o.measureColumns=function(){this.items=this.isotope.filteredItems,r.call(this)};var a=o._getOption;return o._getOption=function(t){return"fitWidth"==t?void 0!==this.options.isFitWidth?this.options.isFitWidth:this.options.fitWidth:a.apply(this.isotope,arguments)},i}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/fit-rows",["../layout-mode"],e):"object"==typeof exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){"use strict";var e=t.create("fitRows"),i=e.prototype;return i._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement("gutter","outerWidth")},i._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth+this.gutter,i=this.isotope.size.innerWidth+this.gutter;0!==this.x&&e+this.x>i&&(this.x=0,this.y=this.maxY);var o={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=e,o},i._getContainerSize=function(){return{height:this.maxY}},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope-layout/js/layout-modes/vertical",["../layout-mode"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){"use strict";var e=t.create("vertical",{horizontalAlignment:0}),i=e.prototype;return i._resetLayout=function(){this.y=0},i._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},i._getContainerSize=function(){return{height:this.y}},e}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","desandro-matches-selector/matches-selector","fizzy-ui-utils/utils","isotope-layout/js/item","isotope-layout/js/layout-mode","isotope-layout/js/layout-modes/masonry","isotope-layout/js/layout-modes/fit-rows","isotope-layout/js/layout-modes/vertical"],function(i,o,n,s,r,a){return e(t,i,o,n,s,r,a)}):"object"==typeof module&&module.exports?module.exports=e(t,require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("fizzy-ui-utils"),require("isotope-layout/js/item"),require("isotope-layout/js/layout-mode"),require("isotope-layout/js/layout-modes/masonry"),require("isotope-layout/js/layout-modes/fit-rows"),require("isotope-layout/js/layout-modes/vertical")):t.Isotope=e(t,t.Outlayer,t.getSize,t.matchesSelector,t.fizzyUIUtils,t.Isotope.Item,t.Isotope.LayoutMode)}(window,function(t,e,i,o,n,s,r){function a(t,e){return function(i,o){for(var n=0;n<t.length;n++){var s=t[n],r=i.sortData[s],a=o.sortData[s];if(r>a||r<a){var u=void 0!==e[s]?e[s]:e,h=u?1:-1;return(r>a?1:-1)*h}}return 0}}var u=t.jQuery,h=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},d=e.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});d.Item=s,d.LayoutMode=r;var l=d.prototype;l._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),e.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var t in r.modes)this._initLayoutMode(t)},l.reloadItems=function(){this.itemGUID=0,e.prototype.reloadItems.call(this)},l._itemize=function(){for(var t=e.prototype._itemize.apply(this,arguments),i=0;i<t.length;i++){var o=t[i];o.id=this.itemGUID++}return this._updateItemsSortData(t),t},l._initLayoutMode=function(t){var e=r.modes[t],i=this.options[t]||{};this.options[t]=e.options?n.extend(e.options,i):i,this.modes[t]=new e(this)},l.layout=function(){return!this._isLayoutInited&&this._getOption("initLayout")?void this.arrange():void this._layout()},l._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},l.arrange=function(t){this.option(t),this._getIsInstant();var e=this._filter(this.items);this.filteredItems=e.matches,this._bindArrangeComplete(),this._isInstant?this._noTransition(this._hideReveal,[e]):this._hideReveal(e),this._sort(),this._layout()},l._init=l.arrange,l._hideReveal=function(t){this.reveal(t.needReveal),this.hide(t.needHide)},l._getIsInstant=function(){var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;return this._isInstant=e,e},l._bindArrangeComplete=function(){function t(){e&&i&&o&&n.dispatchEvent("arrangeComplete",null,[n.filteredItems])}var e,i,o,n=this;this.once("layoutComplete",function(){e=!0,t()}),this.once("hideComplete",function(){i=!0,t()}),this.once("revealComplete",function(){o=!0,t()})},l._filter=function(t){var e=this.options.filter;e=e||"*";for(var i=[],o=[],n=[],s=this._getFilterTest(e),r=0;r<t.length;r++){var a=t[r];if(!a.isIgnored){var u=s(a);u&&i.push(a),u&&a.isHidden?o.push(a):u||a.isHidden||n.push(a)}}return{matches:i,needReveal:o,needHide:n}},l._getFilterTest=function(t){return u&&this.options.isJQueryFiltering?function(e){return u(e.element).is(t);
}:"function"==typeof t?function(e){return t(e.element)}:function(e){return o(e.element,t)}},l.updateSortData=function(t){var e;t?(t=n.makeArray(t),e=this.getItems(t)):e=this.items,this._getSorters(),this._updateItemsSortData(e)},l._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=f(i)}},l._updateItemsSortData=function(t){for(var e=t&&t.length,i=0;e&&i<e;i++){var o=t[i];o.updateSortData()}};var f=function(){function t(t){if("string"!=typeof t)return t;var i=h(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),s=n&&n[1],r=e(s,o),a=d.sortDataParsers[i[1]];return t=a?function(t){return t&&a(r(t))}:function(t){return t&&r(t)}}function e(t,e){return t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&i.textContent}}return t}();d.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},l._sort=function(){if(this.options.sortBy){var t=n.makeArray(this.options.sortBy);this._getIsSameSortBy(t)||(this.sortHistory=t.concat(this.sortHistory));var e=a(this.sortHistory,this.options.sortAscending);this.filteredItems.sort(e)}},l._getIsSameSortBy=function(t){for(var e=0;e<t.length;e++)if(t[e]!=this.sortHistory[e])return!1;return!0},l._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw new Error("No layout mode: "+t);return e.options=this.options[t],e},l._resetLayout=function(){e.prototype._resetLayout.call(this),this._mode()._resetLayout()},l._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},l._manageStamp=function(t){this._mode()._manageStamp(t)},l._getContainerSize=function(){return this._mode()._getContainerSize()},l.needsResizeLayout=function(){return this._mode().needsResizeLayout()},l.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},l.prepended=function(t){var e=this._itemize(t);if(e.length){this._resetLayout(),this._manageStamps();var i=this._filterRevealAdded(e);this.layoutItems(this.filteredItems),this.filteredItems=i.concat(this.filteredItems),this.items=e.concat(this.items)}},l._filterRevealAdded=function(t){var e=this._filter(t);return this.hide(e.needHide),this.reveal(e.matches),this.layoutItems(e.matches,!0),e.matches},l.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;i<n;i++)o=e[i],this.element.appendChild(o.element);var s=this._filter(e).matches;for(i=0;i<n;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;i<n;i++)delete e[i].isLayoutInstant;this.reveal(s)}};var c=l.remove;return l.remove=function(t){t=n.makeArray(t);var e=this.getItems(t);c.call(this,t);for(var i=e&&e.length,o=0;i&&o<i;o++){var s=e[o];n.removeFrom(this.filteredItems,s)}},l.shuffle=function(){for(var t=0;t<this.items.length;t++){var e=this.items[t];e.sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},l._noTransition=function(t,e){var i=this.options.transitionDuration;this.options.transitionDuration=0;var o=t.apply(this,e);return this.options.transitionDuration=i,o},l.getFilteredItemElements=function(){return this.filteredItems.map(function(t){return t.element})},d});
!function(a,b){"function"==typeof define&&define.amd?define("packery/js/rect",b):"object"==typeof module&&module.exports?module.exports=b():(a.Packery=a.Packery||{},a.Packery.Rect=b())}(window,function(){function a(b){for(var c in a.defaults)this[c]=a.defaults[c];for(c in b)this[c]=b[c]}a.defaults={x:0,y:0,width:0,height:0};var b=a.prototype;return b.contains=function(a){var b=a.width||0,c=a.height||0;return this.x<=a.x&&this.y<=a.y&&this.x+this.width>=a.x+b&&this.y+this.height>=a.y+c},b.overlaps=function(a){var b=this.x+this.width,c=this.y+this.height,d=a.x+a.width,e=a.y+a.height;return this.x<d&&b>a.x&&this.y<e&&c>a.y},b.getMaximalFreeRects=function(b){if(!this.overlaps(b))return!1;var c,d=[],e=this.x+this.width,f=this.y+this.height,g=b.x+b.width,h=b.y+b.height;return this.y<b.y&&(c=new a({x:this.x,y:this.y,width:this.width,height:b.y-this.y}),d.push(c)),e>g&&(c=new a({x:g,y:this.y,width:e-g,height:this.height}),d.push(c)),f>h&&(c=new a({x:this.x,y:h,width:this.width,height:f-h}),d.push(c)),this.x<b.x&&(c=new a({x:this.x,y:this.y,width:b.x-this.x,height:this.height}),d.push(c)),d},b.canFit=function(a){return this.width>=a.width&&this.height>=a.height},a}),function(a,b){if("function"==typeof define&&define.amd)define("packery/js/packer",["./rect"],b);else if("object"==typeof module&&module.exports)module.exports=b(require("./rect"));else{var c=a.Packery=a.Packery||{};c.Packer=b(c.Rect)}}(window,function(a){function b(a,b,c){this.width=a||0,this.height=b||0,this.sortDirection=c||"downwardLeftToRight",this.reset()}var c=b.prototype;c.reset=function(){this.spaces=[];var b=new a({x:0,y:0,width:this.width,height:this.height});this.spaces.push(b),this.sorter=d[this.sortDirection]||d.downwardLeftToRight},c.pack=function(a){for(var b=0;b<this.spaces.length;b++){var c=this.spaces[b];if(c.canFit(a)){this.placeInSpace(a,c);break}}},c.columnPack=function(a){for(var b=0;b<this.spaces.length;b++){var c=this.spaces[b],d=c.x<=a.x&&c.x+c.width>=a.x+a.width&&c.height>=a.height-.01;if(d){a.y=c.y,this.placed(a);break}}},c.rowPack=function(a){for(var b=0;b<this.spaces.length;b++){var c=this.spaces[b],d=c.y<=a.y&&c.y+c.height>=a.y+a.height&&c.width>=a.width-.01;if(d){a.x=c.x,this.placed(a);break}}},c.placeInSpace=function(a,b){a.x=b.x,a.y=b.y,this.placed(a)},c.placed=function(a){for(var b=[],c=0;c<this.spaces.length;c++){var d=this.spaces[c],e=d.getMaximalFreeRects(a);e?b.push.apply(b,e):b.push(d)}this.spaces=b,this.mergeSortSpaces()},c.mergeSortSpaces=function(){b.mergeRects(this.spaces),this.spaces.sort(this.sorter)},c.addSpace=function(a){this.spaces.push(a),this.mergeSortSpaces()},b.mergeRects=function(a){var b=0,c=a[b];a:for(;c;){for(var d=0,e=a[b+d];e;){if(e==c)d++;else{if(e.contains(c)){a.splice(b,1),c=a[b];continue a}c.contains(e)?a.splice(b+d,1):d++}e=a[b+d]}b++,c=a[b]}return a};var d={downwardLeftToRight:function(a,b){return a.y-b.y||a.x-b.x},rightwardTopToBottom:function(a,b){return a.x-b.x||a.y-b.y}};return b}),function(a,b){"function"==typeof define&&define.amd?define("packery/js/item",["outlayer/outlayer","./rect"],b):"object"==typeof module&&module.exports?module.exports=b(require("outlayer"),require("./rect")):a.Packery.Item=b(a.Outlayer,a.Packery.Rect)}(window,function(a,b){var c=document.documentElement.style,d="string"==typeof c.transform?"transform":"WebkitTransform",e=function(){a.Item.apply(this,arguments)},f=e.prototype=Object.create(a.Item.prototype),g=f._create;f._create=function(){g.call(this),this.rect=new b};var h=f.moveTo;return f.moveTo=function(a,b){var c=Math.abs(this.position.x-a),d=Math.abs(this.position.y-b),e=this.layout.dragItemCount&&!this.isPlacing&&!this.isTransitioning&&1>c&&1>d;return e?void this.goTo(a,b):void h.apply(this,arguments)},f.enablePlacing=function(){this.removeTransitionStyles(),this.isTransitioning&&d&&(this.element.style[d]="none"),this.isTransitioning=!1,this.getSize(),this.layout._setRectSize(this.element,this.rect),this.isPlacing=!0},f.disablePlacing=function(){this.isPlacing=!1},f.removeElem=function(){this.element.parentNode.removeChild(this.element),this.layout.packer.addSpace(this.rect),this.emitEvent("remove",[this])},f.showDropPlaceholder=function(){var a=this.dropPlaceholder;a||(a=this.dropPlaceholder=document.createElement("div"),a.className="packery-drop-placeholder",a.style.position="absolute"),a.style.width=this.size.width+"px",a.style.height=this.size.height+"px",this.positionDropPlaceholder(),this.layout.element.appendChild(a)},f.positionDropPlaceholder=function(){this.dropPlaceholder.style[d]="translate("+this.rect.x+"px, "+this.rect.y+"px)"},f.hideDropPlaceholder=function(){this.layout.element.removeChild(this.dropPlaceholder)},e}),function(a,b){"function"==typeof define&&define.amd?define("packery/js/packery",["get-size/get-size","outlayer/outlayer","./rect","./packer","./item"],b):"object"==typeof module&&module.exports?module.exports=b(require("get-size"),require("outlayer"),require("./rect"),require("./packer"),require("./item")):a.Packery=b(a.getSize,a.Outlayer,a.Packery.Rect,a.Packery.Packer,a.Packery.Item)}(window,function(a,b,c,d,e){function f(a,b){return a.position.y-b.position.y||a.position.x-b.position.x}function g(a,b){return a.position.x-b.position.x||a.position.y-b.position.y}function h(a,b){var c=b.x-a.x,d=b.y-a.y;return Math.sqrt(c*c+d*d)}c.prototype.canFit=function(a){return this.width>=a.width-1&&this.height>=a.height-1};var i=b.create("packery");i.Item=e;var j=i.prototype;j._create=function(){b.prototype._create.call(this),this.packer=new d,this.shiftPacker=new d,this.isEnabled=!0,this.dragItemCount=0;var a=this;this.handleDraggabilly={dragStart:function(){a.itemDragStart(this.element)},dragMove:function(){a.itemDragMove(this.element,this.position.x,this.position.y)},dragEnd:function(){a.itemDragEnd(this.element)}},this.handleUIDraggable={start:function(b,c){c&&a.itemDragStart(b.currentTarget)},drag:function(b,c){c&&a.itemDragMove(b.currentTarget,c.position.left,c.position.top)},stop:function(b,c){c&&a.itemDragEnd(b.currentTarget)}}},j._resetLayout=function(){this.getSize(),this._getMeasurements();var a,b,c;this._getOption("horizontal")?(a=1/0,b=this.size.innerHeight+this.gutter,c="rightwardTopToBottom"):(a=this.size.innerWidth+this.gutter,b=1/0,c="downwardLeftToRight"),this.packer.width=this.shiftPacker.width=a,this.packer.height=this.shiftPacker.height=b,this.packer.sortDirection=this.shiftPacker.sortDirection=c,this.packer.reset(),this.maxY=0,this.maxX=0},j._getMeasurements=function(){this._getMeasurement("columnWidth","width"),this._getMeasurement("rowHeight","height"),this._getMeasurement("gutter","width")},j._getItemLayoutPosition=function(a){if(this._setRectSize(a.element,a.rect),this.isShifting||this.dragItemCount>0){var b=this._getPackMethod();this.packer[b](a.rect)}else this.packer.pack(a.rect);return this._setMaxXY(a.rect),a.rect},j.shiftLayout=function(){this.isShifting=!0,this.layout(),delete this.isShifting},j._getPackMethod=function(){return this._getOption("horizontal")?"rowPack":"columnPack"},j._setMaxXY=function(a){this.maxX=Math.max(a.x+a.width,this.maxX),this.maxY=Math.max(a.y+a.height,this.maxY)},j._setRectSize=function(b,c){var d=a(b),e=d.outerWidth,f=d.outerHeight;(e||f)&&(e=this._applyGridGutter(e,this.columnWidth),f=this._applyGridGutter(f,this.rowHeight)),c.width=Math.min(e,this.packer.width),c.height=Math.min(f,this.packer.height)},j._applyGridGutter=function(a,b){if(!b)return a+this.gutter;b+=this.gutter;var c=a%b,d=c&&1>c?"round":"ceil";return a=Math[d](a/b)*b},j._getContainerSize=function(){return this._getOption("horizontal")?{width:this.maxX-this.gutter}:{height:this.maxY-this.gutter}},j._manageStamp=function(a){var b,d=this.getItem(a);if(d&&d.isPlacing)b=d.rect;else{var e=this._getElementOffset(a);b=new c({x:this._getOption("originLeft")?e.left:e.right,y:this._getOption("originTop")?e.top:e.bottom})}this._setRectSize(a,b),this.packer.placed(b),this._setMaxXY(b)},j.sortItemsByPosition=function(){var a=this._getOption("horizontal")?g:f;this.items.sort(a)},j.fit=function(a,b,c){var d=this.getItem(a);d&&(this.stamp(d.element),d.enablePlacing(),this.updateShiftTargets(d),b=void 0===b?d.rect.x:b,c=void 0===c?d.rect.y:c,this.shift(d,b,c),this._bindFitEvents(d),d.moveTo(d.rect.x,d.rect.y),this.shiftLayout(),this.unstamp(d.element),this.sortItemsByPosition(),d.disablePlacing())},j._bindFitEvents=function(a){function b(){d++,2==d&&c.dispatchEvent("fitComplete",null,[a])}var c=this,d=0;a.once("layout",b),this.once("layoutComplete",b)},j.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&(this.options.shiftPercentResize?this.resizeShiftPercentLayout():this.layout())},j.needsResizeLayout=function(){var b=a(this.element),c=this._getOption("horizontal")?"innerHeight":"innerWidth";return b[c]!=this.size[c]},j.resizeShiftPercentLayout=function(){var b=this._getItemsForLayout(this.items),c=this._getOption("horizontal"),d=c?"y":"x",e=c?"height":"width",f=c?"rowHeight":"columnWidth",g=c?"innerHeight":"innerWidth",h=this[f];if(h=h&&h+this.gutter){this._getMeasurements();var i=this[f]+this.gutter;b.forEach(function(a){var b=Math.round(a.rect[d]/h);a.rect[d]=b*i})}else{var j=a(this.element)[g]+this.gutter,k=this.packer[e];b.forEach(function(a){a.rect[d]=a.rect[d]/k*j})}this.shiftLayout()},j.itemDragStart=function(a){if(this.isEnabled){this.stamp(a);var b=this.getItem(a);b&&(b.enablePlacing(),b.showDropPlaceholder(),this.dragItemCount++,this.updateShiftTargets(b))}},j.updateShiftTargets=function(a){this.shiftPacker.reset(),this._getBoundingRect();var b=this._getOption("originLeft"),d=this._getOption("originTop");this.stamps.forEach(function(a){var e=this.getItem(a);if(!e||!e.isPlacing){var f=this._getElementOffset(a),g=new c({x:b?f.left:f.right,y:d?f.top:f.bottom});this._setRectSize(a,g),this.shiftPacker.placed(g)}},this);var e=this._getOption("horizontal"),f=e?"rowHeight":"columnWidth",g=e?"height":"width";this.shiftTargetKeys=[],this.shiftTargets=[];var h,i=this[f];if(i=i&&i+this.gutter){var j=Math.ceil(a.rect[g]/i),k=Math.floor((this.shiftPacker[g]+this.gutter)/i);h=(k-j)*i;for(var l=0;k>l;l++)this._addShiftTarget(l*i,0,h)}else h=this.shiftPacker[g]+this.gutter-a.rect[g],this._addShiftTarget(0,0,h);var m=this._getItemsForLayout(this.items),n=this._getPackMethod();m.forEach(function(a){var b=a.rect;this._setRectSize(a.element,b),this.shiftPacker[n](b),this._addShiftTarget(b.x,b.y,h);var c=e?b.x+b.width:b.x,d=e?b.y:b.y+b.height;if(this._addShiftTarget(c,d,h),i)for(var f=Math.round(b[g]/i),j=1;f>j;j++){var k=e?c:b.x+i*j,l=e?b.y+i*j:d;this._addShiftTarget(k,l,h)}},this)},j._addShiftTarget=function(a,b,c){var d=this._getOption("horizontal")?b:a;if(!(0!==d&&d>c)){var e=a+","+b,f=-1!=this.shiftTargetKeys.indexOf(e);f||(this.shiftTargetKeys.push(e),this.shiftTargets.push({x:a,y:b}))}},j.shift=function(a,b,c){var d,e=1/0,f={x:b,y:c};this.shiftTargets.forEach(function(a){var b=h(a,f);e>b&&(d=a,e=b)}),a.rect.x=d.x,a.rect.y=d.y};var k=120;j.itemDragMove=function(a,b,c){function d(){f.shift(e,b,c),e.positionDropPlaceholder(),f.layout()}var e=this.isEnabled&&this.getItem(a);if(e){b-=this.size.paddingLeft,c-=this.size.paddingTop;var f=this,g=new Date;this._itemDragTime&&g-this._itemDragTime<k?(clearTimeout(this.dragTimeout),this.dragTimeout=setTimeout(d,k)):(d(),this._itemDragTime=g)}},j.itemDragEnd=function(a){function b(){d++,2==d&&(c.element.classList.remove("is-positioning-post-drag"),c.hideDropPlaceholder(),e.dispatchEvent("dragItemPositioned",null,[c]))}var c=this.isEnabled&&this.getItem(a);if(c){clearTimeout(this.dragTimeout),c.element.classList.add("is-positioning-post-drag");var d=0,e=this;c.once("layout",b),this.once("layoutComplete",b),c.moveTo(c.rect.x,c.rect.y),this.layout(),this.dragItemCount=Math.max(0,this.dragItemCount-1),this.sortItemsByPosition(),c.disablePlacing(),this.unstamp(c.element)}},j.bindDraggabillyEvents=function(a){this._bindDraggabillyEvents(a,"on")},j.unbindDraggabillyEvents=function(a){this._bindDraggabillyEvents(a,"off")},j._bindDraggabillyEvents=function(a,b){var c=this.handleDraggabilly;a[b]("dragStart",c.dragStart),a[b]("dragMove",c.dragMove),a[b]("dragEnd",c.dragEnd)},j.bindUIDraggableEvents=function(a){this._bindUIDraggableEvents(a,"on")},j.unbindUIDraggableEvents=function(a){this._bindUIDraggableEvents(a,"off")},j._bindUIDraggableEvents=function(a,b){var c=this.handleUIDraggable;a[b]("dragstart",c.start)[b]("drag",c.drag)[b]("dragstop",c.stop)};var l=j.destroy;return j.destroy=function(){l.apply(this,arguments),this.isEnabled=!1},i.Rect=c,i.Packer=d,i}),function(a,b){"function"==typeof define&&define.amd?define(["isotope-layout/js/layout-mode","packery/js/packery"],b):"object"==typeof module&&module.exports?module.exports=b(require("isotope-layout/js/layout-mode"),require("packery")):b(a.Isotope.LayoutMode,a.Packery)}(window,function(a,b){var c=a.create("packery"),d=c.prototype,e={_getElementOffset:!0,_getMeasurement:!0};for(var f in b.prototype)e[f]||(d[f]=b.prototype[f]);var g=d._resetLayout;d._resetLayout=function(){this.packer=this.packer||new b.Packer,this.shiftPacker=this.shiftPacker||new b.Packer,g.apply(this,arguments)};var h=d._getItemLayoutPosition;d._getItemLayoutPosition=function(a){return a.rect=a.rect||new b.Rect,h.call(this,a)};var i=d.needsResizeLayout;d.needsResizeLayout=function(){return this._getOption("horizontal")?this.needsVerticalResizeLayout():i.call(this)};var j=d._getOption;return d._getOption=function(a){return"horizontal"==a?void 0!==this.options.isHorizontal?this.options.isHorizontal:this.options.horizontal:j.apply(this.isotope,arguments)},c});
(function($){
"use strict";
$.fn.avia_masonry=function(options){
if(! this.length){
return this;
}
var the_body=$('body'),
the_win=$(window),
isMobile=$.avia_utilities.isMobile,
isTouchDevice=$.avia_utilities.isTouchDevice,
mobile_no_animation=the_body.hasClass('avia-mobile-no-animations'),
loading=false,
methods={
masonry_filter: function(){
var current=$(this),
linktext=current.html(),
selector=current.data('filter'),
masonry=current.parents('.av-masonry').eq(0),
container=masonry.find('.av-masonry-container').eq(0),
links=masonry.find('.av-masonry-sort a'),
activeCat=masonry.find('.av-current-sort-title');
links.removeClass('active_sort');
current.addClass('active_sort');
container.attr('id', 'masonry_id_' + selector);
if(activeCat.length){
activeCat.html(linktext);
}
methods.applyMasonry(container, selector, function(){
container.css({overflow:'visible'});
});
setTimeout(function(){ the_win.trigger('debouncedresize'); }, 500);
return false;
},
applyMasonry: function(container, selector, callback){
var filters=selector ? {filter: '.'+selector}:{};
filters['layoutMode']='packery';
filters['packery']={gutter:0};
filters['percentPosition']=true;
filters['itemSelector']="a.isotope-item, div.isotope-item";
filters['originLeft']=$('body').hasClass('rtl') ? false:true;
container.isotope(filters, function(){
the_win.trigger('av-height-change');
});
if(typeof callback==='function'){
setTimeout(callback, 0);
}},
show_bricks: function(bricks, callback){
var browserPrefix=$.avia_utilities.supports('transition'),
multiplier=isMobile&&mobile_no_animation ? 0:100;
bricks.each(function(i){
var currentLink=$(this);
var reveal=currentLink.find('.avia-curtain-reveal-overlay');
if(reveal.length > 0){
multiplier=500;
reveal.on('animationstart', function(e){
currentLink.css({ visibility: 'visible' });
});
reveal.on('animationend', function(e){
$(this).remove();
});
}
setTimeout(function(){
if(browserPrefix===false){
currentLink.css({visibility:"visible", opacity:0}).animate({opacity:1}, 1500);
}else{
currentLink.addClass('av-masonry-item-loaded');
reveal.addClass('avia_start_delayed_animation');
}
if(i==bricks.length - 1&&typeof callback=='function'){
callback.call();
the_win.trigger('av-height-change');
}},(multiplier * i) );
});
},
loadMore: function(e){
e.preventDefault();
if(loading){
return false;
}
loading=true;
var current=$(this),
data=current.data(),
masonry=current.parents('.av-masonry').eq(0),
post_id=masonry.data('post_id'),
container=masonry.find('.av-masonry-container'),
items=masonry.find('.av-masonry-entry'),
loader=$.avia_utilities.loading(),
finished=function(){ loading=false; loader.hide(); the_body.trigger('av_resize_finished'); };
if('undefined'!=typeof post_id){
data.post_id=post_id;
}
if(! data.offset){
data.offset=0;
}
data.offset +=data.items;
data.action='avia_ajax_masonry_more';
data.loaded=[];
items.each(function(){
var item_id=$(this).data('av-masonry-item');
if(item_id){
data.loaded.push(item_id);
}});
$.ajax({
url: avia_framework_globals.ajaxurl,
type: "POST",
data: data,
beforeSend: function(){
loader.show();
},
success: function(response){
if(response.indexOf("{av-masonry-loaded}")!==-1){
var response=response.split('{av-masonry-loaded}'),
new_items=$(response.pop()).filter('.isotope-item');
if(new_items.length > data.items){
new_items=new_items.not(new_items.last());
}else{
current.addClass('av-masonry-no-more-items');
}
new_items.find('.avia-animate-admin-preview').removeClass('avia-animate-admin-preview');
if(new_items.find('.avia-curtain-reveal-overlay').length > 0){
new_items.css({ visibility: 'hidden' });
}
var load_container=$('<div class="loadcontainer"></div>').append(new_items);
$.avia_utilities.preload({
container: load_container,
single_callback: function(){
var links=masonry.find('.av-masonry-sort a'),
filter_container=masonry.find('.av-sort-by-term'),
allowed_filters=filter_container.data("av-allowed-sort");
filter_container.hide();
loader.hide();
container.isotope('insert', new_items);
$.avia_utilities.avia_ajax_call(masonry);
setTimeout(function(){ methods.show_bricks(new_items, finished); }, 150);
setTimeout(function(){ the_win.trigger('av-height-change'); }, 550);
if(links){
$(links).each(function(filterlinkindex){
var filterlink=$(this),
sort=filterlink.data('filter');
if(new_items){
$(new_items).each(function(itemindex){
var item=$(this);
if(item.hasClass(sort)&&allowed_filters.indexOf(sort)!==-1){
var term_count=filterlink.find('.avia-term-count').text();
filterlink.find('.avia-term-count').text(' ' +(parseInt(term_count) + 1) + ' ');
if(filterlink.hasClass('avia_hide_sort')){
filterlink.removeClass('avia_hide_sort').addClass('avia_show_sort');
masonry.find('.av-masonry-sort .' + sort + '_sep').removeClass('avia_hide_sort').addClass('avia_show_sort');
masonry.find('.av-masonry-sort .av-sort-by-term').removeClass('hidden');
}}
});
}});
}
filter_container.fadeIn();
}});
}else{
finished();
}},
error: finished,
complete: function(){
setTimeout(function(){ the_win.trigger('debouncedresize'); }, 500);
}});
}};
return this.each(function(){
var masonry=$(this),
container=masonry.find('.av-masonry-container'),
bricks=masonry.find('.isotope-item'),
filter=masonry.find('.av-masonry-sort').css({visibility:"visible", opacity:0}).on('click', 'a', methods.masonry_filter),
load_more=masonry.find('.av-masonry-load-more').css({visibility:"visible", opacity:0});
if(bricks.find('.avia-curtain-reveal-overlay').length > 0){
bricks.css({ visibility: 'hidden' });
}
$.avia_utilities.preload({
container: container,
single_callback: function(){
var start_animation=function(){
filter.animate({opacity:1}, 400);
if(container.outerHeight() + container.offset().top + $('#footer').outerHeight() > $(window).height()){
$('html').css({'overflow-y':'scroll'});
}
methods.applyMasonry(container, false, function(){
masonry.addClass('avia_sortable_active');
container.removeClass('av-js-disabled');
});
methods.show_bricks(bricks, function(){
load_more.css({opacity:1}).on('click', methods.loadMore);
});
};
if(isMobile&&mobile_no_animation){
start_animation();
}else{
masonry.waypoint(start_animation, { offset: '80%'});
}
$(window).on('debouncedresize', function(){
methods.applyMasonry(container, false, function(){
masonry.addClass('avia_sortable_active');
});
});
}});
});
};}(jQuery));
(function($){
"use strict";
$.avia_utilities=$.avia_utilities||{};
$(function(){
$.avia_utilities=$.avia_utilities||{};
if($.avia_utilities.avia_sticky_submenu){
$.avia_utilities.avia_sticky_submenu();
}});
$.avia_utilities.avia_sticky_submenu=function(){
var win=$(window),
html=$('html').first(),
header=$('.html_header_top.html_header_sticky #header'),
html_margin=parseInt($('html').first().css('margin-top'), 10),
setWitdth=$('.html_header_sidebar #main, .boxed #main'),
menus=$('.av-submenu-container'),
bordermod=html.is('.html_minimal_header') ? 0:1,
fixed_frame=$('.av-frame-top').height(),
burger_menu=$('.av-burger-menu-main'),
calc_margin=function(){
html_margin=parseInt(html.css('margin-top'), 10);
if(!$('.mobile_menu_toggle:visible').length){
$('.av-open-submenu').removeClass('av-open-submenu');
}
menus.filter('.av-sticky-submenu').each(function(){
$(this).next('.sticky_placeholder').height($(this).height());
});
},
calc_values=function(){
var content_width=setWitdth.width();
html_margin=parseInt(html.css('margin-top'), 10);
menus.width(content_width);
},
check=function(placeholder, no_timeout){
var menu_pos=this.offset().top,
top_pos=placeholder.offset().top,
scrolled=win.scrollTop(),
modifier=html_margin,
fixed=false;
if(burger_menu.is(":visible")){
this.css({top: 'auto', position: 'absolute'});fixed=false;
return;
}
if(header.length){
modifier +=header.outerHeight() + parseInt(header.css('margin-top'), 10);
}
if(fixed_frame){
modifier +=fixed_frame;
}
if(scrolled + modifier > top_pos){
if(!fixed){
this.css({top: modifier - bordermod, position: 'fixed'});fixed=true;
}}else{
this.css({top: 'auto', position: 'absolute'});fixed=false;
}},
toggle=function(e){
e.preventDefault();
var clicked=$(this),
menu=clicked.siblings('.av-subnav-menu');
if(menu.hasClass('av-open-submenu')){
menu.removeClass('av-open-submenu');
}else{
menu.addClass('av-open-submenu');
}};
win.on("debouncedresize av-height-change",  calc_margin); calc_margin();
if(setWitdth.length){
win.on("debouncedresize av-height-change",  calc_values);
calc_values();
}
menus.each(function(){
var menu=$(this),
sticky=menu.filter('.av-sticky-submenu'),
placeholder=menu.next('.sticky_placeholder'),
mobile_button=menu.find('.mobile_menu_toggle');
if(sticky.length){
win.on('scroll debouncedresize',  function(){
window.requestAnimationFrame(check.bind(sticky, placeholder) );
});
}
if(mobile_button.length){
mobile_button.on('click',  toggle);
}});
html.on('click', '.av-submenu-hidden .av-open-submenu li a', function(){
var current=$(this);
var list_item=current.siblings('ul, .avia_mega_div');
if(list_item.length){
if(list_item.hasClass('av-visible-sublist')){
list_item.removeClass('av-visible-sublist');
}else{
list_item.addClass('av-visible-sublist');
}
return false;
}});
$('.avia_mobile').on('click', '.av-menu-mobile-disabled li a', function(){
var current=$(this);
var list_item=current.siblings('ul');
if(list_item.length){
if(list_item.hasClass('av-visible-mobile-sublist')){
}else{
$('.av-visible-mobile-sublist').removeClass('av-visible-mobile-sublist');
list_item.addClass('av-visible-mobile-sublist');
return false;
}}
});
};}(jQuery));
(function($){
"use strict";
$.fn.avia_sc_messagebox=function (options){
"use strict";
return this.each(function (){
var container=$(this),
close_btn=container.find('.av_message_close'),
mbox_ID=container.attr('id'),
aviaSetCookie=function(CookieName,CookieValue,CookieDays){
var expires="";
if(CookieDays){
var date=new Date();
date.setTime(date.getTime() +(CookieDays*24*60*60*1000) );
expires="; expires=" + date.toGMTString();
}
document.cookie=CookieName + "=" + CookieValue + expires + "; path=/; samesite=strict";
},
aviaGetCookie=function(CookieName){
var docCookiesStr=CookieName + "=";
var docCookiesArr=document.cookie.split(';');
for(var i=0; i < docCookiesArr.length; i++){
var thisCookie=docCookiesArr[i];
while(thisCookie.charAt(0)==' '){
thisCookie=thisCookie.substring(1,thisCookie.length);
}
if(thisCookie.indexOf(docCookiesStr)==0){
var cookieContents=container.attr('data-contents');
var savedContents=thisCookie.substring(docCookiesStr.length, thisCookie.length);
if(savedContents==cookieContents){
return savedContents;
}}
}
return null;
};
if(! aviaGetCookie(mbox_ID) ){
container.removeClass('messagebox-hidden');
}
close_btn.on('click', function(){
var cookieContents=container.attr('data-contents');
var cookieLifetime="";
if(container.hasClass('messagebox-session_cookie')){
cookieLifetime="";
}
else if(container.hasClass('messagebox-custom_cookie')){
cookieLifetime=parseInt(container.attr('data-cookielifetime'));
}
aviaSetCookie(mbox_ID, cookieContents, cookieLifetime);
container.addClass('messagebox-hidden');
});
});
};
$('.avia_message_box').avia_sc_messagebox();
}(jQuery));
(function($){
$.fn.avia_sc_animated_number=function(options){
if(!this.length) return;
if(this.is('.avia_sc_animated_number_active')) return;
this.addClass('avia_sc_animated_number_active');
var simple_upcount=(options&&options.simple_up) ? true:false,
start_timer=(options&&options.start_timer) ? options.start_timer:300,
format_number=function(number, number_format, final_number){
var prepend='',
addZeros=final_number.toString().length - number.toString().length;
for(var i=addZeros; i > 0; i--){
prepend +='0';
}
number=(simple_upcount) ? number.toString():prepend + number.toString();
if(''==number_format){
return number;
}
return number.split(/(?=(?:...)*$)/).join(number_format);
},
start_count=function(element, countTo, increment, current, fakeCountTo, number_format){
var newCount=current + increment,
final='';
if(newCount >=fakeCountTo){
final=format_number(countTo, number_format, countTo);
element.text(final);
}else{
final=format_number(newCount, number_format, countTo);
element.text(final);
window.requestAnimationFrame(function(){ start_count(element, countTo, increment, newCount, fakeCountTo, number_format); });
}};
return this.each(function(){
var number_container=$(this),
elements=number_container.find('.__av-single-number'),
countTimer=number_container.data('timer')||3000;
elements.each(function(i){
var element=$(this),
text=element.text();
if(window.addEventListener) element.text(text.replace(/./g, "0")); 
});
number_container.addClass('number_prepared').on('avia_start_animation', function(){
if(number_container.is('.avia_animation_done')) return;
number_container.addClass('avia_animation_done');
elements.each(function(i){
var element=$(this),
countTo=element.data('number'),
fakeCountTo=countTo,
current=parseInt(element.text(),10),
zeroOnly=/^0+$/.test(countTo),
increment=0,
number_format='';
if('undefined'!=typeof element.data('start_from')){
current=element.data('start_from');
}
if('undefined'!=typeof element.data('number_format')){
number_format=element.data('number_format');
}
if(zeroOnly&&countTo!==0){
fakeCountTo=countTo.replace(/0/g, '9');
}
increment=Math.round(fakeCountTo * 32 / countTimer);
if(increment==0||increment % 10==0) increment +=1;
setTimeout(function(){ start_count(element, countTo, increment, current, fakeCountTo, number_format);}, start_timer);
});
});
if(options&&options.instant_start==true){
number_container.trigger('avia_start_animation');
}});
};})(jQuery);
(function($){
"use strict";
$.avia_utilities=$.avia_utilities||{};
$.fn.avia_iso_sort=function(options){
return this.each(function(){
var the_body=$('body'),
container=$(this),
portfolio_id=container.data('portfolio-id'),
parentContainer=container.closest('.av-portfolio-grid-sorting-container, .entry-content-wrapper, .avia-fullwidth-portfolio'),
filter=parentContainer.find('.sort_width_container[data-portfolio-id="' + portfolio_id + '"]').find('#js_sort_items').css({visibility:"visible", opacity:0}),
links=filter.find('a'),
imgParent=container.find('.grid-image'),
isoActive=false,
items=$('.post-entry', container),
is_originLeft=the_body.hasClass('rtl') ? false:true;
function applyIso(){
container.addClass('isotope_activated').isotope({
layoutMode:'fitRows', itemSelector:'.flex_column', originLeft: is_originLeft
});
container.isotope('on', 'layoutComplete', function(){
container.css({overflow:'visible'});
the_body.trigger('av_resize_finished');
});
isoActive=true;
setTimeout(function(){ parentContainer.addClass('avia_sortable_active'); }, 0);
};
links.on('click',function(){
var current=$(this),
selector=current.data('filter'),
linktext=current.html(),
activeCat=parentContainer.find('.av-current-sort-title');
if(activeCat.length) activeCat.html(linktext);
links.removeClass('active_sort');
current.addClass('active_sort');
container.attr('id', 'grid_id_'+selector);
parentContainer.find('.open_container .ajax_controlls .avia_close').trigger('click');
container.isotope({ layoutMode:'fitRows', itemSelector:'.flex_column' , filter: '.'+selector, originLeft: is_originLeft });
return false;
});
$(window).on('debouncedresize', function(){
applyIso();
});
$.avia_utilities.preload({container: container, single_callback:  function(){
filter.animate({opacity:1}, 400); applyIso();
setTimeout(function(){ applyIso(); });
imgParent.css({height:'auto'}).each(function(i){
var currentLink=$(this);
setTimeout(function(){
currentLink.animate({opacity:1},1500);
}, (100 * i));
});
}});
});
};
$.fn.avia_portfolio_preview=function(passed_options){
var win=$(window),
the_body=$('body'),
isMobile=$.avia_utilities.isMobile,
defaults =
{
open_in:	'.portfolio-details-inner',
easing:		'easeOutQuint',
timing:		800,
transition:	'slide' // 'fade' or 'slide'
},
options=$.extend({}, defaults, passed_options);
return this.each(function(){
var container=$(this),
portfolio_id=container.data('portfolio-id'),
target_wrap=$('.portfolio_preview_container[data-portfolio-id="' + portfolio_id + '"]'),
target_container=target_wrap.find(options.open_in),
items=container.find('.grid-entry'),
content_retrieved={},
is_open=false,
animating=false,
index_open=false,
ajax_call=false,
methods,
controls,
loader=$.avia_utilities.loading();
methods =
{
load_item: function(e){
e.preventDefault();
var link=$(this),
post_container=link.parents('.post-entry').eq(0),
post_id="ID_" + post_container.data('ajax-id'),
clickedIndex=items.index(post_container);
if(post_id===is_open||animating==true){
return false;
}
animating=true;
container.find('.active_portfolio_item').removeClass('active_portfolio_item');
post_container.addClass('active_portfolio_item');
loader.show();
methods.ajax_get_contents(post_id, clickedIndex);
},
scroll_top: function(){
setTimeout(function(){
var target_offset=target_wrap.offset().top - 175,
window_offset=win.scrollTop();
if(window_offset > target_offset||target_offset - window_offset > 100){
$('html:not(:animated),body:not(:animated)').animate({ scrollTop: target_offset }, options.timing, options.easing);
}},10);
},
attach_item: function(post_id){
content_retrieved[post_id]=$(content_retrieved[post_id]).appendTo(target_container);
ajax_call=true;
},
remove_video: function(){
var del=target_wrap.find('iframe, .avia-video').parents('.ajax_slide:not(.open_slide)');
if(del.length > 0){
del.remove();
content_retrieved["ID_" + del.data('slideId')]=undefined;
}},
show_item: function(post_id, clickedIndex){
if(post_id===is_open){
return false;
}
animating=true;
loader.hide();
if(false===is_open){
target_wrap.addClass('open_container');
content_retrieved[post_id].addClass('open_slide');
methods.scroll_top();
target_wrap.css({display:'none'}).slideDown(options.timing, options.easing, function(){
if(ajax_call){
$.avia_utilities.activate_shortcode_scripts(content_retrieved[post_id]);
$.avia_utilities.avia_ajax_call(content_retrieved[post_id]);
the_body.trigger('av_resize_finished');
ajax_call=false;
}
methods.remove_video();
the_body.trigger('av_resize_finished');
});
index_open=clickedIndex;
is_open=post_id;
animating=false;
}else{
methods.scroll_top();
var initCSS={ zIndex:3 },
easing=options.easing;
if(index_open > clickedIndex){ initCSS.left='-110%'; }
if(options.transition==='fade'){ initCSS.left='0%'; initCSS.opacity=0; easing='easeOutQuad'; }
target_container.height(target_container.height());
content_retrieved[post_id].css(initCSS).avia_animate({'left':"0%", opacity:1}, options.timing, easing);
content_retrieved[is_open].avia_animate({opacity:0}, options.timing, easing, function(){
content_retrieved[is_open].attr({'style':""}).removeClass('open_slide');
content_retrieved[post_id].addClass('open_slide');
target_container.avia_animate({height: content_retrieved[post_id].outerHeight() + 2}, options.timing/2, options.easing, function(){
target_container.attr({'style':""});
is_open=post_id;
index_open=clickedIndex;
animating=false;
methods.remove_video();
if(ajax_call){
the_body.trigger('av_resize_finished');
$.avia_utilities.activate_shortcode_scripts(content_retrieved[post_id]);
$.avia_utilities.avia_ajax_call(content_retrieved[post_id]);
ajax_call=false;
}});
});
}},
ajax_get_contents: function(post_id, clickedIndex){
if(content_retrieved[post_id]!==undefined){
methods.show_item(post_id, clickedIndex);
return;
}
var template=$('#avia-tmpl-portfolio-preview-' + post_id.replace(/ID_/,""));
if(template.length==0){
setTimeout(function(){ methods.ajax_get_contents(post_id, clickedIndex); return; }, 500);
}
content_retrieved[post_id]=template.html();
content_retrieved[post_id]=content_retrieved[post_id].replace('','').replace('*]]>','');
methods.attach_item(post_id);
$.avia_utilities.preload({container: content_retrieved[post_id] , single_callback:  function(){ methods.show_item(post_id, clickedIndex); }});
},
add_controls: function(){
controls=target_wrap.find('.ajax_controlls');
target_wrap.avia_keyboard_controls({27:'.avia_close', 37:'.ajax_previous', 39:'.ajax_next'});
items.each(function(){
var current=$(this), overlay;
current.addClass('no_combo').on('click', function(event){
overlay=current.find('.slideshow_overlay');
if(overlay.length){
event.stopPropagation();
methods.load_item.apply(current.find('a').eq(0));
return false;
}});
});
},
control_click: function(){
var showItem,
activeID=container.find('.active_portfolio_item').data('ajax-id'),
active=container.find('.post-entry-'+activeID);
switch(this.hash){
case '#next':
showItem=active.nextAll('.post-entry:visible').eq(0).find('a').eq(0);
if(!showItem.length){ showItem=$('.post-entry:visible', container).eq(0).find('a').eq(0); }
showItem.trigger('click');
break;
case '#prev':
showItem=active.prevAll('.post-entry:visible').eq(0).find('a').eq(0);
if(!showItem.length){ showItem=$('.post-entry:visible', container).last().find('a').eq(0); }
showItem.trigger('click');
break;
case '#close':
animating=true;
target_wrap.slideUp(options.timing, options.easing, function(){
container.find('.active_portfolio_item').removeClass('active_portfolio_item');
content_retrieved[is_open].attr({'style':""}).removeClass('open_slide');
target_wrap.removeClass('open_container');
animating=is_open=index_open=false;
methods.remove_video();
the_body.trigger('av_resize_finished');
});
break;
}
return false;
},
resize_reset: function(){
if(is_open===false){
target_container.html('');
content_retrieved=[];
}}
};
methods.add_controls();
container.on("click", "a", methods.load_item);
controls.on("click", "a", methods.control_click);
win.on('debouncedresize', methods.resize_reset);
});
};}(jQuery));
(function($){
"use strict";
$.fn.avia_sc_progressbar=function(options){
return this.each(function(){
var container=$(this), elements=container.find('.avia-progress-bar');
container.on('avia_start_animation', function(){
elements.each(function(i){
var element=$(this);
setTimeout(function(){
element.find('.progress').addClass('avia_start_animation');
element.find('.progressbar-percent').avia_sc_animated_number({
instant_start:true, simple_up:true, start_timer: 10
});
}, (i * 250));
});
});
});
};}(jQuery));
(function($){
"use strict";
$.AviaVideoAPI=function(options, video, option_container){
this.videoElement=video;
this.$video=$(video);
this.$option_container=option_container ? $(option_container):this.$video;
this.load_btn=this.$option_container.find('.av-click-to-play-overlay');
this.video_wrapper=this.$video.parents('ul').eq(0);
this.lazy_load=this.video_wrapper.hasClass('av-show-video-on-click') ? true:false;
this.isMobile=$.avia_utilities.isMobile;
this.fallback=this.isMobile ? this.$option_container.is('.av-mobile-fallback-image'):false;
if(this.fallback){
return;
}
this._init(options);
};
$.AviaVideoAPI.defaults={
loop: false,
mute: false,
controls: false,
events: 'play pause mute unmute loop toggle reset unload'
};
$.AviaVideoAPI.apiFiles =
{
youtube:{loaded: false, src: 'https://www.youtube.com/iframe_api' }};
$.AviaVideoAPI.players =
{
};
$.AviaVideoAPI.prototype =
{
_init: function(options){
this.options=this._setOptions(options);
this.type=this._getPlayerType();
this.player=false;
this._bind_player();
this.eventsBound=false;
this.playing=false;
this.$option_container.addClass('av-video-paused');
this.pp=$.avia_utilities.playpause(this.$option_container);
},
_setOptions: function(options){
var newOptions=$.extend(true, {}, $.AviaVideoAPI.defaults, options),
htmlData=this.$option_container.data(),
i="";
for(i in htmlData){
if(htmlData.hasOwnProperty(i)&&(typeof htmlData[i]==="string"||typeof htmlData[i]==="number"||typeof htmlData[i]==="boolean")){
newOptions[i]=htmlData[i];
}}
return newOptions;
},
_getPlayerType: function(){
var vid_src=this.$video.get(0).src||this.$video.data('src');
if(this.$video.is('video')){
return 'html5';
}
if(this.$video.is('.av_youtube_frame')){
return 'youtube';
}
if(vid_src.indexOf('vimeo.com')!=-1){
return 'vimeo';
}
if(vid_src.indexOf('youtube.com')!=-1){
return 'youtube';
}},
_bind_player: function(){
var _self=this;
var cookie_check=$('html').hasClass('av-cookies-needs-opt-in')||$('html').hasClass('av-cookies-can-opt-out');
var allow_continue=true;
var silent_accept_cookie=$('html').hasClass('av-cookies-user-silent-accept');
var self_hosted='html5'==this.type;
if(cookie_check&&! silent_accept_cookie&&! self_hosted){
if(! document.cookie.match(/aviaCookieConsent/)||$('html').hasClass('av-cookies-session-refused')){
allow_continue=false;
}else{
if(! document.cookie.match(/aviaPrivacyRefuseCookiesHideBar/)){
allow_continue=false;
}
else if(! document.cookie.match(/aviaPrivacyEssentialCookiesEnabled/)){
allow_continue=false;
}
else if(document.cookie.match(/aviaPrivacyVideoEmbedsDisabled/)){
allow_continue=false;
}}
}
if(window['wp']&&wp.hooks){
allow_continue=wp.hooks.applyFilters('aviaCookieConsent_allow_continue', allow_continue);
}
let allow_class=allow_continue ? 'avia-video-cookie-allowed':'avia-video-cookie-not-allowed';
$('html').addClass(allow_class);
if(! allow_continue){
this._use_external_link();
return;
}
if(this.lazy_load&&this.load_btn.length&&this.type!="html5"){
this.$option_container.addClass('av-video-lazyload');
this.load_btn.on('click', function(){
_self.load_btn.remove();
_self._setPlayer();
});
}else{
this.lazy_load=false;
this._setPlayer();
}},
_use_external_link: function(){
this.$option_container.addClass('av-video-lazyload');
this.load_btn.on('click', function(e){
if(e.originalEvent===undefined) return;
var src_url=$(this).parents('.avia-slide-wrap').find('div[data-original_url]').data('original_url');
if(src_url) window.open(src_url , '_blank');
});
},
_setPlayer: function(){
var _self=this;
switch(this.type){
case "html5":
this.player=this.$video.data('mediaelementplayer');
if(! this.player){
this.$video.data('mediaelementplayer', $.AviaVideoAPI.players[ this.$video.attr('id').replace(/_html5/,'') ]);
this.player=this.$video.data('mediaelementplayer');
}
this._playerReady();
break;
case "vimeo":
var ifrm=document.createElement("iframe");
var $ifrm=$(ifrm);
ifrm.onload=function(){
_self.player=Froogaloop(ifrm);
_self._playerReady();
_self.$option_container.trigger('av-video-loaded');
};
ifrm.setAttribute("src", this.$video.data('src'));
$ifrm.insertAfter(this.$video);
this.$video.remove();
this.$video=ifrm;
break;
case "youtube":
this._getAPI(this.type);
$('body').on('av-youtube-iframe-api-loaded', function(){ _self._playerReady(); });
break;
}},
_getAPI: function(api){
if($.AviaVideoAPI.apiFiles[api].loaded===false){
$.AviaVideoAPI.apiFiles[api].loaded=true;
var tag=document.createElement('script'),
first=document.getElementsByTagName('script')[0];
tag.src=$.AviaVideoAPI.apiFiles[api].src;
first.parentNode.insertBefore(tag, first);
}},
_playerReady: function(){
var _self=this;
this.$option_container.on('av-video-loaded', function(){ _self._bindEvents(); });
switch(this.type){
case "html5":
this.$video.on('av-mediajs-loaded', function(){ _self.$option_container.trigger('av-video-loaded'); });
this.$video.on('av-mediajs-ended' , function(){ _self.$option_container.trigger('av-video-ended');  });
break;
case "vimeo":
_self.player.addEvent('ready',  function(){
_self.$option_container.trigger('av-video-loaded');
_self.player.addEvent('finish', function(){ _self.$option_container.trigger('av-video-ended');  });
});
break;
case "youtube":
var params=_self.$video.data();
if(_self._supports_video()){
params.html5=1;
}
_self.player=new YT.Player(_self.$video.attr('id'),
{
videoId: params.videoid,
height: _self.$video.attr('height'),
width: _self.$video.attr('width'),
playerVars: params,
events: {
'onReady': function(){ _self.$option_container.trigger('av-video-loaded'); },
'onError': function(player){ $.avia_utilities.log('YOUTUBE ERROR:', 'error', player); },
'onStateChange': function(event){
if(event.data===YT.PlayerState.ENDED){
var command=_self.options.loop!=false ? 'loop':'av-video-ended';
_self.$option_container.trigger(command);
}}
}});
break;
}
setTimeout(function(){
if(_self.eventsBound==true||typeof _self.eventsBound=='undefined'||_self.type=='youtube'){
return;
}
$.avia_utilities.log('Fallback Video Trigger "' + _self.type + '":', 'log', _self);
_self.$option_container.trigger('av-video-loaded');
}, 2000);
},
_bindEvents: function(){
if(this.eventsBound==true||typeof this.eventsBound=='undefined'){
return;
}
var _self=this, volume='unmute';
this.eventsBound=true;
this.$option_container.on(this.options.events, function(e){
_self.api(e.type);
});
if(!_self.isMobile){
if(this.options.mute!=false){
volume="mute";
}
if(this.options.loop!=false){
_self.api('loop');
}
_self.api(volume);
}
setTimeout(function(){
_self.$option_container.trigger('av-video-events-bound').addClass('av-video-events-bound');
}, 50);
},
_supports_video: function(){
return !!document.createElement('video').canPlayType;
},
api: function(action){
if(this.isMobile&&!this.was_started()) return;
if(this.options.events.indexOf(action)===-1) return;
this.$option_container.trigger('av-video-'+action+'-executed');
if(typeof this[ '_' + this.type + '_' + action]=='function'){
this[ '_' + this.type + '_' + action].call(this);
}
if(typeof this[ '_' + action]=='function'){
this[ '_' + action].call(this);
}},
was_started: function(){
if(!this.player) return false;
switch(this.type){
case "html5":
if(this.player.getCurrentTime() > 0){
return true;
}
break;
case "vimeo":
if(this.player.api('getCurrentTime') > 0){
return true;
}
break;
case "youtube":
if(this.player.getPlayerState()!==-1){
return true;
}
break;
}
return false;
},
_play: function(){
this.playing=true;
this.$option_container.addClass('av-video-playing').removeClass('av-video-paused');
},
_pause: function(){
this.playing=false;
this.$option_container.removeClass('av-video-playing').addClass('av-video-paused');
},
_loop: function(){
this.options.loop=true;
},
_toggle: function(){
var command=this.playing==true ? 'pause':'play';
this.api(command);
this.pp.set(command);
},
_vimeo_play: function(){
this.player.api('play');
},
_vimeo_pause: function(){
this.player.api('pause');
},
_vimeo_mute: function(){
this.player.api('setVolume', 0);
},
_vimeo_unmute: function(){
this.player.api('setVolume', 0.7);
},
_vimeo_loop: function(){
},
_vimeo_reset: function(){
this.player.api('seekTo',0);
},
_vimeo_unload: function(){
this.player.api('unload');
},
_youtube_play: function(){
this.player.playVideo();
},
_youtube_pause: function(){
this.player.pauseVideo();
},
_youtube_mute: function(){
this.player.mute();
},
_youtube_unmute: function(){
this.player.unMute();
},
_youtube_loop: function(){
if(this.playing==true) this.player.seekTo(0);
},
_youtube_reset: function(){
this.player.stopVideo();
},
_youtube_unload: function(){
this.player.clearVideo();
},
_html5_play: function(){
if(this.player){
this.player.options.pauseOtherPlayers=false;
this.player.play();
}},
_html5_pause: function(){
if(this.player) this.player.pause();
},
_html5_mute: function(){
if(this.player) this.player.setMuted(true);
},
_html5_unmute: function(){
if(this.player) this.player.setVolume(0.7);
},
_html5_loop: function(){
if(this.player) this.player.options.loop=true;
},
_html5_reset: function(){
if(this.player) this.player.setCurrentTime(0);
},
_html5_unload: function(){
this._html5_pause();
this._html5_reset();
}};
$.fn.aviaVideoApi=function(options , apply_to_parent){
return this.each(function(){
var applyTo=this;
if(apply_to_parent){
applyTo=$(this).parents(apply_to_parent).get(0);
}
var self=$.data(applyTo, 'aviaVideoApi');
if(! self){
self=$.data(applyTo, 'aviaVideoApi', new $.AviaVideoAPI(options, this, applyTo) );
}});
};})(jQuery);
window.onYouTubeIframeAPIReady=function(){ jQuery('body').trigger('av-youtube-iframe-api-loaded'); };
var Froogaloop=(function(){
function Froogaloop(iframe){
return new Froogaloop.fn.init(iframe);
}
var eventCallbacks={},
hasWindowEvent=false,
isReady=false,
slice=Array.prototype.slice,
playerOrigin='*';
Froogaloop.fn=Froogaloop.prototype={
element: null,
init: function(iframe){
if(typeof iframe==="string"){
iframe=document.getElementById(iframe);
}
this.element=iframe;
return this;
},
api: function(method, valueOrCallback){
if(!this.element||!method){
return false;
}
var self=this,
element=self.element,
target_id=element.id!=='' ? element.id:null,
params = !isFunction(valueOrCallback) ? valueOrCallback:null,
callback=isFunction(valueOrCallback) ? valueOrCallback:null;
if(callback){
storeCallback(method, callback, target_id);
}
postMessage(method, params, element);
return self;
},
addEvent: function(eventName, callback){
if(!this.element){
return false;
}
var self=this,
element=self.element,
target_id=element.id!=='' ? element.id:null;
storeCallback(eventName, callback, target_id);
if(eventName!='ready'){
postMessage('addEventListener', eventName, element);
}
else if(eventName=='ready'&&isReady){
callback.call(null, target_id);
}
return self;
},
removeEvent: function(eventName){
if(!this.element){
return false;
}
var self=this,
element=self.element,
target_id=element.id!=='' ? element.id:null,
removed=removeCallback(eventName, target_id);
if(eventName!='ready'&&removed){
postMessage('removeEventListener', eventName, element);
}}
};
function postMessage(method, params, target){
if(!target.contentWindow.postMessage){
return false;
}
var data=JSON.stringify({
method: method,
value: params
});
target.contentWindow.postMessage(data, playerOrigin);
}
function onMessageReceived(event){
var data, method;
try {
data=JSON.parse(event.data);
method=data.event||data.method;
}
catch(e){
}
if(method=='ready'&&!isReady){
isReady=true;
}
if(!(/^https?:\/\/player.vimeo.com/).test(event.origin)){
return false;
}
if(playerOrigin==='*'){
playerOrigin=event.origin;
}
var value=data.value,
eventData=data.data,
target_id=target_id==='' ? null:data.player_id,
callback=getCallback(method, target_id),
params=[];
if(!callback){
return false;
}
if(value!==undefined){
params.push(value);
}
if(eventData){
params.push(eventData);
}
if(target_id){
params.push(target_id);
}
return params.length > 0 ? callback.apply(null, params):callback.call();
}
function storeCallback(eventName, callback, target_id){
if(target_id){
if(!eventCallbacks[target_id]){
eventCallbacks[target_id]={};}
eventCallbacks[target_id][eventName]=callback;
}else{
eventCallbacks[eventName]=callback;
}}
function getCallback(eventName, target_id){
if(target_id&&eventCallbacks[target_id]&&eventCallbacks[target_id][eventName]){
return eventCallbacks[target_id][eventName];
}else{
return eventCallbacks[eventName];
}}
function removeCallback(eventName, target_id){
if(target_id&&eventCallbacks[target_id]){
if(!eventCallbacks[target_id][eventName]){
return false;
}
eventCallbacks[target_id][eventName]=null;
}else{
if(!eventCallbacks[eventName]){
return false;
}
eventCallbacks[eventName]=null;
}
return true;
}
function isFunction(obj){
return !!(obj&&obj.constructor&&obj.call&&obj.apply);
}
function isArray(obj){
return toString.call(obj)==='[object Array]';
}
Froogaloop.fn.init.prototype=Froogaloop.fn;
if(window.addEventListener){
window.addEventListener('message', onMessageReceived, false);
}else{
window.attachEvent('onmessage', onMessageReceived);
}
return (window.Froogaloop=window.$f=Froogaloop);
})();
(function($){
"use strict";
$.AviaccordionSlider=function(options, slider){
this.$slider=$(slider);
this.$inner=this.$slider.find('.aviaccordion-inner');
this.$slides=this.$inner.find('.aviaccordion-slide');
this.$images=this.$inner.find('.aviaccordion-image');
this.$last=this.$slides.last();
this.$titles=this.$slider.find('.aviaccordion-preview');
this.$titlePos=this.$slider.find('.aviaccordion-preview-title-pos');
this.$titleWrap=this.$slider.find('.aviaccordion-preview-title-wrap');
this.$win=$(window);
if($.avia_utilities.supported.transition===undefined){
$.avia_utilities.supported.transition=$.avia_utilities.supports('transition');
}
this.options={};
this.browserPrefix=$.avia_utilities.supported.transition;
this.cssActive=this.browserPrefix!==false ? true:false;
this.transform3d=document.documentElement.className.indexOf('avia_transform3d')!==-1 ? true:false;
this.isMobile=$.avia_utilities.isMobile;
this.isTouchDevice=$.avia_utilities.isTouchDevice;
this.property=this.browserPrefix + 'transform';
this.count=this.$slides.length;
this.open=false;
this.autoplay=false;
this.increaseTitle=this.$slider.is(".aviaccordion-title-on-hover");
this._init(options);
};
$.AviaccordionSlider.defaults={
interval: 5,
autoplay: true,
loop_autoplay: 'endless'
};
$.AviaccordionSlider.prototype =
{
_init: function(options){
var _self=this;
this.options=this._setOptions(options);
$.avia_utilities.preload({
container: this.$slider,
single_callback: function(){ _self._kickOff(); }});
},
_setOptions: function(options){
var jsonOptions=this.$slider.data('slideshow-options');
if('object'==typeof jsonOptions){
var newOptions=$.extend({}, $.AviaccordionSlider.defaults, options, jsonOptions);
return newOptions;
}
var newOptions=$.extend({}, $.AviaccordionSlider.defaults, options, this.$slider.data());
return newOptions;
},
_kickOff: function(){
var _self=this;
_self._calcMovement();
_self._bindEvents();
_self._showImages();
_self._autoplay();
},
_autoplay: function(){
var _self=this;
if(_self.options.autoplay){
_self.autoplay=setInterval(function(){
_self.open=_self.open===false ? 0:_self.open + 1;
if(_self.open >=_self.count){
if(_self.options.loop_autoplay=='once'){
clearInterval(_self.autoplay);
_self.options.autoplay=false;
_self.autoplay=false;
return;
}
_self.open=0;
}
_self._move({}, _self.open);
}, _self.options.interval * 1000);
}},
_showImages: function(){
var _self=this,
counter=0,
delay=300,
title_delay=this.count * delay;
if(this.cssActive){
setTimeout(function(){ _self.$slider.addClass('av-animation-active'); }, 10);
}
this.$images.each(function(i){
var current=$(this),
timer=delay * (i + 1);
setTimeout(function(){
current.avia_animate({opacity:1}, 400, function(){
current.css($.avia_utilities.supported.transition + "transform", "none");
});
}, timer);
});
if(_self.increaseTitle){
title_delay=0;
}
this.$titlePos.each(function(i){
var current=$(this),
new_timer=title_delay + 100 * (i + 1);
setTimeout(function(){
current.avia_animate({opacity:1}, 200, function(){
current.css($.avia_utilities.supported.transition + "transform", "none");
});
}, new_timer);
});
},
_bindEvents: function(){
var trigger=this.isMobile ? "click":"mouseenter";
this.$slider.on(trigger, '.aviaccordion-slide', this._move.bind(this) );
this.$slider.on('mouseleave','.aviaccordion-inner', this._move.bind(this) );
this.$win.on('debouncedresize', this._calcMovement.bind(this) );
this.$slider.on('av-prev av-next', this._moveTo.bind(this) );
if(this.isMobile||this.isTouchDevice){
this.$slider.avia_swipe_trigger({next: this.$slider, prev: this.$slider, event:{prev: 'av-prev', next: 'av-next'}});
}},
_titleHeight: function(){
var th=0;
this.$titleWrap.css({'height':'auto'}).each(function(){
var new_h=$(this).outerHeight();
if(new_h > th){
th=new_h;
}}).css({'height': th + 2});
},
_calcMovement: function(event, allow_repeat){
var _self=this,
containerWidth=this.$slider.width(),
defaultPos=this.$last.data('av-left'),
imgWidth=this.$images.last().width()||containerWidth,
imgWidthPercent=Math.floor((100 / containerWidth) * imgWidth),
allImageWidth=imgWidthPercent * _self.count,
modifier=3,
tempMinLeft=100 - imgWidthPercent,
minLeft=tempMinLeft > defaultPos / modifier ? tempMinLeft:0,
oneLeft=minLeft / (_self.count -1),
titleWidth=imgWidth;
if(allImageWidth < 110&&allow_repeat!==false){
var slideHeight=this.$slider.height(),
maxHeight=(slideHeight / allImageWidth) * 110 ;
this.$slider.css({'max-height': maxHeight});
_self._calcMovement(event, false);
return;
}
if(oneLeft < 2){
minLeft=0;
}
this.$slides.each(function(i){
var current=$(this),
newLeft=0,
newRight=0,
defaultLeft=current.data('av-left');
if(minLeft!==0){
newLeft=oneLeft * i;
newRight=imgWidthPercent + newLeft - oneLeft;
}else{
newLeft=defaultLeft / Math.abs(modifier);
newRight=100 - ((newLeft / i) * (_self.count - i));
}
if(i==1&&_self.increaseTitle){
titleWidth=newRight + 1;
}
if(_self.cssActive){
newLeft=newLeft - defaultLeft;
newRight=newRight - defaultLeft;
defaultLeft=0;
}
current.data('av-calc-default', defaultLeft);
current.data('av-calc-left', newLeft);
current.data('av-calc-right', newRight);
});
if(_self.increaseTitle){
_self.$titles.css({width: titleWidth + "%"});
}},
_moveTo: function(event){
var direction=event.type=="av-next" ? 1:-1,
nextSlide=this.open===false ? 0:this.open + direction;
if(nextSlide >=0&&nextSlide < this.$slides.length){
this._move(event, nextSlide);
}},
_move: function(event, direct_open){
var _self=this,
slide=event.currentTarget,
itemNo=typeof direct_open!="undefined" ? direct_open:this.$slides.index(slide);
this.open=itemNo;
if(_self.autoplay&&typeof slide!="undefined"){
clearInterval(_self.autoplay);
_self.autoplay=false;
}
this.$slides.removeClass('aviaccordion-active-slide').each(function(i){
var current=$(this),
dataSet=current.data(),
trans_val=i <=itemNo ? dataSet.avCalcLeft:dataSet.avCalcRight,
transition={},
reset=event.type=='mouseleave' ? 1:0,
active=itemNo===i ? _self.$titleWrap.eq(i):false;
if(active){
current.addClass('aviaccordion-active-slide');
}
if(reset){
trans_val=dataSet.avCalcDefault;
this.open=false;
}
if(_self.cssActive){
transition[_self.property]=_self.transform3d ? "translate3d(" + trans_val  + "%, 0, 0)":"translate(" + trans_val + "%,0)";
current.css(transition);
}else{
transition.left=trans_val + "%";
current.stop().animate(transition, 700, 'easeOutQuint');
}});
}};
$.fn.aviaccordion=function(options){
return this.each(function(){
var active=$.data(this, 'AviaccordionSlider');
if(!active){
$.data(this, 'AviaccordionSlider', 1);
new $.AviaccordionSlider(options, this);
}});
};})(jQuery);
(function($){
"use strict";
$.AviaFullscreenSlider=function(options, slider){
this.$slider=$(slider);
this.$inner=this.$slider.find('.avia-slideshow-inner');
this.$innerLi=this.$inner.find('>li');
this.$caption=this.$inner.find('.avia-slide-wrap .caption_container');
this.$win=$(window);
this.isMobile=$.avia_utilities.isMobile;
this.isTouchDevice=$.avia_utilities.isTouchDevice;
this.mobile_no_animation=$('body').hasClass('avia-mobile-no-animations');
this.options={};
this.property={};
this.scrollPos="0";
this.transform3d=document.documentElement.className.indexOf('avia_transform3d')!==-1 ? true:false;
this.ticking=false;
if($.avia_utilities.supported.transition===undefined){
$.avia_utilities.supported.transition=$.avia_utilities.supports('transition');
}
this._init(options);
};
$.AviaFullscreenSlider.defaults =
{
height: 100,
subtract: '#wpadminbar, #header, #main>.title_container',
image_attachment: 'scroll',
parallax_enabled: true
};
$.AviaFullscreenSlider.prototype =
{
_init: function(options){
var _self=this,
slideshow_options=this.$slider.data('slideshow-options');
this.options=$.extend(true, {}, $.AviaFullscreenSlider.defaults, options);
if('object'==typeof slideshow_options){
this.options.height='undefined'!=typeof slideshow_options.slide_height ? slideshow_options.slide_height:this.options.height;
this.options.image_attachment='undefined'!=typeof slideshow_options.image_attachment ? slideshow_options.image_attachment:this.options.image_attachment;
}else{
if(this.$slider.data('slide_height')){
this.options.height=this.$slider.data('slide_height');
}
if(this.$slider.data('image_attachment')){
this.options.image_attachment=this.$slider.data('image_attachment');
}}
this.options.parallax_enabled=this.options.image_attachment=='' ? true:false;
this.$subtract=$(this.options.subtract);
this._setSize();
this.$win.on('debouncedresize',  this._setSize.bind(this) );
setTimeout(function(){
if(_self.options.parallax_enabled){
if(! _self.isMobile||(_self.isMobile&&! this.mobile_no_animation) ){
_self.$win.on('scroll', _self._on_scroll.bind(_self) );
}}
}, 100);
this.$slider.aviaSlider({bg_slider:true});
},
_on_scroll: function(e){
var _self=this;
if(!_self.ticking){
_self.ticking=true;
window.requestAnimationFrame(_self._parallaxRequest.bind(_self) );
}},
_fetch_properties: function(slide_height){
this.property.offset=this.$slider.offset().top;
this.property.wh=this.$win.height();
this.property.height=slide_height||this.$slider.outerHeight();
this._parallax_scroll();
},
_setSize: function(){
if(! $.fn.avia_browser_height){
var viewport=this.$win.height(),
slide_height=Math.ceil(( viewport / 100) * this.options.height);
if(this.$subtract.length&&this.options.height==100){
this.$subtract.each(function(){
slide_height -=this.offsetHeight - 0.5;
});
}else{
slide_height -=1;
}
this.$slider.height(slide_height).removeClass('av-default-height-applied');
this.$inner.css('padding', 0);
}
this._fetch_properties(slide_height);
},
_parallaxRequest: function(e){
var _self=this;
setTimeout(_self._parallax_scroll.bind(_self), 0);
},
_parallax_scroll: function(e){
if(! this.options.parallax_enabled){
return;
}
if(this.isMobile&&this.mobile_no_animation){
return;
}
var winTop=this.$win.scrollTop(),
winBottom=winTop + this.property.wh,
scrollPos='0',
prop={};
if(this.property.offset < winTop&&winTop <=this.property.offset + this.property.height){
scrollPos=Math.round(( winTop - this.property.offset) * 0.3);
}
if(this.scrollPos!=scrollPos){
this.scrollPos=scrollPos;
if(this.transform3d){
prop[$.avia_utilities.supported.transition + "transform"]="translate3d(0px," + scrollPos + "px,0px)";
}else{
prop[$.avia_utilities.supported.transition + "transform"]="translate(0px," + scrollPos + "px)";
}
this.$inner.css(prop);
}
this.ticking=false;
}};
$.fn.aviaFullscreenSlider=function(options){
return this.each(function(){
var active=$.data(this, 'aviaFullscreenSlider');
if(! active){
$.data(this, 'aviaFullscreenSlider', 1);
new $.AviaFullscreenSlider(options, this);
}});
};})(jQuery);
(function($){
"use strict";
$.fn.layer_slider_height_helper=function(options){
return this.each(function(){
var container=$(this),
first_div=container.find('>div').first(),
timeout=false,
counter=0,
reset_size=function(){
if(first_div.height() > 0||counter > 5){
container.height('auto');
}else{
timeout=setTimeout(reset_size, 500);
counter++;
}};
if(! first_div.length){
return;
}
timeout=setTimeout(reset_size, 0);
});
};}(jQuery));
(function($){
"use strict";
$.fn.avia_sc_tab_section=function(){
var win=$(window),
browserPrefix=$.avia_utilities.supports('transition'),
cssActive=this.browserPrefix!==false ? true:false,
isMobile=$.avia_utilities.isMobile,
isTouchDevice=$.avia_utilities.isTouchDevice,
mobile_no_animation=$('body').hasClass('avia-mobile-no-animations'),
transform3d=document.documentElement.className.indexOf('avia_transform3d')!==-1 ? true:false,
transition={},
animations=[
'avia_animate_when_visible',
'avia_animate_when_almost_visible',
'av-animated-generic',
'av-animated-when-visible',
'av-animated-when-almost-visible',
'av-animated-when-visible-95'
];
return this.each(function(){
var container=$(this),
tabs=container.find('.av-section-tab-title'),
tab_outer=container.find('.av-tab-section-outer-container'),
tab_wrap=container.find('.av-tab-section-tab-title-container'),
tab_nav=container.find('.av_tab_navigation'),
arrows_wrap=container.find('.av-tabsection-arrow'),
arrows=arrows_wrap.find('.av-tab-section-slide'),
slides_wrap=container.find('.av-slide-section-container-wrap'),
slide_arrows_wrap=container.find('.av-tabsection-slides-arrow'),
slide_arrows=slide_arrows_wrap.find('.av-tab-section-slide-content'),
slide_dots_wrap=container.find('.av-tabsection-slides-dots'),
slide_dots=slide_dots_wrap.find('.goto-slide'),
content_wrap=container.find('.av-tab-section-inner-container'),
single_tabs=container.find('.av-animation-delay-container'),
layout_tab_wrap=container.find('.av-layout-tab'),
inner_content=container.find('.av-layout-tab-inner'),
flexible=container.is('.av-tab-content-auto'),
minimumBrowserHeight=container.hasClass('av-minimum-height'),
current_content=null,
current_tab_id='1',
current_iTab_id=1,		// 'undefined'!=typeof current_tab_id ? parseInt(current_tab_id, 10):1,
min_width=0,
transition_action='none',
slideshowOptions={
animation: 'av-tab-slide-transition',
autoplay: false,
loop_autoplay: 'once',			//	'endless' | 'once'
interval: 5,
loop_manual: 'manual-endless',	//	'manual-endless' | 'manual-once'
autoplay_stopper: false,
noNavigation: false
},
slideshowData=tab_outer.data('slideshow-data'),
deepLinksToTabs={},
timeoutIDAutoplay=null;
if('undefined'!=typeof slideshowData){
slideshowOptions=$.extend({}, slideshowOptions, slideshowData);
}
layout_tab_wrap.each(function (){
var tab=$(this),
link=tab.data('av-deeplink-tabs'),
id=tab.data('av-tab-section-content');
if(link){
deepLinksToTabs[ link.toLowerCase() ]=id;
}});
current_tab_id=container.find('.av-active-tab-title').data('av-tab-section-title');
current_tab_id='undefined'!=typeof current_tab_id ? current_tab_id:'1';
current_iTab_id=parseInt(current_tab_id, 10);
current_content=container.find('[data-av-tab-section-content="' + current_tab_id + '"]');
current_content.addClass('__av_init_open av-active-tab-content');
if('av-tab-slide-transition'==slideshowOptions.animation){
transition_action='slide_sidewards';
}
else if('av-tab-slide-up-transition'==slideshowOptions.animation){
transition_action='slide_up';
}
else if('av-tab-fade-transition'==slideshowOptions.animation){
transition_action='fade';
}
if('slide_up'==transition_action){
$.each(animations, function(index, value){
inner_content.find('.' + value).addClass('avia_start_animation_when_active');
});
}
var change_tab=function(e, prevent_hash){
e.preventDefault();
if(container.hasClass('av-is-slideshow')&&e.originalEvent!==undefined){
return;
}
var current_tab=$(e.currentTarget),
tab_nr=current_tab.data('av-tab-section-title'),
iTab_nr=parseInt(tab_nr, 10),
prev_content=current_content;
tabs.removeClass('av-active-tab-title');
prev_content.removeClass('av-active-tab-content');
current_tab.removeClass('no-scroll');
current_content=container.find('[data-av-tab-section-content="' + tab_nr + '"]');
current_tab_id=tab_nr;
current_iTab_id=iTab_nr;
current_tab.addClass('av-active-tab-title');
current_content.addClass('av-active-tab-content');
var new_pos=(( iTab_nr - 1) * -100);
if($('body').hasClass('rtl')){
new_pos=(( iTab_nr - 1) * 100);
}
set_slide_height();
if(['none', 'slide_sidewards'].indexOf(transition_action) >=0){
if(cssActive){
new_pos=new_pos / tabs.length;
transition['transform']=transform3d ? "translate3d(" + new_pos  + "%, 0, 0)":"translate(" + new_pos + "%,0)";
transition['left']="0%";
content_wrap.css(transition);
}else{
content_wrap.css('left', new_pos + "%");
}}
else if('slide_up'==transition_action){
layout_tab_wrap.css('opacity', 1);
if(cssActive){
var top=current_content.data('slide-top');
if('undefined'==typeof top){
top=0;
}
transition['transform']=transform3d ? "translate3d(0, -" + top + "px, 0)":"translate(0, -" + top + "px ,0)";
transition['left']="0";
content_wrap.css(transition);
}else{
content_wrap.css('top', '-' + new_pos + 'px');
}
layout_tab_wrap.filter(':not(.av-active-tab-content)').css('opacity', 0);
}
set_tab_title_pos();
set_slide_arrows_visibility(iTab_nr);
set_slide_dots_visibility(iTab_nr);
if(!(prevent_hash||slideshowOptions.autoplay) ){
var newHash=current_tab.attr('href'),
deepLink=current_content.data('av-deeplink-tabs');
if('undefined'!=typeof(deepLink)&&''!=deepLink){
newHash=deepLink;
}
location.hash=newHash;
}
setTimeout(function(){
current_content.trigger('avia_start_animation_if_current_slide_is_active');
if(! isMobile||(isMobile&&! mobile_no_animation) ){
single_tabs.not(current_content).trigger('avia_remove_animation');
}}, 600);
},
set_min_width=function(){
min_width=0;
tabs.each(function(){
min_width +=$(this).outerWidth();
});
tab_wrap.css('min-width', min_width);
},
set_slide_height=function(){
var tab_wrap_height=container.hasClass('av-hide-tabs') ? 0:tab_wrap.height(),
tab_wrap_add=tab_wrap_height ? tab_wrap.outerHeight():0,
min_el_height=0,
cell_padding=0,
same_slide_height=0,
same_table_cell_height=0,
calc_el_height=0;
if(minimumBrowserHeight){
var css_height=container.hasClass('av-minimum-height-custom') ? container.data('av_minimum_height_px'):container.css('min-height');
css_height=parseInt(css_height, 10);
if(! isNaN(css_height) ){
min_el_height=css_height;
}
if(! min_el_height){
minimumBrowserHeight=false;
}}
if(! flexible){
inner_content.css('height', '');
content_wrap.css('min-height', '');
var first=layout_tab_wrap.first();
cell_padding=first.outerHeight() - first.height();
layout_tab_wrap.each(function(){
var content=$(this),
inner=content.find('.av-layout-tab-inner');
same_slide_height=Math.max(same_slide_height, inner.height());
});
same_table_cell_height=same_slide_height + cell_padding;
calc_el_height=same_table_cell_height + tab_wrap_add;
if(minimumBrowserHeight){
if(calc_el_height < min_el_height){
same_table_cell_height=min_el_height - tab_wrap_add;
calc_el_height=min_el_height;
}}
content_wrap.css('min-height', same_table_cell_height);
content_wrap.css('height', same_table_cell_height);
}
else if(flexible&&minimumBrowserHeight){
same_table_cell_height=min_el_height - tab_wrap_add;
calc_el_height=min_el_height;
content_wrap.css('min-height', same_table_cell_height);
content_wrap.css('height', same_table_cell_height);
}
if(['none', 'slide_sidewards', 'fade'].indexOf(transition_action) >=0){
if(! current_content.length){
return;
}
if(flexible){
inner_content.height('auto');
var content_height=current_content.find('.av-layout-tab-inner').height(),
height=current_content.outerHeight(),
outer_height=height + tab_wrap_height + 100;
tab_outer.css('max-height', outer_height);
inner_content.height(content_height);
inner_content.css('overflow', 'hidden');
}
setTimeout(function(){ win.trigger('av-height-change'); }, 600);
return;
}
var top=0;
layout_tab_wrap.each(function(){
var content=$(this),
inner=content.find('.av-layout-tab-inner'),
layout_tab_nr=content.data('av-tab-section-content'),
layout_iTab_nr=parseInt(layout_tab_nr, 10),
outerHeight=content.outerHeight();
content.data('slide-top', top);
top +=outerHeight;
if(flexible&&layout_iTab_nr==current_iTab_id){
tab_outer.css('max-height', outerHeight + tab_wrap_add);
inner.css('overflow', 'hidden');
}});
},
set_tab_title_pos=function(){
var current_tab=container.find('.av-active-tab-title'),
viewport=container.width(),
left_pos=(current_tab.position().left * - 1) -(current_tab.outerWidth() / 2) +(viewport / 2);
if(! $('body').hasClass('rtl')){
if(viewport >=min_width){
left_pos=0;
}
if(left_pos + min_width < viewport){
left_pos=(min_width - viewport) * -1;
}
if(left_pos > 0){
left_pos=0;
}
tab_wrap.css('left', left_pos);
var show_prev=left_pos!==0;
var show_next=left_pos + min_width > viewport;
set_arrows_visibility(show_prev, show_next);
}else{
var right_pos=0;
if(viewport < min_width){
if(left_pos + min_width > viewport){
if(left_pos > 0){
left_pos=0;
}
right_pos=(left_pos + min_width - viewport) * -1;
}}
tab_wrap.css('left', 'auto');
tab_wrap.css('right', right_pos);
var show_prev=right_pos + min_width > viewport;
var show_next=right_pos!==0;
set_arrows_visibility(show_prev, show_next);
}},
set_arrows_visibility=function(show_prev, show_next){
if(show_prev){
arrows_wrap.addClass('av-visible-prev');
}else{
arrows_wrap.removeClass('av-visible-prev');
}
if(show_next){
arrows_wrap.addClass('av-visible-next');
}else{
arrows_wrap.removeClass('av-visible-next');
}},
set_slide_arrows_visibility=function(current_tab){
if(current_tab > 1){
slide_arrows_wrap.addClass('av-visible-prev');
}else{
slide_arrows_wrap.removeClass('av-visible-prev');
}
if(current_tab < tabs.length){
slide_arrows_wrap.addClass('av-visible-next');
}else{
slide_arrows_wrap.removeClass('av-visible-next');
}},
set_slide_dots_visibility=function(current_tab){
slide_dots_wrap.find('a').removeClass('active');
slide_dots_wrap.find('a').eq(current_tab - 1).addClass('active');
},
swipe_to_next_prev=function(e){
if(slideshowOptions.noNavigation){
return;
}
switch_to_next_prev(e);
},
switch_to_next_prev=function(e){
e.preventDefault();
var clicked=$(e.currentTarget),
current_tab=container.find('.av-active-tab-title');
if(container.hasClass('av-slideshow-section') ){
if(clicked.hasClass('av_prev_tab_section') ){
slide_arrows_wrap.find('.av_prev_tab_section').trigger('click');
}else{
slide_arrows_wrap.find('.av_next_tab_section').trigger('click');
}
return;
}
if(clicked.is('.av_prev_tab_section')){
if(! $('body').hasClass('rtl')){
current_tab.prev('.av-section-tab-title').trigger('click');
}else{
current_tab.next('.av-section-tab-title').trigger('click');
}}else{
if(! $('body').hasClass('rtl')){
current_tab.next('.av-section-tab-title').trigger('click');
}else{
current_tab.prev('.av-section-tab-title').trigger('click');
}}
},
slide_arrows_next_prev=function(e){
e.preventDefault();
if(slideshowOptions.noNavigation&&e.originalEvent!==undefined){
return;
}
var clicked=$(e.currentTarget),
current_tab=container.find('.av-active-tab-title'),
tab_nr=current_tab.data('av-tab-section-title'),
iTab_nr=parseInt(tab_nr, 10),
next=0;
if(clicked.hasClass('av_prev_tab_section') ){
next = ! $('body').hasClass('rtl') ? -1:1;
}else{
next = ! $('body').hasClass('rtl') ? 1:-1;
}
var pos=iTab_nr + next;
if(pos <=0||pos > tabs.length){
if('endless'!=slideshowOptions.loop_autoplay&&'manual-endless'!=slideshowOptions.loop_manual){
return;
}
pos=pos <=0 ? tabs.length:1;
}
clearTimeoutAutoplay();
tabs.eq(pos - 1).trigger('click');
init_autoplay();
},
slide_dots_change_tab=function(e){
e.preventDefault();
var clicked=$(e.currentTarget);
if(clicked.hasClass('active') ){
return;
}
var tab_nr=clicked.attr('href').replace('#', ''),
iTab_nr=parseInt(tab_nr, 10);
if(iTab_nr > tabs.length){
return;
}
clearTimeoutAutoplay();
tabs.eq(iTab_nr - 1).trigger('click');
init_autoplay();
},
get_init_open=function(){
var hash=window.location.hash ? window.location.hash:'',
deepHash=hash.toLowerCase().replace('#', ''),
open=null;
if('undefined'!=typeof(deepLinksToTabs[ deepHash ])&&''!=deepLinksToTabs[ deepHash ]){
var hashID=deepLinksToTabs[ deepHash ];
open=tabs.filter('[data-av-tab-section-title="' + hashID + '"]');
}else{
open=tabs.filter('[href="' + hash + '"]');
}
if(open.length){
if(! open.is('.active_tab') ){
open.trigger('click');
}}else{
container.find('.av-active-tab-title').trigger('click', true);
}},
clearTimeoutAutoplay=function(){
if(typeof timeoutIDAutoplay==='number'){
clearTimeout(timeoutIDAutoplay);
}
timeoutIDAutoplay=null;
},
init_autoplay=function(){
if(! container.hasClass('av-slideshow-section') ){
return;
}
if(true!==slideshowOptions.autoplay){
tab_outer.removeClass('av-slideshow-autoplay').addClass('av-slideshow-manual');
}
if('undefined'==typeof slideshowOptions.loop_autoplay||'endless'!=slideshowOptions.loop_autoplay){
slideshowOptions.loop_autoplay='once';
}
if('undefined'==typeof slideshowOptions.interval){
slideshowOptions.interval=5;
}
if('undefined'==typeof slideshowOptions.autoplay||true!==slideshowOptions.autoplay){
slideshowOptions.autoplay=false;
tab_outer.removeClass('av-slideshow-autoplay').addClass('av-slideshow-manual');
return;
}
clearTimeoutAutoplay();
timeoutIDAutoplay=setTimeout(function(){
rotate_next_slide();
}, slideshowOptions.interval * 1000);
},
rotate_next_slide=function(){
var current_tab=container.find('.av-active-tab-title'),
tab_nr=current_tab.data('av-tab-section-title'),
iTab_nr=parseInt(tab_nr, 10),
stop=false,
next=0;
timeoutIDAutoplay=null;
if('endless'==slideshowOptions.loop_autoplay){
if(! $('body').hasClass('rtl')){
next=iTab_nr < tabs.length ? iTab_nr + 1:1;
}else{
next=iTab_nr > 1 ? iTab_nr - 1:tabs.length;
}}else{
if(! $('body').hasClass('rtl')){
stop=iTab_nr==tabs.length;
next=iTab_nr + 1;
}else{
stop=iTab_nr==1;
next=iTab_nr - 1;
}
if(stop){
slideshowOptions.autoplay=false;
slideshowOptions.loop_autoplay='manual';
tab_outer.removeClass('av-slideshow-autoplay').addClass('av-slideshow-manual');
tab_outer.removeClass('av-loop-endless').addClass('av-loop-once');
return;
}}
tabs.eq(next - 1).trigger('click');
timeoutIDAutoplay=setTimeout(function(){
rotate_next_slide();
}, slideshowOptions.interval * 1000);
};
$.avia_utilities.preload({
container: current_content,
single_callback: function(){
tabs.on('click', change_tab);
arrows.on('click', switch_to_next_prev);
slide_arrows.on('click', slide_arrows_next_prev);
slide_dots.on('click', slide_dots_change_tab);
if(isMobile||isTouchDevice){
tab_nav.on('click', swipe_to_next_prev);
}
win.on('debouncedresize', set_tab_title_pos);
win.on('hashchange', get_init_open);
win.on('debouncedresize av-content-el-height-changed', set_slide_height);
set_min_width();
set_slide_height();
get_init_open();
init_autoplay();
}});
if(isMobile||isTouchDevice){
if(! slideshowOptions.noNavigation){
content_wrap.avia_swipe_trigger({ prev:'.av_prev_tab_section', next:'.av_next_tab_section' });
}}
set_slide_height();
});
};}(jQuery));
(function($){
"use strict";
$.fn.avia_sc_tabs=function(options){
var defaults =
{
heading: '.tab',
content:'.tab_content',
active:'active_tab',
sidebar: false
};
var win=$(window),
options=$.extend(defaults, options);
return this.each(function(){
var container=$(this),
tab_titles=$('<div class="tab_titles" role="tablist"></div>').prependTo(container),
tabs=$(options.heading, container),
content=$(options.content, container),
newtabs=false,
oldtabs=false;
newtabs=tabs.clone();
oldtabs=tabs.addClass('fullsize-tab').attr({ 'aria-hidden': true, 'aria-selected': false, id: '', role: '', 'aria-controls': '', tabindex: 0 });
tabs=newtabs;
tabs.prependTo(tab_titles).each(function(i){
var tab=$(this),
the_oldtab=false;
if(newtabs){
the_oldtab=oldtabs.eq(i);
}
tab.addClass('tab_counter_' + i).attr({ tab_counter: i }).on('click', function(){
open_content(tab, i, the_oldtab);
return false;
});
tab.on('keydown', function(objEvent){
if(objEvent.keyCode===13){
tab.trigger('click');
}});
if(newtabs){
the_oldtab.on('click', function(){
open_content(the_oldtab, i, tab);
return false;
});
the_oldtab.on('keydown', function(objEvent){
if(objEvent.keyCode===13){
the_oldtab.trigger('click');
}});
}});
set_size();
trigger_default_open(false);
win.on("debouncedresize", set_size);
$('a').on('click',function(){
var hash=$(this).attr('href');
if(typeof hash!="undefined"&&hash){
hash=hash.replace(/^.*?#/,'');
trigger_default_open('#'+hash);
}});
function set_size(){
if(! options.sidebar){
return;
}
content.css({'min-height': tab_titles.outerHeight() + 1});
}
function open_content(tab, i, alternate_tab){
if(! tab.is('.' + options.active) ){
$('.' + options.active, container).removeClass(options.active).attr({ 'aria-selected': false, tabindex: 0 });
$('.' + options.active + '_content', container).removeClass(options.active + '_content').attr('aria-hidden', true);
tab.addClass(options.active).attr({ 'aria-selected': true, tabindex: 0 });
var new_loc=tab.data('fake-id');
if(typeof new_loc=='string'){
window.location.replace(new_loc);
}
if(alternate_tab){
alternate_tab.addClass(options.active);
}
var active_c=content.eq(i).addClass(options.active + '_content').attr('aria-hidden', false);
if(typeof click_container!='undefined'&&click_container.length){
sidebar_shadow.height(active_c.outerHeight());
}
var el_offset=active_c.offset().top,
scoll_target=el_offset - 50 - parseInt($('html').css('margin-top'), 10);
if(win.scrollTop() > el_offset){
$('html:not(:animated),body:not(:animated)').scrollTop(scoll_target);
}}
win.trigger('av-content-el-height-changed', tab);
}
function trigger_default_open(hash){
if(! hash&&window.location.hash){
hash=window.location.hash;
}
if(! hash){
return;
}
var open=tabs.filter('[data-fake-id="'+hash+'"]');
if(open.length){
if(! open.is('.active_tab')){
open.trigger('click');
}
window.scrollTo(0, container.offset().top - 70);
}}
});
};}(jQuery));
(function($){
"use strict";
$.fn.avia_sc_testimonial=function(options){
return this.each(function(){
var container=$(this),
elements=container.find('.avia-testimonial');
container.on('avia_start_animation', function(){
elements.each(function(i){
var element=$(this);
setTimeout(function(){ element.addClass('avia_start_animation'); }, (i * 150));
});
});
});
};}(jQuery));
(function($){
"use strict";
$(window).on('load', function (e){
if($.AviaSlider){
$('.avia-timeline-container').avia_sc_timeline();
}});
$.fn.avia_sc_timeline=function (options){
return this.each(function (){
var container=this,
timeline_id='#' + $(this).attr('id'),
timeline=$(timeline_id),
methods;
methods =
{
matchHeights: function(){
this.setMinHeight($(timeline_id + ' .av-milestone-placement-top .av-milestone-date'), true);
this.setMinHeight($(timeline_id + ' .av-milestone-placement-bottom .av-milestone-content-wrap'), true);
this.setMinHeight($(timeline_id + ' .av-milestone-placement-bottom.avia-timeline-boxshadow .av-milestone-contentbox'), false);
this.setMinHeight($(timeline_id + ' .av-milestone-placement-top.avia-timeline-boxshadow .av-milestone-contentbox'), false);
this.setMinHeight($(timeline_id + ' .avia-timeline-horizontal.av-milestone-placement-alternate li >:first-child'), true);
},
setMinHeight: function(els, setNav){
if(els.length < 2){
return;
}
var elsHeights=new Array();
els.css('min-height','0').each(function(i){
var current=$(this);
var currentHeight=current.outerHeight(true);
elsHeights.push(currentHeight);
});
var largest=Math.max.apply(null, elsHeights);
els.css('min-height', largest);
if(setNav){
var $firstElement=els.first(),
$parent=$firstElement.closest('.avia-timeline-container'),
$pos=$firstElement.height();
$parent.find('.av-timeline-nav').css('top', $pos);
}},
createCarousel: function(e){
var self=this,
slider=$(timeline_id + '.avia-slideshow-carousel'),
slides_num=3,
slides_num_small=1;
if(timeline.attr('avia-data-slides')){
slides_num=parseInt(timeline.attr('avia-data-slides'));
}
if(slides_num >=2){
slides_num_small=2;
}
var sliderOptions={
carousel: 'yes',
keep_padding: true,
carouselSlidesToShow: slides_num,
carouselSlidesToScroll: 3,
carouselResponsive: [
{
breakpoint: 989,
settings: {
carouselSlidesToShow: slides_num_small,
carouselSlidesToScroll: slides_num_small
}},
{
breakpoint: 767,
settings: {
carouselSlidesToShow: 1,
carouselSlidesToScroll: 1
}}
]
};
slider.aviaSlider(sliderOptions);
slider.on('_kickOff',function(){
self.matchHeights();
});
$(window).on('resize', function(){
self.matchHeights();
});
},
layoutHelpers: function(e){
$(timeline_id + ' .avia-timeline-vertical li').each(function(index, element){
var $length=$(this).parents('ul').find('li').length;
var $icon_wrap=$(this).find('.av-milestone-icon-wrap');
var $icon_wrap_height=$icon_wrap.outerHeight(true);
var $icon_wrap_height_half=parseInt($icon_wrap_height / 2);
if(index===($length - 1) ){
$icon_wrap.css({
'height': $icon_wrap_height_half
});
}else{
$icon_wrap.css({
'height': $icon_wrap_height
});
}});
},
fireAnimations: function(e){
if($(timeline_id + ' > ul').hasClass('avia-timeline-vertical')){
var milestone=timeline.find('.av-milestone');
timeline.on('avia_start_animation', function(){
milestone.each(function(i){
var element=$(this);
setTimeout(function(){ element.addClass('avia_start_animation'); },(i * 350) );
});
});
}}
};
methods.createCarousel();
methods.layoutHelpers();
methods.fireAnimations();
methods.matchHeights();
});
};})(jQuery);
(function($){
"use strict";
$.fn.avia_sc_toggle=function(options){
var defaults =
{
single: '.single_toggle',
heading: '.toggler',
content: '.toggle_wrap',
sortContainer:'.taglist'
};
var win=$(window),
options=$.extend(defaults, options);
return this.each(function(){
var container=$(this).addClass('enable_toggles'),
toggles=$(options.single, container),
heading=$(options.heading, container),
allContent=$(options.content, container),
sortLinks=$(options.sortContainer + " a", container),
preview=$('#av-admin-preview');
var activeStyle='',
headingStyle='';
heading.each(function(i){
var thisheading=$(this),
content=thisheading.hasClass('av-title-below') ? thisheading.prev(options.content, container):thisheading.next(options.content, container),
slideSpeed=parseInt(thisheading.data('slide-speed') );
slideSpeed=isNaN(slideSpeed) ? 200:slideSpeed;
function scroll_to_viewport(){
var el_offset=content.offset().top,
scoll_target=el_offset - 50 - parseInt($('html').css('margin-top'),10);
if(win.scrollTop() > el_offset){
$('html:not(:animated),body:not(:animated)').animate({scrollTop: scoll_target}, slideSpeed);
}}
if(content.css('visibility')!="hidden"){
thisheading.addClass('activeTitle').attr('style',activeStyle);
}
thisheading.on('keydown', function(objEvent){
if(objEvent.keyCode===13||objEvent.keyCode===32){
thisheading.trigger('click');
}});
thisheading.on('click', function(){
if(content.css('visibility')!="hidden"){
content.slideUp(slideSpeed, function(){
content.removeClass('active_tc').attr({style:''});
win.trigger('av-height-change');
win.trigger('av-content-el-height-changed', this);
if(preview.length==0){
location.replace(thisheading.data('fake-id') + "-closed");
}});
thisheading.removeClass('activeTitle').attr('style', headingStyle);
}else{
if(container.is('.toggle_close_all')){
allContent.not(content).slideUp(slideSpeed, function(){
$(this).removeClass('active_tc').attr({style:''});
scroll_to_viewport();
});
heading.removeClass('activeTitle').attr('style',headingStyle);
}
content.addClass('active_tc');
setTimeout(function(){
content.slideDown(slideSpeed, function(){
if(! container.is('.toggle_close_all')){
scroll_to_viewport();
}
win.trigger('av-height-change');
win.trigger('av-content-el-height-changed', this);
});
}, 1);
thisheading.addClass('activeTitle').attr('style', activeStyle);
if(preview.length==0){
location.replace(thisheading.data('fake-id'));
}}
});
});
sortLinks.on('click', function(e){
e.preventDefault();
var show=toggles.filter('[data-tags~="' + $(this).data('tag') + '"]'),
hide=toggles.not('[data-tags~="' + $(this).data('tag') + '"]');
sortLinks.removeClass('activeFilter');
$(this).addClass('activeFilter');
heading.filter('.activeTitle').trigger('click');
show.slideDown();
hide.slideUp();
});
function changeTitleAria(){
heading.each(function(i){
let $heading=$(this),
title_open=$heading.data('title-open'),
title=$heading.data('title'),
content=$heading.hasClass('av-title-below') ? $heading.prev(options.content, container):$heading.next(options.content, container),
titleHasHtml=false;
if(! title){
title='***';
}
titleHasHtml=title.indexOf('<') >=0;
if(content.css('visibility')!="hidden"){
if(title_open&&! titleHasHtml){
$heading.contents()[0].data=title_open;
}
$heading.attr('aria-expanded', 'true');
content.attr({ 'aria-hidden': 'false', tabindex: 0 });
}else{
if(! titleHasHtml){
$heading.contents()[0].data=title;
}
$heading.attr('aria-expanded', 'false');
content.attr({ 'aria-hidden': 'true', tabindex: -1 });
}});
setTimeout(function(){ changeTitleAria(); }, 150);
}
function trigger_default_open(hash){
if(! hash&&window.location.hash){
hash=window.location.hash;
}
if(! hash){
return;
}
var open=heading.filter('[data-fake-id="' + hash + '"]');
if(open.length){
if(! open.is('.activeTitle')){
open.trigger('click');
}
window.scrollTo(0, container.offset().top - 70);
}}
changeTitleAria();
trigger_default_open(false);
$('a').on('click', function(){
var hash=$(this).attr('href');
if(typeof hash!="undefined"&&hash){
hash=hash.replace(/^.*?#/,'');
trigger_default_open('#' + hash);
}});
});
};}(jQuery));
(function($){
"use strict";
$('body').on('click', '.av-lazyload-video-embed .av-click-to-play-overlay', function(e){
var clicked=$(this);
var cookie_check=$('html').hasClass('av-cookies-needs-opt-in')||$('html').hasClass('av-cookies-can-opt-out');
var allow_continue=true;
var silent_accept_cookie=$('html').hasClass('av-cookies-user-silent-accept');
if(cookie_check&&! silent_accept_cookie){
if(! document.cookie.match(/aviaCookieConsent/)||$('html').hasClass('av-cookies-session-refused')){
allow_continue=false;
}else{
if(! document.cookie.match(/aviaPrivacyRefuseCookiesHideBar/)){
allow_continue=false;
}
else if(! document.cookie.match(/aviaPrivacyEssentialCookiesEnabled/)){
allow_continue=false;
}
else if(document.cookie.match(/aviaPrivacyVideoEmbedsDisabled/)){
allow_continue=false;
}}
}
if(window['wp']&&wp.hooks){
allow_continue=wp.hooks.applyFilters('aviaCookieConsent_allow_continue', allow_continue);
}
var container=clicked.parents('.av-lazyload-video-embed');
if(container.hasClass('avia-video-lightbox')&&container.hasClass('avia-video-standard-html') ){
allow_continue=true;
}
if(! allow_continue){
if(typeof e.originalEvent=='undefined'){ return; }
var src_url=container.data('original_url');
if(src_url) window.open(src_url , '_blank', 'noreferrer noopener');
return;
}
var video=container.find('.av-video-tmpl').html();
var link='';
if(container.hasClass('avia-video-lightbox') ){
link=container.find('a.lightbox-link');
if(link.length==0){
container.append(video);
setTimeout(function(){
link=container.find('a.lightbox-link');
if($('html').hasClass('av-default-lightbox') ){
link.addClass('lightbox-added').magnificPopup($.avia_utilities.av_popup);
link.trigger('click');
}else{
link.trigger('avia-open-video-in-lightbox');
}}, 100);
}else{
link.trigger('click');
}}else{
container.html(video);
}});
$('.av-lazyload-immediate .av-click-to-play-overlay').trigger('click');
}(jQuery));
(function($){
"use strict";
$(function(){
$.avia_utilities=$.avia_utilities||{};
if('undefined'==typeof $.avia_utilities.isMobile){
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&'ontouchstart' in document.documentElement){
$.avia_utilities.isMobile=true;
}else{
$.avia_utilities.isMobile=false;
}}
avia_hamburger_menu();
$(window).trigger('resize');
});
$.avia_utilities=$.avia_utilities||{};
function avia_hamburger_menu(){
var header=$('#header'),
header_main=$('#main .av-logo-container'),
menu=$('#avia-menu'),
burger_wrap=$('.av-burger-menu-main a'),
htmlEL=$('html').eq(0),
overlay=$('<div class="av-burger-overlay" role="menu" aria-orientation="vertical"></div>'),
overlay_scroll=$('<div class="av-burger-overlay-scroll"></div>').appendTo(overlay),
inner_overlay=$('<div class="av-burger-overlay-inner"></div>').appendTo(overlay_scroll),
bgColor=$('<div class="av-burger-overlay-bg"></div>').appendTo(overlay),
animating=false,
first_level={},
logo_container=$('.av-logo-container .inner-container'),
menu_in_logo_container=logo_container.find('.main_menu'),
cloneFirst=htmlEL.is('.html_av-submenu-display-click.html_av-submenu-clone, .html_av-submenu-display-hover.html_av-submenu-clone'),
menu_generated=false,
cloned_menu_cnt=0;
if(! htmlEL.hasClass('html_av-submenu-hidden') ){
htmlEL.addClass('html_av-submenu-visible');
}
var alternate=$('#avia_alternate_menu');
if(alternate.length > 0){
menu=alternate;
}
var	set_list_container_height=function(){
if($.avia_utilities.isMobile){
overlay_scroll.outerHeight(window.innerHeight);
}},
create_list=function(items , append_to){
if(! items){
return;
}
var list, link, current, subitems, megacolumns, sub_current, sub_current_list, new_li, new_ul;
items.each(function(){
current=$(this);
subitems=current.find(' > .sub-menu > li');
if(subitems.length==0){
subitems=current.find(' > .children > li');
}
megacolumns=current.find('.avia_mega_div > .sub-menu > li.menu-item');
var cur_menu=current.find('>a');
var clone_events=true;
if(cur_menu.length){
if(cur_menu.get(0).hash=='#'||'undefined'==typeof cur_menu.attr('href')||cur_menu.attr('href')=='#'){
if(subitems.length > 0||megacolumns.length > 0){
clone_events=false;
}}
}
link=cur_menu.clone(clone_events).attr('style','');
if('undefined'==typeof cur_menu.attr('href')){
link.attr('href', '#');
}
new_li=$('<li>').append(link);
new_li.attr('role', 'menuitem');
var cls=[];
if('undefined'!=typeof current.attr('class')){
cls=current.attr('class').split(/\s+/);
$.each(cls, function(index, value){
if(( value.indexOf('menu-item')!=0)&&(value.indexOf('page-item') < 0)&&(value.indexOf('page_item')!=0)&&(value.indexOf('dropdown_ul') < 0) ){
new_li.addClass(value);
}
return true;
});
}
if('undefined'!=typeof current.attr('id')&&''!=current.attr('id')){
new_li.addClass(current.attr('id'));
}else{
$.each(cls, function(index, value){
if(value.indexOf('page-item-') >=0){
new_li.addClass(value);
return false;
}});
}
append_to.append(new_li);
if(subitems.length){
new_ul=$('<ul class="sub-menu">').appendTo(new_li);
if(cloneFirst&&(link.get(0).hash!='#'&&link.attr('href')!='#')){
new_li.clone(true).prependTo(new_ul);
}
new_li.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">');
create_list(subitems , new_ul);
}
else if(megacolumns.length){
new_ul=$('<ul class="sub-menu">').appendTo(new_li);
if(cloneFirst&&(link.get(0).hash!='#'&&link.attr('href')!='#')){
new_li.clone(true).prependTo(new_ul);
}
megacolumns.each(function(iteration){
var megacolumn=$(this),
mega_current=megacolumn.find('> .sub-menu'),
mega_title=megacolumn.find('> .mega_menu_title'),
mega_title_link=mega_title.find('a').attr('href')||"#",
current_megas=mega_current.length > 0 ? mega_current.find('>li'):null,
mega_title_set=false,
mega_link=new_li.find('>a'),
hide_enty='';
if(( current_megas===null)||(current_megas.length==0) ){
if(mega_title_link=='#'){
hide_enty=' style="display: none;"';
}}
if(iteration==0) new_li.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">');
if(mega_title.length&&mega_title.text()!=""){
mega_title_set=true;
if(iteration > 0){
var check_li=new_li.parents('li').eq(0);
if(check_li.length) new_li=check_li;
new_ul=$('<ul class="sub-menu">').appendTo(new_li);
}
new_li=$('<li' + hide_enty + '>').appendTo(new_ul);
new_ul=$('<ul class="sub-menu">').appendTo(new_li);
$('<a href="'+mega_title_link+'"><span class="avia-bullet"></span><span class="avia-menu-text">' +mega_title.text()+ '</span></a>').insertBefore(new_ul);
mega_link=new_li.find('>a');
if(cloneFirst&&(mega_current.length > 0)&&(mega_link.length&&mega_link.get(0).hash!='#'&&mega_link.attr('href')!='#')){
new_li.clone(true).addClass('av-cloned-title').prependTo(new_ul);
}}
if(mega_title_set&&(mega_current.length > 0) ){
new_li.addClass('av-width-submenu').find('>a').append('<span class="av-submenu-indicator">');
}
create_list(current_megas , new_ul);
});
}});
burger_wrap.trigger('avia_burger_list_created');
return list;
};
var burger_ul, burger;
$('body').on('mousewheel DOMMouseScroll touchmove', '.av-burger-overlay-scroll', function (e){
var height=this.offsetHeight,
scrollHeight=this.scrollHeight,
direction=e.originalEvent.wheelDelta;
if(scrollHeight!=this.clientHeight){
if(( this.scrollTop >=(scrollHeight - height)&&direction < 0)||(this.scrollTop <=0&&direction > 0)){
e.preventDefault();
}}else{
e.preventDefault();
}});
$(document).on('mousewheel DOMMouseScroll touchmove', '.av-burger-overlay-bg, .av-burger-overlay-active .av-burger-menu-main', function (e){
e.preventDefault();
});
var touchPos={};
$(document).on('touchstart', '.av-burger-overlay-scroll', function(e){
touchPos.Y=e.originalEvent.touches[0].clientY;
});
$(document).on('touchend', '.av-burger-overlay-scroll', function(e){
touchPos={};});
$(document).on('touchmove', '.av-burger-overlay-scroll', function (e){
if(!touchPos.Y){
touchPos.Y=e.originalEvent.touches[0].clientY;
}
var	differenceY=e.originalEvent.touches[0].clientY - touchPos.Y,
element=this,
top=element.scrollTop,
totalScroll=element.scrollHeight,
currentScroll=top + element.offsetHeight,
direction=differenceY > 0 ? "up":"down";
$('body').get(0).scrollTop=touchPos.body;
if(top <=0){
if(direction=="up"){
e.preventDefault();
}}
else if(currentScroll >=totalScroll){
if(direction=="down"){
e.preventDefault();
}}
});
$(window).on('debouncedresize', function (e){
var close=true;
if($.avia_utilities.isMobile&&htmlEL.hasClass('av-mobile-menu-switch-portrait')&&htmlEL.hasClass('html_text_menu_active') ){
var height=$(window).height();
var width=$(window).width();
if(width <=height){
htmlEL.removeClass('html_burger_menu');
}else{
var switch_width=htmlEL.hasClass('html_mobile_menu_phone') ? 768:990;
if(height < switch_width){
htmlEL.addClass('html_burger_menu');
close=false;
}else{
htmlEL.removeClass('html_burger_menu');
}}
}
if(close&&burger&&burger.length){
if(! burger_wrap.is(':visible')){
burger.filter(".is-active").parents('a').eq(0).trigger('click');
}}
set_list_container_height();
});
$('.html_av-overlay-side').on('click', '.av-burger-overlay-bg', function (e){
e.preventDefault();
burger.parents('a').eq(0).trigger('click');
});
$(window).on('avia_smooth_scroll_start', function(){
if(burger&&burger.length){
burger.filter(".is-active").parents('a').eq(0).trigger('click');
}});
$('.html_av-submenu-display-hover').on('mouseenter', '.av-width-submenu', function (e){
$(this).children("ul.sub-menu").slideDown('fast');
});
$('.html_av-submenu-display-hover').on('mouseleave', '.av-width-submenu', function (e){
$(this).children("ul.sub-menu").slideUp('fast');
});
$('.html_av-submenu-display-hover').on('click', '.av-width-submenu > a', function (e){
e.preventDefault();
e.stopImmediatePropagation();
});
$('.html_av-submenu-display-hover').on('touchstart', '.av-width-submenu > a', function (e){
var menu=$(this);
toggle_submenu(menu, e);
});
$('.html_av-submenu-display-click').on('click', '.av-width-submenu > a', function (e){
var menu=$(this);
toggle_submenu(menu, e);
});
$('.html_av-submenu-display-click, .html_av-submenu-visible').on('click', '.av-burger-overlay a', function (e){
var loc=window.location.href.match(/(^[^#]*)/)[0];
var cur=$(this).attr('href').match(/(^[^#]*)/)[0];
if(cur==loc){
e.preventDefault();
e.stopImmediatePropagation();
burger.parents('a').eq(0).trigger('click');
return false;
}
return true;
});
function toggle_submenu(menu, e){
e.preventDefault();
e.stopImmediatePropagation();
var parent=menu.parents('li').eq(0);
parent.toggleClass('av-show-submenu');
if(parent.is('.av-show-submenu')){
parent.children("ul.sub-menu").slideDown('fast');
}else{
parent.children("ul.sub-menu").slideUp('fast');
}};
(function normalize_layout(){
if(menu_in_logo_container.length){
return;
}
var menu2=$('#header .main_menu').clone(true),
ul=menu2.find('ul.av-main-nav'),
id=ul.attr('id');
if('string'==typeof id&&''!=id.trim()){
ul.attr('id', id + '-' + cloned_menu_cnt++);
}
menu2.find('.menu-item:not(.menu-item-avia-special)').remove();
menu2.insertAfter(logo_container.find('.logo').first());
var social=$('#header .social_bookmarks').clone(true);
if(! social.length){
social=$('.av-logo-container .social_bookmarks').clone(true);
}
if(social.length){
menu2.find('.avia-menu').addClass('av_menu_icon_beside');
menu2.append(social);
}
burger_wrap=$('.av-burger-menu-main a');
}());
burger_wrap.on('click', function(e){
if(animating){
return;
}
burger=$(this).find('.av-hamburger'),
animating=true;
if(!menu_generated){
menu_generated=true;
burger.addClass("av-inserted-main-menu");
burger_ul=$('<ul>').attr({id:'av-burger-menu-ul', class:'', 'aria-haspopup': 'true', 'aria-controls': 'menu2'});
var first_level_items=menu.find('> li:not(.menu-item-avia-special)');
var	list=create_list(first_level_items , burger_ul);
burger_ul.find('.noMobile').remove();
burger_ul.appendTo(inner_overlay);
first_level=inner_overlay.find('#av-burger-menu-ul > li');
if($.fn.avia_smoothscroll){
$('a[href*="#"]', overlay).avia_smoothscroll(overlay);
}}
if(burger.is(".is-active")){
burger.removeClass("is-active");
htmlEL.removeClass("av-burger-overlay-active-delayed");
overlay.animate({opacity:0}, function(){
overlay.css({display:'none'});
htmlEL.removeClass("av-burger-overlay-active");
animating=false;
});
}else{
set_list_container_height();
var offsetTop=header_main.length ? header_main.outerHeight() + header_main.position().top:header.outerHeight() + header.position().top;
overlay.appendTo($(e.target).parents('.avia-menu'));
burger_ul.css({padding:(offsetTop) + "px 0px"});
first_level.removeClass('av-active-burger-items');
burger.addClass("is-active");
htmlEL.addClass("av-burger-overlay-active");
overlay.css({display:'block'}).animate({opacity:1}, function(){
animating=false;
});
setTimeout(function(){
htmlEL.addClass("av-burger-overlay-active-delayed");
}, 100);
first_level.each(function(i){
var _self=$(this);
setTimeout(function(){
_self.addClass('av-active-burger-items');
}, (i + 1) * 125);
});
}
e.preventDefault();
});
}})(jQuery);
(function($){
"use strict";
$.avia_utilities=$.avia_utilities||{};
$(function(){
if($.fn.avia_parallax){
$('.av-parallax,.av-parallax-object').avia_parallax();
}});
var AviaObjectParallaxElement=function(options, element){
if(!(this.transform||this.transform3d) ){
return;
}
this.options=$.extend({}, options);
this.win=$(window);
this.body=$('body');
this.isMobile=$.avia_utilities.isMobile,
this.winHeight=this.win.height();
this.winWidth=this.win.width();
this.el=$(element).addClass('active-parallax');
this.objectType=this.el.hasClass('av-parallax-object') ? 'object':'background-image';
this.elInner=this.el;
this.elBackgroundParent=this.el.parent();
this.elParallax=this.el.data('parallax')||{};
this.direction='';
this.speed=0.5;
this.elProperty={};
this.ticking=false,
this.isTransformed=false;
if($.avia_utilities.supported.transition===undefined){
$.avia_utilities.supported.transition=$.avia_utilities.supports('transition');
}
this._init(options);
};
AviaObjectParallaxElement.prototype =
{
mediaQueries: {
'av-mini-':		'(max-width: 479px)',
'av-small-':	'(min-width: 480px) and (max-width: 767px)',
'av-medium-':	'(min-width: 768px) and (max-width: 989px)',
'av-desktop-':	'(min-width: 990px)'
},
transform:			document.documentElement.className.indexOf('avia_transform')!==-1,
transform3d:		document.documentElement.className.indexOf('avia_transform3d')!==-1,
mobileNoAnimation:	$('body').hasClass('avia-mobile-no-animations'),
defaultSpeed:		0.5,
defaultDirections:	[ 'bottom_top', 'left_right', 'right_left', 'no_parallax' ],
transformCSSProps:	[ 'transform', '-webkit-transform', '-moz-transform', '-ms-transform', '-o-transform' ],
matrixDef:			[ 1, 0, 0, 1, 0, 0 ],
matrix3dDef:		[ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 ],
_init: function(){
var _self=this;
if(typeof this.el.data('parallax-selector')!='undefined'&&this.el.data('parallax-selector')!==''){
this.elInner=this.el.find(this.el.data('parallax-selector') );
if(this.elInner.length==0){
this.elInner=this.el;
}}
if('background-image'==this.objectType){
if(this.isMobile&&this.mobileNoAnimation){
return;
}
this.elParallax.parallax='bottom_top';
this.elParallax.parallax_speed=parseFloat(this.el.data('avia-parallax-ratio') )||0.5;
}
setTimeout(function(){
_self._fetchProperties();
}, 30);
this.win.on('debouncedresize av-height-change', _self._fetchProperties.bind(_self) );
this.body.on('av_resize_finished', _self._fetchProperties.bind(_self) );
setTimeout(function(){
_self.win.on('scroll', _self._onScroll.bind(_self) );
}, 100);
},
_setParallaxProps: function(){
if('background-image'==this.objectType){
this.direction=this.elParallax.parallax;
this.speed=this.elParallax.parallax_speed;
return;
}
var all_direction=this.elParallax.parallax||'',
all_speed=this.elParallax.parallax_speed||'',
resp_direction='',
resp_speed='',
media='all';
if(this.defaultDirections.indexOf(all_direction) < 0){
all_direction='no_parallax';
}
if(typeof window.matchMedia=='function'){
$.each(this.mediaQueries, function(key, query){
var mql=window.matchMedia(query);
if(mql.matches){
media=key;
return false;
}});
}
if('all'==media){
this.direction=all_direction;
this.speed=''==all_speed ? this.defaultSpeed:parseFloat(all_speed) / 100.0;
return;
}
resp_direction=this.elParallax[ media + 'parallax' ]||'';
resp_speed=this.elParallax[ media + 'parallax_speed' ]||'';
if('inherit'==resp_direction){
resp_direction=all_direction;
resp_speed=all_speed;
}
if(this.defaultDirections.indexOf(resp_direction) < 0){
resp_direction='no_parallax';
}
this.direction=resp_direction;
this.speed=''==resp_speed ? this.defaultSpeed:parseFloat(resp_speed) / 100.0;
},
_getTranslateObject: function(element){
var translate={
type:	'',
matrix: [],
x:		0,
y:		0,
z:		0
};
$.each(this.transformCSSProps, function(i, prop){
var found=element.css(prop);
if('string'!=typeof found||'none'==found){
return;
}
if(found.indexOf('matrix') >=0){
var matrixValues=found.match(/matrix.*\((.+)\)/)[1].split(', ');
if(found.indexOf('matrix3d') >=0){
translate.type='3d';
translate.matrix=matrixValues;
translate.x=matrixValues[12];
translate.y=matrixValues[13];
translate.z=matrixValues[14];
}else{
translate.type='2d';
translate.matrix=matrixValues;
translate.x=matrixValues[4];
translate.y=matrixValues[5];
}
return false;
}else{
translate.type='';
var matchX=found.match(/translateX\((-?\d+\.?\d*px)\)/);
if(matchX){
translate.x=parseInt(matchX[1], 10);
}
var matchY=found.match(/translateY\((-?\d+\.?\d*px)\)/);
if(matchY){
translate.y=parseInt(matchY[1], 10);
}}
});
return translate;
},
_getTranslateMatrix: function(translateObj, changes){
var matrix='';
$.each(changes, function(key, value){
translateObj[key]=value;
});
if(this.transform3d){
var matrix3d=this.matrix3dDef.slice(0);
switch(translateObj.type){
case '2d':
matrix3d[0]=translateObj.matrix[0];
matrix3d[1]=translateObj.matrix[1];
matrix3d[4]=translateObj.matrix[2];
matrix3d[5]=translateObj.matrix[3];
matrix3d[12]=translateObj.x;
matrix3d[13]=translateObj.y;
break;
case '3d':
matrix3d=translateObj.matrix.slice(0);
matrix3d[12]=translateObj.x;
matrix3d[13]=translateObj.y;
matrix3d[14]=translateObj.z;
break;
default:
matrix3d[12]=translateObj.x;
matrix3d[13]=translateObj.y;
break;
}
matrix='matrix3d(' + matrix3d.join(', ') + ')';
}
else if(this.transform){
var matrix2d=this.matrixDef.slice(0);
switch(translateObj.type){
case '2d':
matrix2d=translateObj.matrix.slice(0);
matrix2d[4]=translateObj.x;
matrix2d[5]=translateObj.y;
break;
case '3d':
matrix2d[0]=translateObj.matrix[0];
matrix2d[1]=translateObj.matrix[1];
matrix2d[2]=translateObj.matrix[4];
matrix2d[3]=translateObj.matrix[5];
matrix2d[4]=translateObj.x;
matrix2d[5]=translateObj.y;
break;
default:
matrix2d[4]=translateObj.x;
matrix2d[5]=translateObj.y;
break;
}
matrix='matrix(' + matrix2d.join(', ') + ')';
}
return matrix;
},
_fetchProperties: function(){
this._setParallaxProps();
this.el.css($.avia_utilities.supported.transition + 'transform', '');
this.winHeight=this.win.height();
this.winWidth=this.win.width();
if('background-image'==this.objectType){
this.elProperty.top=this.elBackgroundParent.offset().top;
this.elProperty.height=this.elBackgroundParent.outerHeight();
this.el.height(Math.ceil(( this.winHeight * Math.abs(this.speed) ) + this.elProperty.height) );
}else{
this.elProperty.top=this.elInner.offset().top;
this.elProperty.left=this.elInner.offset().left;
this.elProperty.height=this.elInner.outerHeight();
this.elProperty.width=this.elInner.outerWidth();
this.elProperty.bottom=this.elProperty.top + this.elProperty.height;
this.elProperty.right=this.elProperty.left + this.elProperty.width;
this.elProperty.distanceLeft=this.elProperty.right;
this.elProperty.distanceRight=this.winWidth - this.elProperty.left;
}
this.elProperty.translateObj=this._getTranslateObject(this.el);
this._parallaxScroll();
},
_onScroll: function(e){
var _self=this;
if(! _self.ticking){
_self.ticking=true;
window.requestAnimationFrame(_self._parallaxRequest.bind(_self) );
}},
_inViewport: function(elTop, elRight, elBottom, elLeft, winTop, winBottom, winLeft, winRight){
return !(elTop > winBottom + 10||elBottom < winTop - 10||elLeft > winRight + 10||elRight < winLeft - 10);
},
_parallaxRequest: function(e){
var _self=this;
setTimeout(_self._parallaxScroll.bind(_self), 0);
},
_parallaxScroll: function(e){
if(( 'no_parallax'==this.direction||''==this.direction)&&! this.isTransformed){
this.ticking=false;
return;
}
var winTop=this.win.scrollTop(),
winLeft=this.win.scrollLeft(),
winRight=winLeft + this.winWidth,
winBottom=winTop + this.winHeight,
scrollPos=0,
matrix='';
if('background-image'==this.objectType){
if(this.elProperty.top < winBottom&&winTop <=this.elProperty.top + this.elProperty.height){
scrollPos=Math.ceil(( winBottom - this.elProperty.top) * this.speed);
matrix=this._getTranslateMatrix(this.elProperty.translateObj, { y: scrollPos });
this.el.css($.avia_utilities.supported.transition + 'transform', matrix);
}
this.ticking=false;
return;
}
if(( 'no_parallax'==this.direction||''==this.direction) ){
matrix=this._getTranslateMatrix(this.elProperty.translateObj, { x: 0, y: 0  });
this.el.css($.avia_utilities.supported.transition + 'transform', matrix);
this.ticking=false;
this.isTransformed=false;
return;
}
var scroll_px_toTop=Math.ceil(this.elProperty.top - winTop),
scroll_px_el=Math.ceil(winBottom - this.elProperty.top),
scrolled_pc_toTop=0,
reduceDistanceX=0,
transform={ x: 0, y: 0 };
if(this.elProperty.top < this.winHeight){
reduceDistanceX=Math.ceil(this.winHeight - this.elProperty.top);
}
if(this.elProperty.top > winBottom){
scrolled_pc_toTop=0;
scroll_px_el=0;
}else{
scrolled_pc_toTop=1 -(scroll_px_toTop + reduceDistanceX) / this.winHeight;
}
switch(this.direction){
case 'bottom_top':
scrollPos=Math.ceil(( scroll_px_el - reduceDistanceX) * this.speed);
transform.y=-scrollPos;
matrix=this._getTranslateMatrix(this.elProperty.translateObj, { y: -scrollPos });
break;
case 'left_right':
scrollPos=Math.ceil(this.elProperty.distanceRight * scrolled_pc_toTop * this.speed);
transform.x=scrollPos;
matrix=this._getTranslateMatrix(this.elProperty.translateObj, { x: scrollPos });
break;
case 'right_left':
scrollPos=Math.ceil(this.elProperty.distanceLeft * scrolled_pc_toTop * this.speed);
transform.x=-scrollPos;
matrix=this._getTranslateMatrix(this.elProperty.translateObj, { x: -scrollPos });
break;
default:
break;
}
var elInViewport=this._inViewport(this.elProperty.top, this.elProperty.right, this.elProperty.bottom, this.elProperty.left, winTop, winBottom, winLeft, winRight),
transformedInViewport=this._inViewport(this.elProperty.top + transform.y, this.elProperty.right + transform.x, this.elProperty.bottom + transform.y, this.elProperty.left + transform.x, winTop, winBottom, winLeft, winRight);
if(elInViewport||transformedInViewport){
this.el.css($.avia_utilities.supported.transition + 'transform', matrix);
}
this.ticking=false;
this.isTransformed=true;
}};
$.fn.avia_parallax=function(options){
return this.each(function(){
var obj=$(this);
var self=obj.data('aviaParallax');
if(! self){
self=obj.data('aviaParallax', new AviaObjectParallaxElement(options, this) );
}});
};})(jQuery);