
/*
Image w/ description tooltip_1- 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_1 div or 
put tooltip_1 div just before </BODY>. */

var dom_1 = (document.getElementById) ? true : false;
var ns5_1 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom_1) ? true: false;
var ie5_1 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom_1) ? true : false;
var ns4_1 = (document.layers && !dom_1) ? true : false;
var ie4_1 = (document.all && !dom_1) ? true : false;
var nodyn_1 = (!ns5_1 && !ns4_1 && !ie4_1 && !ie5_1) ? true : false;

// resize fix for ns4_1
var origWidth_1, origHeight_1;
if (ns4_1) {
origWidth_1 = window.innerWidth; origHeight_1 = window.innerHeight;
window.onresize = function() { if (window.innerWidth != origWidth_1 || window.innerHeight != origHeight_1) history.go(0); }
}

// avoid error of passing event object in older browsers
if (nodyn_1) { event = "nope" }

/////////////////////// CUSTOMIZE HERE ////////////////////
// settings for tooltip_1 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse_1= true; 
// Be sure to set tipWidth_1 wide enough for widest image
var tipWidth_1= 99;
var offX_1= 60; // how far from mouse to show tip
var offY_1= -20; 
var tipFontFamily_1= "Verdana, arial, helvetica, sans-serif";
var tipFontSize_1= "8pt";
// set default text color and background color for tooltip_1 here
// individual tooltip_1s can have their own (set in messages arrays)
// but don't have to
var tipFontColor_1= "#F50E0E";
var tipBgColor_1= "#F6F8DC"; 
var tipBorderColor_1= "#6A3BEF";
var tipBorderWidth_1= 1;
var tipBorderStyle_1= "ridge";
var tipPadding_1= 4;

// tooltip_1 content goes here (image, description, optional bgColor, optional textcolor)
//var messages = new Array();
// multi-dimensional arrays containing: 
// image and text for tooltip_1
// optional: bgColor and color to be sent to tooltip_1

//////////////////// END OF CUSTOMIZATION AREA ///////////////////

// preload images that are to appear in tooltip_1
// from arrays above
// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in popup_image function
// startStr_1 goes before image, midStr_1 goes between image and text
var startStr_1 = '<table width="' + tipWidth_1 + '"><tr><td align="center" width="100%"><img src="';
var midStr_1 = '" border="0"></td></tr><tr><td valign="top">';
var endStr_1 = '</td></tr></table>';

////////////////////////////////////////////////////////////
// initTip - initialization for tooltip_1.
// Global variables for tooltip_1. 
// Set styles for all but ns4_1. 
// Set up mousemove capture if tipFollowMouse_1 set true.
////////////////////////////////////////////////////////////
var tooltip_1, tipcss_1;
function initTip() {
if (nodyn_1) return;
tooltip_1 = (ns4_1)? document.tipDiv.document: (ie4_1)? document.all['tipDiv']: (ie5_1||ns5_1)? document.getElementById('tipDiv'): null;
tipcss_1 = (ns4_1)? document.tipDiv: tooltip_1.style;
if (ie4_1||ie5_1||ns5_1) { // ns4_1 would lose all this on rewrites
tipcss_1.width = tipWidth_1+"px";
tipcss_1.fontFamily = tipFontFamily_1;
tipcss_1.fontSize = tipFontSize_1;
tipcss_1.color = tipFontColor_1;
tipcss_1.backgroundColor = tipBgColor_1;
tipcss_1.borderColor = tipBorderColor_1;
tipcss_1.borderWidth = tipBorderWidth_1+"px";
tipcss_1.padding = tipPadding_1+"px";
tipcss_1.borderStyle = tipBorderStyle_1;
}
if (tooltip_1&&tipFollowMouse_1) {
if (ns4_1) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = trackMouse;
}
}

//window.onload = initTip;

