// JavaScript Document

$(document).ready(function(){


 //Look through all the links in the sidebar
   $("#nav a").filter(function() {

      //Take the current URL and split it into chunks at each slash
      var currentURL = location.pathname.toString().split("/");
	//alert (currentURL);
      //return true if the bit after the last slash is the current page name
      return $(this).attr("href") == currentURL[currentURL.length-1];

    //when the filter function is done, you're left with the links that match.
    }).parent("li").addClass("current");

   //Afterwards, look back through the links. If none of them were marked,
   //mark your default one.
   if($("#nav li").hasClass("current") == false) {
      $("#home-link").addClass("current");
    }

});


