var delay = 13000; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=40; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(255,255,255); // start color (red, green, blue)
var endcolor=new Array(50,63,71); // end color (red, green, blue)

var fcontent=new Array();
begintag=''; //set opening tag, such as font declarations
fcontent[0]="&quot;The center was there for me at a very low point in my life when there was no one else I felt I could turn to for guidance and support. The counseling I received brought me encouragement and hope for the future. I would recommend the Center to anyone who is looking for affordable, biblical counseling from loving people.&quot; <p>LLMFC Counselee</p>";
fcontent[1]="&quot;I was strengthened through the Word of God and I learned how it practically plays out in day to day life. My counselor gave me activities to do outside of the sessions and they were simple enough - read a book, do the corresponding workbook activities, read a Psalm a day and journal. Through this I found the psalm I now live by - Psalm 73. I found the key to my healing right there in my homework. God is with me and will be with me.&quot; <p>LLMFC Counselee</p>";
fcontent[2]="&quot;For several years I struggled with depression. The source was the sexual abuse that had occurred in my childhood. I lived in utter fear and intense shame over my dark secret. I finally spoke with a former professor who arranged for me to begin counseling at the Love-Life Marriage and Family Center. To this day, I still practice many of the things I learned there. They are part of my life and routine. I am no longer the frightened little child I once was. My life is no longer held captive by fear and temptation. Instead, I choose to use the practical, biblical tools I acquired in my months of counseling to conquer my fear and live victoriously.&quot; <p>LLMFC Counselee</p>";
fcontent[3]="&quot;No matter how seasoned we believe our Christian lives to be, we must grasp every tool available for receiving God’s grace and knowing His love. The Love-Life Marriage and Family Center was that tool for me.&quot; <p>LLMFC Counselee</p>";
fcontent[4]="&quot;For me, counseling isn’t just for immature Christians or people with problems. It’s one of God’s gracious rescue tools. I have recommended the center to friends and loved ones and wouldn’t hesitate to return myself – because I know the people at the center really care for me.&quot; <p>LLMFC Counselee</p>";
fcontent[5]="&quot;My sessions were encouraging because they offered me hope.&quot; <p>LLMFC Counselee</p>";
fcontent[6]="&quot;I sought counseling at the center because I was struggling with depression and the relationships in my life. I wanted more biblical counsel and help than my pastor could give and I think I needed a woman to talk to.&quot; <p>LLMFC Counselee</p>";
closetag='';

var fwidth='572px'; //set scroller width
var fheight='150px'; //set scroller height

var fadelinks=0;  //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=0;
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="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