$(document).ready(function() {
	// hiding login dialog
	$("#dialog").hide();
	$("#overlay").hide();
	// hiding submenus
	showSubMenu( $("#nav-main > .active").attr("id") );

	// showing the submenu for an active item
	function showSubMenu(sub_class_name) {
		// hiding all
		$(".nav-sub").hide();
		// defining what is needed
		var active_sub_menu = "#subnav > ul[class*='"+sub_class_name+"']";
		// showing what is needed
		$(active_sub_menu).show();
	}
	
	// showing the submenu for an hovered item
	$("#nav-main > li").hover(
		function() {
			showSubMenu( $(this).attr("id") );
			
			/* if ($(this) != $("#nav-main > .active")) {
				$(this).children().addClass("nav_main_hover");
				$(this).children("em").addClass("nav_main_hover_em");
			} */
		}, 
		function() {
			return false;
		}
	);
	
	// fixing PNG problems
	$('img[@src$=.png]').ifixpng();
	
	
});