//	This code is from Dynamic Web Coding - www.dyn-web.com

/* 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;

// 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	= false;	
var tipWidth 			 	= 150;
var offX					 	= 8;	// how far from mouse to show tip
var offY					 	= 12; 
var tipFontFamily 	= "geneva, MS Sans Serif, arial, verdana";
var tipFontSize			= "11px";
var tipFontColor		= "#000000";
var tipBgColor 			= "#DDDDC0";
var tipBorderColor 	= "#000066";
var tipBorderWidth 	= 1;
var tipBorderStyle 	= "solid";
var tipPadding		 	= 4;

// variables for tooltip content 
var tip1 = "Minimum withdrawal $200, 6 withdrawals with 3 of the 6 may be by check. $5 service charge per transaction over 6 or 3 by check."
var tip2 = "6 pre-authorized withdrawals per month - with 3 free and a $1 service charge for each additional withdrawal."
var tip3 = "<b>></b>Currency at $.15 per strap<br><b>></b>Rolled coin at $.06 per roll<br><b>></b>Food stamps at .02 each<br><b>></b>On-us checks deposited<br>&nbsp;$.05 each<br><b>></b>Transit items $.08 each<br><b>></b>Return items $3.00 each<br><b>></b>Account maintenance<br>&nbsp;$15.00 per month<br><b>></b>ACH transaction<br>&nbsp;$5.00 in, $15.00 out<br><b>></b>Deposits at $.25 each<br><b>></b>On-us checks written at<br>&nbsp;$.15 each"
var tip4 = "A balance credit is calculated based on the 90 day T-Bill rate."
var tip5 = "AD insurance, 2 license fees per year, safe deposit box rental discounts, free traveler's checks, 3 free money orders per month, free checks (limited styles)"
var tip6 = "6 withdrawals with 3 of the 6 may be by check, $5 service charge per transaction over 6 or 3 by check."
var tip7 = "1 free withdrawal per quarter, $5 service charge for each additional withdrawal."
var tip8 = "No interest paid if balance falls below $500, $2.00 service charge per month if balance falls below $100."
var tip9 = "<b>></b>Open with as little as<br>&nbsp;$100.00<br><b>></b>Minimum monthly deposits<br>&nbsp;of $100.00 made to the Easy<br>&nbsp;Builder account - deposits<br>&nbsp;can be set up to be made<br>&nbsp;automatically from customer's<br>&nbsp;checking account<br><b>></b>After balance reaches<br>&nbsp;$1,000.00 the customer can<br>&nbsp;choose to move the funds to<br>&nbsp;another IRA CD product at<br>&nbsp;Easy Builder term maturity<br><b>></b>Allows customer to take<br>&nbsp;advantage of the IRA tax<br>&nbsp;breaks without coming up<br>&nbsp;with a lump sum at tax time"
var tip10 = "$100 to open Deposit to account until $1,000 balance is attained. After the target is reached, a regular IRA certificate may be opened."

////////////////////  END OF CUSTOMIZATION AREA  ///////////////////

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles for all but ns4. Set width of tooltip.
//		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 (ns4) tooltip.width = tipWidth;
	else if (ns5) tipcss.width = tipWidth;
	else if (ie4||ie5) tipcss.pixelWidth = tipWidth;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.fontColor = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth;
		tipcss.padding = tipPadding;
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tipFollowMouse) {
		if (ns4) document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = trackMouse;
	}
}
window.onload = initTip;

/////////////////////////////////////////////////////////////
//  Note on tipFollowMouse:
//		If tipFollowMouse is set true, positionTip is called
//		from trackMouse and tooltip is made visible at end of 
//		doTooltip function.
//		If tipFollowMouse is set false, positionTip is called
//		from doTooltip and the tooltip is made visible at the
//		end of the positionTip function.
/////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes it to tipDiv.
//			Call positionTip function from here if tipFollowMouse
//			is set to false.
//////////////////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
function doTooltip(evt,txt) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	if (ns4) {
		tip = '<TABLE BGCOLOR="' + tipBorderColor + '" WIDTH="' + tipWidth + '" CELLSPACING="0" CELLPADDING="' + tipBorderWidth + '" BORDER="0"><TR><TD><TABLE BGCOLOR="' + tipBgColor + '" WIDTH="100%" CELLSPACING="0" CELLPADDING="' + tipPadding + '" BORDER="0"><TR><TD><SPAN STYLE="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + tipFontColor + ';">' + txt  + '</SPAN></TD></TR></TABLE></TD></TR></TABLE>';
		tooltip.write(tip);
		tooltip.close();
	} else if (ie4||ie5||ns5) {
		tip = txt;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
	if (ns4||ns5) {
		mouseX = evt.pageX;
		mouseY = evt.pageY;
	} else if (ie4||ie5) {
		mouseX = window.event.clientX + document.body.scrollLeft;
		mouseY = window.event.clientY + document.body.scrollTop;
	}
	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 space available.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
	if (ns4) {
		if (!tipFollowMouse) {mouseX=evt.pageX; mouseY=evt.pageY;	}
		if ((mouseX+offX+tooltip.width) > (window.innerWidth-20 + window.pageXOffset)) tipcss.left = mouseX - (tooltip.width + offX);
		else tipcss.left = mouseX + offX;
		if ((mouseY+offY+tooltip.height) > (window.innerHeight-20 + window.pageYOffset)) tipcss.top = mouseY - (tooltip.height + offY);
		else tipcss.top = mouseY + offY;
	}
	
	else if (ie4||ie5) {
		if (!tipFollowMouse) {
			mouseX = window.event.clientX + document.body.scrollLeft;
			mouseY = window.event.clientY + document.body.scrollTop;
		}
		if ((mouseX+offX+tooltip.clientWidth) > (document.body.clientWidth + document.body.scrollLeft)) 
			tipcss.pixelLeft = mouseX-(tooltip.clientWidth + offX);
		else tipcss.pixelLeft = mouseX + offX;
	
		if ((mouseY+offY+tooltip.clientHeight) > (document.body.clientHeight+document.body.scrollTop)) 
			tipcss.pixelTop = mouseY-(tooltip.clientHeight + offY);
		else tipcss.pixelTop = mouseY + offY;
	}
	
	else if (ns5) {
		if (!tipFollowMouse) {mouseX=evt.pageX; mouseY=evt.pageY;}
		if ((mouseX+offX+tooltip.offsetWidth) > (window.innerWidth-20 + window.pageXOffset)) 
 			tipcss.left = mouseX - (tooltip.offsetWidth + offX);
	  else tipcss.left = mouseX + offX;
		
		if ((mouseY+offY+tooltip.offsetHeight) > (window.innerHeight-20 + window.pageYOffset)) 
			tipcss.top = mouseY - (tooltip.offsetHeight + offY);
	  else tipcss.top = mouseY + offY;
	}
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	tipcss.visibility = "hidden";
	//	t2=setTimeout("tipcss.visibility='hidden'",100);
}
///////////// end tooltip code ///////////////
