

/***********************************************
* 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= 220;//160;
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= "#000080";
var tipBorderWidth= 3;
var tipBorderStyle= "ridge";
var tipPadding= 4;

// 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
var FoxtrotDef;
FoxtrotDef = "Mr. Harry Fox, a Vaudeville Star, is generally accepted to have initiated ";
FoxtrotDef = FoxtrotDef + "the Fox Trot in 1912 and over the years it has developed into the ";
FoxtrotDef = FoxtrotDef + "smooth and sophisticated dance we know today. ";
FoxtrotDef = FoxtrotDef + "Foxtrot is one of the most ";
FoxtrotDef = FoxtrotDef + "popular slow dances of all time. Classic crooners such as ";
FoxtrotDef = FoxtrotDef + "Frank Sinatra, Tony Bennett, and Nat King Cole provide the ";
FoxtrotDef = FoxtrotDef + "jazzy standards ideal for this dance."
var WaltzDef;
WaltzDef = "When the Waltz was first introduced in the ballrooms of the worlds in the early 19th century, it was met with outraged ";
WaltzDef = WaltzDef + "indignation, for it was the first dance where couples danced in a closed position with the man's hand around the girl's waist.  ";
WaltzDef = WaltzDef + "Done to a three count, the waltz is an elegant and graceful dance that will never go out of style.";
var TangoDef;
TangoDef = "The passionate and dramatic Tango made its first appearance in 1910-1914, ";
TangoDef = TangoDef + "and conjures up images of dancers with roses clenched between their teeth. ";
TangoDef = TangoDef + "For the last 60 years or so, the distinctive four-beat Tango music has ";
TangoDef = TangoDef + "endured and has continued to enjoy undiminished favor everywhere. ";
TangoDef = TangoDef + "The Tango is one of the most highly stylized ballroom dances,  ";
TangoDef = TangoDef + "and has been popularized in many Hollywood movies.";
var VWaltzDef;
VWaltzDef = "The Viennese Waltz, as we know it today, was first danced in ";
VWaltzDef = VWaltzDef + "the courts of European Royalty during the Strauss era (1800s). ";
VWaltzDef = VWaltzDef + "It has the charm and sophistication that is so typical of that period of history. ";
VWaltzDef = VWaltzDef + "Couples whirl around the floor; first one way, then another. Grand and majestic, ";
VWaltzDef = VWaltzDef + "It is a dance that requires a great deal ";
VWaltzDef = VWaltzDef + "of control due to the speed of the music.";
var RumbaDef;
RumbaDef = "Rumba is Cuban in origin and is often referred to as the 'dance of love'. ";
RumbaDef = RumbaDef + "Sultry and romantic, the music is a mix of African and Latin rhythms. ";
RumbaDef = RumbaDef + "The Rumba is danced in a small confined area of the dance floor to slow music, ";
RumbaDef = RumbaDef + "and is characterized by a smooth and subtle movement of the hips.";
var ChaChaDef;
ChaChaDef = "The Cha Cha Cha is derived from the Mambo and originates in Cuba. ";
ChaChaDef = ChaChaDef + "It was introduced to the United States in 1954, and by 1959 Americans ";
ChaChaDef = ChaChaDef + "were hooked, with dance studios reporting it to be their most popular dance. ";
ChaChaDef = ChaChaDef + "The Cha Cha derives its personality, character, and rhythm from two major dance sources: ";
ChaChaDef = ChaChaDef + "the music is from Mambo, and it's Triple Step and Breaks are from the Lindy. ";
var SwingDef;
SwingDef = "The Swing, originally called the Lindy Hop, was born in the southern United States, ";
SwingDef = SwingDef + "and is the most famous American folk dance. About 55 years ago, the Swing was danced ";
SwingDef = SwingDef + "in the Harlem section of New York City and the music was supplied by Big Band greats ";
SwingDef = SwingDef + "such as Duke Ellington and Benny Goodman. ";
SwingDef = SwingDef + "Swing includes a broad category that includes Jive, Jitterbug, Lindy Hop, and Shag, among others. ";
SwingDef = SwingDef + "There are two types: ";
SwingDef = SwingDef + "East Coast Swing - This dance is frequently referred to as Triple Step Swing due ";
SwingDef = SwingDef + "to the rhythm of the basic triple step. ";
SwingDef = SwingDef + "It is a circular dance that is danced with a bounce and is very grounded and not high in the legs. ";
SwingDef = SwingDef + "West Coast Swing - This dance consists of six and eight count patterns, which are ";
SwingDef = SwingDef + "done in a slot. The woman no longer rocks back as in East Coast swing, but instead ";
SwingDef = SwingDef + "she always walks forward on count one. This dance is usually done to medium tempo ";
SwingDef = SwingDef + "swing music, frequently slower than East Coast swing. ";
var MamboDef;
MamboDef = "No other dance from south of the border has ever attained the instantaneous popularity ";
MamboDef = MamboDef + "that the zestful Mambo did when it was first introduced from Cuba. This fun and carefree ";
MamboDef = MamboDef + "dance has been popular since the 1950s. The characteristics of the Mambo include much pelvic movement and a strongly ";
MamboDef = MamboDef + "accented 'up' beat. With an unlimited variety of movements, steps and ";
MamboDef = MamboDef + "spins it is one of the most abandoned fun dances of all time .";
MamboDef = MamboDef + "Sometimes referred to as 'the dancer's dance,' mambo requires excellent timing and coordination.";
var SambaDef;
SambaDef = "When the Samba was imported from Brazil into the United States in 1929, ";
SambaDef = SambaDef + "it became an overnight sensation. The intoxicating rhythm makes the Samba ";
SambaDef = SambaDef + "festive and lighthearted, and it brings to mind pictures of the 'Carnival in Rio'. ";
SambaDef = SambaDef + "The Samba is danced in a moderate to slow tempo in South America, but until recently, the tempo ";
SambaDef = SambaDef + "in North America was always very fast. Unlike the other Latin dances that are ";
SambaDef = SambaDef + "stationary, many samba steps travel around the floor.";
var SalsaDef;
SalsaDef = "Salsa is the Spanish word for 'sauce' denoting a 'spicy' and 'hot' flavor ";
SalsaDef = SalsaDef + "to this popular dance style to a complex mix of many different rhythms. ";
SalsaDef = SalsaDef + "Salsa is considered the national music and dance of Puerto Rico. ";
SalsaDef = SalsaDef + "The fusion of an Afro-Cuban beat with enhanced jazz textures results in an aggressive ";
SalsaDef = SalsaDef + "high energy pulse which has become popular everywhere. Many of the patterns are closely ";
SalsaDef = SalsaDef + "related to those of the Mambo and Cha-Cha.";
var MerengueDef;
MerengueDef = "Since the 1930s Merengue is readily recognized as the national dance of the Dominican Republic. ";
MerengueDef = MerengueDef + "Of all dances, it is by far the easiest to learn! Strangers tend to keep a respectable distance ";
MerengueDef = MerengueDef + "from each other, while more intimate couples break the barriers of personal space and entwine ";
MerengueDef = MerengueDef + "their bodies. Whatever method the contagious beat causes the adrenaline to rise and you can imagine ";
MerengueDef = MerengueDef + "yourself dancing bare foot to the pulse of a Caribbean sunset.";
var HustleDef;
HustleDef = "Hustle began, freeform, in discos as a dance with simple footwork and a simple count. ";
HustleDef = HustleDef + "It is a fast, smooth dance, with the lady spinning almost constantly, while her partner ";
HustleDef = HustleDef + "draws her close and sends her away.";
var JiveDef;
JiveDef = "This dance is the European version of East Coast swing. ";
JiveDef = JiveDef + "Six and eight count patterns make up this dance, as in East Coast swing ";
JiveDef = JiveDef + "but it is quite bouncy with very sharp kicks and flicks. ";
JiveDef = JiveDef + "Unlike East Coast swing, Jive is danced to a faster tempo swing music ";
JiveDef = JiveDef + "and is meant for competitive style dancing.";
var BoleroDef;
BoleroDef = "The Bolero was introduced to North America in the mid 1930's. ";
BoleroDef =BoleroDef + "It is danced in a 4/4 time and requires a special feeling and response to its beautiful music. ";
BoleroDef =BoleroDef + "The Bolero combines the rise and fall of waltz and the hip movements of Rumba.";
var QuickstepDef;
QuickstepDef = "As the name implies, the Quickstep is a very quick and lively dance, ";
QuickstepDef = QuickstepDef + "comprised of hops, skips and kicks. The dance began as a quick version of Foxtrot ";
QuickstepDef = QuickstepDef + " mixed with the Charleston, and musical Jazz influences.";
var PolkaDef;
PolkaDef = "The Polka is a lively Central European dance and also a genre of dance ";
PolkaDef = PolkaDef + "music familiar throughout Europe and the Americas. It originated in the ";
PolkaDef = PolkaDef + "middle of the 19th century in the Czech lands and is still a common genre ";
PolkaDef = PolkaDef + "in Eastern Europe.  Versions also exist in the Nordic countries, Ireland and Latin America, especially Mexico.";
var PasoDobleDef;
PasoDobleDef = "The Paso Doble is a theatrical Spanish dance that characterizes the man as the matador and the lady as his cape. ";
PasoDobleDef = PasoDobleDef + "Based on Flamenco dancing, the character of the dance is arrogant and passionate. ";
PasoDobleDef = PasoDobleDef + "It was brought to this country by the Flamenco dancers and has been a favorite since.";
var ATangoDef;
ATangoDef = "Slow and free-form, the Argentine Tango is characterized ";
ATangoDef = ATangoDef + "by a close upper-body embrace and complex footwork ";
ATangoDef = ATangoDef + "with many kicks and the use of the legs to caress ";
ATangoDef = ATangoDef + "the partner.";
//messages[0] = new Array('','Here is a red balloon on a white background',"#FFFFFF");
messages[0] = new Array('',FoxtrotDef,"#DDECFF");
messages[1] = new Array('',WaltzDef,"#DDECFF");
messages[2] = new Array('',TangoDef,"#DDECFF");
messages[3] = new Array('',VWaltzDef,"#DDECFF");
messages[4] = new Array('',RumbaDef,"#DDECFF");
messages[5] = new Array('',ChaChaDef,"#DDECFF");
messages[6] = new Array('',SwingDef,"#DDECFF");
messages[7] = new Array('',MamboDef,"#DDECFF");
messages[8] = new Array('',SambaDef,"#DDECFF");
messages[9] = new Array('',SalsaDef,"#DDECFF");
messages[10] = new Array('',MerengueDef,"#DDECFF");
messages[11] = new Array('',HustleDef,"#DDECFF");
messages[12] = new Array('',JiveDef,"#DDECFF");
messages[13] = new Array('',BoleroDef,"#DDECFF");
messages[14] = new Array('',QuickstepDef,"#DDECFF");
messages[15] = new Array('',PolkaDef,"#DDECFF");
messages[16] = new Array('',PasoDobleDef,"#DDECFF");
messages[17] = new Array('',ATangoDef,"#DDECFF");

////////////////////  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;
		var tip = '<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>')
