(function($){
	//code goes here
	$.fn.initAkMenu=function(data){
		//alert($(this).html());
		//alert($(this).children().length);
		$.each($(this).children('li'),function(){
			$(this).children('ul').css('display','none');
			$(this).children('ul').find('ul').css('display','none');
			$(this).children('a').click(toggleMenus);
			$(this).children('ul').find('ul').siblings('a').click(toggleMenus);
		});
		if (window.location.hash) {
		//alert(window.location.hash);
			$(window.location.hash).siblings('a').trigger("click");
			//alert('click');
			$(window.location.hash).parents('li').children('a').trigger("click");
		}
	};
	
	function toggleMenus(){
		
		if($(this).parent().attr('class')!='active')
		{
			//alert('aks');
			//hide all other
			$.each($(this).parent().siblings('li'),function(){
				$(this).find('ul').css('display','none');
				$(this).children('ul').css('display','none');
				$(this).removeClass('active');
				$(this).find('li').removeClass('active');
			});
			
			//alert($(this).attr('href'));
			//alert($(this).children('ul').length);
			$(this).siblings('ul').css('display','block');
			$(this).parent().addClass('active');
		 }
		 else{
		 //alert('act');
		 }
		 //return false;
	}

})(jQuery);	