// HIGHLIGHTING NAV WHEN ON PAGE

$(document).ready(function() {
    //Look through all the links in the sidebar
   $("#smoothmenu1 ul li a").filter(function() {
	  
	//Take the current URL and split it into chunks at each slash
	var currentURL = window.location.toString().split("http://");
	var currentURL = currentURL.toString().split("/");
	//alert ($(this).attr("href"));	  
	// alert (currentURL[1]);
	var url = '';
	if(currentURL[1]!= ''){
	url = currentURL[1] + '/'
	}
	//alert (url);
      //return true if the bit after the last slash is the current page name
      return $(this).attr("href") == "/" + url;	  
    //when the filter function is done, you're left with the links that match.
    }).addClass("active");


    //Look through all the links in the sidebar
   $(".footerLinks a").filter(function() {
	  
	//Take the current URL and split it into chunks at each slash
	var currentURL = window.location.toString().split("http://");
	var currentURL = currentURL.toString().split("/");
	//alert ($(this).attr("href"));	  
	// alert (currentURL[1]);
	var url = '';
	if(currentURL[1]!= ''){
	url = currentURL[1] + '/'
	}
	//alert (url);
      //return true if the bit after the last slash is the current page name
      return $(this).attr("href") == "/" + url;	  
    //when the filter function is done, you're left with the links that match.
    }).addClass("active");
});

