/* Menu file for Fenton's
This menu file will drive the menu options for all Fenton's sites
menu_items = new Array(); lets us populate the menu grid;
menu_items[i] = new Array(); creates the menu item for use;
menu_items[i]['title'] = 'whatever'; says what text will be used with the item;
menu_items[i]['file'] = 'whatever'; purpose two-fold:
	1) the link for that page, i.e. electric will give the url of 'electric.htm?';
	2) the button grouping for that page with hover effect, i.e. 'electric' will use the 'electric' set of buttons;

menu_main = new Array(); sets up the menu options on the main page
menu_main[j] = new Array(); lets us select menu items that belong on the main page;
menu_main[j]['item'] = #; tells the server which menu item to use;
menu_main[j]['top'] = 0; tells the server that there is no button to put in the top page menu
menu_main[j]['bottom'] = 1; tells the server that there is a link for the bottom menu
menu_main[j]['sub_img'] = 'img'; tells the server to substitute a different button set than the default
**** 0 turns the feature on; 1 turns the feature off

menu_electric and menu_lighting are the same as menu_main except that they work for there respective sides
links in menu_main will appear as 'contact.htm?side=all';
links in menu_electric will appear as 'contact.htm?side=electric';
links in menu_lighting will appear as 'contact.htm?side=lights';
*/

menu_items = new Array();

i = 0;
menu_items[i] = new Array();
menu_items[i]['title'] = 'Fenton Brothers\' Electric';
menu_items[i]['file'] = 'electric';

i++; // 1
menu_items[i] = new Array();
menu_items[i]['title'] = 'Fenton\'s Festival of Lights';
menu_items[i]['file'] = 'lights';

i++; // 2
menu_items[i] = new Array();
menu_items[i]['title'] = 'About Us';
menu_items[i]['file'] = 'about';

i++; // 3
menu_items[i] = new Array();
menu_items[i]['title'] = 'Contact Us';
menu_items[i]['file'] = 'contact';

i++; // 4
menu_items[i] = new Array();
menu_items[i]['title'] = 'Find Us';
menu_items[i]['file'] = 'find';

i++; // 5
menu_items[i] = new Array();
menu_items[i]['title'] = 'Vendors';
menu_items[i]['file'] = 'vendors';

i++; // 6
menu_items[i] = new Array();
menu_items[i]['title'] = 'Commercial &amp; Repair';
menu_items[i]['file'] = 'commercial';

i++; // 7
menu_items[i] = new Array();
menu_items[i]['title'] = 'Specials';
menu_items[i]['file'] = 'specials';

i++; // 8
menu_items[i] = new Array();
menu_items[i]['title'] = 'Lamp Shades';
menu_items[i]['file'] = 'shades';

i++; // 9
menu_items[i] = new Array();
menu_items[i]['title'] = 'Home Page';
menu_items[i]['file'] = 'home';

i++; // 10
menu_items[i] = new Array();
menu_items[i]['title'] = 'Tools &amp; Supplies';
menu_items[i]['file'] = 'tools';

i++; // 11
menu_items[i] = new Array();
menu_items[i]['title'] = 'Our Staff';
menu_items[i]['file'] = 'staff';

i++; // 12
menu_items[i] = new Array();
menu_items[i]['title'] = 'Our Showroom';
menu_items[i]['file'] = 'showroom';

i++; // 13
menu_items[i] = new Array();
menu_items[i]['title'] = 'Thomasville Showroom';
menu_items[i]['file'] = 'thomasville';

i++; // 14
menu_items[i] = new Array();
menu_items[i]['title'] = 'Howard Miller Clocks';
menu_items[i]['file'] = 'clocks';

i++; // 15
menu_items[i] = new Array();
menu_items[i]['title'] = 'Art Prints';
menu_items[i]['file'] = 'art';

menu_main = new Array();

j = 0;
menu_main[j] = new Array();
menu_main[j]['item'] = 0; // select menu item # 0
menu_main[j]['top'] = 1; // turn on the button for Fenton Brothers' Electric
menu_main[j]['bottom'] = 1; // turn on the link for Fenton Brothers' Electric

j++;
menu_main[j] = new Array();
menu_main[j]['item'] = 2; // select menu item # 2
menu_main[j]['top'] = 1; // turn on the button for About Us
menu_main[j]['bottom'] = 1; // turn on the link for About Us

j++;
menu_main[j] = new Array();
menu_main[j]['item'] = 4; // select menu item # 4
menu_main[j]['top'] = 1; // turn on the button for Find Us
menu_main[j]['bottom'] = 1; // turn on the link for Find Us

j++;
menu_main[j] = new Array();
menu_main[j]['item'] = 3; // select menu item # 3
menu_main[j]['top'] = 1; // turn on the button for Contact Us
menu_main[j]['bottom'] = 1; // turn on the link for Contact Us

