function getSticky(t){function n(){$(window).scrollTop()>r.top?(e.addClass(i),o.css("margin-top",s)):(e.removeClass(i),o.css("margin-top","0"))}var e=t,i="sticky",o=$("body"),s=e.outerHeight(!0),r=e.offset();n(),$(window).scroll(function(){n()})}"function"!=typeof Object.create&&(Object.create=function(t){function n(){}return n.prototype=t,new n}),function(t,n){"use strict";var e={init:function(e,i){this.options=t.extend({},t.fn.singlePageNav.defaults,e),this.container=i,this.$container=t(i),this.$links=this.$container.find("a"),""!==this.options.filter&&(this.$links=this.$links.filter(this.options.filter)),this.$window=t(n),this.$htmlbody=t("html, body"),this.$links.on("click.singlePageNav",t.proxy(this.handleClick,this)),this.didScroll=!1,this.checkPosition(),this.setTimer()},handleClick:function(e){var i=this,o=e.currentTarget,s=t(o.hash);e.preventDefault(),s.length&&(i.clearTimer(),"function"==typeof i.options.beforeStart&&i.options.beforeStart(),i.setActiveLink(o.hash),i.scrollTo(s,function(){var t=n.location.pathname+n.location.search;i.options.updateHash&&history.pushState&&history.pushState(null,null,t+o.hash),i.setTimer(),"function"==typeof i.options.onComplete&&i.options.onComplete()}))},scrollTo:function(t,n){var e=this,i=e.getCoords(t).top,o=!1;e.$htmlbody.stop().animate({scrollTop:i},{duration:e.options.speed,easing:e.options.easing,complete:function(){"function"!=typeof n||o||n(),o=!0}})},setTimer:function(){var t=this;t.$window.on("scroll.singlePageNav",function(){t.didScroll=!0}),t.timer=setInterval(function(){t.didScroll&&(t.didScroll=!1,t.checkPosition())},250)},clearTimer:function(){clearInterval(this.timer),this.$window.off("scroll.singlePageNav"),this.didScroll=!1},checkPosition:function(){var t=this.$window.scrollTop(),n=this.getCurrentSection(t);null!==n&&this.setActiveLink(n)},getCoords:function(t){return{top:Math.round(t.offset().top)-this.options.offset}},setActiveLink:function(t){var n=this.$container.find("a[href$='"+t+"']");n.hasClass(this.options.currentClass)||(this.$links.removeClass(this.options.currentClass),n.addClass(this.options.currentClass))},getCurrentSection:function(n){var e,i,o,s;for(e=0;e=o.top-this.options.threshold&&(s=i));return s||(0===this.$links.length?null:this.$links[0].hash)}};t.fn.singlePageNav=function(t){return this.each(function(){var n=Object.create(e);n.init(t,this)})},t.fn.singlePageNav.defaults={offset:0,threshold:120,speed:400,currentClass:"current",easing:"swing",updateHash:!1,filter:"",onComplete:!1,beforeStart:!1}}(jQuery,window,document);var bwrkOnepageNav=$(".tx-bwrk-onepage-menu");$(document).ready(function(){bwrkOnepageNav.each(function(){var t=$(this),n=t.attr("data-offset"),e=t.attr("data-threshold"),i=t.attr("data-scroll-speed"),o=t.attr("data-update-hash"),s=0;n&&(s=parseInt(n));var r=120;e&&(r=parseInt(e));var a=0;i&&(a=parseInt(i));var l=!1;void 0!=o&&(l=!0),t.singlePageNav({offset:s,threshold:r,speed:a,currentClass:"bwrk-onepage-current",updateHash:l,filter:":not(.bwrk-onepage-external)"})})}),$(window).on('load', function(){bwrkOnepageNav.each(function(){var t=$(this),n=t.attr("data-sticky");void 0!=n&&getSticky(t)})});