// JavaScript Document

/*for navigation NOT in a page wrapper NOT dependent on style classes
This script accepts an id for a container element (ul,p,div,etc.) and runs through each 'a' (link) element inside the container until it finds one that matches the current page url (window.location.href) and underlines it*/

function underlineActive(containerId) {

 var navlist = $(containerId).getElementsByTagName('a');
 
  for (var i=0; i<navlist.length; i++) {
    if (window.location.href == navlist[i].href) {
      navlist[i].style.textDecoration = 'underline';
      navlist[i].style.fontWeight = 'bold';
      break;
    }
  }

} 


