var delay = 19000; //set delay between message change (in miliseconds)
var maxsteps=50; // number of steps to take to change from start color to endcolor
var stepdelay=60; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(128,128,128); // start color (red, green, blue)
var endcolor=new Array(52,47,43); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div style="font:normal 14px Arial; padding:12px;">';
fcontent[0]="[Nonviolence] is a force that works silently and apparently slowly. In reality, there is no force in the world that is so direct or swift in working.<p align='right'>Mahatma Gandhi</p>";
fcontent[1]="Never underestimate the power of a few committed people to change the world. Indeed, it is the only thing that ever has.<p align='right'>Margaret Mead</p>";
fcontent[2]="And so, my fellow Americans, ask not what your country can do for you; ask what you can do for your country.<p align='right'>John F. Kennedy</p>";
fcontent[3]="Hatred never ceases by hatred, but by love alone is healed.<p align='right'>The Buddha</p>";
fcontent[4]="Love your neighbor as yourself.<p align='right'>Jesus Christ</p>";
fcontent[5]="If you really love your people, help show them how to turn their backs on violence and throw off their fear.<p align='right'>Mahatma Gandhi</p>";
fcontent[6]="Force is all-conquering, but its victories are short-lived.<p align='right'>Abraham Lincoln </p>";
fcontent[7]="If a free society cannot help the many who are poor, it cannot save the few who are rich..<p align='right'>John F. Kennedy</p>";
fcontent[8]="I object to violence because when it appears to do good, the good is only temporary; the evil it does is permanent.<p align='right'>Mahatma Gandhi</p>";
fcontent[9]="Tell General Howard I know his heart. What he told me before I have in my heart....  Hear me, my chiefs. I am tired; my heart is sick and sad. From where the sun now stands, I will fight no more forever.<p align='right'>Chief Joseph, Nez Perce Native American Chief</p>";
fcontent[10]="Our lives begin to end the day we become silent about things that matter.<p align='right'>Martin Luther King Jr.</p>";
fcontent[11]="All truth passes through three stages. First, it is ridiculed. Second, it is violently opposed. Third, it is accepted as being self-evident.<p align='right'>Arthur Schopenhauer</p>";
fcontent[12]="If you seek Truth, you will not seek to gain a victory by every possible means; and when you have found Truth, you need not fear being defeated.<p align='right'>Epictetus</p>";
fcontent[13]="Truth never damages a cause that is just.<p align='right'>Mahatma Gandhi</p>";
fcontent[14]="Our scientific power has outrun our spiritual power. We have guided missiles and misguided men.<p align='right'>Martin Luther King Jr.</p>";
fcontent[15]="Let us never negotiate out of fear, but let us never fear to negotiate.<p align='right'>John F. Kennedy</p>";
fcontent[16]="Am I not destroying my enemies when I make friends of them?<p align='right'>Abraham Lincoln</p>";
fcontent[17]="Here in America we are descended in blood and in spirit from revolutionists and rebels - men and women who dare to dissent from accepted doctrine. As their heirs, may we never confuse honest dissent with disloyal subversion.<p align='right'>Dwight D. Eisenhower</p>";
fcontent[18]="I believe that unarmed truth and unconditional love will have the final word in reality. That is why right, temporarily defeated, is stronger than evil triumphant.<p align='right'>Martin Luther King Jr.</p>";
fcontent[19]="Whether you think you can or think you can't, you are right.<p align='right'>Henry Ford </p>";
fcontent[20]="A man is but the product of his thoughts what he thinks, he becomes.<p align='right'>Mahatma Gandhi</p>";
fcontent[21]="Darkness can not drive out darkness; only light can do that. Hate cannot drive out hate; only love can do that.<p align='right'>Martin Luther King, Jr.</p>";
fcontent[22]="Whenever the people are well informed, they can be trusted with their own government; that whenever things get so far wrong as to attract their notice, they may be relied on to set them to rights.<p align='right'>Thomas Jefferson</p>";
fcontent[23]="A small body of determined spirits fired by an unquenchable faith in their mission can alter the course of history.<p align='right'>Mahatma Gandhi</p>";
fcontent[24]="We must combine the toughness of the serpent with the softness of the dove, a tough mind and a tender heart.<p align='right'>Martin Luther King, Jr.</p>";
fcontent[25]="The highest use of capital is not to make more money, but to make money do more for the betterment of life.<p align='right'>Henry Ford</p>";
fcontent[26]="Always aim at complete harmony of thought and word and deed. Always aim at purifying your thoughts and everything will be well.<p align='right'>Mahatma Gandhi</p>";
fcontent[27]="The ultimate measure of a man is not where he stands in moments of comfort and convenience, but where he stands at times of challenge and controversy.<p align='right'>Martin Luther King, Jr.</p>";
fcontent[28]="There is one rule for the industrialist and that is: Make the best quality of goods possible at the lowest cost possible, paying the highest wages possible.<p align='right'>Henry Ford</p>";
fcontent[29]="As human beings, our greatness lies not so much in being able to remake the world - that is the myth of the atomic age - as in being able to remake ourselves.<p align='right'>Mahatma Gandhi</p>";
fcontent[30]="A business that makes nothing but money is a poor kind of business.<p align='right'>Henry Ford</p>";
fcontent[31]="Honesty is the first chapter of the book of wisdom.<p align='right'>Thomas Jefferson</p>";
fcontent[32]="Fourscore and seven years ago our fathers brought forth upon this continent a new nation, conceived in liberty, and dedicated to the proposition that all men are created equal.<p align='right'>Abraham Lincoln</p>";
fcontent[33]="Where love is, there God is also.<p align='right'>Mahatma Gandhi</p>";
fcontent[34]="All this will not be finished in the first one hundred days. Nor will it be finished in the first one thousand days, nor in the life of this Administration, nor even perhaps in our lifetime on this planet. But let us begin.<p align='right'>John F. Kennedy</p>";
fcontent[35]="Each one has to find his peace from within. And peace to be real must be unaffected by outside circumstances.<p align='right'>Mahatma Gandhi</p>";
fcontent[36]="Nearly all men can stand adversity, but if you want to test a man's character, give him power.<p align='right'>Abraham Lincoln</p>";
fcontent[37]="For those to whom much is given, much is required.<p align='right'>John F. Kennedy</p>";
fcontent[38]="We hold these truths to be self-evident: That all men are created equal; that they are endowed by their Creator with certain unalienable rights; that among these are life, liberty, and the pursuit of happiness.<p align='right'>Thomas Jefferson</p>";
fcontent[39]="Honest disagreement is often a good sign of progress.<p align='right'>Mahatma Gandhi</p>";
fcontent[40]="When angry, count ten before you speak; if very angry, one hundred.<p align='right'>Thomas Jefferson</p>";
fcontent[41]="Whenever I hear anyone arguing for slavery, I feel a strong impulse to see it tired on him personally.<p align='right'>Abraham Lincoln</p>";
fcontent[42]="I have nothing new to teach the world. Truth and Non-violence are as old as the hills. All I have done is to try experiments in both on as vast a scale as I could.<p align='right'>Mahatma Gandhi</p>";
fcontent[43]="I have nothing new to teach the world. Truth and Non-violence are as old as the hills. All I have done is to try experiments in both on as vast a scale as I could.<p align='right'>Mahatma Gandhi</p>";
closetag='</div>';
fcontent[44]="It's not too late at all.  You just don't yet know what you are capable of.<p align='right'>Mahatma Gandhi</p>";
fcontent[45]="You cannot simultaneously prevent and prepare for war.<p align='right'>Albert Einstein</p>";
fcontent[46]="Those who say it cannot be done should not interrupt the people doing it.<p align='right'>Chinese Proverb</p>";
fcontent[47]="The world is too dangerous for anything but truth and too small for anything but love.<p align='right'>William Sloane Coffin</p>";
closetag='</div>';
var fwidth='180px';
var fheight='215px';
var fheight2='225px';
var maxlen='260';
var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.
var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;

function strlen(string){
    return ("" + string).length;
}
//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

  len=strlen(fcontent[index]);
  if(len>maxlen){
   document.getElementById("fscroller").style.height=fheight2;
//   alert(index+'  '+len);
  }else{   document.getElementById("fscroller").style.height=fheight; }

    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 15);
  }
  else if (ie4)
    document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
  index++
}
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);
  }
}
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);
	
  }   
}
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="background-color:#AEAF9D; border:1px solid gray;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

