function openTab(evt, links, tabs, tab) {
    links = document.querySelectorAll(links);
    tabs = document.querySelectorAll(tabs);
    tab = document.querySelector(tab);

    var i;
    for (i = 0; i < tabs.length; i++) {
        tabs[i].style.display = "none";
    }
    for (i = 0; i < links.length; i++) {
        links[i].className = links[i].className.replace(" active", "");
    }

    // Show the current tab, and add an "active" class to the button that opened the tab
    tab.style.display = "block";
    if (evt) {
        evt.currentTarget.className += " active";
    }
}

function restoreOpenTab(links, tabs) {
    if (window.location.hash) {
        openTab(null, links, tabs, decodeURI(window.location.hash));
    }
}

@@ -661,34 +661,18 @@
     
-openTab(null, links, tabs,
+var hash =
  dec
@@ -699,16 +699,84 @@
 on.hash)
+.substr(1);%0A        openTab(null, links, tabs, %22%5Bid='%22 + hash + %22'%5D%22
 );%0A    %7D

Fix tab reopening