jQuery(document).ready(function($){var fixedHeight=0;var make_sticky=function(){var $sticky_sections=$(".stick-on-top");var offset=0,changes=[];$sticky_sections.each(function(){var $sticky=$(this),$next=$sticky.next(),soffset=$sticky.offset().top,sheight=$sticky.outerHeight();offset+=sheight;if(soffset-fixedHeight>10){changes.push({elem:$sticky,type:"affix",offset:soffset-fixedHeight,top:fixedHeight,margin:-offset})}else{changes.push({elem:$sticky,type:"css",props:{position:"fixed",top:fixedHeight}})}fixedHeight+=sheight;if(!$next.is(".stick-on-top")){changes.push({elem:$next,type:"css",props:{"padding-top":offset}});offset=0}});$(changes).each(function(){if(this.type=="affix"){this.elem.affix({offset:{top:this.offset}}).css({"margin-bottom":this.margin,top:this.top})}else{this.elem.css(this.props)}})};$(window).on("load",make_sticky);$("body").on("click",function(e){var $a=$(e.target);if($a.is("a")){if($a.data("toggle"))return;var href=$a.attr("href");if(href[0]!="#"||href=="#")return;var target=$(href);if(!target.length)target=$("[name="+href.slice(1)+"]");if(target.length){var duration=Math.abs((target.offset().top-fixedHeight-$("html").scrollTop())*.4);if(duration>1e3)duration=1e3;$("html, body").animate({scrollTop:target.offset().top-fixedHeight},duration);return false}}});if($(".float-pos").length){$(window).on("load",function(){$("body").scrollspy({target:".float-pos",offset:fixedHeight+1})})}if($('[data-toggle="gallery"]').length){var $modal=$('
'),$header=$('