/////////////////////////////////////////////////
// popup_image function
// Assembles content for tooltip_1 and writes 
// it to tipDiv
/////////////////////////////////////////////////
var t1_1,t2_1; // for setTimeouts
var tipOn_1 = false; // check if over tooltip_1 link
function popup_image(evt,img,txt) {
initTip();
if (!tooltip_1) return;
if (t1_1) clearTimeout(t1_1); if (t2_1) clearTimeout(t2_1);
tipOn_1 = true;
// set colors if included in messages array
curBgColor = tipBgColor_1;
curFontColor = tipFontColor_1;
if (ns4_1) {
var tip = '<table bgcolor="' + tipBorderColor_1 + '" width="' + tipWidth_1 + '" cellspacing="0" cellpadding="' + tipBorderWidth_1 + '" border="0"><tr><td><table bgcolor="' + curBgColor + '" width="100%" cellspacing="0" cellpadding="' + tipPadding_1 + '" border="0"><tr><td align="center">'+ startStr_1 + img + midStr_1 + '<span align="center" style="font-family:' + tipFontFamily_1 + '; font-size:' + tipFontSize_1 + '; color:' + curFontColor + ';">' + txt + '</span>' + endStr_1 + '</td></tr></table></td></tr></table>';
tooltip_1.write(tip);
tooltip_1.close();
} else if (ie4_1||ie5_1||ns5_1) {
var tip = startStr_1 + img + midStr_1 + '<span style="font-family:' + tipFontFamily_1 + '; font-size:' + tipFontSize_1 + '; color:' + curFontColor + ';">' + txt + '</span>' + endStr_1;
tipcss_1.backgroundColor = curBgColor;
tooltip_1.innerHTML = tip;
}
if (!tipFollowMouse_1) positionTip(evt);
else t1_1=setTimeout("tipcss_1.visibility='visible'",100);
}

var mouseX_1, mouseY_1;
function trackMouse(evt) {
mouseX_1 = (ns4_1||ns5_1)? evt.pageX: window.event.clientX + document.body.scrollLeft;
mouseY_1 = (ns4_1||ns5_1)? evt.pageY: window.event.clientY + document.body.scrollTop;
if (tipOn_1) positionTip(evt);
}

/////////////////////////////////////////////////////////////
// positionTip function
// If tipFollowMouse_1 set false, so trackMouse function
// not being used, get position of mouseover event.
// Calculations use mouseover event position, 
// offset amounts and tooltip_1 width to position
// tooltip_1 within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
if (!tipFollowMouse_1) {
mouseX_1 = (ns4_1||ns5_1)? evt.pageX: window.event.clientX + document.body.scrollLeft;
mouseY_1 = (ns4_1||ns5_1)? evt.pageY: window.event.clientY + document.body.scrollTop;
}
// tooltip_1 width and height
var tpWd = (ns4_1)? tooltip_1.width: (ie4_1||ie5_1)? tooltip_1.clientWidth: tooltip_1.offsetWidth;
var tpHt = (ns4_1)? tooltip_1.height: (ie4_1||ie5_1)? tooltip_1.clientHeight: tooltip_1.offsetHeight;
// document area in view (subtract scrollbar width for ns)
var winWd = (ns4_1||ns5_1)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
var winHt = (ns4_1||ns5_1)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
// check mouse position against tip and window dimensions
// and position the tooltip_1 
if ((mouseX_1+offX_1+tpWd)>winWd) 
tipcss_1.left = (ns4_1)? mouseX_1-(tpWd+offX_1): mouseX_1-(tpWd+offX_1)+"px";
else tipcss_1.left = (ns4_1)? mouseX_1+offX_1: mouseX_1+offX_1+"px";
if ((mouseY_1+offY_1+tpHt)>winHt) 
tipcss_1.top = (ns4_1)? winHt-(tpHt+offY_1): winHt-(tpHt+offY_1)+"px";
else tipcss_1.top = (ns4_1)? mouseY_1+offY_1: mouseY_1+offY_1+"px";
if (!tipFollowMouse_1) t1_1=setTimeout("tipcss_1.visibility='visible'",100);
}

function hide_popup_image() {
if (!tooltip_1) return;
t2_1=setTimeout("tipcss_1.visibility='hidden'",100);
tipOn_1 = false;
}
