
function showtab(tabID) {
    // display content:
    var tabs = getElementsByClassName(document, "tab_content")
    for (var i = 0; i < tabs.length; i++) tabs[i].style.display = "none";
    document.getElementById(tabID).style.display = "block";

    // update tab effect:
    var li_tabs = document.getElementById("tab_" + tabID).parentNode.childNodes;
    for (var i = 0; i < li_tabs.length; i++) if (li_tabs[i].tagName == "LI") li_tabs[i].className = "";
    document.getElementById("tab_" + tabID).className = "current";

    // prevent scrolling off the screen:
    if (document.getElementById("tab_container1").offsetTop) {
        //alert(document.getElementById("tab_container1").offsetTop);
        setTimeout("window.scrollTo(0,document.getElementById(\"tab_container1\").offsetTop-20);",1);
    }
}

function showtab_onload() {
    //update tab effect based on #value in querystring:
    var current_hash = location.href.split("#");
    if (current_hash.length == 2) {
        showtab(current_hash[1]);
    }
}

window.onload = showtab_onload;