<!--

/*
Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
Copyright 2002 by Sharon Paine
Visit http://www.dynamicdrive.com for this script
*/

/* IMPORTANT: Put script after tooltip div or 
	 put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ns4 = (document.layers && !dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ns4 && !ie4 && !ie5) ? true : false;

// resize fix for ns4
var origWidth, origHeight;
if (ns4) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

// 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= 354;
var offX= 30;	// how far from mouse to show tip
var offY= 12; 
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "12px";
// 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= "#ffffff";
var tipBgColor= "#001858"; 
var tipBorderColor= "#ffcb00";
var tipBorderWidth= 2;
var tipBorderStyle= "solid";
var tipPadding= 15;

// 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('/maps/images/ww1.jpg','<span class="tooltip">WWI Exhibit</span><br>The museum’s newly launched World War I exhibit is divided into four distinct dioramas. Each of these scenes of recreated wartime history includes a touch screen kiosk with interactive programs. Literally at their fingertips, visitors can learn about each diorama with the information complemented by period images. They can also view an animated dogfight, read about wartime aircraft, and hear voices from the past in the form of words from actual letters written by World War I servicemen at Pensacola and overseas. The exhibit is located on the Main Deck near the Cubi Bar Cafe.');
messages[1] = new Array('/maps/images/early_aircraft.jpg','<span class="tooltip">Early Aircraft</span><br>Explore the origins of Naval Aviation, from the first flight off a naval vessel to the Flying Aces of WWI.');
messages[2] = new Array('/maps/images/nc_4.jpg','<span class="tooltip">NC-4</span><br>The NC-4 Flying Boat is the actual aircraft that completed the first crossing of the Atlantic Ocean by air and was one of the sparks of the aerial revolution.');
messages[3] = new Array('/maps/images/modern_aircraft.jpg','<span class="tooltip">Modern Aircraft</span><br>Get a close-up look at aircraft that flew in skies from Vietnam to Iraq.');
messages[4] = new Array('/maps/images/pow_exhibit.jpg','<span class="tooltip">P.O.W. Exhibit</span><br>This dramatic recreation of the Hoa Lo Prison gives visitors a never-before-seen look at a real Vietnam P.O.W. camp. See actual P.O.W. garments, letters written to fathers from their children back home in the United States, and much more.');
messages[5] = new Array('/maps/images/squadron_patches.jpg','<span class="tooltip">Squadron Patches</span><br>Take a look at the flight gear, jackets, and squadron patches worn by Naval Aviators since the dawning of the age of flight.');
messages[6] = new Array('/maps/images/bob_hope.jpg','<span class="tooltip">Bob Hope</span><br>Watch and listen as Bob Hope performs at a USO event onboard an aircraft carrier.');
messages[7] = new Array('/maps/images/top_gun_sim.jpg','<span class="tooltip">Top Gun Air Combat Simulation Center</span><br>Test your flying skills inside the cockpit of a Navy F-14 Tomcat simulator. Land on an aircraft carrier, engage in a dogfight and much more!');
messages[8] = new Array('/maps/images/us_coast_guard.jpg','<span class="tooltip">U.S. Coast Guard</span><br>Discover the major role this premier maritime service played in early aviation… especially helicopter aviation. This exhibit highlights the Coast Guard’s role in national security and gives you a look into its many duties.');
messages[9] = new Array('/maps/images/cubi_bar_cafe.jpg','<span class="tooltip">Cubi Bar Cafe</span><br>The Cubi Bar Café is rich in history and offers a variety of soups, salads and sandwiches, featuring fresh-baked bread and homemade cookies. Open daily.');
messages[10] = new Array('/maps/images/museum_tours.jpg','<span class="tooltip">Museum Tours</span><br>The museum offers free guided tours of the first floor exhibits and outside flight line. Don’t forget to head to the second deck after your tour!');
messages[11] = new Array('/maps/images/blue_angel_atrium.jpg','<span class="tooltip">Blue Angel Atrium</span><br>The Ceremonial center of the Museum, the 10,000 square foot Blue Angel Atrium is regularly used for military and civilian functions. View the previous generation of Blue Angel aircraft in their flight formation! ');		
messages[12] = new Array('/maps/images/uss_cabot_flight_deck.jpg','<span class="tooltip">USS Cabot Flight Deck</span><br>Have you ever wondered what a wooden flight deck looked like? See our WWII aircraft carrier replica, the USS Cabot, up close. The flight deck is made from planks taken from the USS Lexington.');
messages[13] = new Array('/maps/images/emil_buehler_naval_aviation_library.jpg','<span class="tooltip">Emil Buehler Naval Aviation Library</span><br>See one of a kind artwork, and peruse manuscripts, 8,000 books and technical manuals, and 400,000 declassified Naval Aviation photos.');
messages[14] = new Array('/maps/images/ww2_to_korean_war_aircraft.jpg','<span class="tooltip">WWII to Korean War Aircraft</span><br>Learn how aviation became an integral part of warfare in the modern era.');
messages[15] = new Array('/maps/images/sunken_treasure.jpg','<span class="tooltip">Sunken Treasure</span><br>See a stunning underwater recreation. Below the surface of Lake Michigan, refracted light bounces over two WWII aircraft lost  by young Naval aviators during carrier training at the height of the war.');
messages[16] = new Array('/maps/images/flight_deck_museum_store.jpg','<span class="tooltip">Flight Deck Museum Store</span><br>Visit the official store of the National Museum of Naval Aviation (available online). You can purchase gifts, toys, clothes, and souvenirs.');
messages[17] = new Array('/maps/images/imax_theater.jpg','<span class="tooltip">IMAX Theater</span><br>The National Museum of Naval Aviation boasts one of the largest IMAX theaters in the world, with several shows playing each day.');
messages[18] = new Array('/maps/images/information_desk.jpg','<span class="tooltip">Information Desk</span><br>As you enter the museum, check with the friendly volunteers at the Information Desk to find out the "must-sees."');
messages[19] = new Array('/maps/images/art_gallery.jpg','<span class="tooltip">Art Gallery</span><br>Gaze upon the museum collection of some of the finest aviation art in the world.');
messages[20] = new Array('/maps/images/space.jpg','<span class="tooltip">Space</span><br>Walk with the astronauts. See the Apollo command module, Skylab 2, that carried an all-Navy crew to the earth-orbiting skylab.');
messages[21] = new Array('/maps/images/lighter_than_air.jpg','<span class="tooltip">Lighter than Air</span><br>See another realm of flight – dirigibles serving as aircraft carriers that could launch, recover and hangar aircraft while airborne by means of a retractable trapeze.');
messages[22] = new Array('/maps/images/ww2_aircraft_carrier.jpg','<span class="tooltip">WWII Aircraft Carrier</span><br>If you ever wanted to know how sailors survived carrier life, you’ll want to see this realistic exhibit.');
messages[23] = new Array('/maps/images/ww2_south_pacific.jpg','<span class="tooltip">WWII South Pacific</span><br>Relive the rustic lifestyle of naval aviators based at jungle airstrips. This exhibit will take you back in time.');
messages[24] = new Array('/maps/images/home_front_usa.jpg','<span class="tooltip">Home Front USA</span><br>Take a stroll down Main Street in a small town on the home front during World War II.');
messages[25] = new Array('/maps/images/flight_adventure_deck.jpg','<span class="tooltip">Flight Adventure Deck</span><br>Extensive interactive exhibits on the principals of flight. The Flight Adventure program is teacher-led instruction for studentse from local school districts.  principles of flight. Guided tours available daily.');
messages[26] = new Array('/maps/images/motion_based_flight_sim.jpg','<span class="tooltip">Motion-Based Flight Simulator: </span><br>This 15-seat, virtual reality simulator is as close as you can get to the real thing. Fly in a Blue Angel or take part in a Desert Storm sortie.');
messages[27] = new Array('/maps/images/cockpit_trainers.jpg','<span class="tooltip">Cockpit Trainers</span><br>Ever wondered what it looks like inside an aircraft cockpit? Here you’ll find cockpit trainers like the A-7 Corsair II, the F-8 Crusader and many more. Climb inside and pretend you’re flying.');
messages[28] = new Array('/maps/images/hall_of_honor.jpg','<span class="tooltip">Hall of Honor</span><br>Each year, the Navy honors several individuals for their extraordinary contributions to naval aviation. They are enshrined in the Hall of Honor.');
messages[29] = new Array('/maps/images/medal_of_honor.jpg','<span class="tooltip">Medal of Honor</span><br>Learn about the brave aviators who have acted above and beyond the call of duty, receiving the nation’s highest decoration.');
messages[30] = new Array('/maps/images/enlisted_aviators.jpg','<span class="tooltip">Enlisted Aviators</span><br>Learn about early aviators who were selected from the enlisted ranks.');
messages[31] = new Array('/maps/images/uss_enterprise.jpg','<span class="tooltip">USS Enterprise</span><br>The US Navys sixth aircraft carrier, the USS Enterprise established a combat record that, by the end of World War II, was the envy of the fleet.');
messages[32] = new Array('/maps/images/blue_angel_atrium.jpg','<span class="tooltip">Blue Angel Atrium</span><br>The Ceremonial center of the Museum, the 10,000 square foot Blue Angel Atrium is regularly used for military and civilian functions. View the previous generation of Blue Angel aircraft in their flight formation!');
messages[33] = new Array('/maps/images/.jpg','<span class="tooltip"></span><br>');
messages[34] = new Array('/maps/images/.jpg','<span class="tooltip"></span><br>');
messages[35] = new Array('/maps/images/.jpg','<span class="tooltip"></span><br>');
messages[36] = new Array('/maps/images/.jpg','<span class="tooltip"></span><br>');
messages[37] = new Array('/maps/images/.jpg','<span class="tooltip"></span><br>');
messages[38] = new Array('/maps/images/.jpg','<span class="tooltip"></span><br>');
messages[39] = new Array('/maps/images/.jpg','<span class="tooltip"></span><br>');
messages[40] = new Array('/maps/images/.jpg','<span class="tooltip"></span><br>');



////////////////////  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 for all but ns4. 
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ns4)? document.tipDiv.document: (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = (ns4)? document.tipDiv: 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) {
		if (ns4) document.captureEvents(Event.MOUSEMOVE);
		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 (ns4) {
		var tip = '<table bgcolor="' + tipBorderColor + '" width="' + tipWidth + '" cellspacing="0" cellpadding="' + tipBorderWidth + '" border="0"><tr><td><table bgcolor="' + curBgColor + '" width="100%" cellspacing="0" cellpadding="' + tipPadding + '" border="0"><tr><td>'+ startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr + '</td></tr></table></td></tr></table>';
		tooltip.write(tip);
		tooltip.close();
	} else 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) {
	mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
	mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.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) {
		mouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
		mouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
	var winHt = (ns4||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"px";
	else tipcss.left = (ns4)? mouseX+offX: mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = (ns4)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"px";
	else tipcss.top = (ns4)? mouseY+offY: mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

//-->
