/* 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[0]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[0] = "It isn't necessary to have relatives in Kansas City in order to be unhappy. -- Groucho Marx<br><br>In case you're worried about what's going to become of the younger generation, it's going to grow up and start worrying about the younger generation. -- Roger Allen";

  arrFadeLinks[12]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[12] = "Children are all foreigners. -- Ralph Waldo Emerson<br><br>By the time a man realizes that maybe his father was right, he usually has a son who thinks he's wrong. -- Charles Wadsworth";

  arrFadeLinks[13]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[13] = "Before I got married I had six theories about bringing up children; now I have six children and no theories. -- John Wilmot<br><br>Learning to dislike children at an early age saves a lot of expense and aggravation later in life. -- Robert Byrne";

 arrFadeLinks[1]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[1] = "I'm a godmother, that's a great thing to be, a godmother. She calls me god for short, that's cute, I taught her that. -- Ellen DeGeneres, My Point and I Do Have One<br><br>Illegitimacy is something we should talk about in terms of not having it. -- Dan Quayle, 5/20/92 (reported in Esquire, 8/92)";

  arrFadeLinks[2]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[2] = "If your parents never had children, chances are you won't, either. -- Dick Cavett<br><br>If your dog is barking at the back door and your wife yelling at the front door, who do you let in first?  The Dog of course... at least he'll shut up after u let him in! --Anonymous"; 

  arrFadeLinks[3]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[3] = "Happiness is nothing more than good health and a bad memory. -- Albert Schweitzer<br><br>I take my wife everywhere, but she keeps finding her way back home,  always.--Anonymous - "; 

  arrFadeLinks[4]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[4] = "I take my children everywhere, but they always find their way back home. -- Robert Orben<br><br>Setting a good example for children takes all the fun out of middle age. William Feather"; 
 
  arrFadeLinks[5]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[5] = "I haven't spoken to my wife in years. I didn't want to interrupt her. -- Rodney Dangerfield<br><br>I have found the best way to give advice to your children is to find out what they want and then advise them to do it. -- Harry S Truman"; 

  arrFadeLinks[6]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[6] = "I hate women because they always know where things are. -- James Thurber<br><br>Children are all foreigners. -- Ralph Waldo Emerson";

  arrFadeLinks[7]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[7] = "I don't worry about terrorism. I was married for two years. --Sam Kinison<br><br>Few things are more satisfying than seeing your own children have teenagers of their own. -- Doug Larson";

  arrFadeLinks[8]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[8] = "I asked my wife, 'Where do you want to go for our anniversary?' She said,'Somewhere I have never been!' I told her, 'How about the kitchen?' –Anonymous<br><br>Happiness is having a large, loving, caring, close-knit family in another city. -- George Burns"; 

  arrFadeLinks[9]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[9] = "Few things are more satisfying than seeing your own children have teenagers of their own. -- Doug Larson<br><br>I'm not a real movie star. I've still got the same wife I started out with twenty-eight years ago. -- Will Rogers"; 

  arrFadeLinks[10]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[10] = "Every man should get married some time; after all, happiness is not the only thing in life!! --Anonymous<br><br>Eighty percent of married men cheat in America. The rest cheat in Europe. -- Jackie Mason"; 

  arrFadeLinks[11]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[11] = "Don't marry for money; you can borrow it cheaper. --Scottish Proverb<br><br>Don't accept rides from strange men, and remember that all men are strange. -- Robin Morgan";


  arrFadeLinks[14]  = "http://www.cdroms.com.au/cd/printing.html";
  arrFadeTitles[14] = "Bachelors should be heavily taxed. It is not fair that some men should be happier than others.--Oscar Wilde<br><br>Bad Teddy recently explained to me why he refuses to get to married. He says 'the wedding rings look like minature handcuffs.....' --Anonymous";


}



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