/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder_4 = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources_4 = new Array("button1up_4.png");

overSources_4 = new Array("button1over_4.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo_4 = new Array();
subInfo_4[1] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//
subInfo_4[1][1] = new Array("George and Martha Washington","Washingtonmovie.htm","");
subInfo_4[1][2] = new Array("James and Dolley Madison","Madisonmovie.htm","");
subInfo_4[1][3] = new Array("Theodore and Edith Roosevelt","TRMovie.htm","");
subInfo_4[1][4] = new Array("Ike and Mamie Eisenhower","EisMovie.htm","");
subInfo_4[1][5] = new Array("Jack and Jackie Kennedy","Kennedymovie.htm","");


//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset_4 = 123;
var ySubOffset_4 = 0;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_4 = false;
var delay_4 = 1000;
totalButtons_4 = upSources_4.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_4; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_4[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '_4">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '_4" class="dropmenu_4" ');
		document.write('onMouseOver="overSub_4=true;');
		document.write('setOverImg_4(\'' + (x+1) + '\',\'_4\');"');
		document.write('onMouseOut="overSub_4=false;');
		document.write('setTimeout(\'hideSubMenu_4(\\\'submenu' + (x+1) + '_4\\\')\',delay_4);');
		document.write('setOutImg_4(\'' + (x+1) + '\',\'_4\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo_4[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_4[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_4[x+1][k+1][2] + '">');
			document.write( subInfo_4[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_4() {
	for ( x=0; x<totalButtons_4; x++ ) {
		buttonUp_4 = new Image();
		buttonUp_4.src = buttonFolder_4 + upSources_4[x];
		buttonOver_4 = new Image();
		buttonOver_4.src = buttonFolder_4 + overSources_4[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg_4(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_4 + overSources_4[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg_4(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_4 + upSources_4[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement_4(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft_4(id) { 
	var el = getElement_4(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_4(id) {
	var el = getElement_4(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_4(objectID,x,y) {
	var el = getElement_4(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_4(subID, buttonID) {
	hideAllSubMenus_4();
	butX = getRealLeft_4(buttonID);
	butY = getRealTop_4(buttonID);
	moveObjectTo_4(subID,butX+xSubOffset_4, butY+ySubOffset_4);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_4() {
	for ( x=0; x<totalButtons_4; x++) {
		moveObjectTo_4("submenu" + (x+1) + "_4",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_4(subID) {
	if ( overSub_4 == false ) {
		moveObjectTo_4(subID,-500, -500);
	}
}



//preload_4();

