function highlight_subnav(){
	$('#nav .dir li').each(function(){
	  $(this).mouseover(function(){
	    $(this).parents('.dir').children('.parent').addClass("hover");
	  });
	  $(this).mouseout(function(){
	    $(this).parents('.dir').children('.parent').removeClass("hover");
	  });
	});
}

function active_nav(){
  var pathname = window.location.pathname;
  var pages = ["about-us","programs","documents", "meetings", "media-events", "contact", "menufill" ];
	var match = "home";
  //remove the dev name
  pathname = pathname.replace("category", "about-us");
  pathname = pathname.replace("2011", "about-us");  
  pathname = pathname.replace("2012", "about-us"); 
  pathname = pathname.replace("2013", "about-us");
  pathname = pathname.replace("2014", "about-us");
  pathname = pathname.replace("2015", "about-us");
  pathname = pathname.replace("2016", "about-us");
  pathname = pathname.replace("2017", "about-us");
  pathname = pathname.replace("2018", "about-us");
  pathname = pathname.replace("2019", "about-us");
  pathname = pathname.replace("2020", "about-us");
  pathname = pathname.replace("2021", "about-us");
  pathname = pathname.replace("2022", "about-us");
  pathname = pathname.replace("2023", "about-us");
  pathname = pathname.replace("2024", "about-us");
  pathname = pathname.replace("2025", "about-us");
  pathname = pathname.replace("2026", "about-us");
  pathname = pathname.replace("2027", "about-us");
  pathname = pathname.replace("2028", "about-us");
  pathname = pathname.replace("2029", "about-us");
  pathname = pathname.replace("2030", "about-us");
  pathname = pathname.replace("members-area","menufill");
  pathname = pathname.replace("privacy-statement","menufill");
  pathname = pathname.replace("terms","menufill");
  pathname = pathname.replace("in-the-news","media-events");
 
	for(var i in pages) {
	  if(pathname.match(pages[i]) != null) {
			match = pathname.match(pages[i]);
			if(match=="about-us"){
				match = "aboutus";
			}
				
		}
	}	
	
	$('#nav>li').each(function(){
	  var cssClass = $(this).attr('class');	
		var result = cssClass.match(match);
		if (result != null){
			$('#nav .' + result + ' a').addClass("hover");			
		}
	});
}


