/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder_hga2main = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources_hga2main = new Array("button1up_hga2main.png","button2up_hga2main.png","button3up_hga2main.png","button4up_hga2main.png");

overSources_hga2main = new Array("button1over_hga2main.png","button2over_hga2main.png","button3over_hga2main.png","button4over_hga2main.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo_hga2main = new Array();
subInfo_hga2main[1] = new Array();
subInfo_hga2main[2] = new Array();
subInfo_hga2main[3] = new Array();
subInfo_hga2main[4] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//
subInfo_hga2main[1][1] = new Array("Dan Rocco","DanRocco.html","");
subInfo_hga2main[1][2] = new Array("Frank DeLaMarre","Frank.html","");





//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset_hga2main = 132;
var ySubOffset_hga2main = 0;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_hga2main = false;
var delay_hga2main = 1000;
totalButtons_hga2main = upSources_hga2main.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_hga2main; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_hga2main[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '_hga2main">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '_hga2main" class="dropmenu_hga2main" ');
		document.write('onMouseOver="overSub_hga2main=true;');
		document.write('setOverImg_hga2main(\'' + (x+1) + '\',\'_hga2main\');"');
		document.write('onMouseOut="overSub_hga2main=false;');
		document.write('setTimeout(\'hideSubMenu_hga2main(\\\'submenu' + (x+1) + '_hga2main\\\')\',delay_hga2main);');
		document.write('setOutImg_hga2main(\'' + (x+1) + '\',\'_hga2main\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo_hga2main[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_hga2main[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_hga2main[x+1][k+1][2] + '">');
			document.write( subInfo_hga2main[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_hga2main() {
	for ( x=0; x<totalButtons_hga2main; x++ ) {
		buttonUp_hga2main = new Image();
		buttonUp_hga2main.src = buttonFolder_hga2main + upSources_hga2main[x];
		buttonOver_hga2main = new Image();
		buttonOver_hga2main.src = buttonFolder_hga2main + overSources_hga2main[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg_hga2main(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_hga2main + overSources_hga2main[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg_hga2main(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_hga2main + upSources_hga2main[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement_hga2main(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft_hga2main(id) { 
	var el = getElement_hga2main(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_hga2main(id) {
	var el = getElement_hga2main(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_hga2main(objectID,x,y) {
	var el = getElement_hga2main(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_hga2main(subID, buttonID) {
	hideAllSubMenus_hga2main();
	butX = getRealLeft_hga2main(buttonID);
	butY = getRealTop_hga2main(buttonID);
	moveObjectTo_hga2main(subID,butX+xSubOffset_hga2main, butY+ySubOffset_hga2main);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_hga2main() {
	for ( x=0; x<totalButtons_hga2main; x++) {
		moveObjectTo_hga2main("submenu" + (x+1) + "_hga2main",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_hga2main(subID) {
	if ( overSub_hga2main == false ) {
		moveObjectTo_hga2main(subID,-500, -500);
	}
}



//preload_hga2main();


