function rand ( n )
{
  return ( Math.floor ( Math.random ( ) * (n + 1) ) );
}

function startTicker()
{
  // Reset tracker vars
  curLength = 0;
  itemNo = rand(itemCount);

  if (document.getElementById)
  {
    runTicker();
  }
  else
  {
    return true;
  }
} // function startTicker

// Ticker main run loop
function runTicker()
{
  var pauseTime;
  aTag = document.getElementById("ticker");

  // Get next news item
  if(curLength == 0)
  {
    itemNo++;
    if(itemNo >= itemCount)
    {
       itemNo = 0;
    }
    itemNo = itemNo % itemCount;
    curItem = ticker[itemNo][0].replace(/&quot;/g,'"');
    curURL = '';

    if (ticker[itemNo].length > 1)
    {
      aTag.parentNode.innerHTML = '<a id="ticker"></a>';
      curURL = ticker[itemNo][1].replace(/&quot;/g,'"');
    }
    else
      aTag.parentNode.innerHTML = '<span id="ticker"></span>';

    aTag = document.getElementById("ticker");
    aTag.href = curURL;
  } // if

  // Display text
  aTag.innerHTML = curItem.substring(0,curLength);

  // set string length
  if(curLength != curItem.length)
  {
    curLength++;
    pauseTime = charTimeout;
  } // if
  else
  {
    curLength = 0;
    pauseTime = itemTimeout;
  } // else

  setTimeout("runTicker()", pauseTime);
} // function runTicker