Template:Calgary/General-Code

function emphasizeNavigation() { // -- Highlighting the current page link on the navigation bar --

linkList = document.getElementsByClassName("nav-link");

for(i = 0; i < linkList.length; ++i) { link = linkList[i]; address = link.getAttribute("href"); if (window.location.href.indexOf(address) != -1) { link.classList.add("active"); link.innerHTML = link.textContent + "(current)"; break; } } }

// Adjusts the body so that no content is hidden by the fixed content (navigation bar, etc.) at the top of the page function adjustBody() {

   topMenu = document.getElementById("top_menu_14");

fixedContent = document.getElementById("fixed-content");

   fixedContent.style.top = (topMenu.offsetHeight) + "px";

document.body.style.marginTop = (topMenu.offsetHeight + fixedContent.offsetHeight) + "px"; }

function updateProgressBar() {

 var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
 var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
 var scrolled = (height == 0) ? 0 : (winScroll / height) * 100;
 document.getElementById("bar").value = scrolled;

}