/***********************************************
* 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 = 1500; //set delay between message change (in miliseconds)
var maxsteps=60; // 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(0,0,0); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div align="center" style="font: normal 11px Verdana; padding: 0px;">'; //set opening tag, such as font declarations
fcontent[0]="''This one track alone is worth the price of the whole CD.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Ian Sutherland";
fcontent[1]="''The best royalty free music in cyberspace. Thank you!''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Mike Gould";
fcontent[2]="''My customer's response was, ''THAT doesn't sound like library music!''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Philipp W. Erhardt";
fcontent[3]="''Thanks for saving the day. It was the PERFECT selection.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Ed Pohlman";
fcontent[4]="''Your music is more acoustic and more ALIVE.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Tom Montalbano";
fcontent[5]="''The Music Bakery is all WONDERFULLY composed production music.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Kris Semchych";
fcontent[6]="''I always reach for my Music Bakery CDs first.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Rob Neidig";
fcontent[7]="''I only use Music Bakery cuts in all of my videos!''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Mark Roberts";
fcontent[8]="''Thank you for giving us such great music at such a reasonable price.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Frank J. Morelli";
fcontent[9]="''The Music Bakery is light years ahead of the competition''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -George Krecorian";
fcontent[10]="''The Music Bakery seems like it was written specifically for MY productions.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Steve Waltner";
fcontent[11]="''Sensational! For lack of better words, will WOW do?''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Elizabeth Lautner";
fcontent[12]="''The most professionally produced, highest quality music I have heard to date!!''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -John Berg";
fcontent[13]="''Music Bakery is FAR superior in execution, format, and price than any other service.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Jim Morrison";
fcontent[14]="''The breadth and quality of your work is EXCEPTIONAL.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Rod Schwartz";
fcontent[15]="''The Music Bakery has provided just what I needed time after time.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Curtis Cox";
fcontent[16]="''You are making our productions and concepts a dream come true.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Darrel Suta";
fcontent[17]="''Such wonderfully versatile and professional music packages. A fantastic service!''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Bill Ladd";
fcontent[18]="''You are awesome! The Music Bakery saved me a HUGE headache!''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Ramie Babcock";
fcontent[19]="''The baritone saxes kicking the bass sound great! I'm amazed by the natural sound.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Perry Schirmer";
fcontent[20]="''I am SUPER pleased with your great tunes! Thanks!''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Alex Melli";
fcontent[21]="''Thanks a million! I will certainly use you again. Great sound quality!''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -John Miller";
fcontent[22]="''Thank you, Jack. God bless you!''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Ivette Marcial";
fcontent[23]="''I love your music! Far better than other royalty-free sites I've researched.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Dave Arntson";
fcontent[24]="''It's an incredible piece of music! Thank you, Music Bakery!''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Melinda Hoehn";
fcontent[25]="''Music Bakery is great! Extremely courteous and prompt customer service. Impressive!''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Serena Smith";
fcontent[26]="''Wow, what great work! I'm glad I found your company.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Mark W. Balthrop";
fcontent[27]="''Music Bakery is by far and away the best buyout music I've come across in 25 years.''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Gordon Nicol";
fcontent[28]="''I love your site and will be back for more new music!''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Gina M. Propp";
fcontent[29]="''Wow! I am amazed at the wealth of music (and the well organized site) you have!''<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -Mark Gillott";
closetag='</div>';

var fwidth='510px'; //set scroller width
var fheight='30px'; //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="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

