var list1; 
var tickerObj1; 
var hex1 = 255;

function fadeText1(divId) {
  if(tickerObj1)
  {
    if(hex1>0) {
      hex1-=5; // increase color darkness
      tickerObj1.style.color="rgb("+hex1+","+hex1+","+hex1+")";
      setTimeout("fadeText1('" + divId + "')", fadeSpeed1); 
    } else
      hex1=255; //reset hex value
  }
}

function initialiseList1(divId,link) {
  tickerObj1 = document.getElementById(divId);
  if(!tickerObj1)
    reportError1("Could not find a div element with id \"" + divId + "\"");
  list1 = tickerObj1.childNodes;

  if(list1.length <= 0)
    reportError1("The div element \"" + divId + "\" does not have any children");
  for (var i=0; i<list1.length; i++) {
    var node = list1[i];
    if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 
    	tickerObj1.removeChild(node);
  }
  run1(divId, 0);
}

function run1(divId, count) {
  fadeText1(divId);
  list1[count].style.display = "block";
  if(count > 0)
    list1[count-1].style.display = "none";
  else
    list1[list1.length-1].style.display = "none";
  count++;
  if(count == list1.length)
    count = 0;
  window.setTimeout("run1('" + divId + "', " + count+ ")", interval1*1000);
}
function reportError1(error) {
  alert("The script could not run because you have errors:\n\n" + error);
  return false;
}

var interval1 = 5; // interval in seconds
var fadeSpeed1 = 40;




var list; 
var tickerObj; 
var hex = 255;

function fadeText(divId) {
  if(tickerObj)
  {
    if(hex>0) {
      hex-=5; // increase color darkness
      tickerObj.style.color="rgb("+hex+","+hex+","+hex+")";
      setTimeout("fadeText('" + divId + "')", fadeSpeed); 
    } else
      hex=255; //reset hex value
  }
}

function initialiseList(divId) {
  tickerObj = document.getElementById(divId);
  if(!tickerObj)
    reportError("Could not find a div element with id \"" + divId + "\"");
  list = tickerObj.childNodes;
  if(list.length <= 0)
    reportError("The div element \"" + divId + "\" does not have any children");
  for (var i=0; i<list.length; i++) {
    var node = list[i];
    if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 
              tickerObj.removeChild(node);
  }
  run(divId, 0);
}

function run(divId, count) {
  fadeText(divId);
  list[count].style.display = "block";
  if(count > 0)
    list[count-1].style.display = "none";
  else
    list[list.length-1].style.display = "none";
  count++;
  if(count == list.length)
    count = 0;
  window.setTimeout("run('" + divId + "', " + count+ ")", interval*1000);
}
function reportError(error) {
  alert("The script could not run because you have errors:\n\n" + error);
  return false;
}

var interval = 5; // interval in seconds
var fadeSpeed = 40;
