function Ticker(name, id, shiftBy, interval, tickerWidth) {
  this.tickerWidth = tickerWidth;
  this.name     = name;
  this.id       = id;
  this.shiftBy  = shiftBy ? shiftBy : 1;
  this.interval = interval ? interval : 100;
  this.runId	= null;
  this.div = document.getElementById(id);  
  // remove extra textnodes that may separate the child nodes
  // of the ticker div
  var node = this.div.firstChild;
  var next;
  while (node) {
    next = node.nextSibling;
    if (node.nodeType == 3) {this.div.removeChild(node);}
    node = next;
  }
  //end of extra textnodes removal
  this.left = 0;
  this.shiftLeftAt = this.div.firstChild.offsetWidth;
  this.div.style.height	= this.div.firstChild.offsetHeight;
  this.div.style.width = 2 * screen.availWidth;
  this.div.style.visibility = 'visible';
}

function startTicker() {
  this.stop();  
  this.left -= this.shiftBy;
  if (this.left <= -this.shiftLeftAt) {            
    this.left = this.tickerWidth;    
    this.div.appendChild(this.div.firstChild);
    this.shiftLeftAt = this.div.firstChild.offsetWidth;
  }
  this.div.style.left = (this.left + 'px');
  this.runId = setTimeout(this.name + '.start()', this.interval);
}

function stopTicker() {
  if (this.runId) {clearTimeout(this.runId);}
  this.runId = null;
}

/* Prototypes for Ticker */
Ticker.prototype.start = startTicker;
Ticker.prototype.stop = stopTicker;

/* Netscape 4 support */
function scrollit(nameNS, idNS, shiftByNS, intervalNS,tickerWidth,thelength) {	
  var thisTicker = eval("document."+nameNS+".document."+idNS);
  thisTicker.left -= shiftByNS;
  if (thisTicker.left >= thelength * (-1)){    
    setTimeout("scrollit('"+nameNS+"', '"+idNS+"', "+shiftByNS+", "+intervalNS+","+tickerWidth+","+thelength+")",intervalNS);
  } else {    
    thisTicker.left = tickerWidth;
    scrollit(nameNS, idNS, shiftByNS, intervalNS,tickerWidth,thelength);
  }
}
