// set up drop downs anywhere in the body of the page. I think the bottom of the page is better..
// but you can experiment with effect on loadtime.
//================================================================================================
// create a set of dropdowns
//================================================================================================
// the first param should always be down, as it is here
//
// The second and third param are the top and left offset positions of the menus from their actuators
// respectively. To make a menu appear a little to the left and bottom of an actuator, you could use
// something like -5, 5
//
// The last parameter can be .topLeft, .bottomLeft, .topRight, or .bottomRight to inidicate the corner
// of the actuator from which to measure the offset positions above. Here we are saying we want the
// menu to appear directly below the bottom left corner of the actuator
//==================================================================================================

if(mtDropDown.isSupported()) {
	var IE = false;
	var ua = navigator.userAgent.toLowerCase();
	var an = navigator.appName;
	
	if(ua.indexOf("gecko") > -1) {
		IE = false;
	} else if(an == "Microsoft Internet Explorer") {
		if(document.getElementById) { IE = true; }
	}
	
	if(IE) {
		var ms = new mtDropDownSet(mtDropDown.direction.down, 0, 0, mtDropDown.reference.bottomLeft);
	} else {
		var ms = new mtDropDownSet(mtDropDown.direction.down, 0, 0, mtDropDown.reference.bottomLeft);
	}

//==================================================================================================
// create a dropdown menu
//==================================================================================================
// the first parameter should be the HTML element which will act actuator for the menu
//==================================================================================================
// Use a '#' to represent no URL

	var menu1 = ms.addMenu(document.getElementById("health"));
	menu1.addItem("Stress Relief", "/stress_relief.htm", false);
	menu1.addItem("Healthy Sleep", "/healthy_sleep.htm", false);
	menu1.addItem("Pain Management", "/pain_management.htm", false);

//==================================================================================================
//==================================================================================================
// add a sub-menu
//==================================================================================================
// to add a sub menu to an existing menu object, call it's addMenu method and pass it the item from
// the parent menu which should act as it's actuator. To add a submenu to the fourth item of a menu
// called "theMenu", you would do theMenu.addMenu(theMenu.items[3])
//==================================================================================================

	var menu2 = ms.addMenu(document.getElementById("lifestyle"));
	menu2.addItem("Entertainment / Party Ideas", "/entertainment_party_ideas.htm", false);
	menu2.addItem("Family Time", "/family_time.htm", false);
	
	var menu3 = ms.addMenu(document.getElementById("gettingstarted"));
	menu3.addItem("What&#8217;s Involved", "/whats_involved.htm", false);
	menu3.addItem("Schedule a Site Visit", "/schedule_a_site_visit.htm", false);
	menu3.addItem("Financing", "/financing.htm", false);
	menu3.addItem("Energy Use", "/energy_use.htm", false);
	
	var menu4 = ms.addMenu(document.getElementById("location"));
	menu4.addItem("Jamison, PA", "/location_1.htm", false);
	menu4.addItem("Exton, PA", "/location_2.htm", false);
	menu4.addItem("West Berlin, NJ", "/location_3.htm", false);
	
	var menu5 = ms.addMenu(document.getElementById("care"));
	menu5.addItem("Spa Care", "/spa_care.htm", false);
	menu5.addItem("Helpful Resources", "/links.htm", false);


//==================================================================================================
// write drop downs into page
//==================================================================================================
// this method writes all the HTML for the menus into the page with document.write(). It must be
// called within the body of the HTML page.
//==================================================================================================

	mtDropDown.renderAll();
}