/* 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[14]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[14] = "Sometimes people carry to such perfection the mask they have assumed that in due course they actually become the person they seem. -- W. Somerset Maugham, The Moon and Sixpence<br><br>But what is the difference between literature and journalism?...Journalism is unreadable and literature is not read. That is all. -- Oscar Wilde, The Critic as Artist, 1891";

  arrFadeLinks[3]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[3] = "Why do writers write? Because it isn't there. -- Thomas Berger<br><br>The trouble with being poor is that it takes up all of your time. -- Willem de Kooning";

  arrFadeLinks[2]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[2] = "The greatest challenge to any thinker is stating the problem in a way that will allow a solution. -- Bertrand Russell<br><br>Most advances in science come when a person for one reason or another is forced to change fields. -- Peter Borden";

  arrFadeLinks[1]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[1] = "Nothing can be so amusingly arrogant as a young man who has just discovered an old idea and thinks it is his own. -- Sidney J. Harris<br><br>Play: Work that you enjoy doing for nothing. -- Evan Esar, Esar's Comic Dictionary";

  arrFadeLinks[10]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[10] = "If you watch a game, it's fun. If you play at it, it's recreation.  If you work at it, it's golf. -- Bob Hope<br><br>Freedom of the press is limited to those who own one. -- A. J. Liebling";

  arrFadeLinks[9]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[9] = "I don't want to achieve immortality through my work... I want to achieve it through not dying. -- Woody Allen<br><br>Do you realize if it weren't for Edison we'd be watching TV by candlelight? -- Al Boliska";

  arrFadeLinks[8]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[8] = "Half the money I spend on advertising is wasted; the trouble is I don't know which half. -- John Wanamaker<br><br>The very first law in advertising is to avoid the concrete promise and cultivate the delightfully vague. -- Bill Cosby";

  arrFadeLinks[7]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[7] = "I'm living so far beyond my income that we may almost be said to be living apart. -- e e cummings<br><br>Every man is wise when attacked by a mad dog; fewer when pursued by a mad woman; only the wisest survive when attacked by a mad notion. -- Robertson Davies";

  arrFadeLinks[6]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[6] = "Machines take me by surprise with great frequency. -- Alan Turing<br><br>Half the money I spend on advertising is wasted; the trouble is I don't know which half. -- John Wanamaker";

  arrFadeLinks[5]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[5] = "People will buy anything that is one to a customer. -- Sinclair<br><br>He who builds a better mousetrap these days runs into material shortages, patent-infringement suits, work stoppages, collusive bidding, discount discrimination--and taxes. -- H. E. Martz";

  arrFadeLinks[4]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[4] = "Try to learn something about everything and everything about something. -- Thomas H. Huxley<br><br>All progress is based upon a universal innate desire on the part of every organism to live beyond its income. -- Samuel Butler, Notebooks, 1912";

  arrFadeLinks[13]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[13] = "Most advances in science come when a person for one reason or another is forced to change fields. -- Peter Bordeny<br><br>Every composer knows the anguish and despair occasioned by forgetting ideas which one had no time to write down. -- Hector Berlioz";

  arrFadeLinks[12]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[12] = "It is difficult to get a man to understand something when his job depends on not understanding it. -- Upton Sinclairy<br><br>Home computers are being called upon to perform many new functions, including the consumption of homework formerly eaten by the dog. -- Doug Larson";

  arrFadeLinks[11]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[11] = "Why do writers write? Because it isn't there. -- Thomas Berger<br><br>Management is doing things right; leadership is doing the right things. -- Peter Drucker";

  arrFadeLinks[0]  = "http://www.cdroms.com.au/cd/duplication.html";
  arrFadeTitles[0] = "If two men agree on everything, you may be sure that one of them is doing the thinking. -- Lyndon B. Johnson<br><br>When two men in business always agree, one of them is unnecessary. -- William Wrigley Jr.";


  
}



// 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)
  {
  }
}
