

var delay = 5000; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=100; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(148,207,21); // start color (red, green, blue)
var endcolor=new Array(255,255,255); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div style="font: bold 14px Arial; padding: 5px; vertical-align:middle; background-color:#009900;">'; //set opening tag, such as font declarations
fcontent[0]="\"Courage is the discovery that you may not win, and trying when you know you can lose.\" - Tom Krause";
fcontent[1]="\"Being happy doesn't mean that everything is perfect. It means that you've decided to look beyond the imperfections.\" - Anonymous";
fcontent[2]="\"It’s not what you are that holds you back, it’s what you think you are not.\" - Dennis Waitly";
fcontent[3]="\"If you can imagine it, you can achieve it; if you can dream it, you can become it.\" - William Arthur Ward";
fcontent[4]="\"Every artist was first an amateur.\" - Ralph Waldo Emerson";
fcontent[5]="\"First say to yourself what you would be; and then do what you have to do.\" - Epictetus";
fcontent[6]="\"The best way to prepare for life is to begin to live.\" - Elbert Hubbard";
fcontent[7]="\"They can because they think they can.\" - Virgil";
fcontent[8]="\"Nothing can stop the man with the right mental attitude from achieving his goal; nothing on earth can help the man with the wrong mental attitude.\" - Thomas Jefferson";
fcontent[9]="\"There is only one success - to be able to spend your life in your own way.\" - Christopher Morley";
fcontent[10]="\"I cannot give you the formula for success, but I can give you the formula for failure--which is: Try to please everybody.\" - Herbert Bayard Swope";
fcontent[11]="\"The only way of finding the limits of the possible is by going beyond them into the impossible.\" - Arthur C. Clarke";
fcontent[12]="\"Our greatest glory is not in never falling but in rising every time we fall.\" - Confucius"
fcontent[13]="\"Knowing is not enough; we must apply. Willing is not enough; we must do.\" - Johann Wolfgang von Goethe";
fcontent[14]="\"Nothing great was ever achieved without enthusiasm.\" - Ralph Waldo Emerson";
fcontent[15]="\"A loving heart is the truest wisdom.\" - Charles Dickens";
fcontent[16]="\"The significance of a man is not in what he attains but in what he longs to attain.\" - Kahlil Gibran";
fcontent[17]="\"That which does not kill you makes you stronger.\" - Neitzsche";
fcontent[18]="\"Anyone who has never made a mistake has never tried anything new.\" - Albert Einstein";
fcontent[19]="\"Happiness does not depend on outward things, but on the way we see them.\" - Leo Tolstoy";
fcontent[20]="\"There is only one way to happiness, and that is to cease worrying things which are beyond the power of our will.\" - Epictetus";
fcontent[21]="\"Dreams are free, so dream big.\" - Christine Pringle"	;
fcontent[22]="\"Never let life's hardships disturb you ... no one can avoid problems, not even saints or sages.\" - Nichiren Daishonen";
fcontent[23]="\"Ask yourself this question: Will this matter a year from now?\" - Richard Carlson";
fcontent[24]="\"Do not anticipate trouble, or worry about what may never happen. Keep in the sunlight.\" - Benjamin Franklin";
fcontent[25]="\"You cannot dream yourself into a character: you must hammer and forge yourself into one.\" - Henry D. Thoreau";
fcontent[26]="\"Some people walk in the rain. Others just get wet.\" - Roger Miller";
fcontent[27]="\"Take the first step in faith. You don't have to see the whole staircase, just take the first step.\" - Martin Luther King, Jr.";
fcontent[28]="\"You see things; and you say, 'Why?' But I dream things that never were; and I say, \'Why not?\'\" - George Bernard Shaw";
fcontent[29]="\"Anyone can give up, it's the easiest thing in the world to do. But to hold it together when everyone else would understand if you fell apart, that\'s true strength.\" - Anonymous";
fcontent[30]="\"People often say that motivation doesn\'t last. Well, neither does bathing - that\'s why we recommend it daily.\" - Zig Ziglar";
fcontent[31]="\"Man can live about forty days without food, about three days without water, about eight minutes without air, but only for one second without hope.\" - Anonymous";
fcontent[32]="\"People become really quite remarkable when they start thinking that they can do things. When they believe in themselves they have the first secret of success.\" - Norman Vincent Peale";
fcontent[33]="\"You have a very powerful mind that can make anything happen as long as you keep yourself centered.\" - Dr. Wayne W. Dyer";
fcontent[34]="\"Our attitude toward life determines life's attitude towards us.\" - John N. Mitchell";
fcontent[35]="\"I can\'t change the direction of the wind, but I can adjust my sails to always reach my destination.\" - Jimmy Dean";
closetag='</div>';

var fwidth='627px'; //set scroller width
var fheight='100%'; //set scroller height

var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////


var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=100;
var index=0;


/*Rafael Raposo edited function*/
//function to change content
function changecontent(){
  if (index>=fcontent.length)
    index=0;
  if (DOM2){
    document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 15);
  }
  else if (ie4)
    document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
  index++
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

function linkcolorchange(step){
  var obj=document.getElementById("fscroller").getElementsByTagName("A");
  if (obj.length>0){
    for (i=0;i<obj.length;i++)
      obj[i].style.color=getstepcolor(step);
  }
}

/*Rafael Raposo edited function*/
var fadecounter;
function colorfade(step) {
  if(step<=maxsteps) {	
    document.getElementById("fscroller").style.color=getstepcolor(step);
    if (fadelinks)
      linkcolorchange(step);
    step++;
    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
  }else{
    clearTimeout(fadecounter);
    document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
    setTimeout("changecontent()", delay);
	
  }   
}

/*Rafael Raposo's new function*/
function getstepcolor(step) {
  var diff
  var newcolor=new Array(3);
  for(var i=0;i<3;i++) {
    diff = (startcolor[i]-endcolor[i]);
    if(diff > 0) {
      newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
    } else {
      newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
    }
  }
  return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}

if (ie4||DOM2)
  document.write('<div id="fscroller" style="border:0px solid black;width:'+fwidth+';height:'+fheight+'"></div>');

if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent


