/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Mike Hudson :: http://www.afrozeus.com */

function setupFadeLinks() {
  arrFadeLinks[17]  = "http://www.cdroms.com.au/cd/cdcases.html";
  arrFadeTitles[17] = "Politics is made up largely of irrelevancies. -- Dalton Camp<br><br>No one has ever had an idea in a dress suit. -- Sir Frederick G. Banting";

  arrFadeLinks[16]  = "http://www.cdroms.com.au/cd/cdcases.html";
  arrFadeTitles[16] = "Idealism is what precedes experience; cynicism is what follows. -- David T. Wolf<br><br>I used to think that the brain was the most wonderful organ in my body. Then I realized who was telling me this. -- Emo Phillips, Neuropsychology: Clinical and Experimental Foundations";

  arrFadeLinks[15]  = "http://www.cdroms.com.au/cd/cdcases.html";
  arrFadeTitles[15] = "Man is ready to die for an idea, provided that idea is not quite clear to him. -- Paul Eldridge<br><br>After two years in Washington, I often long for the realism and sincerity of Hollywood. -- Fred Thompson, Speech before the Commonwealth Club of California";

  arrFadeLinks[13]  = "http://www.cdroms.com.au/cd/cdcases.html";
  arrFadeTitles[13] = "When I took office, only high energy physicists had ever heard of what is called the Worldwide Web.... Now even my cat has its own page. -- Bill Clinton, announcement of Next Generation Internet initiative, 1996<br><br>You may have to fight a battle more than once to win it. -- Margaret Thatcher";

  arrFadeLinks[12]  = "http://www.cdroms.com.au/cd/cdcases.html";
  arrFadeTitles[12] = "Nobody believes the official spokesman... but everybody trusts an unidentified source.  -- Ron Nesen<br><br>There is a tragic flaw in our precious Constitution, and I don't know what can be done to fix it. This is it: Only nut cases want to be president. -- Kurt Vonnegut, 'Cold Turkey', In These Times, May 10, 2004";

  arrFadeLinks[11]  = "http://www.cdroms.com.au/cd/flashprices.html";
  arrFadeTitles[11] = "There is no greater importance in all the world like knowing you are right and that the wave of the world is wrong, yet the wave crashes upon you. -- Norman Mailer, Armies Of The Night<br><br>I have left orders to be awakened at any time in case of national emergency, even if I'm in a cabinet meeting. -- Ronald Reagan";

  arrFadeLinks[10]  = "http://www.cdroms.com.au/cd/flashprices.html";
  arrFadeTitles[10] = "I believe that people would be alive today if there were a death penalty. -- Nancy Reagan<br><br>Think of what would happen to us in America if there were no humorists; life would be one long Congressional Record. -- Tom Masson";

  arrFadeLinks[9]  = "http://www.cdroms.com.au/cd/flashprices.html";
  arrFadeTitles[9] = "There are 10^11 stars in the galaxy. That used to be a huge number. But it's only a hundred billion. It's less than the national deficit! We used to call them astronomical numbers. Now we should call them economical numbers. -- Richard Feynman<br><br>We need a president who's fluent in at least one language. -- Buck Henry";

  arrFadeLinks[8]  = "http://www.cdroms.com.au/cd/flashprices.html";
  arrFadeTitles[8] = "The illegal we do immediately. The unconstitutional takes a little longer. -- Henry Kissinger, New York Times, Oct. 28, 1973<br><br>Democracy means government by discussion, but it is only effective if you can stop people talking. -- Clement Atlee";

  arrFadeLinks[7]  = "http://www.cdroms.com.au/cd/flashprices.html";
  arrFadeTitles[7] = "The only difference between the Democrats and the Republicans is that the Democrats allow the poor to be corrupt, too.  -- Oscar Levant<br><br>I believe that people would be alive today if there were a death penalty. -- Nancy Reagan";

  arrFadeLinks[6]  = "http://www.cdroms.com.au/cd/flashprices.html";
  arrFadeTitles[6] = "The problem with any unwritten law is that you don't know where to go to erase it. -- Glaser and Way<br><br>History teaches us that men and nations behave wisely once they have exhausted all other alternatives. -- Abba Eban";

  arrFadeLinks[5]  = "http://www.cdroms.com.au/cd/flashprices.html";
  arrFadeTitles[5] = "There is no greater importance in all the world like knowing you are right and that the wave of the world is wrong, yet the wave crashes upon you. -- Norman Mailer, Armies Of The Night<br><br>Martyrdom... is the only way in which a man can become famous without ability. -- George Bernard Shaw, The Devil's Disciple (1901) act 3";

  arrFadeLinks[4]  = "http://www.cdroms.com.au/cd/flashprices.html";
  arrFadeTitles[4] = "Whoso would be a man must be a nonconformist. -- Ralph Waldo Emerson<br><br>To be willing to die for an idea is to set a rather high price on conjecture. -- Anatole France";

  arrFadeLinks[3]  = "http://www.cdroms.com.au/cd/flashprices.html";
  arrFadeTitles[3] = "You may have to fight a battle more than once to win it. -- Margaret Thatcher<br><br>The danger is not that a particular class is unfit to govern. Every class is unfit to govern.  -- Lord Acton, Letter to Mary Gladstone, 1881";

  arrFadeLinks[2]  = "http://www.cdroms.com.au/cd/flashprices.html";
  arrFadeTitles[2] = "More than any other time in history, mankind faces a crossroads. One path leads to despair and utter hopelessness. The other, to total extinction. Let us pray we have the wisdom to choose correctly.  -- Woody Allen, My Speech to the Graduates<br><br>When I am abroad, I always make it a rule never to criticize or attack the government of my own country. I make up for lost time when I come home. -- Sir Winston Churchill";

  arrFadeLinks[1]  = "http://www.cdroms.com.au/cd/flashprices.html";
  arrFadeTitles[1] = "A conservative is a man with two perfectly good legs who, however, has never learned to walk forward. -- Franklin D. Roosevelt, radio address, Oct. 26, 1939<br><br>America is a large, friendly dog in a very small room. Every time it wags its tail, it knocks over a chair. -- Arnold Toynbee";

  arrFadeLinks[0]  = "http://www.cdroms.com.au/cd/flashprices.html";
  arrFadeTitles[0] = "The word 'politics' is derived from the word 'poly', meaning 'many', and the word 'ticks', meaning 'blood sucking parasites'.-- Larry Hardiman<br><br>When you think of the long and gloomy history of man, you will find more hideous crimes have been committed in the name of obedience than have ever been committed in the name of rebellion. -- C. P. Snow";

  


}



// You can also play with these variables to control fade speed, fade color, and how fast the colors jump.

var m_FadeOut =10;
var m_FadeIn=0;
var m_Fade = 0;
var m_FadeStep = 3;
var m_FadeWait =8000;
var m_bFadeOut = true;

var m_iFadeInterval;

window.onload = Fadewl;

var arrFadeLinks;
var arrFadeTitles;
var arrFadeCursor = 0;
var arrFadeMax;

function Fadewl() {
  m_iFadeInterval = setInterval(fade_ontimer, 50);
  arrFadeLinks = new Array();
  arrFadeTitles = new Array();
  setupFadeLinks();
  arrFadeMax = arrFadeLinks.length-1;
  setFadeLink();
}

function setFadeLink() {
  var ilink = document.getElementById("fade_link");
  ilink.innerHTML = arrFadeTitles[arrFadeCursor];
  ilink.href = arrFadeLinks[arrFadeCursor];
}

function fade_ontimer() {
  if (m_bFadeOut) {
    m_Fade+=m_FadeStep;
    if (m_Fade>m_FadeOut) {
      arrFadeCursor++;
      if (arrFadeCursor>arrFadeMax)
        arrFadeCursor=0;
      setFadeLink();
      m_bFadeOut = false;
    }
  } else {
    m_Fade-=m_FadeStep;
    if (m_Fade<m_FadeIn) {
      clearInterval(m_iFadeInterval);
      setTimeout(Faderesume, m_FadeWait);
      m_bFadeOut=true;
    }
  }
  var ilink = document.getElementById("fade_link");
  if ((m_Fade<m_FadeOut)&&(m_Fade>m_FadeIn))
    ilink.style.color = "#" + ToHex(m_Fade);
}

function Faderesume() {
  m_iFadeInterval = setInterval(fade_ontimer, 10);
}

function ToHex(strValue) {
  try {
    var result= (parseInt(strValue).toString(16));

    while (result.length !=2)
            result= ("0" +result);
    result = result + result + result;
    return result.toUpperCase();
  }
  catch(e)
  {
  }
}
