
$(document).ready(function(){
	
if(document.location.href) 
		hrefString = document.location.href;
else
       hrefString = document.location;

str = hrefString.split('/');
len=str.length;


// updated to handle links that contain directories
// specifically "/tenant/" since thats the only one ATM

$('.menu').find('li a').each(function(i){
	
	if($(this).attr('href') == "/" + str[len-1] || $(this).attr('href') ==  "/tenant/" + str[len-1]){
		val=$(this).attr('rel');
		$('#'+val).css({"color":"#f26300"}); 
		$('#s'+val).css({"color":"#0d69a3"}); 
	}
	
});


// Set the sub (indented) menu
// updated to handle links that contain directories

$(".sidemenu ul").find('ul > li a').each(function(i){
 
  var o = $(this).attr('href').split("/");
  s = o[o.length-1];
  //if($(this).attr('href') == str[len-1]){
  if(s == str[len-1]){
	  val=$(this).attr("id");
   	  $('#'+val).css({"color":"#EB630C"}); 
	 }
});
});