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=50; // time in miliseconds of a single step
var startcolor= new Array(255,255,255); // start color (red, green, blue)
var endcolor=new Array(0,0,0); // end color (red, green, blue)
var fcontent=new Array();
begintag='<div style="font: normal 11px Verdana; padding: 5px;text-align:left"><BR>'; //set opening tag, such as font declarations
fcontent[0]="<i>The result quality is amazing. I got all the songs i wanted to listen to</i><BR><BR><B>Abhilash Pandey</B>";
fcontent[1]="<i>I have been listening to online music for so long. But nothing better that Guruji.com. All songs at one place. It's really awesome</i><BR><BR><B>Sonia Katri</B>";
fcontent[2]="<i>I got my mom to listen to one of her favorites Bengali song \"Laal Jhuti Kakatua \". Mom happy! Me happy! Thanks Guruji.com</i><BR><BR><B>Saurabh Ghosh</B>";
fcontent[3]="<i>I told all my friends that they can now listen to Bhojpuri songs online. Really felt happy when i came across Guruji.com</i><BR><BR><B>Ajay Tiwari</B>";
fcontent[4]="<i>Wow, 10 out of 10. I got all the songs buddy. All oldies are available online now. Really musical stuff</i><BR><BR><B>Sanjay Kishore</B>";
fcontent[5]="<i>As a quiz nut,wanted to find the only song by Kishore Kumar in Kannada and there it was on guruji.com</i><BR><BR><B>Karthik. M</B>";
fcontent[6]="<i>What was cool about Guruji music is that i could  find both the original and the remix versions of my favorite song.</i><BR><BR><B>Tanmay</B>";
fcontent[7]="<i>My favorites! Me and my bad memory can now listen to the songs from Guruji my favorites.</i><BR><BR><B>Vivek Jha</B>";
fcontent[8]="<i>Any Language, Any Song. Listen to music on guruji.com. It's a great music site.</i><BR><BR><B>Ranjan Pawar</B>";


closetag='</div>';
var fwidth='100px'; //set scroller width
var fheight='100px'; //set scroller height 
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;
/*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++
}
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 (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent
