// Syntaxes: *** START EDITING HERE, READ THIS SECTION CAREFULLY! ***
//
// menu[menuNumber][0] = new Menu(Vertical menu? (true/false), 'popout indicator', left, top,
// width, 'mouseover colour', 'background colour', 'border stylesheet', 'text stylesheet');
//
// Left and Top are measured on-the-fly relative to the top-left corner of its trigger, or
// for the root menu, the top-left corner of the page.
//
// menu[menuNumber][itemNumber] = new Item('Text', 'URL', 'target frame', length of menu item,
//  additional spacing to next menu item, number of target menu to popout);
//
// If no target menu (popout) is desired, set it to 0. Likewise, if your site does not use
// frames, pass an empty string as a frame target.
//
// Something that needs explaining - the Vertical Menu setup. You can see most menus below
// are 'true', that is they are vertical, except for the first root menu. The 'length' and
// 'width' of an item depends on its orientation -- length is how long the item runs for in
// the direction of the menu, and width is the lateral dimension of the menu. Just look at
// the examples and tweak the numbers, they'll make sense eventually :).

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 in bulk).
var defOver = '#FFDAB9', defBack = '#FAF0E6';

// Default 'length' of menu items - item height if menu is vertical, width if horizontal.
var CasMenuLeft = 7;
var scLogoDivTop = 25;    
var scLogoDivHeight = 50;
var BibleRefTop = scLogoDivTop + scLogoDivHeight;
var BibleRefHeight = 45 ;
var CasMenutop = BibleRefTop + BibleRefHeight;
var CasMenuWidth = 158;
var defLength = 20;
var CasMenuSpacing = 10;

// Menu 0 is the special, 'root' menu from which everything else arises.
menu[0] = new Array();
// A non-vertical menu with a few different colours and no popout indicator, as an example.
// *** MOVE ROOT MENU AROUND HERE ***  it's positioned at (5, 0) and is 17px high now.
menu[0][0] = new Menu(true, '>', CasMenuLeft, CasMenutop, CasMenuWidth, defOver, defBack, 'itemBorder', 'itemText');
// Notice how the targets are all set to nonzero values...
// The 'length' of each of these items is 40, and there is spacing of 10 to the next item.
// Most of the links are set to '#' hashes, make sure you change them to actual files.
menu[0][1] = new Item('Home', 'http://www.servantcare.com/index.php', '', defLength, CasMenuSpacing, 0);
menu[0][2] = new Item('About Us', 'http://www.servantcare.com/AboutUs/index.php', '', defLength, CasMenuSpacing, 1);
menu[0][3] = new Item('Hospitality Homes', 'http://www.servantcare.com/hospitality/index.php', '', defLength, CasMenuSpacing, 2);
menu[0][4] = new Item('Regional CARE Locations', 'http://www.servantcare.com/regionalCare.php', '', defLength, CasMenuSpacing, 0);
menu[0][5] = new Item('The Dwelling Place', 'http://www.servantcare.com/theDwelling.php', '', defLength, CasMenuSpacing, 0);
//menu[0][4] = new Item('Adopt a Missionary', 'http://www.servantcare.com/adopt/index.php', '', defLength, CasMenuSpacing, 0);
menu[0][6] = new Item('Prayer Shield', 'http://www.servantcare.com/ps.php', '', defLength, CasMenuSpacing, 0);
menu[0][7] = new Item('Resources', 'http://www.servantcare.com/Links/index.php', '', defLength, CasMenuSpacing, 3);
menu[0][8] = new Item('Founder\'s Writings', 'http://www.servantcare.com/scwrite/index.php', '', defLength, CasMenuSpacing, 4);
menu[0][9] = new Item('Photo Album', 'http://www.servantcare.com/photos.php', '', defLength, CasMenuSpacing, 0);
menu[0][10] = new Item('Support Us', 'http://www.servantcare.com/support.php', '', defLength, CasMenuSpacing, 0);

