  var curnews = 0;
  var curphase = 22;
  var prev_bg = -1;
  var neoncontent = "";
  var curni = 0;

  var newsToDisplay = new Array(10);
  
  function fillNewsToDisplay() {
    for (i = 1 ; i <= 10 && i < newsTab.length ; i++) {
      if (newsTab[i].length < 68) {
        newsToDisplay[i] = newsTab[i];
      } else {
        cutplace = newsTab[i].lastIndexOf(" ", 68);
        if (cutplace < 10) {
          newsToDisplay[i] = newsTab[i].substring(0, 65) + "...";
        } else {
          newsToDisplay[i] = newsTab[i].substring(0, cutplace) + "...";
        }
      }
      if (linkTab[i].substring(0,3) == "../") {
        linkTab[i] = linkTab[i].substring(3, linkTab[i].length);
      }
    }
  }

  function initiateNews(period) {
    if (document.all) {
      newsneon.innerHTML = '&nbsp;';
    } else {
      document.layers.newsneon.document.write('&nbsp;');
      document.layers.newsneon.document.close();
    }

    fillNewsToDisplay();
    curnews = 1;
    curphase = 9;
    pomnews = curnews;
    setTimeout("timeClick(" + period + ")", period * 500);
  }

  function timeClick(period) {
    if (curphase < 9) {
      curphase++;
      setTimeout("timeClick(" + period + ")", period * 820);
    } else {
      if (curphase == 9) {
        curni = 0;
        curphase++;
      }
      if (curphase == 10) {
        curni++;
        if (curni <= newsToDisplay[curnews].length) {
          if (document.all) {
            newsneon.innerHTML = '<a href="' + linkTab[pomnews] + '"id=neon_link>' + newsToDisplay[curnews].substr(0, curni) + '</a>';
          } else {
            document.layers.newsneon.document.write('<a href="' + linkTab[pomnews] + '"id=neon_link>' + newsToDisplay[curnews].substr(0, curni) + '</a>');
            document.layers.newsneon.document.close();
          }
        } else {
          curphase++;
        }
        setTimeout("timeClick(" + period + ")", period * 10);
        return;
      }
      if (curphase == 11) {
        curphase++;
        prev_bg == -1;
        setTimeout("timeClick(" + period + ")", period * 1000);
        return;
      }
      if (curphase > 11 && curphase < 22) {
        if (document.all) {
          if (prev_bg == -1) {
            prev_bg = document.all.item("neon_link").style.color;
            document.all.item("neon_link").style.color = '#ffffFF';
            curphase++;
          } else {
            document.all.item("neon_link").style.color = prev_bg;
            prev_bg = -1;
            curphase++;
          }
        } else {
          curphase = 22;
        }
        setTimeout("timeClick(" + period + ")", period * 300);
        return;
      }
      if (curphase == 22) {
        prev_bg == -1;
        curnews++;
        curnews = (curnews - 1) % (newsToDisplay.length - 1) + 1;
        curphase = 0;
        pomnews = curnews;
        setTimeout("timeClick(" + period + ")", period * 1000);
      }
    }
  }
