function menu() {
	$('#menu1').fadeIn(800); // speed
};

function expand() {
	$("#menu1 > li > a[class=]").find("+ ul").slideToggle("medium");
}
		
function collapse() {
	$("#menu1 > li > a[class=]").find("+ ul").slideToggle("medium");
}
function logo() {
	$('#logo').fadeIn(800); // speed
}


$(document).ready(function () {

	// the following show the menu and highlight the active link when the page is active
	$("#menu2 > li[class=page_item page-item-931 current_page_ancestor current_page_parent ] > a").find("+ ul").show();
	$("#menu2 > li[class=page_item page-item-14 current_page_ancestor current_page_parent ] > a").find("+ ul").show();
	$("#menu2 > li[class=page_item page-item-1194 current_page_ancestor current_page_parent ] > a").find("+ ul").show();
	$("#menu2 > li[class=page_item page-item-1116 current_page_ancestor current_page_parent ] > a").find("+ ul").show();
	$("#menu2 > li[class=page_item page-item-2 current_page_ancestor current_page_parent ] > a").find("+ ul").show();
	$("#menu2 > li[class=page_item page-item-2 current_page_ancestor ] > a").find("+ ul").show();
	
	// deactivates click functionality for main navigation items
	$(".menu > .page_item > a").click(function() { return false; });
		
	// Toggle the selected menu's class and expand or collapse the menu
	$("#menu1 > li > a").click(function() {
		$(this).toggleClass("expanded").toggleClass("collapsed").find("+ ul").slideToggle("fast");
	});

	// Toggle the selected menu's class and expand or collapse the menu
	$("#menu2 > li > a").click(function() {
		$(this).toggleClass("expanded").toggleClass("collapsed").find("+ ul").slideToggle("fast");
	});
	
	// time-based events
	setTimeout("menu()",300);
	setTimeout("expand()",1200);
	setTimeout("collapse()",2300); 
	setTimeout("logo()",2500);

});