// JavaScript Document
function getPageName(sPath)
{
  var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
  
  return sPage;
}
function highlightMenuItem() 
{
  var docLinks = document.getElementsByTagName('a');
  var currentPage = getPageName(window.location.pathname);
  if (currentPage == '')
  {
    currentPage = 'index.html';
  } 
  for (i=0; i<docLinks.length; i++)
  {
    var currentLink = getPageName(docLinks[i].href);
    if ( currentPage == currentLink )
    {
      docLinks[i].className = docLinks[i].className.replace(' selected','') + ' selected';
    }
  }
}
$(document).ready(highlightMenuItem);