j++;
menu_main[j] = new Array();
menu_main[j]['item'] = 1; // select menu item # 1
menu_main[j]['top'] = 1; // turn on the button for Fenton's Festival of Lights
menu_main[j]['bottom'] = 1; // turn on the link for Fenton's Festival of Lights

menu_electric = new Array();

k = 0;
menu_electric[k] = new Array();
menu_electric[k]['item'] = 0;
menu_electric[k]['top'] = 1;
menu_electric[k]['bottom'] = 1;
menu_electric[k]['sub_img'] = 'home';

k++;
menu_electric[k] = new Array();
menu_electric[k]['item'] = 11;
menu_electric[k]['top'] = 1;
menu_electric[k]['bottom'] = 1;

k++;
menu_electric[k] = new Array();
menu_electric[k]['item'] = 6;
menu_electric[k]['top'] = 1;
menu_electric[k]['bottom'] = 1;

k++;
menu_electric[k] = new Array();
menu_electric[k]['item'] = 10;
menu_electric[k]['top'] = 1;
menu_electric[k]['bottom'] = 1;

k++;
menu_electric[k] = new Array();
menu_electric[k]['item'] = 1;
menu_electric[k]['top'] = 0;
menu_electric[k]['bottom'] = 1;

k++;
menu_electric[k] = new Array();
menu_electric[k]['item'] = 5;
menu_electric[k]['top'] = 1;
menu_electric[k]['bottom'] = 1;

k++;
menu_electric[k] = new Array();
menu_electric[k]['item'] = 2;
menu_electric[k]['top'] = 1;
menu_electric[k]['bottom'] = 1;

k++;
menu_electric[k] = new Array();
menu_electric[k]['item'] = 3;
menu_electric[k]['top'] = 1;
menu_electric[k]['bottom'] = 1;

k++;
menu_electric[k] = new Array();
menu_electric[k]['item'] = 4;
menu_electric[k]['top'] = 1;
menu_electric[k]['bottom'] = 1;

/*
k++;
menu_electric[k] = new Array();
menu_electric[k]['item'] = 7;
menu_electric[k]['top'] = 1;
menu_electric[k]['bottom'] = 1;
*/

menu_lighting = new Array();

l = 0;
menu_lighting[l] = new Array();
menu_lighting[l]['item'] = 1;
menu_lighting[l]['top'] = 1;
menu_lighting[l]['bottom'] = 1;
menu_lighting[l]['sub_img'] = 'home';

l++;
menu_lighting[l] = new Array();
menu_lighting[l]['item'] = 11;
menu_lighting[l]['top'] = 1;
menu_lighting[l]['bottom'] = 1;

l++;
menu_lighting[l] = new Array();
menu_lighting[l]['item'] = 13;
menu_lighting[l]['top'] = 1;
menu_lighting[l]['bottom'] = 1;

l++;
menu_lighting[l] = new Array();
menu_lighting[l]['item'] = 12;
menu_lighting[l]['top'] = 1;
menu_lighting[l]['bottom'] = 1;

l++;
menu_lighting[l] = new Array();
menu_lighting[l]['item'] = 0;
menu_lighting[l]['top'] = 0;
menu_lighting[l]['bottom'] = 1;

l++;
menu_lighting[l] = new Array();
menu_lighting[l]['item'] = 5;
menu_lighting[l]['top'] = 1;
menu_lighting[l]['bottom'] = 1;

l++;
menu_lighting[l] = new Array();
menu_lighting[l]['item'] = 2;
menu_lighting[l]['top'] = 1;
menu_lighting[l]['bottom'] = 1;

l++;
menu_lighting[l] = new Array();
menu_lighting[l]['item'] = 3;
menu_lighting[l]['top'] = 1;
menu_lighting[l]['bottom'] = 1;

l++;
menu_lighting[l] = new Array();
menu_lighting[l]['item'] = 4;
menu_lighting[l]['top'] = 1;
menu_lighting[l]['bottom'] = 1;

/*
l++;
menu_lighting[l] = new Array();
menu_lighting[l]['item'] = 2;
menu_lighting[l]['top'] = 1;
menu_lighting[l]['bottom'] = 1;

l++;
menu_lighting[l] = new Array();
menu_lighting[l]['item'] = 3;
menu_lighting[l]['top'] = 1;
menu_lighting[l]['bottom'] = 1;

l++;
menu_lighting[l] = new Array();
menu_lighting[l]['item'] = 4;
menu_lighting[l]['top'] = 1;
menu_lighting[l]['bottom'] = 1;
*/

// creating the buttons and their actions:
top_menu = new Array();
bottom_menu = new Array();
btn = new Array();

function hvr(obj,ret)
{
	obj.src = ret.src;
}

