$(document).ready(function(){
	
	
	$(".menu").click(function(){
    if ($("ul",this).length){        
        if ($("ul",this).css("display") == "none"){
            $(".menu ul").slideUp("fast");
            $("ul", this).slideDown("fast");
         }
     }
  });
  
  
   $(".submenu li a").each(function(){
		var hreflink = $(this).attr("href");
	
		if (hreflink.toLowerCase()==location.href.toLowerCase() || location.href.toLowerCase().search(hreflink.toLowerCase())>=0) {
			//$("ul",$(this).parents("li")).css({"display":"block"});
			$(this).parents("ul").css({"display":"block"});
			$(this).attr({"class":"active"});
		}
  });
});