function startup()
{
/* 

function: to highlight the menu item, this is done by retieving the 
page currently in the browser, and which link in the navigation matches
the page.

This script requires a class to be added to the css:

selected, as in a.selected:link, a.selected:visted { color: #fff;} - which styles the link

*/

// Start by retrieving the name of the navigation element, in this case a 
// div with an id of 'menu', and if it doesn't exist skip the rest of the script...

var nav = window.document.getElementById('menu');
if(nav != null)
{
  // retrieve the url of the page and clean it up...
  var sloc = window.location.href.toLowerCase().replace('.html','/').replace('//','/');

		
  // retrieve all the links (a href) within the navigation...
  var as = nav.getElementsByTagName('a');

		
  //loop over all the a href links
  for(var i=0; i< as.length;i++) {
		
    // for each link in the loop, remove unwanted data...
    var sAloc = as[i].href.toLowerCase();
    sAloc = sAloc.replace('.html','/').replace('//','/').replace('//','/');

    // check if the current page is the same as this link...
    if(sAloc == sloc) {

      // then we have the current page
      // finally set its class to selected
      
      as[i].className = 'selected';
      
      }
    }
  }
}

startup;





















