/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder_menu4 = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources_menu4 = new Array("button1up_menu4.png");

overSources_menu4 = new Array("button1over_menu4.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo_menu4 = new Array();
subInfo_menu4[1] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//
subInfo_menu4[1][1] = new Array("The Company","http://hearts-choice-opps.com/The-Company.html","");
subInfo_menu4[1][2] = new Array("The Process","http://hearts-choice-opps.com/The_Process.html","");
subInfo_menu4[1][3] = new Array("The Taste!","http://hearts-choice-opps.com/Eating_Great_Jerky.html","");
subInfo_menu4[1][4] = new Array("Compensation Plan","http://hearts-choice-opps.com/CompPlan.html","");


//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset_menu4 = 110;
var ySubOffset_menu4 = 7;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_menu4 = false;
var delay_menu4 = 1000;
totalButtons_menu4 = upSources_menu4.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_menu4; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_menu4[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '_menu4">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '_menu4" class="dropmenu_menu4" ');
		document.write('onMouseOver="overSub_menu4=true;');
		document.write('setOverImg_menu4(\'' + (x+1) + '\',\'_menu4\');"');
		document.write('onMouseOut="overSub_menu4=false;');
		document.write('setTimeout(\'hideSubMenu_menu4(\\\'submenu' + (x+1) + '_menu4\\\')\',delay_menu4);');
		document.write('setOutImg_menu4(\'' + (x+1) + '\',\'_menu4\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo_menu4[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_menu4[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_menu4[x+1][k+1][2] + '">');
			document.write( subInfo_menu4[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_menu4() {
	for ( x=0; x<totalButtons_menu4; x++ ) {
		buttonUp_menu4 = new Image();
		buttonUp_menu4.src = buttonFolder_menu4 + upSources_menu4[x];
		buttonOver_menu4 = new Image();
		buttonOver_menu4.src = buttonFolder_menu4 + overSources_menu4[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg_menu4(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_menu4 + overSources_menu4[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg_menu4(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_menu4 + upSources_menu4[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement_menu4(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft_menu4(id) { 
	var el = getElement_menu4(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_menu4(id) {
	var el = getElement_menu4(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_menu4(objectID,x,y) {
	var el = getElement_menu4(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_menu4(subID, buttonID) {
	hideAllSubMenus_menu4();
	butX = getRealLeft_menu4(buttonID);
	butY = getRealTop_menu4(buttonID);
	moveObjectTo_menu4(subID,butX+xSubOffset_menu4, butY+ySubOffset_menu4);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_menu4() {
	for ( x=0; x<totalButtons_menu4; x++) {
		moveObjectTo_menu4("submenu" + (x+1) + "_menu4",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_menu4(subID) {
	if ( overSub_menu4 == false ) {
		moveObjectTo_menu4(subID,-500, -500);
	}
}



//preload_menu4();