function make_top_menu(arr)
{
	this_menu = '';
	the_file = '';
	for ( m = 0 ; m < arr.length ; m++ )
	{
		if ( arr[m]['top'] == 0 ) continue;
		btn[m] = new Array();
		btn[m]['nrm'] = new Image();
		btn[m]['hvr'] = new Image();
		if ( arr[m]['sub_img'] != undefined )
		{
			btn[m]['nrm'].src = 'img/btn/' + arr[m]['sub_img'] + '_' + (( menu_item != arr[m]['item'] ) ? 'nrm' : 'act') + '.png';
			btn[m]['hvr'].src = 'img/btn/' + arr[m]['sub_img'] + '_' + (( menu_item != arr[m]['item'] ) ? 'hvr' : 'act') + '.png';
		}
		else
		{
			btn[m]['nrm'].src = 'img/btn/' + menu_items[arr[m]['item']]['file'] + '_' + (( menu_item != arr[m]['item'] ) ? 'nrm' : 'act') + '.png';
			btn[m]['hvr'].src = 'img/btn/' + menu_items[arr[m]['item']]['file'] + '_' + (( menu_item != arr[m]['item'] ) ? 'hvr' : 'act') + '.png';
		}
		if ( arr == menu_main ) current_side = 'all';
		if ( arr == menu_electric ) current_side = 'electric';
		if ( arr == menu_lighting ) current_side = 'festival';
		
		this_menu += '<a href="' + (( menu_items[arr[m]['item']]['file'] != 'home' ) ? menu_items[arr[m]['item']]['file'] : 'index.htm') + '.htm?side=' + current_side + '"><img src="' + btn[m]['nrm'].src + '" title="' + menu_items[arr[m]['item']]['title'] + '" class="topmenu" onmouseover="hvr(btn_' + m + ', btn[' + m + '][\'hvr\']);" onmouseout="hvr(btn_' + m + ', btn[' + m + '][\'nrm\']);" name="btn_' + m + '"></a>';
		the_file += menu_items[arr[m]['item']]['file'] + ' ';
	}
	document.getElementById('top_menu_block').innerHTML = this_menu;
}

function do_top_img()
{
		top_img = '<img src="http://fentonbros.com/img/bnr/fenton';
		top_img2 = '.png" alt="Fenton';
		top_img3 = '" title="Welcome to Fenton';
		if ( side == 'all' )
		{
			use_arr = menu_main;
			top_img += 'sall' + top_img2 + " Brothers' Electric & Fenton's Festival of Lights logo" + top_img3 + "'s\">";
		}
		if ( side == 'electric' )
		{
			use_arr = menu_electric;
			top_img += 'electric' + top_img2 + " Brother' Electric logo" + top_img3 + " Brothers' Electric" + '">';
		}
		if ( side == 'festival' )
		{
			use_arr = menu_lighting;
			top_img += 'lights' + top_img2 + "'s Festival of Lights logo" + top_img3 + "\'s Festival of Lights" + '">';
		}
		document.getElementById('centered').innerHTML += top_img;
}

function jumpgate()
{
	options = new Array();
	
	options[0] = new Array();
	options[0]['action'] = false;
	
	options[1] = new Array();
	options[1]['action'] = true;
	options[1]['title'] = 'Welcome Page';
	options[1]['url'] = 'index.htm';
	
	options[2] = new Array();
	options[2]['action'] = true;
	options[2]['title'] = 'About Us';
	options[2]['url'] = 'about.htm?side=all';
	
	options[3] = new Array();
	options[3]['action'] = true;
	options[3]['title'] = 'Contact Us';
	options[3]['url'] = 'contact.htm?side=all';
	
	options[4] = new Array();
	options[4]['action'] = true;
	options[4]['title'] = 'Find Us';
	options[4]['url'] = 'find.htm?side=all';
	
	n = 5;
	
	choices = '<option>Choose a page</option>';
	choices += '<option style="font-weight: normal; font-style: normal; margin-left: 17px; ">Welcome Page</option>';
	choices += '<option style="font-weight: normal; font-style: normal; margin-left: 17px; ">About Us</option>';
	choices += '<option style="font-weight: normal; font-style: normal; margin-left: 17px; ">Contact Us</option>';
	choices += '<option style="font-weight: normal; font-style: normal; margin-left: 17px; ">Find Us</option>';
	choices += '<optgroup label="Fenton Brothers\'s Electric">';
	
	for ( o = 0 ; o < menu_electric.length ; o++ )
	{
		cur_item = menu_electric[o]['item'];
		if ( ( cur_item == 1 ) || ( cur_item == 3 ) || ( cur_item == 4 ) || ( cur_item == 2 ) ) continue;
		options[n] = new Array();
		options[n]['action'] = true;
		options[n]['title'] = ( cur_item == 0 ) ? 'Home' : menu_items[cur_item]['title'];
		options[n]['url'] = menu_items[cur_item]['file'] + '.htm?side=electric';
		choices += '<option>' + options[n]['title'] + '</option>';
		n++;
	}
	
	choices += '</optgroup><optgroup label="Fenton\'s Festival of Lights">';
	for ( p = 0 ; p < menu_lighting.length ; p++ )
	{
		cur_item = menu_lighting[p]['item'];
		if ( ( cur_item == 0 ) || ( cur_item == 3 ) || ( cur_item == 4 ) || ( cur_item == 2 ) ) continue;
		options[n] = new Array();
		options[n]['action'] = true;
		options[n]['title'] = ( cur_item == 1 ) ? 'Home' : menu_items[cur_item]['title'];
		options[n]['url'] = menu_items[cur_item]['file'] + '.htm?side=festival';
		choices += '<option>' + options[n]['title'] + '</option>';
		n++;
	}
	
	choices += '</optgroup>';
	
	choice_list = '<form name="jumper" style="text-align: right; padding: 8px 25px 0px 0px"><select name="jumpto" onchange="doJump();" style="font-weight: bold; font-style: italic;">' + choices + '</select></form>';
	document.getElementById('bottom_spacer').innerHTML = choice_list;
}

