/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: James Crooke :: http://www.cj-design.com */

/*Modified as necessary by Bill Kilborn for SeeNorthFlorida.com, http://billkilborn.com*/

var listxx; // global listxx variable cache
var tickerObjxx; // global tickerObjxx cache
var hexxx = 0;  // This is the starting value, xx55 would be full white

function fadeTextxx(divIdxx) {
  if(tickerObjxx)
  {
    if(hexxx<255) {
      hexxx=hexxx+5; // increase color darkness
      tickerObjxx.style.color="rgb("+hexxx+","+hexxx+","+hexxx+")";
      setTimeout("fadeTextxx('" + divIdxx + "')", fadeSpeedxx); 
    } else
      hexxx=0; //reset hex value - full white is 255
  }
}

function initialiseListxx(divIdxx) {
  tickerObjxx = document.getElementById(divIdxx);
  if(!tickerObjxx)
    reportError("Could not find a div element with id \"" + divIdxx + "\"");
  listxx = tickerObjxx.childNodes;
  if(listxx.length <= 0)
    reportErrorxx("The div element \"" + divIdxx + "\" does not have any children");
  for (var ixx=0; ixx<listxx.length; ixx++) {
    var nodexx = listxx[ixx];
    if (nodexx.nodeType == 3 && !/\S/.test(nodexx.nodeValue)) 
              tickerObjxx.removeChild(nodexx);
  }
  runxx(divIdxx, 0);
}

function runxx(divIdxx, countxx) {
  fadeTextxx(divIdxx);
  listxx[countxx].style.display = "block";
  if(countxx > 0)  
    listxx[countxx-1].style.display = "none";
  else
    listxx[listxx.length-1].style.display = "none";
  countxx++;
  if(countxx == listxx.length)
    countxx = 0;
  window.setTimeout("runxx('" + divIdxx + "', " + countxx+ ")", intervalxx*1000);
}
function reportErrorxx(errorxx) {
  alert("The script could not run because you have errors:\n\n" + errorxx);
  return false;
}

var intervalxx = 9; // interval in seconds
var fadeSpeedxx = 40; // fade speed, the lower the speed the faster the fade.  40 is normal.

