/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources = new Array("button1up.png","button2up.png","button3up.png","button4up.png","button5up.png","button6up.png","button7up.png","button8up.png","button9up.png","button10up.png","button11up.png","button12up.png","button13up.png","button14up.png");

overSources = new Array("button1over.png","button2over.png","button3over.png","button4over.png","button5over.png","button6over.png","button7over.png","button8over.png","button9over.png","button10over.png","button11over.png","button12over.png","button13over.png","button14over.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo = new Array();
subInfo[1] = new Array();
subInfo[2] = new Array();
subInfo[3] = new Array();
subInfo[4] = new Array();
subInfo[5] = new Array();
subInfo[6] = new Array();
subInfo[7] = new Array();
subInfo[8] = new Array();
subInfo[9] = new Array();
subInfo[10] = new Array();
subInfo[11] = new Array();
subInfo[12] = new Array();
subInfo[13] = new Array();
subInfo[14] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//
subInfo[1][1] = new Array("City Officials","http://www.fruitcakecity.net/city_officials.htm","");
subInfo[1][2] = new Array("Urban Renewal","http://www.fruitcakecity.net/urban_renewal.htm","");
subInfo[1][3] = new Array("Joe\'s Place","http://www.fruitcakecity.net/joes place.htm","");
subInfo[1][4] = new Array("Parakeets","http://www.fruitcakecity.net/parakeets.htm","");
subInfo[1][5] = new Array("First Dogs","http://www.fruitcakecity.net/first_dogs.htm","");
subInfo[1][6] = new Array("Midi Files","http://www.fruitcakecity.net/midi__files.htm","");

subInfo[2][1] = new Array("Parakeet No. 1","http://www.fruitcakecity.net/littlest_fruitcake.htm","");
subInfo[2][2] = new Array("Parakeet No. 2","http://www.fruitcakecity.net/new_littlest_fruitcake.htm","");
subInfo[2][3] = new Array("Parakeet No. 3","http://www.fruitcakecity.net/brand_new_littlest_fruitcake.htm","");
subInfo[2][4] = new Array("Parakeet No. 4","http://www.fruitcakecity.net/ parakeet_no_4.htm","");

subInfo[3][1] = new Array("Dallas 2003","http://www.fruitcakecity.net/jimmy_buffett_concert_2003.htm","");
subInfo[3][2] = new Array("Irving 2004","http://www.fruitcakecity.net/jimmy_buffett_concert_2004.htm","");
subInfo[3][3] = new Array("Dallas 2006","http://www.fruitcakecity.net/jimmy_buffett_concert_2006.htm","");
subInfo[3][4] = new Array("Frisco 2008","http://www.fruitcakecity.net/jimmy_buffett_concert_2008.htm","");
subInfo[3][5] = new Array("Margaritaville New Orleans","http://www.fruitcakecity.net/margaritaville_new_orleans.htm","");
subInfo[3][6] = new Array("Margaritaville Key West","http://www.fruitcakecity.net/margaritaville_key_west.htm","");
subInfo[3][7] = new Array("Margaritaville Orlando","http://www.fruitcakecity.net/margaritaville_orlando.htm","");
subInfo[3][8] = new Array("Margaritaville Las Vegas","http://www.fruitcakecity.net/margaritaville_las_vegas.htm","");
subInfo[3][9] = new Array("Lulu\'s Place","http://www.fruitcakecity.net/lulu.htm","");

subInfo[4][1] = new Array("Jimmy Buffett","http://www.fruitcakecity.net/jimmy_buffett.htm","");
subInfo[4][2] = new Array("Dylan & the Dead","http://www.fruitcakecity.net/dylan%20and%20the%20dead.htm","");
subInfo[4][3] = new Array("Paul McCartney","http://www.fruitcakecity.net/sir_paul_mccartney.htm","");
subInfo[4][4] = new Array("The Who","http://www.fruitcakecity.net/who.htm","");
subInfo[4][5] = new Array("Eric Clapton","http://www.fruitcakecity.net/eric_clapton.htm","");
subInfo[4][6] = new Array("Rod Stewart","http://www.fruitcakecity.net/rod_stewart.htm","");
subInfo[4][7] = new Array("Eagles","http://www.fruitcakecity.net/eagles.htm","");
subInfo[4][8] = new Array("Simon & Garfunkel","http://www.fruitcakecity.net/simon__garfunkel.htm","");
subInfo[4][9] = new Array("Paul Simon","http://www.fruitcakecity.net/paul_simon.htm","");
subInfo[4][10] = new Array("Everly Brothers","http://www.fruitcakecity.net/everly_brothers.htm","");
subInfo[4][11] = new Array("James Gang","http://www.fruitcakecity.net/james_gang.htm","");
subInfo[4][12] = new Array("Jackson Browne","http://www.fruitcakecity.net/jackson_browne.htm","");
subInfo[4][13] = new Array("Tom Petty","http://www.fruitcakecity.net/tom_petty.htm","");
subInfo[4][14] = new Array("James Taylor","http://www.fruitcakecity.net/james_taylor.htm","");
subInfo[4][15] = new Array("Carlos Santana","http://www.fruitcakecity.net/carlos_santana.htm","");
subInfo[4][16] = new Array("Elton John","http://www.fruitcakecity.net/sir_elton_john.htm","");
subInfo[4][17] = new Array("Billy Joel","http://www.fruitcakecity.net/billy_joel.htm","");
subInfo[4][18] = new Array("Bonnie Raitt","http://www.fruitcakecity.net/bonnie_raitt.htm","");
subInfo[4][19] = new Array("Zappa Plays Zappa","http://www.fruitcakecity.net/zappa_plays_zappa.htm","");
subInfo[4][20] = new Array("Toby Keith","http://www.fruitcakecity.net/toby_keith.htm","");
subInfo[4][21] = new Array("Willie Nelson","http://www.fruitcakecity.net/willie_nelson.htm","");
subInfo[4][22] = new Array("Rascal Flatts","http://www.fruitcakecity.net/rascal_flatts.htm","");
subInfo[4][23] = new Array("Maynard Ferguson","http://www.fruitcakecity.net/maynard_ferguson.htm","");
subInfo[4][24] = new Array("Pearl Jam","http://www.fruitcakecity.net/pearl_jam.htm","");
subInfo[4][25] = new Array("Black Crowes","http://www.fruitcakecity.net/black_crows.htm","");
subInfo[4][26] = new Array("Smashing Pumpkins","http://www.fruitcakecity.net/smashing_pumpkins.htm","");
subInfo[4][27] = new Array("Kiss","http://www.fruitcakecity.net/kiss.htm","");

subInfo[5][1] = new Array("Quatro Gringos","http://www.fruitcakecity.net/quatro_gringos.htm","");
subInfo[5][2] = new Array("The Big Fish","http://www.fruitcakecity.net/big_fish.htm","");
subInfo[5][3] = new Array("Mazatlan Revisted","http://www.fruitcakecity.net/mazatlan_revisted.htm","");
subInfo[5][4] = new Array("Gringo Honeymoon","http://www.fruitcakecity.net/gringo_honeymoon.htm","");
subInfo[5][5] = new Array("Sunset Video","http://www.fruitcakecity.net/mazatlan_sunset.htm","");
subInfo[5][6] = new Array("El Cid","http://www.fruitcakecity.net/el_cid.htm","");
subInfo[5][7] = new Array("Old Town","http://www.fruitcakecity.net/old_town_mazatlan.htm","");
subInfo[5][8] = new Array("High Divers","http://www.fruitcakecity.net/high_divers.htm","");
subInfo[5][9] = new Array("El Faro Lighthouse","http://www.fruitcakecity.net/el_faro_lighthouse.htm","");
subInfo[5][10] = new Array("OP\'s","http://www.fruitcakecity.net/op.htm","");
subInfo[5][11] = new Array("Pulmonias","http://www.fruitcakecity.net/pulmonias.htm","");
subInfo[5][12] = new Array("Manuel","http://www.fruitcakecity.net/manuel.htm","");
subInfo[5][13] = new Array("Consigliore","http://www.fruitcakecity.net/parasailing_with_the_consigliore.htm","");
subInfo[5][14] = new Array("Plaza de la Revolucion","http://www.fruitcakecity.net/plaza_de_la_revolucion.htm","");
subInfo[5][15] = new Array("Plazuela Machado","http://www.fruitcakecity.net/plazuela_machado.htm","");
subInfo[5][16] = new Array("Puerto Viejo","http://www.fruitcakecity.net/puerto_viejo.htm","");
subInfo[5][17] = new Array("Beach","http://www.fruitcakecity.net/beach.htm","");
subInfo[5][18] = new Array("Parasailing","http://www.fruitcakecity.net/parasailing.htm","");
subInfo[5][19] = new Array("Tropical Sunsets","http://www.fruitcakecity.net/tropical_sunsets.htm","");
subInfo[5][20] = new Array("Rob Lamonica","http://www.fruitcakecity.net/rob_lamonica.htm","");
subInfo[5][21] = new Array("Sunset Cruise","http://www.fruitcakecity.net/sunset_cruise.htm","");
subInfo[5][22] = new Array("Stone Island","http://www.fruitcakecity.net/stone_island.htm","");
subInfo[5][23] = new Array("Boats","http://www.fruitcakecity.net/boats.htm","");
subInfo[5][24] = new Array("Tropical Storm","http://www.fruitcakecity.net/tropical_storm.htm","");

subInfo[6][1] = new Array("Daytona","http://www.fruitcakecity.net/daytona.htm","");
subInfo[6][2] = new Array("Destin","http://www.fruitcakecity.net/destin.htm","");
subInfo[6][3] = new Array("Epcot Center","http://www.fruitcakecity.net/epcot_center.htm","");
subInfo[6][4] = new Array("Key West","http://www.fruitcakecity.net/Key West.htm","");
subInfo[6][5] = new Array("Magic Kingdom","http://www.fruitcakecity.net/magic_kingdom.htm","");
subInfo[6][6] = new Array("Panama City","http://www.fruitcakecity.net/panama_city_beach.htm","");
subInfo[6][7] = new Array("Pensacola NAS","http://www.fruitcakecity.net/pensacola_nas.htm","");
subInfo[6][8] = new Array("Universal City","http://www.fruitcakecity.net/universal_studios_theme_parks.htm","");

subInfo[7][1] = new Array("Washington DC","http://www.fruitcakecity.net/washington_dc.htm","");
subInfo[7][2] = new Array("Las Vegas","http://www.fruitcakecity.net/las_vegas.htm","");
subInfo[7][3] = new Array("Mount Vernon","http://www.fruitcakecity.net/mount_vernon.htm","");
subInfo[7][4] = new Array("Vicksburg","http://www.fruitcakecity.net/vicksburg_national_military_park.htm","");
subInfo[7][5] = new Array("Way Out West","http://www.fruitcakecity.net/way_out_west.htm","");
subInfo[7][6] = new Array("Yellowstone & the Tetons","http://www.fruitcakecity.net/yellowstone__the_tetons.htm","");
subInfo[7][7] = new Array("Greer\'s Ferry Lake","http://www.fruitcakecity.net/greers ferry lake.htm","");
subInfo[7][8] = new Array("Sugarloaf Island","http://www.fruitcakecity.net/sugarloaf_island.htm","");
subInfo[7][9] = new Array("New Orleans","http://www.fruitcakecity.net/new_orleans.htm","");
subInfo[7][10] = new Array("Lulu Buffett\'s","http://www.fruitcakecity.net/lulu.htm","");
subInfo[7][11] = new Array("Sam Noble Museum","http://www.fruitcakecity.net/sam_noble_museum.htm","");

subInfo[8][1] = new Array("Kennedy Space Center","http://www.fruitcakecity.net/kennedy_space_center.htm","");
subInfo[8][2] = new Array("US Space & Rocket Museum","http://www.fruitcakecity.net/us space rocket center.htm","");
subInfo[8][3] = new Array("Quark\'s Bar & Grill","http://www.fruitcakecity.net/hilton.htm","");








//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset = 5;
var ySubOffset = 27;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub = false;
var delay = 1000;
totalButtons = upSources.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '" class="dropmenu" ');
		document.write('onMouseOver="overSub=true;');
		document.write('setOverImg(\'' + (x+1) + '\',\'\');"');
		document.write('onMouseOut="overSub=false;');
		document.write('setTimeout(\'hideSubMenu(\\\'submenu' + (x+1) + '\\\')\',delay);');
		document.write('setOutImg(\'' + (x+1) + '\',\'\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo[x+1][k+1][2] + '">');
			document.write( subInfo[x+1][k+1][0] + '</a>');
			document.write('</li>');
		}
		document.write('</ul>');
	}
	document.write('</div>');
}