// About Us menu.
menu[1] = new Array();
// The About Us menu is positioned 0px across and 22 down from its trigger, and is 80 wide.
// All text in this menu has the stylesheet class 'item' -- see the <style> section above.
// We've passed a 'greater-than' sign '>' as a popout indicator. Try an image...?
menu[1][0] = new Menu(true, '>', CasMenuWidth, 0, CasMenuWidth, defOver, defBack, 'itemBorder', 'itemText');
menu[1][1] = new Item('Who are We?', 'http://www.servantcare.com/AboutUs/index.php', '', defLength, 0, 0);
menu[1][2] = new Item('Prophet\'s Chamber', 'http://www.servantcare.com/hospitality/pChamber.php', '', defLength, 0, 0);
menu[1][3] = new Item('About our Logo', 'http://www.servantcare.com/AboutUs/aboutLogo.php', '', defLength, 0, 0);
menu[1][4] = new Item('Boards/Founder', 'http://www.servantcare.com/AboutUs/board.php', '', defLength, 0, 0);
// Non-zero target means this will trigger a popout -- menu[4] which is the 'Reopen' menu.
menu[1][5] = new Item('Staff', 'http://www.servantcare.com/AboutUs/scstaff.php', '', defLength, 0, 0);
menu[1][6] = new Item('Beliefs', 'http://www.servantcare.com/AboutUs/creed.php', '', defLength, 0, 0);
menu[1][7] = new Item('Testimonials', 'http://www.servantcare.com/AboutUs/testimonials.php', '', defLength, 0, 0);

// Hospitality Homes menu.
menu[2] = new Array();
menu[2][0] = new Menu(true, '>', CasMenuWidth, 50, CasMenuWidth, defOver, defBack, 'itemBorder', 'itemText');
menu[2][1] = new Item('Policies for Guests', 'http://www.servantcare.com/hospitality/index.php#guest', '', defLength, 0, 0);
menu[2][2] = new Item('Policies for Hosts', 'http://www.servantcare.com/hospitality/index.php#host', '', defLength, 0, 0);
menu[2][3] = new Item('Home Locations', 'http://www.servantcare.com/hospitality/hhList.php', '', defLength, 0, 0);

// Resources menu
menu[3] = new Array();
menu[3][0] = new Menu(true, '>', CasMenuWidth, 0, 150, defOver, defBack, 'itemBorder', 'itemText');
menu[3][1] = new Item('Automobiles', 'http://www.servantcare.com/Links/index.php#a', '', defLength, 0, 0);
menu[3][2] = new Item('Aviation', 'http://www.servantcare.com/Links/index.php#aviation', '', defLength, 0, 0);
menu[3][3] = new Item('Communication', 'http://www.servantcare.com/Links/index.php#com', '', defLength, 0, 0);
menu[3][4] = new Item('Computers', 'http://www.servantcare.com/Links/index.php#computers', '', defLength, 0, 0);
menu[3][5] = new Item('Debriefing/Re-Entry', 'http://www.servantcare.com/Links/index.php#d', '', defLength, 0, 0);
menu[3][6] = new Item('Dental', 'http://www.servantcare.com/Links/index.php#dental', '', defLength, 0, 0);
menu[3][7] = new Item('Encouragement', 'http://www.servantcare.com/Links/index.php#e', '', defLength, 0, 0);
menu[3][8] = new Item('Grief', 'http://www.servantcare.com/Links/index.php#g', '', defLength, 0, 0);
menu[3][9] = new Item('Int. Health Ins.', 'http://www.servantcare.com/Links/index.php#i', '', defLength, 0, 0);
menu[3][10] = new Item('Medical', 'http://www.servantcare.com/Links/index.php#m', '', defLength, 0, 0);
menu[3][11] = new Item('Missionfield Prep/Support', 'http://www.servantcare.com/Links/index.php#mission', '', defLength, 0, 0);
menu[3][12] = new Item('MK Scholarships', 'http://www.servantcare.com/Links/mKSchol.php', '', defLength, 0, 0);
menu[3][13] = new Item('Packing', 'http://www.servantcare.com/Links/index.php#p', '', defLength, 0, 0);
menu[3][14] = new Item('Personal Ministry', 'http://www.servantcare.com/Links/personalMin.php', '', defLength, 0, 0);
menu[3][15] = new Item('Practical Ministry', 'http://www.servantcare.com/Links/index.php#practical', '', defLength, 0, 0);
menu[3][16] = new Item('Resource Providers', 'http://www.servantcare.com/Links/index.php#resource', '', defLength, 0, 0);
menu[3][17] = new Item('Retreat/Furlough', 'http://www.servantcare.com/Links/index.php#retreatFurl', '', defLength, 0, 5);
menu[3][18] = new Item('Free Downloadable Resources', 'http://www.servantcare.com/Links/index.php#free', '', defLength*2, 0, 0);

