
function initMenus() {
	
	

	$.each($('ul.dropdown'), function(){
		$(this).css('top', $(this).height()*-1-20);
		$(this).hide();
		
		$.each($(this).find('a'), function(){
			
			var _string = '?pg='+String(activeMenu)
						
			if ($(this).attr('href') == _string){
				$(this).addClass('activeMenu');
				$(this).parent().parent().show();
				$(this).parent().parent().parent().find('a:first').addClass('activeTopMenu');
			}
			
		});

		
	});
	
	/*
	$.each($('ul.menu'), function(){
		var cookie = $.cookie(this.id);
		if(cookie === null || String(cookie).length < 1) {
			$('#' + this.id + '.expandfirst ul:first').show();
		}
		else {			
			$('#' + this.id + ' .' + cookie).next().show();
		}
	});
	*/
	
	$('ul.menu li a').mouseover(
		function() {

			var checkElement = $(this).next();
			var parent = this.parentNode.parentNode.id;
			
			if( checkElement.is(':hidden') ) {

			$('#' + parent + ' ul:visible').fadeOut('normal');
			checkElement.fadeIn('normal');
			
			}
			
			return false;
		}
	).click(function(){trigger('mouseover')});
}
$(document).ready(function() {initMenus();});

