// $Id: quotetickertape.js.perlpp 4305 2009-12-21 23:03:55Z earl $
var messages = new Array(
    "Men occasionally stumble over the truth, "
    + "but most pick themselves up and hurry off "
    + "as if nothing had happened.  -- Winston Churchill",
    "Nothing will benefit human health "
    + "and increase chances for survival of life on Earth "
    + "as much as the evolution to a vegetarian diet.  -- Albert Einstein",
    "To sin by silence when they should protest "
    + "makes cowards out of men.  -- Abraham Lincoln",
    "The whole aim of practical politics is to keep the populace alarmed "
    + "(and hence clamorous to be led to safety) "
    + "by menacing it with an endless series of hobgoblins, "
    + "all of them imaginary.  -- H.L. Mencken",
    "We do not inherit the earth from our fathers.  "
    + "We borrow it from our children.  -- David Bower",
    "The difference in mind between man and the higher animals, "
    + "great as it is, certainly is one of degree and not of kind.  "
    + "-- Charles Darwin",
    "We did not weave the web of life; we are merely a strand in it. "
    + "Whatever we do to the web, we do to ourselves.  -- Ted Perry",
    "The corporate grip on opinion in the United States is one of the "
    + "wonders of the Western world. No first world country has ever "
    + "managed to eliminate so entirely from its media all "
    + "objectivity -- much less dissent.  -- Gore Vidal",
    "Whenever I hear anyone arguing for slavery, I feel a strong impulse to "
    + "see it tried on him personally.  -- Abraham Lincoln");
function spaces (n)
{
  var s = "";
  for (var b = " "; b.length <= n; b += b) {
    if (b.length & n) {
      s += b;
    }
  }
  return s;
}
function tickerTape (msgid, position)
{
  window.status = position < 0
		? spaces(-position) + messages[msgid]
		: messages[msgid].substring(position, messages[msgid].length);
  position += 1;
  if (position == messages[msgid].length) {
    position = -(window.innerWidth >> 2);
    var omsgid = msgid;
    do {
      msgid = Math.floor(Math.random() * messages.length);
    } while (msgid == omsgid);
  }
  timerTwo = window.setTimeout("tickerTape("+msgid+","+position+")", 50);
}
function startTickerTape ()
{
  tickerTape(Math.floor(Math.random()*3), -(window.innerWidth >> 2));
}
