
/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder = "images/";
var i=0;

/*** SET BUTTONS' FILENAMES HERE ***/
upSources = new Array("button1up.jpg","button2up.jpg","button3up.jpg","button4up.jpg","button5up.jpg","button6up.jpg","button7up.jpg","button8up.jpg");
overSources = new Array("button1over.jpg","button2over.jpg","button3over.jpg","button4over.jpg","button5over.jpg","button6over.jpg","button7over.jpg","button8over.jpg");

// 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();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//

//Services
//subInfo[2][1] = new Array("Installation","chanServices.php","");


//Topics
subInfo[4][1] = new Array("Corporate Wellness","TopicsCorporate.php","");
subInfo[4][2] = new Array("Diseases and Conditions","TopicsDiseases.php","");
subInfo[4][3] = new Array("General Wellness","TopicsGeneral.php","");
subInfo[4][4] = new Array("Stress Management","TopicsStress.php","");
subInfo[4][5] = new Array("Mental and Emotional Fitness","TopicsMental.php","");
subInfo[4][6] = new Array("Humor, Dance and Music Therapy","TopicsHumor.php","");
subInfo[4][7] = new Array("Physical Fitness","TopicsPhysical.php","");
subInfo[4][8] = new Array("Spiritual Wellness","TopicsSpiritual.php","");



//Schedule
subInfo[2][1] = new Array("Schedule - 2010","Schedule2010.php","");
subInfo[2][2] = new Array("Schedule - 2009","Schedule.php","");
subInfo[2][3] = new Array("Lopez Health and Wellness Fair 2008","WellnessFair.php","");
subInfo[2][4] = new Array("Stress Management","StressManagement.php","");
subInfo[2][5] = new Array("Basketball Tournament","Basketball2008.php","");
subInfo[2][6] = new Array("Chess Tournament","Chess2008.php","");
subInfo[2][7] = new Array("Walk the Talk Series","WalktheTalk.php","");
subInfo[2][8] = new Array("Mountain Trek Series","MountainTrek.php","");

//Tips and Advise
subInfo[5][21] = new Array("Stress management by Johns Hopkins","TipsAdvise3.php","");
subInfo[5][20] = new Array("Handling workplace stress","TipsAdvise1.php","");
subInfo[5][19] = new Array("Wellness is a state of mind","TipsAdvise5.php","");
subInfo[5][18] = new Array("Keeping your brain healthy","TipsAdvise4.php","");
subInfo[5][17] = new Array("Enhancing your well-being","TipsAdvise2.php","");
subInfo[5][16] = new Array("Burning calories in traffic jams","TipsAdvise6.php#1","");
subInfo[5][15] = new Array("Computer & desk stretches","video/office_exercises.pps","");
subInfo[5][14] = new Array("Repetitive Strain Injuries","video/RSI_Presentation.pps","");
subInfo[5][13] = new Array("Fatty Liver","video/fattyliverq.pps","");
subInfo[5][12] = new Array("Cancer Prevention","TipsAdvise7.php","");
subInfo[5][11] = new Array("Must Read","Diary.php","");
subInfo[5][10] = new Array("Stuck on the Couch","TipsAdvise8.php","");
subInfo[5][9] = new Array("A chat with Dr. Devi Shetty (Heart Specialist)","TipsAdvise9.php","");
subInfo[5][8] = new Array("Ken Holtyn Presentation","doc/KenHoltynPresentation.ppt","");
subInfo[5][7] = new Array("Waist, hip size key to predicting health risk","http://www.abs-cbnnews.com/lifestyle/11/13/08/waist-hip-size-key-predicting-health-risk","");
subInfo[5][6] = new Array("Water and Coke","doc/Water and Coke.doc","");
subInfo[5][5] = new Array("HEALTHbeat extra: Is it forgetfulness or dementia?","https://www.health.harvard.edu/healthbeat/HEALTHbeat_072005.htm","");
subInfo[5][4] = new Array("What Doctors Wish You'd Do","TipsAdvise10.php","");
subInfo[5][3] = new Array("10 Commandments for Those Over 60 Years OLD","TipsAdvise11.php","");
subInfo[5][2] = new Array("Be healthy with WATER","TipsAdvise12.php","");
subInfo[5][1] = new Array("Handbook 2010","TipsAdvise13.php","");
subInfo[5][0] = new Array("Tips and Advice","TipsAdvise.php","");

