/* Syntaxes:
 *
 * menu[menuNumber][0] = new Menu('menu ID', left, top, width, 'mouseover colour',
 *'background colour', 'border colour');
 * Left and Top are measured on-the-fly relative to the top-left corner of its trigger.
 *
 * menu[menuNumber][itemNumber] = new Item('Text', 'URL', vertical spacing to next item, 
 *target menu number);
 * If no target menu (popout) is desired, set it to 0. All menus must trace back their
 * targets to the root menu! That is, every menu must be targeted by one item somewhere.
 * Even if you're not writing the root menu, you must still specify its settings here.
 */
var menu = new Array();
// Default colours passed to most menu constructors (just passed to functions, not
// a global variable - makes things easier to change later).
var defOver = '#00C47A', defBack = '#FFFFFF', defBorder = '#00009F';
// Default height of menu items - the spacing to the next item, actually.
var defHeight = 22;
// Menu 0 is the special, 'root' menu from which everything else arises.
menu[0] = new Array();
// Pass a few different colours, as an example.
menu[0][0] = new Menu('rootMenu', 0, 155, 0, '', '', defBorder);
// Notice how the targets are all set to nonzero values...
menu[0][1] = new Item('menu_company', 'http://www.yourfuturehealth.com/company_mission.htm', defHeight, 1);
menu[0][2] = new Item('menu_whytest', 'http://www.yourfuturehealth.com/whytest_general.htm', defHeight, 2);
menu[0][3] = new Item('menu_services', 'http://www.yourfuturehealth.com/services_comparison.htm', defHeight, 3);
menu[0][4] = new Item('menu_saying', 'http://www.yourfuturehealth.com/saying_media.htm', defHeight, 4);
menu[0][5] = new Item('menu_pricing', 'http://www.yourfuturehealth.com/pricing_pricing.htm', defHeight, 5);
menu[0][6] = new Item('menu_partnerships', 'http://www.yourfuturehealth.com/partnerships_stores.htm', defHeight, 6);
menu[0][7] = new Item('menu_resources', 'http://www.yourfuturehealth.com/resources_booksvideos.htm', defHeight, 7);

menu[1] = new Array();
// The File menu is positioned 0px across and 22 down from its trigger, and is 80 wide.
menu[1][0] = new Menu('menu_company', 0, 30, 110, defOver, defBack, defBorder);
menu[1][1] = new Item('Our Mission', 'http://www.yourfuturehealth.com/company_mission.htm', defHeight, 0);
menu[1][2] = new Item('Our Story', 'http://www.yourfuturehealth.com/company_story.htm', defHeight, 0);
menu[1][3] = new Item('Medical Panel', 'http://www.yourfuturehealth.com/company_team.htm', defHeight, 0);
menu[1][4] = new Item('Advisory Board', 'http://www.yourfuturehealth.com/company_advisory.htm', defHeight, 0);
menu[1][5] = new Item('Contact Us', 'http://www.yourfuturehealth.com/company_contact.htm', defHeight, 0);
// Non-zero target means this will trigger a popup.

menu[2] = new Array();
menu[2][0] = new Menu('menu_whytest', 0, 30, 93, defOver, defBack, defBorder);
menu[2][1] = new Item('In General', 'http://www.yourfuturehealth.com/whytest_general.htm', defHeight, 0);
menu[2][2] = new Item('With YFH', 'http://www.yourfuturehealth.com/whytest_yfh.htm', defHeight, 0);

menu[3] = new Array();
menu[3][0] = new Menu('menu_services', 0, 30, 150, defOver, defBack, defBorder);
menu[3][1] = new Item('Service Comparison', 'http://www.yourfuturehealth.com/services_comparison.htm', defHeight, 0);
menu[3][2] = new Item('HealthPrint', 'http://www.yourfuturehealth.com/services_healthprints.htm', defHeight, 0);
menu[3][3] = new Item('Test Only', 'http://www.yourfuturehealth.com/services_testonly.htm', defHeight, 0);
menu[3][4] = new Item('Omega 3 Profile +', 'http://www.yourfuturehealth.com/services_aaepa.htm', defHeight, 0);
menu[3][5] = new Item('Tests Explained', 'http://www.yourfuturehealth.com/services_testsexplained.htm', defHeight, 0);
menu[3][6] = new Item('Symptoms, Illnesses, & Diseases', 'http://www.yourfuturehealth.com/services_symptoms.htm', defHeight, 0);

menu[4] = new Array();
menu[4][0] = new Menu('menu_saying', 0, 30, 113, defOver, defBack, defBorder);
menu[4][1] = new Item('Media', 'http://www.yourfuturehealth.com/saying_media.htm', defHeight, 0);
menu[4][2] = new Item('Doctors', 'http://www.yourfuturehealth.com/saying_doctors.htm', defHeight, 0);
menu[4][3] = new Item('Testimonials', 'http://www.yourfuturehealth.com/saying_testimonials.htm', defHeight, 0);
menu[4][4] = new Item('Customer Comments', 'http://www.yourfuturehealth.com/saying_customer.htm', defHeight, 0);

menu[5] = new Array();
menu[5][0] = new Menu('menu_pricing', 0, 30, 150, defOver, defBack, defBorder);
menu[5][1] = new Item('Pricing', 'http://www.yourfuturehealth.com/pricing_pricing.htm', defHeight, 0);
menu[5][2] = new Item('New Client Registration', 'http://www.yourfuturehealth.com/pricing_registration.htm', defHeight, 0);
menu[5][3] = new Item('Current Client Login', 'http://www.yourfuturehealth.com/pricing_login.htm', defHeight, 0);

