var interval = 5000;
var list;

function rotateNews(index) {
  if (index == list.length) {
    list[index - 1].style.display = "none";
    list[0].style.display = "block";
    setTimeout("rotateNews(1)", interval);
  } else {
    list[index - 1].style.display = "none";
    list[index].style.display = "block";
    setTimeout("rotateNews(" + (index + 1) + ")", interval);
  }
}

function startTicker() {
  list = document.getElementById("ticker").getElementsByTagName("li");
  list[0].style.display = "block";
  
  setTimeout("rotateNews(1)", interval);
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(startTicker);