

function initMenus() {
	jQuery('ul.menu ul').hide();

	jQuery.each(jQuery('ul.menu'), function(){
		jQuery("li[class*=current_page_item]").parents('ul').show();
		jQuery("li[class*=current_page_item]").children('ul').show();
	});

	//jQuery('ul.menu li:has(ul) a').click(
	//	function() {
	//		var checkElement = jQuery(this).next();
	//		var parent = this.parentNode.parentNode.id;
    //
	//		if(checkElement.is('ul')) {
	//			jQuery(this).next().slideToggle('fast');
	//			return false;
    //
	//			return false;
	//		}
	//	}
	//);
}

jQuery(document).ready(function() {
		// Init Main Menu
		initMenus();

		// Trick to add bgcolor and bgimage to a link
		jQuery("#menu1 a").wrapInner("<span></span>");

		// Used for swapping top small icons
		jQuery.swapImage(".swapImage");

		// Set tooltip
		jQuery("#menu1 li.page-item-21:not(.current_page_item):not(.current_page_parent)").tooltip({	tip: '#tooltip1',
																										position: 'center right',
																										direction: 'right',
																										offset: [0, -45],
																										opacity: 0.96
		});

		jQuery("#menu1 li.page-item-13:not(.current_page_item):not(.current_page_parent)").tooltip({	tip: '#tooltip2',
																										position: 'center right',
																										direction: 'right',
																										offset: [0, -45],
																										opacity: 0.96
		});

		jQuery("#menu1 li.page-item-36:not(.current_page_item):not(.current_page_parent)").tooltip({	tip: '#tooltip3',
																										position: 'center right',
																										direction: 'right',
																										offset: [0, -45],
																										opacity: 0.96
		});

		jQuery("#menu1 li.page-item-6:not(.current_page_item):not(.current_page_parent)").tooltip({		tip: '#tooltip4',
																										position: 'center right',
																										direction: 'right',
																										offset: [0, -45],
																										opacity: 0.96
		});
});