var browser = '';
var menu_left = '';

function detect()
{
	var x = navigator;
	browser = x.userAgent;

return browser;
}

function init()
{
	//==========================================================================================
	// if supported, initialize TransMenus
	//==========================================================================================
	// Check isSupported() so tdat menus aren't accidentally sent to non-supporting browsers.
	// tdis is better tdan server-side checking because it will also catch browsers which would
	// normally support tde menus but have javascript disabled.
	//
	// If supported, call initialize() and tden hook whatever image rollover code you need to do
	// to tde .onactivate and .ondeactivate events for each menu.
	//==========================================================================================

	if (TransMenu.isSupported())
		TransMenu.initialize();

}

function createMenu()
{
	if (TransMenu.isSupported())
	{
		if(detect().indexOf('Firefox') != (-1))
			var ms = new TransMenuSet(TransMenu.direction.right, -5, 0, TransMenu.reference.topRight);
		else
			var ms = new TransMenuSet(TransMenu.direction.right, 5, 16, TransMenu.reference.topRight);

		var menu0 = ms.addMenu(document.getElementById("about_us"));
		menu0.addItem("History & Overview", "about_us.html");
		menu0.addItem("Staff & Board", "staff.html");
		menu0.addItem("Employment Opportunities", "employment.html");		

		var menu1 = ms.addMenu(document.getElementById("ara"));
		menu1.addItem("Overview", "affordable_apartments.html");
		menu1.addItem("Housing Development", "housing_developments.html");
		menu1.addItem("Affordable Rental Apartments", "apartment_listings.html");
		menu1.addItem("FAQ", "faq.html");
	

		var menu2 = ms.addMenu(document.getElementById("homes"));
		menu2.addItem("What is AHfS?", "affordable_homes_for_sale.html");
		menu2.addItem("Properties for Sale", "for_sale.html");
		menu2.addItem("Ways to Help", "ahfs_waystohelp.html");		
		
		var menu3 = ms.addMenu(document.getElementById("hbec"));
		menu3.addItem("HBFSC Overview", "home_buyer_education_center.html");
		menu3.addItem("Classes/Counseling", "hbec_classes.html");
		menu3.addItem("Individual Development Accounts", "magic_accounts.html");
		menu3.addItem("Class Schedule & Registration", "hbec_registration.php");
		menu3.addItem("Resources, Partners", "resources.html");
		menu3.addItem("Ways to Help", "hbec_waystohelp.html");		

		var menu4 = ms.addMenu(document.getElementById("res"));
		menu4.addItem("Resident Programs Overview", "resident.html");
		menu4.addItem("REAP", "reap.html");
		menu4.addItem("Resident Services Coordination", "resident_services_coordination.html");		

		var menu5 = ms.addMenu(document.getElementById("news"));
		menu5.addItem("Current Events", "events.html");
		menu5.addItem("Event Registration", "event_registration.php");
		menu5.addItem("News & Publications", "news.html");
		menu5.addItem("Newsletter", "e-news.html");
		menu5.addItem("Archived Events", "events_archived.html");		

		var menu6 = ms.addMenu(document.getElementById("ways"));
		menu6.addItem("Ways to Help Overview", "waystohelp.html");
		menu6.addItem("Make a Donation", "https://secure.jmazedesign.com/~catch/donations.php");		

		var menu7 = ms.addMenu(document.getElementById("contact"));
		menu7.addItem("Contact Info", "contact_us.php");
		menu7.addItem("Directions", "directions.html");		

	TransMenu.renderAll();
	}
}