// Founder's Writings menu
menu[4] = new Array();
menu[4][0] = new Menu(true, '>', 0, 0, 150, defOver, defBack, 'itemBorder', 'itemText');
// These items are lengthier than normal, and have extra spacing due to the fancy borders.
menu[4][1] = new Item('Early ServantCARE', 'http://www.servantcare.com/scwrite/scorig.php', '', defLength, 0, 0);
menu[4][2] = new Item('Why all the Bother?', 'http://www.servantcare.com/scwrite/bother.php', '', defLength, 0, 0);
menu[4][3] = new Item('Hobbyist or the Real Thing?', 'http://www.servantcare.com/scwrite/hobby.php', '', defLength*2, 0, 0);
menu[4][4] = new Item('Short-term Mission Guide', 'http://www.servantcare.com/scwrite/stmhexc.php', '', defLength*2, 0, 0);

// Retreat/Furlough popout
menu[5] = new Array();
menu[5][0] = new Menu(true, '>', 0, 0, 110, defOver, defBack, 'itemBorder', 'itemText');
menu[5][1] = new Item('US', '', '', defLength, 0, 6);
menu[5][2] = new Item('International', 'http://www.servantcare.com/Links/RetreatFurl/internat.php', '', defLength, 0, 0);

// US menu
menu[6] = new Array();
menu[6][0] = new Menu(true, '', 120, 0, 130, defOver, defBack, 'itemBorder', 'itemText');
// These items are lengthier than normal, and have extra spacing due to the fancy borders.
menu[6][1] = new Item('Alabama-Florida', 'http://www.servantcare.com/Links/RetreatFurl/US/AtoF.php', '', defLength, 0, 0);
menu[6][2] = new Item('Georgia-Louisiana', 'http://www.servantcare.com/Links/RetreatFurl/US/GtoL.php', '', defLength, 0, 0);
menu[6][3] = new Item('Maryland-Pennsylvania', 'http://www.servantcare.com/Links/RetreatFurl/US/MtoP.php', '', defLength*2, 0, 0);
menu[6][4] = new Item('South Carolina-Washington', 'http://www.servantcare.com/Links/RetreatFurl/US/StoW.php', '', defLength*2, 0, 0);

// Adopt a Missionary menu
//menu[7] = new Array();
//menu[7][0] = new Menu(true, '>', CasMenuWidth, 50, 150, defOver, defBack, 'itemBorder', 'itemText');
//menu[7][1] = new Item('Available for Adoption', 'http://www.servantcare.com/adopt/meetThornbery_s.pdf', '', defLength, CasMenuSpacing, 0);

// *** OPTIONAL CODE FROM HERE DOWN ***

// These two lines handle the window resize bug in NS4. See <body onResize="...">.
// I recommend you leave this here as otherwise when you resize NS4's width menus are hidden.

var popOldWidth = window.innerWidth;
nsResizeHandler = new Function('if (popOldWidth != window.innerWidth) location.reload()');


// 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);
}


// This is just the moving command for the example.

function moveRoot()
{
 	with(menu[0][0].ref) left = ((parseInt(left) < 100) ? 100 : 5);
}
//  End -->
