/***********************************************
* Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
* Copyright 2002-2007 by Sharon Paine
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* 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= 380;
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= "#ffffff"; 
var tipBorderColor= "#0db14b";
var tipBorderWidth= 1;
var tipBorderStyle= "ridge";
var tipPadding= 5;

// 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('images/bacolod_img.jpg','Situated in the province of Negros Occidental, the City of Smiles is famous for its annual Maskara Festival held every October. Colorfully-masked dancers parade the streets and the rhythm of Latin beats fill the air as locals and tourists come together in this wonderful celebration. Bacolod City is also known as the Sugar Bowl of the Philippines which produces half of the country&acute;s sugar crop.<br><br><b>Zest Air flies from Manila to Bacolod and vice versa once daily.</b>',"#ffffff");
messages[1] = new Array('images/boracay_img.jpg','Melancholic no more! This once quite, rustic island has become a favorite tourist destination. Bask in the world-renowned crystal clear waters and pristine white beaches of Boracay. Wind-surfing, Kite-boarding, Parasailing, Snorkeling, Scuba Diving..... just a few adventures worth trying in this tropical island paradise by day... party haven by night.<br><br><b>Zest Air flies to Boracay from Manila and vice versa 10 times daily.</b>',"#ffffff");
messages[2] = new Array('images/busuanga_img.jpg','Relax in tranquil waters! Recharge your spirit in clean mountain lakes! Aside from its pristine white sand beaches, Northern Palawan&acute;s treasure is the sheer beauty of its unspoiled natural environment.<br><br><b>Zest Air flies from Manila to Busuanga and vice versa once daily.</b>',"#ffffff");
messages[3] = new Array('images/cagayan-de-oro_img.jpg','Be ready for fun-filled adventure as you explore the Gateway to Northern Mindanao! Cagayan de Oro is the starting point for trips to the island of Camiguin, Bukidnon as well as Siargao. Diving enthusiasts will be fascinated by the famous sunken cemetery located in Bonbon. Discover the thrill of nature as you experience white water rafting and river trekking along the CDO&acute;s river.<br><br><b>Zest Air will soon fly from Cebu to Cagayan de Oro and vice versa.</b>',"#ffffff");
messages[4] = new Array('images/calbayog_img.jpg','This City of Waterfalls never fails to amaze her visitors. The mesmerizing motion and therapeutic sound of water continuously flowing is truly a wonderful piece of kinetic art. Definitely one of Mother Nature&acute;s masterpieces<br><br><b>Zest Air flies from Manila to Calbayog and vice versa 3 times weekly.</b>',"#ffffff");
messages[5] = new Array('images/catarman_img.jpg','This developing town on the shoulder of Samar Island is home to White Beach, whose virgin, silky sand faces the seemingly rough San Bernardino Strait. Also located in Northern Samar is Onay Beach facing Laoang Bay, with its cool blue waters ideal for surfing and swimming. Catarman owns just a few of our country&acute;s many unknown beaches waiting to be explored.<br><br><b>Zest Air flies from Manila to Catarman and vice versa 4 times weekly.</b>',"#ffffff");
messages[6] = new Array('images/cebu_img.jpg','Dubbed as The Queen City of the South, this highly cosmopolitan, Visayan metropolis is the origin of internationally acclaimed acoustic guitars... crispy, sun dried danggit... and the sweetest fresh mangoes. Unleash the fun and excitement in Cebu&acute;s 5 Star hotels, casinos, white sand beaches, world-class golf courses, convention centers and shopping malls.<br><br><b>Zest Air flies from Manila to Cebu and vice versa twice daily.</b>',"#ffffff");
messages[7] = new Array('images/clark_img.jpg','Up, up and away! Recognized as the Philippines&acute; largest aviation sports event, the Hot Air Balloon Festival is definitely a must-see attraction for locals and tourists as well.  For three days during the second week of February, multi-colored hot air balloons in different shapes and sizes fill the skies. A few of the loads of activities that await guests during this event include skydiving, freestyle aerobatics and paragliding.<br><br><b>Zest Air flies from Clark to Caticlan and vice versa 2 times weekly.</b>',"#ffffff");
messages[8] = new Array('images/davao_img.jpg','The largest city in the Philippines is host to the world-famous Kadayawan sa Dabaw. A celebration of Davao&acute;s history, culture and heritage, the festival is highlighted by floral floats, street dancing competitions and showcases the island&acute;s most popular albeit pungent fruit, the Durian. Her island resorts, exclusive hotels and exotic marine life leave all tourists with nothing more to be desired.<br><br><b>Zest Air flies from Manila to Davao and vice versa twice daily.</b>',"#ffffff");
messages[9] = new Array('images/iloilo_img.jpg','With almost every town and municipality celebrating fiestas annually, no one questions why Iloilo is dubbed as the Province of Festivals. Dinagyang is the biggest religious and cultural festival in the province in honor of the Sto. Ni&ntilde;o and celebrates the arrival of early Malay Settlers in Panay Island. The week-long festivities include Ati-Atihan and Kasadyahan, where the Ilonggos show off their dancing prowess and hail the fairest among the fair in a local beauty pageant.<br><br><b>Zest Air flies from Manila to Iloilo and vice versa once daily.</b>',"#ffffff");
messages[10] = new Array('images/kalibo_img.jpg','This is the place to party and dance to the beat of the drums all day long!  Ati-Atihan, known as the Filipino Mardi Gras is one of the wildest celebrations in the country where participants paint their faces in fanciful ways and dress in outrageous costumes.  So dance with the Aklanons to drum beats that run non-stop for several days and shout:  Hala Bira!<br><br><b>Zest Air flies from Manila to Kalibo and vice versa twice daily.</b>',"#ffffff");
messages[11] = new Array('images/legazpi_img.jpg','Take a trip back in history and explore the province of Legazpi. The Cagsawa Ruins, remains of a Church buried during the 1814 Mayon Volcano eruption is a must-see tourist attraction. Food lovers should be ready to spice up their taste buds as this City offers delectable dishes from the very spicy Bicol Express to the milder Laing.<br><br><b>Zest Air flies from Manila to Legazpi and vice versa 3 times weekly.</b>',"#ffffff");
messages[12] = new Array('images/manila_img.jpg','The Cosmopolitan Capital of the Philippines is a curious mix of cultures that offers endless historic places to visit. At the heart of Manila lies Intramuros. This Walled City is home to countless dungeons and ancient churches that served as witnesses to the Spanish colonial period. Five-star hotels, restaurants, casinos and bars make Manila the perfect party place. And for the shopaholics? Bring out the fashionista in you and delight in this shopper&acute;s paradise. From the inexpensive &quot;ukay-ukays&quot; to the extravagant signature boutiques, Manila has it all.',"#ffffff");
messages[13] = new Array('images/marinduque_img.jpg','This heart-shaped island is home to the country&acute;s most colorful festival, Moriones. Costumed penitents wear painted masks, helmets and brightly colored tops. The province is also characterized by the abundance of its natural beauty - unspoiled beaches, sulfur springs and mountain peaks.<br><br><b>Zest Air flies from Manila to Marinduque and vice versa 4 times weekly.</b>',"#ffffff");
messages[14] = new Array('images/naga_img.jpg','Every third week of September, the Bicolano faithful gather to celebrate and honor the Feast of Our Lady of Penafrancia. One must not leave Naga without taking home bagsful of her famous delicacy: pili nuts. Being among the country&acute;s oldest cities, Naga&acute;s favorite photo spot among tourists is the Baroque inspired edifice which is the city&acute;s Cathedral, built in 1595.<br><br><b>Zest Air flies from Manila to Naga and vice versa 4 times weekly.</b>',"#ffffff");
messages[15] = new Array('images/puerto_princesa_img.jpg','The Philippines&acute; Last Frontier is a tropical paradise with a developing urban center perfect for business and leisure trips as well.  The Puerto Princesa Subterranean River National Park is a UNESCO World Heritage Site which boasts of a vast limestone landscape. Strands of white sand beaches cover the bays of Puerto Princesa&acute;s coastline perfect for that much needed getaway.<br><br><b>Zest Air flies from Manila to Puerto Princesa and vice versa once daily.</b>',"#ffffff");
messages[16] = new Array('images/san_jose-mindoro_img.jpg','Diving enthusiasts will love this haven for their aquatic sport - the Apo Reef Marine Park. This diver&acute;s sanctuary is home to over 500 species of marine life and an array of kaleidoscopic coral varieties. San Jose is also the take-off point to the long powdery beaches of tranquil White Sand, where visitors are cautioned to leave turtle eggs buried in the sand, undisturbed.<br><br><b>Zest Air flies from Manila to San Jose, Mindoro and vice versa once daily.</b>',"#ffffff");
messages[17] = new Array('images/tablas_img.jpg','The province of Romblon is strategically located in the center of the Philippine archipelago. Travel to the Marble Country of the Philippines and discover the stretch of white sand beaches along its coast which boasts of an abundant marine life. Join Romblomanons as they celebrate Biniray Festival in January with a grand procession honoring the image of the Holy Child.<br><br><b>Zest Air flies from Manila to Tablas and vice versa 2 times weekly.</b>',"#ffffff");
messages[18] = new Array('images/tacloban_img.jpg','The Pintados Festival displays the unique cultural heritage of the people of Samar and Leyte. The energetic dancers painted from head to toe with armor designs grace the streets of the City. Their dances portray the traditions that flourished during the Spanish era.<br><br><b>Zest Air flies from Manila to Tacloban and vice versa once daily.</b>',"#ffffff");
messages[19] = new Array('images/tagbilaran_img.jpg','The Department of Tourism has recently declared Bohol as a top tourist destination. Her lure? A picture perfect view of the Chocolate Hills, the world&acute;s smallest primate - the Tarsier and an enchanting cruise along the Loboc River. These are just few of the many tourist attractions in The City of Friendship. The locals will surely insist that you taste their native delicacies: peanut kisses and edelweiss torta.<br><br><b>Zest Air flies from Manila to Tagbilaran and vice versa once daily.</b>',"#ffffff");
messages[20] = new Array('images/virac_img.jpg','With the deep rumbling Pacific Ocean as its closest neighbor, it is not surprising that only the more experienced surfers brave the gigantic waves of Virac. The search for the elusive "perfect wave" might prove to be not so elusive in this capital island of Catanduanes. After all, there&acute;s a long 400 meter coastline to work on.<br><br><b>Zest Air flies from Manila to Virac and vice versa 4 times weekly.</b>',"#ffffff");
messages[21] = new Array('images/new_airbus320.jpg','',"#ffffff");
messages[22] = new Array('images/makati_sitemap.jpg','',"#ffffff");
messages[23] = new Array('images/makati_office_b.jpg','',"#ffffff");
messages[24] = new Array('images/signing_b.jpg','',"#ffffff");
messages[25] = new Array('images/lite_n_easy.jpg','',"#ffffff");

////////////////////  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="left" width="100%"><img align="left" 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>')