menu[6] = new Array();
menu[6][0] = new Menu('menu_partnerships', 0, 30, 150, defOver, defBack, defBorder);
menu[6][1] = new Item('Health Food Stores', 'http://www.yourfuturehealth.com/partnerships_stores.htm', defHeight, 0);
menu[6][2] = new Item('Health Professionals', 'http://www.yourfuturehealth.com/partnerships_professionals.htm', defHeight, 0);
menu[6][3] = new Item('Fitness Centers', 'http://www.yourfuturehealth.com/partnerships_fitness.htm', defHeight, 0);
menu[6][4] = new Item('National', 'http://www.yourfuturehealth.com/partnerships_national.htm', defHeight, 0);

menu[7] = new Array();
menu[7][0] = new Menu('menu_resources', 0, 30, 125, defOver, defBack, defBorder);
menu[7][1] = new Item('Books & Videos', 'http://www.yourfuturehealth.com/resources_booksvideos.htm', defHeight, 0);
menu[7][2] = new Item('FAQs', 'http://www.yourfuturehealth.com/resources_faqs.htm', defHeight, 0);
menu[7][3] = new Item('Statistics', 'http://www.yourfuturehealth.com/resources_statistics.htm', defHeight, 0);
menu[7][4] = new Item('Did You Know?', 'http://www.yourfuturehealth.com/resources_didyouknow.htm', defHeight, 0);

// Now, this next bit of script will write our own custom root menu -- a horizontal
// one, as the defaults are all vertical with borders. Even if you are writing your
// own root menu, you must still specify the names, colours and targets above -- the
// positions are calculated on the fly and hence are ignored.
// Basically, you must duplicate the output of the writeMenus() function. Just work
// from this example.
// Syntax: startDL('id', x, y, width, height, 'visibility', '#background colour or null
//for transparent', '#border colour or null for no border', 'additional properties');
// It returns a string of HTML text comprising the opening tag of a div or layer.
// mouseProps(menu, item) returns the 'onMouseEvent' properties for a specific menu item,
// passed as 'additional properties' to startDL. Just cut and paste below, or allow the
// script to write its own root menu.
// endDL is a variable containing either '</div>' or '</layer>', so add it afterwards.
newRoot = startDL('rootMenu', 0, 0, '100%', 36, 'hidden', '', null, 100, '');
newRoot += startDL('rootMenu1', 0, 120, 87, 36, 'inherit', '', null, 100, mouseProps(0, 1));
newRoot += '<span class="Item"><a href="http://www.yourfuturehealth.com/company_mission.htm"><img border="0" src="http://www.yourfuturehealth.com/images/company_info.jpg" width="87" height="35"></a></span>' + endDL;
newRoot += startDL('rootMenu2', 87, 120, 93, 36, 'inherit', '', null, 100, mouseProps(0, 2));
newRoot += '<span class="Item"><a href="http://www.yourfuturehealth.com/whytest_general.htm"><img border="0" src="http://www.yourfuturehealth.com/images/why_test.jpg" width="93" height="35"></a></span>' + endDL;
newRoot += startDL('rootMenu3', 180, 120, 114, 36, 'inherit', '', null, 100, mouseProps(0, 3));
newRoot += '<span class="Item"><a href="http://www.yourfuturehealth.com/services_comparison.htm"><img border="0" src="http://www.yourfuturehealth.com/images/our_services.jpg" width="114" height="35"></a></span>' + endDL;
newRoot += startDL('rootMenu4', 294, 120, 113, 36, 'inherit', '', null, 100, mouseProps(0, 4));
newRoot += '<span class="Item"><a href="http://www.yourfuturehealth.com/saying_media.htm"><img border="0" src="http://www.yourfuturehealth.com/images/what_people.jpg" width="113" height="35"></a></span>' + endDL;
newRoot += startDL('rootMenu5', 407, 120, 79, 36, 'inherit', '', null, 100, mouseProps(0, 5));
newRoot += '<span class="Item"><a href="http://www.yourfuturehealth.com/pricing_pricing.htm"><img border="0" src="http://www.yourfuturehealth.com/images/order_pricing.jpg" width="79" height="35"></a></span>' + endDL;
newRoot += startDL('rootMenu6', 486, 120, 108, 36, 'inherit', '', null, 100, mouseProps(0, 6));
newRoot += '<span class="Item"><a href="http://www.yourfuturehealth.com/partnerships_stores.htm"><img border="0" src="http://www.yourfuturehealth.com/images/partnerships.jpg" width="108" height="35"></a></span>' + endDL;
newRoot += startDL('rootMenu7', 594, 120, 155, 36, 'inherit', '', null, 100, mouseProps(0, 7));
newRoot += '<span class="Item"><a href="http://www.yourfuturehealth.com/resources_booksvideos.htm"><img border="0" src="http://www.yourfuturehealth.com/images/resources.jpg" width="155" height="35"></a></span>' + endDL;
newRoot += endDL;
// Pass this two strings - the first is HTML to write a custom root menu, or null to
// generate one normally. The second is the popout indicator HTML - try an image...?
// Try writeMenus(null, '<img src="...">'); in your own script.
writeMenus(newRoot, '>');
// This is a quick snippet that captures all clicks on the document and hides the menus
// every time you click. Use if you want.
if (isNS4) document.captureEvents(Event.CLICK);
document.onclick = clickHandle;
function clickHandle(evt) {
if (isNS4) document.routeEvent(evt);
hideAllBut(0);
}
// Show root menu command - place in an onLoad="..." type function if you want.
eval(docObj + menu[0][0].id + styObj + '.visibility = "visible"');
// This is just the moving command for the example.
function moveRoot() {
rM = eval(docObj + menu[0][0].id + styObj);
if (parseInt(rM.top) < 40) rM.top = 40;
else rM.top = 0;
}
