<!--
//***********************************************************
// 	TIP OF THE DAY 
//***********************************************************
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

function loadXML(xmlFile)
{
  xmlDoc.async="false";
  //xmlDoc.onreadystatechange=verify;
  xmlDoc.load(xmlFile);
  xmlObj=xmlDoc.documentElement;
}
function get_random(nTips)
{
    var ranNum= Math.round(Math.random()*nTips);
    return ranNum;
}

function loadTips(){
   loadXML('xml/tip_of_day.xml');
   var tipsNode = xmlObj.childNodes;
   var totalTips = tipsNode.length
   var showTip = get_random(totalTips) - 1; // gets the random number then substracts 1 to pull the corresponding XML node
   if (showTip < 0){
   		showTip = 0;
   }

   var t;
 
   if (xmlDoc.readyState == 4){
	t = ('<p><b>' + tipsNode(showTip).getAttribute("name") + '</b><br><br>');
	t += (tipsNode(showTip).firstChild.text + "</p>");
	document.getElementById("tipOftheDay").innerHTML = t;
   }
}

//***********************************************************
//		OPEN NEW WINDOW
//***********************************************************
var newwin;
function launchwin(winurl,winname,winfeatures)
{

						//This launches a new window and then
						//focuses it if window.focus() is supported.

	newwin = window.open(winurl,winname,winfeatures);
	if(javascript_version > 1.0){
	   setTimeout('newwin.focus();',250);	//delay a bit here because IE4 encounters errors
						//when trying to focus a recently opened window
	}
}
//***********************************************************
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//***********************************************************
//		TICKER
//***********************************************************
var xmlDso, tickerSet;
function initTicker(xmlFile, objName, counter, maxMsgs, timeOut) {
    if(document.all&&navigator.userAgent.indexOf("Opera")==-1) {
        eval('xmlDso='+objName+'.XMLDocument');
        xmlDso.load(xmlFile);
		//alert(xmlDso.documentElement.childNodes.length);
        setTimeout("xmlDsoTicker('"+objName+"','"+counter+"','"+maxMsgs+"','"+timeOut+"')", timeOut);
    }
    else {
        alert('This Ticker works with IE4+ only!');
        return false;
    }
}

function xmlDsoTicker(objName, counter, maxMsgs, timeOut) {
    eval('tickerSet=' + objName + '.recordset');
    if(!tickerSet.EOF && counter<maxMsgs-1) {
        tickerSet.MoveNext();
        counter++;
    }
    else {
        counter=0;
        tickerSet.MoveFirst();
    }
    setTimeout("xmlDsoTicker('"+objName+"','"+counter+"','"+maxMsgs+"','"+timeOut+"')", timeOut);
}
/*************************************************************************
  This code is from Dynamic Web Coding at dyn-web.com
  Copyright 2003-5 by Sharon Paine 
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/

function doTooltip(e, msg) {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.show(e, msg);
}

function hideTip() {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.hide();
}
	
// variables for tooltip content 
var tipRich = '<div class="tp1">This text is in a div with it\'s own class for different style specifications than the tooltip. </div>';
var tipImg = '<div style="text-align:center"><img src="images/dot-com-btn.gif" width="176" height="30" alt="" border="0"></div>';
var tipImgTxt = '<img src="images/sm-duck.gif" width="90" height="44" alt="" border="0"><div class="tp2">Images and text can go together in a tooltip.</div>';
var tipTerms = "If you plan to use our code, please follow our terms. Thank you.";
//-->