//Photo /& Video 
i=15;
subInfo[6][i-14] = new Array("-Walk The Talk Race to 120 Days Awarding","http://www.lopezwellness.com/gallery/index.php?twg_album=Walk+The+Talk+-+Race+to+120+Days+Awarding","");
subInfo[6][i-13] = new Array("-Walk The Talk June 9, 2009 EDC","http://www.lopezwellness.com/gallery/index.php?twg_album=Walk The Talk June 9, 2009 - EDC","");
subInfo[6][i-12] = new Array("-Walk The Talk May 9, 2009 ELC","http://www.lopezwellness.com/gallery/index.php?twg_album=Walk The Talk May 9, 2009 - ELC","");
subInfo[6][i-11] = new Array("-Walk The Talk March 9, 2009 La Mesa Watershed. Click here","http://www.lopezwellness.com/gallery/index.php?twg_album=Walk The Talk March 9, 2009 - La Mesa Watershed","");
subInfo[6][i-10] = new Array("-Mt. Kanlaon Ocular - March 18 to 21, 2009. Click here","http://www.lopezwellness.com/gallery/index.php?twg_album=Mt.+Kanlaon+0318-0321%2C+2009","");
subInfo[6][i-9] = new Array("-Walk The Talk @ ELC June 21, 2008","http://www.lopezwellness.com/gallery/index.php?twg_album=Walk The Talk @ ELC June 21, 2008","");
subInfo[6][i-8] = new Array("-Mt. Apo Climb May 1, 2, and 3, 2008","http://www.lopezwellness.com/gallery/index.php?twg_album=Mt. Apo Climb - May 1, 2, and 3, 2008","");
subInfo[6][i-7] = new Array("-Walk The Talk @ FPIP May 24, 2008","http://www.lopezwellness.com/gallery/index.php?twg_album=Walk The Talk @ FPIP May 24, 2008","");
subInfo[6][i-6] = new Array("-MERALCO Juniors and Seniors Summer Games","http://www.lopezwellness.com/gallery/index.php?twg_album=MERALCO Juniors and Seniors Summer Games","");
subInfo[6][i-5] = new Array("-Mt. Apo Ocular Visit","http://www.lopezwellness.com/gallery/index.php?twg_album=Mt. Apo Ocular Visit","");
subInfo[6][i-4] = new Array("-Walk the Talk @ Paradise 3","http://www.lopezwellness.com/gallery/index.php?twg_album=Walk the Talk @ Paradise 3","");
subInfo[6][i-3] = new Array("-MERALCOlympics Pawns, Bishops, and Rooks Simul","http://www.lopezwellness.com/gallery/index.php?twg_album=MERALCOlympics Pawns, Bishops, and Rooks Simul","");
subInfo[6][i-2] = new Array("-Mt. Arayat Climb March 1, 2008","http://www.lopezwellness.com/gallery/index.php?twg_album=Mt. Arayat Climb March 1, 2008","");
subInfo[6][i-1] = new Array("-Walk the Talk @ La Mesa Watershed","http://www.lopezwellness.com/gallery/index.php?twg_album=Walk the Talk @ La Mesa Watershed","");


