/***********************************************
* Fading Scroller- Š Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var delay = 2000; //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(56,56,56); // start color (red, green, blue)
var endcolor=new Array(242,226,6); // end color (red, green, blue)

var fcontent=new Array();
begintag=''; //set opening tag, such as font declarations
fcontent[0]='<a href="/lyrics/D/Dash_Berlin/">Dash Berlin</a><br /><a href="/lyrics/D/Dash_Berlin/10914/Never_Cry_Again/">Never Cry Again</a>';
fcontent[9]='<a href="/lyrics/S/Jordin_Sparks/">Jordin Sparks</a><br /><a href="/lyrics/S/Jordin_Sparks/11005/Walking_On_Snow/">Walking On Snow</a>';
fcontent[19]='<a href="/lyrics/L/Pixie_Lott/">Pixie Lott</a><br /><a href="/lyrics/L/Pixie_Lott/10927/Cry_Me_Out/">Cry Me Out</a>';
fcontent[14]='<a href="/lyrics/O/OneRepublic/">OneRepublic</a><br /><a href="/lyrics/O/OneRepublic/11080/Secrets/">Secrets</a>';
fcontent[6]='<a href="/lyrics/M/Milk_Inc./">Milk Inc.</a><br /><a href="/lyrics/M/Milk_Inc./11093/Storm/">Storm</a>';
fcontent[1]='<a href="/lyrics/N/N-Force/">N-Force</a><br /><a href="/lyrics/N/N-Force/11095/Just_For_You/">Just For You</a>';
fcontent[5]='<a href="/lyrics/I/Ich_Und_Ich/">Ich + Ich</a><br /><a href="/lyrics/I/Ich_Und_Ich/11043/Was_War_Ich_Ohne_Dich/">Was War Ich Ohne Dich</a>';
fcontent[2]='<a href="/lyrics/R/R.I.O./">R.I.O. feat. Liz Kay</a><br /><a href="/lyrics/R/R.I.O./11041/Something_About_You_(feat._Liz_Kay)/">Something About You</a>';
fcontent[8]='<a href="/lyrics/M/Katharine_McPhee/">Katharine McPhee</a><br /><a href="/lyrics/M/Katharine_McPhee/11024/Terrified/">Terrified</a>';
fcontent[11]='<a href="/lyrics/B/Bodybangers/">Bodybangers</a><br /><a href="/lyrics/B/Bodybangers/11017/Bodytalk/">Bodytalk</a>';
fcontent[10]='<a href="/lyrics/T/Tokio_Hotel/">Tokio Hotel</a><br /><a href="/lyrics/T/Tokio_Hotel/10986/World_Behind_My_Wall/">World Behind My Wall</a>';
fcontent[18]='<a href="/lyrics/L/LoveLine/">LoveLine</a><br /><a href="/lyrics/L/LoveLine/10925/Right_Now/">Right Now</a>';
fcontent[16]='<a href="/lyrics/L/Lifehouse/">Lifehouse</a><br /><a href="/lyrics/L/Lifehouse/11083/Halfway_Gone/">Halfway Gone</a>';
fcontent[17]='<a href="/lyrics/J/Jaybee/">Jaybee</a><br /><a href="/lyrics/J/Jaybee/11089/Maybe_Tomorrow_(feat._Deshayla)/">Maybe Tomorrow</a>';
fcontent[12]='<a href="/lyrics/L/Laidback_Luke_And_Gregor_Salto/">Laidback Luke</a><br /><a href="/lyrics/L/Laidback_Luke_And_Gregor_Salto/11091/Step_By_Step_(feat._Mavis_Acquah)/">Step By Step</a>';
fcontent[15]='<a href="/lyrics/K/Kesha/">AnnaGrace</a><br /><a href="/lyrics/K/Kesha/11031/Your_Love_Is_My_Drug/">Your Love Is My Drug</a>';
fcontent[13]='<a href="/lyrics/E/Example/">Example</a><br /><a href="/lyrics/E/Example/11018/Won\'t_Go_Quietly/">Won\'t Go Quietly</a>';
fcontent[3]='<a href="/lyrics/C/Cheryl_Cole/">Cheryl Cole</a><br /><a href="/lyrics/C/Cheryl_Cole/10966/Fight_For_This_Love_/">Fight For This Love</a>';
fcontent[7]='<a href="/lyrics/D/Alesha_Dixon/">Alesha Dixon</a><br /><a href="/lyrics/D/Alesha_Dixon/10969/To_Love_Again/">To Love Again</a>';
fcontent[4]='<a href="/lyrics/F/Flanders/">Flanders</a><br /><a href="/lyrics/F/Flanders/11094/Time/">Time</a>';
closetag='';

var fwidth='164px'; //set scroller width
var fheight='50px'; //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=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