/***********************************************
* Image w/ description tooltip- By Dynamic Web Coding 
* Copyright 2002-2007 by Sharon Paine
***********************************************/

/* IMPORTANT: Put script after tooltip div or 
	 put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;

var origWidth, origHeight;

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 218;
var offX= 20;	// how far from mouse to show tip
var offY= 12; 
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#DDECFF"; 
var tipBorderColor= "#CCCCCC";
var tipBorderWidth= 1;
var tipBorderStyle= "ridge";
var tipPadding= 8;

// tooltip content goes here (image, description, optional bgColor, optional textcolor)
var messages = new Array();
// multi-dimensional arrays containing: 
// image and text for tooltip
// optional: bgColor and color to be sent to tooltip
messages[0] = new Array('BDB_PLM/cunanan.jpg','',"#FFFFFF");
messages[1] = new Array('BDB_PLM/dejesus_masheryl.jpg','',"#FFFFFF");
messages[2] = new Array('BDB_PLM/dalit_jr.jpg','',"#FFFFFF");
messages[3] = new Array('BDB_PLM/fernandez_rhodora.jpg','',"#FFFFFF");
messages[4] = new Array('BDB_PLM/mira_ellaine.jpg','',"#FFFFFF");
messages[5] = new Array('BDB_PLM/monje_karen.jpg','',"#FFFFFF");
messages[6] = new Array('BDB_PLM/obama_emmanuel.jpg','',"#FFFFFF");
messages[7] = new Array('BDB_PLM/papillero_paulo.jpg','',"#FFFFFF");
messages[8] = new Array('BDB_PLM/rabago_ann.jpg','',"#FFFFFF");
messages[9] = new Array('BDB_PLM/umali_winnie.jpg','',"#FFFFFF");
messages[10] = new Array('BDB_PLM/avila_mariel.jpg','',"#FFFFFF");
messages[11] = new Array('BDB_PLM/bunoan_janis.jpg','',"#FFFFFF");
messages[12] = new Array('BDB_PLM/deleon_pinky.jpg','',"#FFFFFF");
messages[13] = new Array('BDB_PLM/genebago_marcos.jpg','',"#FFFFFF");
messages[14] = new Array('BDB_PLM/liao_deborah.jpg','',"#FFFFFF");
messages[15] = new Array('BDB_PLM/motos_jefrey.jpg','',"#FFFFFF");
messages[16] = new Array('BDB_PLM/obias_michelle.jpg','',"#FFFFFF");
messages[17] = new Array('BDB_PLM/raagas_dyan.jpg','',"#FFFFFF");
messages[18] = new Array('BDB_PLM/sabularce_joey.jpg','',"#FFFFFF");
messages[19] = new Array('BDB_PLM/sanches_mary.jpg','',"#FFFFFF");
messages[20] = new Array('BDB_PLM/anicete_andrew.jpg','ANDREW ANICETE is from Cavite. He is the third of 8 children in the family. The meager income from the hardware which his father keeps is not sufficient to sustain the schooling of his siblings the youngest of whom is still in the elementary. As a one time President of, the BMS, he finds time to help other face the demands of a medical student. The scholarship will help him make his dream come true to serve as a doctor to the barrio.',"#FFFFFF");
messages[21] = new Array('BDB_PLM/bocajes_rodney.jpg','RODNEY R. BONCAJES is the eldest of 3 children. His mother worked as a caregiver abroad but passed away last year due to cervical cancer. His father has stopped working when the company he worked for closed down and his father has a heart problem. Relatives who use to help Rodney in his studies have their own families thus the BDB program is a great help for him to finish his medical studies.',"#FFFFFF");
messages[22] = new Array('BDB_PLM/casuga_mark.jpg','GABRIEL MARK L. CASUGA is being financed by his father, in his medical studies who also helps him raise his two-year old son thus the father’s income is not sufficient especially with the rising cost of tuition fees and other living expenses. He is grateful for the assistance from First Gentleman’s foundation that allows medical students like him achieve their dream to become a doctor and eventually help alleviate the health problems of the country by providing dedicated doctors to serve where there are no doctors.',"#FFFFFF");
messages[23] = new Array('BDB_PLM/comia_angeli.jpg','ANGELI A. COMIA was an SK Chairwoman and was very active in helping the community of Bgy Majadaot Laguna where there is no doctor. This helped her get a free education at UPLB and enjoy a temporary financial assistance from the Mayor. Her family’s properties were sequestered. Her parents believe that education is the only legacy they could impart to Angeli, hence they work each day to support her needs. She is forever grateful to the help that the FG Foundation can extend to an aspiring doctor like her. She says, her heart belongs to the entire Filipino nation.',"#FFFFFF");
messages[24] = new Array('BDB_PLM/crisostomo_maria.jpg','MARIA VINNA N. CRISOSTOMO is interested in community health which was honed when she took a course in Public Health. She looks forward to serve in communities outside Manila such as Bulacan, Nueva Ecija and Quezon provinces. The father is a construction worker abroad and this allows her and her younger sister to continue their studies. The scholarship will certainly alleviate the financial burden that they are experiencing.',"#FFFFFF");
messages[25] = new Array('BDB_PLM/cuartero_evangeline.jpg','EVANGELINE CUARTERO is a single mom with two children and is being supported mainly by her father who keeps a laundry store. The earnings are just sufficient to sustain their daily needs. Though her life is full of ups and down she believes that she can surpass them all. If she finishes her medical studies, she will be a loyal public servant. ',"#FFFFFF");
messages[26] = new Array('BDB_PLM/deniega_rowell.jpg','ROWELL O. DENIEGA is an orphan and have depended for financial support from his older brother and sister. After two years in med school their finances have been depleted hence he went on LOA for one year to earn for his third year level. As a medical clerk the support coming from a sister is not sufficient and is a threat for him to continue his studies. He prefers to serve in Batangas, Laguna and Cagayan where he was a councilor in high school.',"#FFFFFF");
messages[27] = new Array('BDB_PLM/elloran_mae.jpg','FRANZI MAE B. ELLORAN hails from Negros and would want to go back and serve this province. She plans to take her residency training there since there are several depressed areas in Bacolod. As a scholar she will return the favor to help the less fortunate countrymen particularly in that area. Her parents are both unemployed thus being selected as a scholar of the FGF is truly a blessing since this will help fulfill her plans to serve in the country.',"#FFFFFF");
messages[28] = new Array('BDB_PLM/placido_jenny.jpg','JENNYLEEN P. PLACIDO is the eldest of 5 children. She has lived independently from her mother who was a widow twice thus making her the sole breadwinner for her family. She was able to get help from an aunt until she passed away recently and thus is left only with the rental fees of boarders with whom she also lives. The scholarship program will help her get through her medical studies. As a medical clerk she talked of an instance when she attended to a 14-yr old girl from a remote barrio whose eyes were removed due to the complications which was not managed right away. Jennyleen says, “my country needs me.”',"#FFFFFF");
messages[29] = new Array('BDB_PLM/rodriguez_krisna.jpg','JAN KRISNA M. RODRIGUEZ utmost dream is not only to be one of the top ranking medical students at PLM but a doctor to the barrios where there are individuals who have not seen a doctor to look after their health. Their family depends on a grandfather who has a nursing home in the US. Leaving country however has not been an attractive option for her as her conviction is that our country needs the services of the doctors more.',"#FFFFFF");
messages[30] = new Array('BDB_PLM/toledo_peonio.jpg','PEONIO R. TOLEDO JR is also an only child. His father is a retiree and his retirement pension is not enough to sustain their needs. Thus Peony’s mother who is also a retired teacher continues to tutor to help him get through his medical studies. The vision of the program parallels his vision and this is a strong pull factor for him to stay in the country aside from being close to his parents who are already in their very senior years. He wants to pursue a career in public health.',"#FFFFFF");
messages[31] = new Array('BDB_PLM/alvez.jpg','',"#FFFFFF");
messages[32] = new Array('BDB_PLM/andres.jpg','',"#FFFFFF");
messages[33] = new Array('BDB_PLM/cabanes.jpg','',"#FFFFFF");
messages[34] = new Array('BDB_PLM/cabigting.jpg','',"#FFFFFF");
messages[35] = new Array('BDB_PLM/castelo.jpg','',"#FFFFFF");
messages[36] = new Array('BDB_PLM/cuevas.jpg','',"#FFFFFF");
messages[37] = new Array('BDB_PLM/dela_rosa.jpg','',"#FFFFFF");
messages[38] = new Array('BDB_PLM/estrella.jpg','',"#FFFFFF");
messages[39] = new Array('BDB_PLM/evangelista.jpg','',"#FFFFFF");
messages[40] = new Array('BDB_PLM/fronda.jpg','',"#FFFFFF");
messages[41] = new Array('BDB_PLM/gabuyo.jpg','',"#FFFFFF");
messages[42] = new Array('BDB_PLM/geneblazo.jpg','',"#FFFFFF");
messages[43] = new Array('BDB_PLM/gonzales.jpg','',"#FFFFFF");
messages[44] = new Array('BDB_PLM/hermosura.jpg','',"#FFFFFF");
messages[45] = new Array('BDB_PLM/jose.jpg','',"#FFFFFF");
messages[46] = new Array('BDB_PLM/kashim.jpg','',"#FFFFFF");
messages[47] = new Array('BDB_PLM/lozada.jpg','',"#FFFFFF");
messages[48] = new Array('BDB_PLM/magsakay.jpg','',"#FFFFFF");
messages[49] = new Array('BDB_PLM/osorio.jpg','',"#FFFFFF");
messages[50] = new Array('BDB_PLM/reyes.jpg','',"#FFFFFF");
messages[51] = new Array('BDB_PLM/vergara.jpg','',"#FFFFFF");
messages[52] = new Array('BDB_PLM/0.jpg','',"#FFFFFF");
messages[53] = new Array('BDB_PLM/0.jpg','',"#FFFFFF");
messages[54] = new Array('BDB_PLM/0.jpg','',"#FFFFFF");
messages[55] = new Array('BDB_PLM/0.jpg','',"#FFFFFF");
messages[56] = new Array('BDB_PLM/0.jpg','',"#FFFFFF");
messages[57] = new Array('BDB_PLM/0.jpg','',"#FFFFFF");
messages[58] = new Array('BDB_PLM/0.jpg','',"#FFFFFF");
messages[59] = new Array('BDB_PLM/loading.gif','loading','white','white');

////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

// preload images that are to appear in tooltip
// from arrays above
if (document.images) {
	var theImgs = new Array();
	for (var i=0; i<messages.length; i++) {
  	theImgs[i] = new Image();
		theImgs[i].src = messages[i][0];
  }
}

// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		document.onmousemove = trackMouse;
	}
}

window.onload = initTip;

/////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes 
//			it to tipDiv
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,num) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (messages[num][2])	var curBgColor = messages[num][2];
	else curBgColor = tipBgColor;
	if (messages[num][3])	var curFontColor = messages[num][3];
	else curFontColor = tipFontColor;
	if (ie4||ie5||ns5) {
		var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
	standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
	mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position, 
//		offset amounts and tooltip width to position
//		tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
	if (!tipFollowMouse) {
		standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
		mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
		mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
	var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = mouseX-(tpWd+offX)+"px";
	else tipcss.left = mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = winHt-(tpHt+offY)+"px";
	else tipcss.top = mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

document.write('<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>')
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

