// JavaScript Document

var menu = document.getElementById("site-nav").getElementsByTagName("a");
var liCurrent = document.getElementById("site-nav").getElementsByTagName("li");
//creates an array out of each "a" element
for(var i=0; i<menu.length; i++) {
    if(menu[i].href == "http://"+window.location.hostname+window.location.pathname) {
    // comparing each href vs this allows for query and hash variables
		var n=liCurrent[i];
		if(n){
			n.className+=n.className?' current':'current';
		}
   // add class of "active" if there is a match
    }
}

var sidenav = document.getElementById("section-nav").getElementsByTagName("a");
var sideliCurrent = document.getElementById("section-nav").getElementsByTagName("li");
//creates an array out of each "a" element
for(var i=0; i<sidenav.length; i++) {
    if(sidenav[i].href == "http://"+window.location.hostname+window.location.pathname) {
    // comparing each href vs this allows for query and hash variables
		var n=sideliCurrent[i];
		if (n){
			n.className+=n.className?' current':'current';
		}
    //    sideliCurrent[i].className="current";
   // add class of "active" if there is a match
    }
}