/*
	subInfo[6][i-22] = new Array("Walk the Talk @ Forest Hills","http://www.lopezwellness.com/gallery/index.php?twg_album=Walk the Talk @ Forest Hills","");
subInfo[6][i-21] = new Array("MERALCO CHESS - GM Rosendo Balinas Memorial Cup","http://www.lopezwellness.com/gallery/index.php?twg_album=MERALCO CHESS - GM Rosendo Balinas Memorial Cup","");
subInfo[6][i-20] = new Array("MERALCO vs New Bilibid Prison","http://www.lopezwellness.com/gallery/index.php?twg_album=MERALCO vs New Bilibid Prison","");
subInfo[6][i-19] = new Array("Christmas Chess with a Master","http://www.lopezwellness.com/gallery/index.php?twg_album=Christmas Chess with a Master","");
subInfo[6][i-18] = new Array("MERALCO-TRANSCO Match","http://www.lopezwellness.com/gallery/index.php?twg_album=MERALCO-TRANSCO Match","");
subInfo[6][i-17] = new Array("MERALCO UST Alumni Badminton Fun Cup","http://www.lopezwellness.com/gallery/index.php?twg_album=MERALCO UST Alumni Badminton Fun Cup","");
subInfo[6][i-16] = new Array("MERALCO's Child's Play Chess Match","http://www.lopezwellness.com/gallery/index.php?twg_album=MERALCO's Child's Play Chess Match","");
subInfo[6][i-15] = new Array("MERALCO UST Alumni Badminton Goodwill Games","http://www.lopezwellness.com/gallery/index.php?twg_album=MERALCO UST Alumni Badminton Goodwill Games","");
subInfo[6][i-14] = new Array("MERALCO Halloween Blitz Tournament 2007","http://www.lopezwellness.com/gallery/index.php?twg_album=MERALCO Halloween Blitz Tournament 2007","");
subInfo[6][i-13] = new Array("MERALCO OCTOBERCHESS Blitz Tournament","http://www.lopezwellness.com/gallery/index.php?twg_album=MERALCO OCTOBERCHESS Blitz Tournament","");
subInfo[6][i-12] = new Array("Chess Workshop for MERALCO Children","http://www.lopezwellness.com/gallery/index.php?twg_album=Chess Workshop for MERALCO Children","");
subInfo[6][i-11] = new Array("2007 Badminton Lopez Cup - Champion: MERALCO","http://www.lopezwellness.com/gallery/index.php?twg_album=2007 Badminton Lopez Cup - Champion: MERALCO","");
subInfo[6][i-10] = new Array("Basketball Tournament Championship Game - MERALCO Inter-Dept ","http://www.lopezwellness.com/gallery/index.php?twg_album=Basketball Tournament Championship Game - MERALCO Inter-Dept August 23, 2007","");
subInfo[6][i-9] = new Array("Mt. Pico De Loro Climb","http://www.lopezwellness.com/gallery/index.php?twg_album=Mt. Pico De Loro Climb - June 16, 2007","");
subInfo[6][i-8] = new Array("Walk the Talk @ Paradise-3","http://www.lopezwellness.com/gallery/index.php?twg_album=Walk The Talk - June 9, 2007","");
subInfo[6][i-7] = new Array("Forum on Lifestyle Choices","http://www.lopezwellness.com/gallery/index.php?twg_album=Forum on Lifestyle Choices - Mar. 30, 2007","");
subInfo[6][i-6] = new Array("Walk the Talk @ ELC","http://www.lopezwellness.com/gallery/index.php?twg_album=Walk The Talk - ELC to Nipa Hut - Mar. 17, 2007","");
subInfo[6][i-5] = new Array("Stress Management Kick-off","http://www.lopezwellness.com/gallery/index.php?twg_album=Stress Management Kick-off - March 16, 2007","");
subInfo[6][i-4] = new Array("Chess Exhibition with GM Eugene Torre","http://www.lopezwellness.com/gallery/index.php?twg_album=Chess+Exhibition+with+GM+Eugene+Torre - March+17%2C+2007","");
subInfo[6][i-3] = new Array("Mt. Pulag Climb","http://www.lopezwellness.com/gallery/index.php?twg_album=Mt.+Pulag+Climb - Feb.+15-18%2C+2007","");
subInfo[6][i-2] = new Array("Walk the Talk @ MMLDC ","http://www.lopezwellness.com/gallery/index.php?twg_album=Walk+The+Talk+-+MMLDC+-+Feb.+10%2C+2007","");
subInfo[6][i-1] = new Array("Walk the Talk @ Ateneo De Manila University","http://www.lopezwellness.com/gallery/index.php?twg_album=Walk+The+Talk+Jan.+20%2C+2007","");
*/



//Links

subInfo[7][1] = new Array("4 Must-Eat Foods for Healthy Skin","http://www.realage.com/ct/eat-smart/food-and-nutrition/tip/6357","");
subInfo[7][2] = new Array("Corporate","Links.php#7","");
subInfo[7][3] = new Array("Diseases & Conditions","Links.php#6","");
subInfo[7][4] = new Array("General","Links.php#1","");
subInfo[7][5] = new Array("Mental-Emotional","Links.php#5","");
subInfo[7][6] = new Array("Nutrition & Diet","Links.php#3","");
subInfo[7][7] = new Array("Physical","Links.php#2","");
subInfo[7][8] = new Array("Spiritual","Links.php#4","");


//Health Tools
subInfo[8][1] = new Array("What's New?","http://www.sonnyradio.com/realage3.swf","");
subInfo[8][2] = new Array("BMI Calculator","quickcalc.php","");
subInfo[8][3] = new Array("Calorie Guide by Lifesteps","http://www.lifesteps.com/gm/Atoz/tl/misc/foodpyramid.jsp","");
subInfo[8][4] = new Array("Calorie Plan by Sanirose Orbeta","NutritionCorner.php","");
subInfo[8][5] = new Array("Blood Pressure Chart","BloodPressureChart.php","");
subInfo[8][6] = new Array("Good Charts to know","GoodCharts.php","");

//Partners
//subInfo[4][1] = new Array("1",".php","");
//subInfo[4][2] = new Array("2",".php","");
//subInfo[4][3] = new Array("PLDT","Sub-Link 3","");



//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset = 123;
var ySubOffset = 1;



//*** 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();