function doJump()
{
	opt_nbr = document.jumper.jumpto.selectedIndex;
	if ( options[opt_nbr]['action'] == true ) location = options[opt_nbr]['url'];
}

function make_bottom_menu(arr)
{
	this_menu = '';
	menu_lvl = 1;
	menu_pos = 0;
	restart = false;
	for ( m = 0 ; m < arr.length ; m++ )
	{
		if ( arr[m]['bottom'] == 0 ) continue;
		if ( ( menu_pos > 0 ) && ( ( menu_pos % 5 ) != 0 ) && ( menu_lvl == 1 ) ) this_menu += ' &nbsp; &mdash; &nbsp; ';
		if ( ( menu_pos > 0 ) && ( ( menu_pos % 6 ) != 0 ) && ( menu_lvl > 1 ) ) this_menu += ' &nbsp; &mdash; &nbsp; ';
		if ( ( ( menu_pos % 5 ) == 0 ) && ( menu_lvl < 2 ) && ( menu_pos > 0 ) )
		{
			this_menu += '<br>';
			menu_lvl++;
			restart = true;
		}
		else if ( ( ( menu_pos % 6 ) == 0 ) && ( menu_pos > 0 ) && ( menu_lvl >= 2 )  && ( use_arr != menu_main ) )
		{
			this_menu += '<br>';
			menu_lvl++;
			restart = true;
		}
		if ( restart )
		{
			menu_pos = 0;
			restart = false;
		}
		if ( arr == menu_main ) current_side = 'all';
		if ( arr == menu_electric ) current_side = 'electric';
		if ( arr == menu_lighting ) current_side = 'festival';
		
		this_menu += '<a href="' + (( menu_items[arr[m]['item']]['file'] != 'home' ) ? menu_items[arr[m]['item']]['file'] : 'index.htm') + '.htm?side=' + current_side + '" class="' + (( menu_item == arr[m]['item'] ) ? 'actlwrlinks' : 'lwrlinks') + '">' + menu_items[arr[m]['item']]['title'] + '</a>';
		menu_pos++;
	}
	
	// Now we'll add our credit card policy:
	credit = '<br><br>~ Both stores are pleased to accept MasterCard, Visa, Discover &amp; American Express ~';

	// We're also going to put in the appropriate copyright message here:
	copy = '<br><br>&copy;1999 - 2008, ';
	store = '';
	if ( ( current_side == 'all' ) || ( current_side == 'electric' ) ) store += "Fenton Brothers' Electric";
	if ( current_side == 'all' ) store += ' &amp; ';
	if ( ( current_side == 'all' ) || ( current_side == 'festival' ) ) store += "Fenton's Festival of Lights";
	copy += store + '<br>235 Ray Avenue NE, New Philadelphia, OH 44663<br>330.343.8858 &nbsp; &mdash; &nbsp; Fax 330.343.6874 &nbsp; &mdash; &nbsp; Toll Free 800.229.8858<br><br>This site best viewed at 1024 x 768 resolution.<br><br><a href="http://www.TwistedGem.com" title="This site designed by Twisted Gemini Web Solutions"><img src="img/logos/twisted.png" alt="Twisted Gemini Web Solutions Logo" style="border: 0px; height: 40px; width: 300px; margin: 10px; "><br><a href="http://www.icra.org" title="Labeled with ICRA" target="otherwin"><img src="img/logos/icra.gif" width="40" height="38" alt="Labeled with ICRA" border="0" hspace="5"></a>';
	document.getElementById('bottom_menu_block').innerHTML = this_menu + credit + copy;
	jumpgate();
}

