/* script to scroll text in a table row from right to left */

/* Global variables */
var showit = 0;
var pos = 0;
var oldcolour = "";

function textflowon() {
   showit = 1;
   pos = 0;
   var scrollarea = document.getElementById("tickertape");
   scrollarea.style.border = "6";
   oldcolour = scrollarea.style.backgroundColor;
   scrollarea.style.backgroundColor = "#000000";
}

function textflowoff() {
   showit = 0;
}

function textflow(textparm) {
   scrolltext = textparm;
   var scrollarea = document.getElementById("tickertape");
   if (showit == 0) {
      scrollarea.firstChild.nodeValue = ".";
      scrollarea.style.border = "0";
      scrollarea.style.backgroundColor = oldcolour;
      return;
      }
   var displaytext = scrolltext.substring(pos, scrolltext.length) + scrolltext.substring(0, pos);
   scrollarea.firstChild.nodeValue = displaytext;
   pos++;
   if (pos > scrolltext.length) {
      pos = 0;
      }
   window.setTimeout("textflow(scrolltext)",100);
}
