/*! scrollNav - v2.2.0 - 2014-03-14 * http://scrollnav.com * Copyright (c) 2014 James Wilson; Licensed MIT */ (function(s){var t=function(t,e,i,n){if(s(t).length>0){var a=s(t).offset().top;e=n?e:0,s("html:not(:animated),body:not(:animated)").animate({scrollTop:a-i},e)}},e=function(){return window.location.hash},i={classes:{loading:"sn-loading",failed:"sn-failed",success:"sn-active"},defaults:{sections:"h2",subSections:!1,sectionElem:"section",className:"scroll-nav",showHeadline:!0,headlineText:"Scroll To",showTopLink:!0,topLinkText:"Top",fixedMargin:40,scrollOffset:40,animated:!0,speed:500,insertLocation:"insertBefore",arrowKeys:!1,onInit:null,onRender:null,onDestroy:null},_set_body_class:function(t){var e=s("body");"loading"===t?e.addClass(i.classes.loading):"success"===t?e.removeClass(i.classes.loading).addClass(i.classes.success):e.removeClass(i.classes.loading).addClass(i.classes.failed)},_find_sections:function(t){var e=i.settings.sections,n=[];if(i.settings.showTopLink){var a=t.children().first();a.is(e)||n.push(a.nextUntil(e).andSelf())}t.find(e).each(function(){n.push(s(this).nextUntil(e).andSelf())}),i.sections={raw:n}},_setup_sections:function(t){var e=[];s(t).each(function(t){var n=[],a=s(this),o="scrollNav-"+(t+1),l=function(){return 0===t},c=function(){return!a.eq(0).is(i.settings.sections)},r=i.settings.showTopLink&&l()&&c()?i.settings.topLinkText:a.filter(i.settings.sections).text();if(a.wrapAll("<"+i.settings.sectionElem+' id="'+o+'" class="'+i.settings.className+'__section" />'),i.settings.subSections){var d=a.filter(i.settings.subSections);d.length>0&&d.each(function(t){var e=o+"-"+(t+1),l=s(this).text(),c=a.filter(s(this).nextUntil(d).andSelf());c.wrapAll('
'),n.push({id:e,text:l})})}e.push({id:o,text:r,sub_sections:n})}),i.sections.data=e},_tear_down_sections:function(t){s(t).each(function(){var t=this.sub_sections;s("#"+this.id).children().unwrap(),t.length>0&&s(t).each(function(){s("#"+this.id).children().unwrap()})})},_setup_nav:function(t){var e=s("",{"class":i.settings.className+"__heading",text:i.settings.headlineText}),n=s("
",{"class":i.settings.className+"__wrapper"}),a=s("