function showFootnotes(){$(".footnotes").show();$(".footnotes_toggle").attr("href","javascript:hideFootnotes();").html("Hide Footnotes")}function hideFootnotes(){$(".footnotes").hide();$(".footnotes_toggle").attr("href","javascript:showFootnotes();").html("View Footnotes")}function scrollToHash(){if(location.hash==="#footnotes"){$("#footnotes").removeClass("hidden");showFootnotes();var n=$(".navbar-fixed-top").height(),i=$(this).attr("href"),t=$(location.hash).offset().top-n;$("html,body").stop(!0).animate({scrollTop:t},500,"swing");$("#footnotes").addClass("hidden")}}$(function(){if($(".footnotes").length){$(".article .footnote").html(function(){return"<a class='footnotelink' href='#footnotes'>"+$(this).html()+"<\/a>"});$(".article").find("sup").not(".aside sup").filter(function(){return(this.textContent||this.innerText).match(/([0-9]{1,3}[-,][0-9]{1,3})|(^[0-9]{1,3})/g)}).html(function(){return"<a class='footnotelink' href='#footnotes'>"+$(this).html()+"<\/a>"});$(".footnotes").before("<a id='footnotes' name='footnotes' class='hidden'><\/a>").after("<a class='footnotes_toggle' href='javascript:showFootnotes();'>View Footnotes<\/a>");scrollToHash();$(window).on("hashchange",function(){scrollToHash()});$(".footnotelink").on("click",function(){location.hash!==""&&scrollToHash()})}})