function nav_over(id_top, id_btm) {
  document.getElementById(id_top).style.backgroundColor='rgb(165, 201, 216)';
  //document.getElementById(id_btm).style.backgroundColor='rgb(103, 159, 181)';
  return true;
}
function nav_out(id_top, id_btm) {
  document.getElementById(id_top).style.backgroundColor='white';
  //document.getElementById(id_btm).style.backgroundColor='rgb(165, 201, 216)';
  return true;
}
function doPopUp(sURL, sID, iWidth, iHeight) {
  var iLeft = ((screen.width/2)-(iWidth/2));
  var iTop = ((screen.height/2)-(iHeight/2));
  newWindow = window.open(sURL,sID,'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+iWidth+',height='+iHeight+',left=' + iLeft +',top=' + iTop);
  newWindow.focus();
  return false;
}
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;


// Ticker startup
function startTicker()
{
	// Define run time values
	theCurrentStory     = -1;
	theCurrentLength    = 0;
	// Locate base objects
	if (document.getElementById) {	
		    theAnchorObject     = document.getElementById("tickerAnchor");
			runTheTicker();   	
		 }
	else {
            document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
            return true;
	}
}
// Ticker main run loop
function runTheTicker()
{
	var myTimeout;  
	// Go for the next story data block
	if(theCurrentLength == 0)
	{
		theCurrentStory++;
		theCurrentStory      = theCurrentStory % theItemCount;
		theStorySummary      = theSummaries[theCurrentStory].replace(/&quot;/g,'"');		
		theTargetLink        = theSiteLinks[theCurrentStory];
		theAnchorObject.href = theTargetLink;
		thePrefix 	     = "<span class=\"scrollitem\">" + theLeadString + "</span>";
	}
	// Stuff the current ticker text into the anchor
	theAnchorObject.innerHTML = thePrefix + 
	theStorySummary.substring(0,theCurrentLength) + whatWidget();
	// Modify the length for the substring and define the timer
	if(theCurrentLength != theStorySummary.length)
	{
	    if(theStorySummary.substring(theCurrentLength,theCurrentLength + 1) == '&')
	    {
	    	endofentity = theStorySummary.indexOf(';', theCurrentLength + 1);
	    	if(endofentity != -1)
	    	{
				theCurrentLength = endofentity;
	    	}
	    }  
		theCurrentLength++;
		myTimeout = theCharacterTimeout;
	}
	else
	{
		theCurrentLength = 0;
		myTimeout = theStoryTimeout;
	}
	// Call up the next cycle of the ticker
	setTimeout("runTheTicker()", myTimeout);
}
// Widget generator
function whatWidget()
{
	if(theCurrentLength == theStorySummary.length)
	{
		return theWidgetNone;
	}

	if((theCurrentLength % 2) == 1)
	{
		return theWidgetOne;
	}
	else
	{
		return theWidgetTwo;
	}
}

function showHide(inDIVID, inAID, showTxt, hideTxt) {
  theObj = document.getElementById(inDIVID);
  theObjA = document.getElementById(inAID);
  theDisp = theObj.style.display == "none" ? "block" : "none";
  theObj.style.display = theDisp;
  theDisp = theDisp == "block" ? hideTxt : showTxt;
  theObjA.innerHTML = theDisp;
}