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(menu)
{
	if (TransMenu.isSupported())
	{
		if(detect().indexOf('Firefox') != (-1))
			var ms = new TransMenuSet(TransMenu.direction.right, -12, 0, TransMenu.reference.topRight);
		else
			var ms = new TransMenuSet(TransMenu.direction.right, -12, 5, TransMenu.reference.topRight);

		if(menu == 'default') {	
			var menu1 = ms.addMenu(document.getElementById("agent_insight"));
			menu1.addItem("Web Site System", "agent.php");
			menu1.addItem("Add-ons", "add_on.php");
			menu1.addItem("Email Insight", "email_agent.php");
			menu1.addItem("Product Demo", "insight_demo.php");
			menu1.addItem("Pricing/Order", "https://secure.jmazedesign.com/~mlsinsight/order_online.php");

			var menu2 = ms.addMenu(document.getElementById("office_insight"));
			menu2.addItem("Web Site System", "office.php");
			menu2.addItem("Add-ons", "add_on.php");
			menu2.addItem("Email Insight", "email_office.php");
			menu2.addItem("Product Demo", "insight_demo.php");
			menu2.addItem("Pricing/Order", "https://secure.jmazedesign.com/~mlsinsight/order_online.php");

			/*var menu3 = ms.addMenu(document.getElementById("custom_idx"));
			menu3.addItem("Custom IDX", "custom_idx.php");
			menu3.addItem("Quote Request", "idx_request.php");*/

			var menu4 = ms.addMenu(document.getElementById("buyers_sellers"));
			menu4.addItem("Automated Property Finder", "buyer_information.php");
			menu4.addItem("Register Here", "register.php");

			var menu7 = ms.addMenu(document.getElementById("tech_support"));
			menu7.addItem("Tech FAQs", "tech_support_buyer.php");
			menu7.addItem("Request Form", "request_support.php");
		}
		if(menu == 'customer') {	
			var menu1 = ms.addMenu(document.getElementById("search_alert"));
			menu1.addItem("Manage Saved Listings", "edit_search.php");
			menu1.addItem("Create Search/Alert", "add_new_search.php");
			
			var menu2 = ms.addMenu(document.getElementById("account_settings"));
			menu2.addItem("Edit Profile", "account.php");
			menu2.addItem("Change Password", "change_pass.php");
			
			var menu3 = ms.addMenu(document.getElementById("tech_support"));
			menu3.addItem("Tech FAQs", "tech_support_buyer.php");
			menu3.addItem("Request Form", "request_support.php");
		}
		
		if(menu == 'agent') {	
			var menu1 = ms.addMenu(document.getElementById("additional_features"));
			menu1.addItem("Add an Open House", "oh.php");
			menu1.addItem("Edit an Open House", "edit_vtoh.php?type=oh");
			menu1.addItem("Add a Virtual Tour", "vt.php");
			menu1.addItem("Edit a Virtual Tour", "edit_vtoh.php?type=vt");
			menu1.addItem("Add Comments to a Listing", "comments.php");
			menu1.addItem("Edit Comments to a Listing", "update_comments.php");
			menu1.addItem("Add Sellers Package to a Listing", "sp.php");
			menu1.addItem("Edit Sellers Packages", "edit_sp.php");
			var menu3 = ms.addMenu(document.getElementById("tech_support"));
			menu3.addItem("Getting Started", "start_agent.php");
			menu3.addItem("Tech FAQs", "tech_support.php");
			menu3.addItem("Request Form", "request_support.php");
		}
		if(menu == 'broker') {	
			var menu1 = ms.addMenu(document.getElementById("additional_features"));
			menu1.addItem("Add an Open House", "oh.php");
			menu1.addItem("Edit an Open House", "edit_vtoh.php?type=oh");
			menu1.addItem("Add a Virtual Tour", "vt.php");
			menu1.addItem("Edit a Virtual Tour", "edit_vtoh.php?type=vt");
			menu1.addItem("Add Comments to a Listing", "comments.php");
			menu1.addItem("Edit Comments for a Listing", "update_comments.php");
			menu1.addItem("Add Sellers Package to a Listing", "sp.php");
			menu1.addItem("Edit Sellers Packages", "edit_sp.php");
			var menu3 = ms.addMenu(document.getElementById("tech_support"));
			menu3.addItem("Getting Started", "start_broker.php");
			menu3.addItem("Tech FAQs", "tech_support.php");
			menu3.addItem("Request Form", "request_support.php");
		}
	TransMenu.renderAll();
	}
}