/*! Striking Multiflex * Copyright (c) 2015 Lyon Holding Limited O/A www.thethemebuilders.com */ !function(i,o,d){"use strict";var y=d(i),f=y.height(),p={count:0,started:!1,instances:[],types:{},generateId:function(){return this.count++,this.count},scroll:function(){d.each(p.instances,function(t,e){e.enabled&&(p.types[e.type].scroll(e),d.isFunction(e.options.scroll)&&e.options.scroll.call(e))})},resize:function(){f=y.height(),d.each(p.instances,function(t,e){e.enabled&&(p.types[e.type].resize(e),p.types[e.type].scroll(e),d.isFunction(e.options.resize)&&e.options.resize.call(e))})},start:function(t){this.started||(y.on("scroll.sticker",p.throttle(this.scroll,t)),y.on("orientationchange.sticker resize.sticker",p.throttle(this.resize,t)),this.started=!0)},stop:function(){this.started=!1,y.off(".sticker")},throttle:function(s,i){function o(){c=a(),r=null,l=s.apply(n,p),n=p=null}var n,p,l,a=Date.now||function(){return(new Date).getTime()},r=null,c=0;return function(){var t=a(),e=i-(t-c);return n=this,p=arguments,e<=0?(clearTimeout(r),r=null,c=t,l=s.apply(n,p),n=p=null):r=r||setTimeout(o,e),l}}},n=d.Sticker=function(t,e){this.element=t,this.$element=d(t),this.type=void 0!==e.type?e.type:n.defaults.type,this.options=d.extend({},n.defaults,p.types[this.type].defaults,e),this.enabled=!1,this.sticky=!1;var s=this.options.namespace;this.classes={},this.classes.wrapper=s+"-wrapper",this.classes.enabled=s+"_enabled",this.classes.sticky=s+"_sticky",this.components={},this.init()};n.defaults={namespace:"sticker",type:"top",throttle:"250",init:null,destroy:null,scroll:null,resize:null,enable:null,disable:null,sticky:null,unsticky:null},n.registerType=function(t,e){p.types[t]=e},n.prototype={constructor:n,init:function(){this.id=p.generateId();var t=d("
").addClass(this.classes.wrapper),e=this.$element.attr("id");void 0!==e&&t.attr("id",e+"-"+this.options.namespace+"-wrapper"),this.$element.wrapAll(t),this.$wrapper=this.$element.parent(),p.types[this.type].init(this),d.isFunction(this.options.init)&&this.options.init.call(this),this.enable(),p.instances.push(this),p.start(this.options.throttle)},destroy:function(){for(var t in this.$element.unwrap(),p.instances)p.instances[t].id===this.id&&p.instances.splice(t,1);0===p.instances.length&&p.stop(),d.isFunction(this.options.destroy)&&this.options.destroy.call(this)},enable:function(){this.enabled=!0,p.types[this.type].enable(this),this.$wrapper.addClass(this.classes.enabled),p.types[this.type].scroll(this),d.isFunction(this.options.enable)&&this.options.enable.call(this)},disable:function(){this.enabled=!1,this.sticky=!1,p.types[this.type].disable(this),this.$wrapper.removeClass(this.classes.sticky).removeClass(this.classes.enabled),d.isFunction(this.options.disable)&&this.options.disable.call(this)},on:function(t,e){"string"==typeof t&&"function"==typeof e&&(this.options[t]=e)},off:function(t){"string"==typeof t&&(this.options[t]=null)},set:function(t,e){this.options[t]=e},update:function(){this.enabled&&p.types[this.type].scroll(this)}},n.registerType("top",{defaults:{topSpace:0,check:!0,boxClass:"box-layout",bodyWrapper:".body-wrapper",adminElement:"#wpadminbar",resetTopWrapper:function(t,e){if(""!=t.options.bodyWrapper){var s=d(t.options.bodyWrapper);if(s.length){var i=s[0].getBoundingClientRect().top+parseInt(s.css("border-top-width"));0').appendTo("body"),e=parseInt(i.innerHeight/2,10),s=parseInt((i.getComputedStyle?i.getComputedStyle(t.get(0),null):t.get(0).currentStyle).height,10);return t.remove(),s===e}}),n.registerType("sidebar",{defaults:{topSpace:0,bottom:null,unbottom:null},init:function(t){},scroll:function(t){var e,s=t.options.topSpace,i=y.scrollTop()+s,o=t.$element.outerHeight(),n=t.$parent.height(),p=parseInt(t.$parent.css("border-top-width"),10),l=parseInt(t.$parent.css("padding-top"),10),a=t.$parent.offset().top+p+l,r=t.$element.offset().top-parseInt(t.$element.css("padding-top"),10);!t.sticky&&r