//*** MAIN BUTTONS FUNCTIONS ***//
// PRELOAD MAIN MENU BUTTON IMAGES
function preload() {
	for ( x=0; x<totalButtons; x++ ) {
		buttonUp = new Image();
		buttonUp.src = buttonFolder + upSources[x];
		buttonOver = new Image();
		buttonOver.src = buttonFolder + overSources[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + overSources[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + upSources[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft(id) { 
	var el = getElement(id);
	if (el) { 
		xPos = el.offsetLeft;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			xPos += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;
		} 
		return xPos;
	} 
} 

// GET Y COORDINATE
function getRealTop(id) {
	var el = getElement(id);
	if (el) { 
		yPos = el.offsetTop;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			yPos += tempEl.offsetTop;
			tempEl = tempEl.offsetParent;
		}
		return yPos;
	}
}

// MOVE OBJECT TO COORDINATE
function moveObjectTo(objectID,x,y) {
	var el = getElement(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu(subID, buttonID) {
	hideAllSubMenus();
	butX = getRealLeft(buttonID);
	butY = getRealTop(buttonID);
	moveObjectTo(subID,butX+xSubOffset, butY+ySubOffset);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus() {
	for ( x=0; x<totalButtons; x++) {
		moveObjectTo("submenu" + (x+1) + "",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu(subID) {
	if ( overSub == false ) {
		moveObjectTo(subID,-500, -500);
	}
}



//preload();

