!function($){var t={topSpacing:0,bottomSpacing:0,className:"is-sticky",wrapperClassName:"sticky-wrapper",center:!1,getWidthFrom:"",responsiveWidth:!1},e=$(window),i=$(document),s=[],n=e.height(),r=function(){for(var t=e.scrollTop(),r=i.height(),o=r-n,a=t>o?o-t:0,c=0;c<s.length;c++){var p=s[c],d=p.stickyWrapper.offset().top,l=d-p.topSpacing-a;if(l>=t)null!==p.currentTop&&(p.stickyElement.css("width","").css("position","").css("top",""),p.stickyElement.trigger("sticky-end",[p]).parent().removeClass(p.className),p.currentTop=null);else{var h=r-p.stickyElement.outerHeight()-p.topSpacing-p.bottomSpacing-t-a;0>h?h+=p.topSpacing:h=p.topSpacing,p.currentTop!=h&&(p.stickyElement.css("width",p.stickyElement.width()).css("position","fixed").css("top",h),"undefined"!=typeof p.getWidthFrom&&p.stickyElement.css("width",$(p.getWidthFrom).width()),p.stickyElement.trigger("sticky-start",[p]).parent().addClass(p.className),p.currentTop=h)}}},o=function(){n=e.height();for(var t=0;t<s.length;t++){var i=s[t];"undefined"!=typeof i.getWidthFrom&&i.responsiveWidth===!0&&i.stickyElement.css("width",$(i.getWidthFrom).width())}},a={init:function(e){var i=$.extend({},t,e);return this.each(function(){var e=$(this),n=e.attr("id"),r=n?n+"-"+t.wrapperClassName:t.wrapperClassName,o=$("<div></div>").attr("id",n+"-sticky-wrapper").addClass(i.wrapperClassName);e.wrapAll(o),i.center&&e.parent().css({width:e.outerWidth(),marginLeft:"auto",marginRight:"auto"}),"right"==e.css("float")&&e.css({"float":"none"}).parent().css({"float":"right"});var a=e.parent();a.css("height",e.outerHeight()),s.push({topSpacing:i.topSpacing,bottomSpacing:i.bottomSpacing,stickyElement:e,currentTop:null,stickyWrapper:a,className:i.className,getWidthFrom:i.getWidthFrom,responsiveWidth:i.responsiveWidth})})},update:r,unstick:function(t){return this.each(function(){for(var t=$(this),e=-1,i=0;i<s.length;i++)s[i].stickyElement.get(0)==t.get(0)&&(e=i);-1!=e&&(s.splice(e,1),t.unwrap(),t.removeAttr("style"))})}};window.addEventListener?(window.addEventListener("scroll",r,!1),window.addEventListener("resize",o,!1)):window.attachEvent&&(window.attachEvent("onscroll",r),window.attachEvent("onresize",o)),$.fn.sticky=function(t){return a[t]?a[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void $.error("Method "+t+" does not exist on jQuery.sticky"):a.init.apply(this,arguments)},$.fn.unstick=function(t){return a[t]?a[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void $.error("Method "+t+" does not exist on jQuery.sticky"):a.unstick.apply(this,arguments)},$(function(){setTimeout(r,0)})}(jQuery);