// 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.
    }).parents().removeClass('grey_links').addClass("blue_links").closest("ul").parents().addClass("blue_links");

/*
    //Look through all the links in the sidebar
   $("ul.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 != ''){
	url = currentURL[1] + '/'
	}
      //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");

   //Afterwards, look back through the links. If none of them were marked,
   //mark your default one.
	if(($("ul#sddm a").hasClass("active") == false) && ($("ul.footerLinks a").hasClass("active") == false)) {		
		$("ul#sddm li:nth-child(1) a").addClass("active");
	}*/
});

