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

/*** SET BUTTONS' FILENAMES HERE ***/
upSources_menu2 = new Array("button1up_menu2.png","button2up_menu2.png","button3up_menu2.png","button4up_menu2.png","button5up_menu2.png");

overSources_menu2 = new Array("button1over_menu2.png","button2over_menu2.png","button3over_menu2.png","button4over_menu2.png","button5over_menu2.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo_menu2 = new Array();
subInfo_menu2[1] = new Array();
subInfo_menu2[2] = new Array();
subInfo_menu2[3] = new Array();
subInfo_menu2[4] = new Array();
subInfo_menu2[5] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//
subInfo_menu2[1][1] = new Array("William J. Clinton Library (July 4, 2009)","Clinton.htm","");
subInfo_menu2[1][2] = new Array("George Bush","BushLib.html","");
subInfo_menu2[1][3] = new Array("Adams","Adams.html","");
subInfo_menu2[1][4] = new Array("Herbert Hoover","Hooverfest.html","");
subInfo_menu2[1][5] = new Array("Jimmy Carter","Carter.html","");
subInfo_menu2[1][6] = new Array("Gerald Ford","Ford.html","");

subInfo_menu2[2][1] = new Array("Florida","FlLib.htm","");
subInfo_menu2[2][2] = new Array("North Carolina","NCLib.htm","");
subInfo_menu2[2][3] = new Array("New Jersey","NJLib.htm","");
subInfo_menu2[2][4] = new Array("Illinois/Wisconsin","ILLib.htm","");
subInfo_menu2[2][5] = new Array("Indiana","INLib.htm","");
subInfo_menu2[2][6] = new Array("Ohio","OHLib.htm","");
subInfo_menu2[2][7] = new Array("Connecticut","CTLib.htm","");

subInfo_menu2[3][1] = new Array("Celebrity","Cele.htm","");
subInfo_menu2[3][2] = new Array("Princess","Princess.htm","");

subInfo_menu2[4][1] = new Array("For Middle-hign school age students","Homeschool.html","");

subInfo_menu2[5][1] = new Array("Retirement Communities have used our programs to generate business","Marketing.html","");
subInfo_menu2[5][2] = new Array("Franciscan Communities","Franciscan.htm","");
subInfo_menu2[5][3] = new Array("","");


//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset_menu2 = 123;
var ySubOffset_menu2 = 0;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_menu2 = false;
var delay_menu2 = 1000;
totalButtons_menu2 = upSources_menu2.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_menu2; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_menu2[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '_menu2">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '_menu2" class="dropmenu_menu2" ');
		document.write('onMouseOver="overSub_menu2=true;');
		document.write('setOverImg_menu2(\'' + (x+1) + '\',\'_menu2\');"');
		document.write('onMouseOut="overSub_menu2=false;');
		document.write('setTimeout(\'hideSubMenu_menu2(\\\'submenu' + (x+1) + '_menu2\\\')\',delay_menu2);');
		document.write('setOutImg_menu2(\'' + (x+1) + '\',\'_menu2\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo_menu2[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_menu2[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_menu2[x+1][k+1][2] + '">');
			document.write( subInfo_menu2[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_menu2() {
	for ( x=0; x<totalButtons_menu2; x++ ) {
		buttonUp_menu2 = new Image();
		buttonUp_menu2.src = buttonFolder_menu2 + upSources_menu2[x];
		buttonOver_menu2 = new Image();
		buttonOver_menu2.src = buttonFolder_menu2 + overSources_menu2[x];
	}
}

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

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



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

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

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_menu2(subID, buttonID) {
	hideAllSubMenus_menu2();
	butX = getRealLeft_menu2(buttonID);
	butY = getRealTop_menu2(buttonID);
	moveObjectTo_menu2(subID,butX+xSubOffset_menu2, butY+ySubOffset_menu2);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_menu2() {
	for ( x=0; x<totalButtons_menu2; x++) {
		moveObjectTo_menu2("submenu" + (x+1) + "_menu2",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_menu2(subID) {
	if ( overSub_menu2 == false ) {
		moveObjectTo_menu2(subID,-500, -500);
	}
}



//preload_menu2();

