var footnote={containnerClass:".articleDetailContainer",spanClass:".footNoteContent",getSections:function(){this.buildFootnote()},buildFootnote:function(){var t="FtnRef",i='<li id="{0}">{1} <a href="#_{2}"><i class="fa fa-caret-square-o-up" aria-hidden="true"><\/i><\/a><\/li><\/br>',r='<sup><a href="#{0}" name="_{2}">[{1}]<\/a><\/sup>',n="",u;$(this.containnerClass+" "+this.spanClass).length>0?($(this.containnerClass+" "+this.spanClass).each(function(u,f){var e=t+(u+1),h=r.replace("{0}",e).replace("{1}",u+1).replace("{2}",e),o,s;$(f).replaceWith(h);o=f.innerText.split(" ");s="";o.forEach(function(n,t){if((n.startsWith("http://")||n.startsWith("https://"))&&!n.startsWith("<a")){var i='<a target="_blank" href="'+n+'" rel="external">'+n+"<\/a>";o[t]=i}s+=o[t]+" "});n=n+i.replace("{0}",e).replace("{1}",s).replace("{2}",e)}),$("#footenoteList ol").append(n)):(u=$("#footNote").parent().attr("id"),$("#footNote").remove())},highlight:function(n){var r=document.getElementById("inputText"),t=r.innerHTML,i=t.indexOf(n);i>=0&&(t=t.substring(0,i)+"<span class='highlight'>"+t.substring(i,i+n.length)+"<\/span>"+t.substring(i+n.length),r.innerHTML=t)},modifyHighlight:function(n){var r=document.getElementById("inputText"),t=r.innerHTML,i=t.indexOf(n);i>=0&&(t=t.substring(0,i)+"<span class='highlight'>"+t.substring(i,i+n.length)+"<\/span>"+t.substring(i+n.length),r.innerHTML=t)}},article={sections:[],getSections:function(){$("h2").each(function(){article.sections.push($(this)[0])});this.moveSections();this.buildSideBar()},moveSections:function(){for(var i,f,n=0;n<this.sections.length;n++){var r=undefined,u=$(this.sections[n]).parent(),t=$(this.sections[n]);u[0].nodeName!=="SECTION"&&(this.sections.length>=n+1&&(r=$(this.sections[n+1])),i=$("<section>").addClass("scrollspy").attr("id","section"+(n+1)),i.insertBefore(u),u.is(r.parent())?(f=t.parent().clone().html(""),t.nextUntil(r).appendTo(f),f.appendTo(i).prepend(t)):(t.parent().nextUntil(r.parent()).appendTo(i),i.prepend(t.parent())))}},buildSideBar:function(){for(var t=$("<ul><\/ul>"),n=0;n<this.sections.length;n++)this.sections[n].parentNode.parentNode.nodeName==="SECTION"?t.append($("<li><\/li>").append($("<a><\/a>").addClass("nav-link").attr("href","#"+this.sections[n].parentNode.parentNode.id).text($(this.sections[n]).text()))):t.append($("<li><\/li>").append($("<a><\/a>").addClass("nav-link").attr("href","#"+this.sections[n].parentNode.id).text($(this.sections[n]).text()))),window.test=this.sections[n];t.appendTo($(".tableContent > .tablebody"));t.clone().appendTo($(".tableContentMobile > .tablebody"))}};$(function(){footnote.getSections();article.getSections()}(jQuery))