/***********************************************
* 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 = 5000; //set delay between message change (in miliseconds)
var maxsteps=50; // number of steps to take to change from start color to endcolor
var stepdelay=1; // 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(5,115,185); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div style="font: normal 11px Arial; padding: 5px; color:#0573B9;">'; //set opening tag, such as font declarations
fcontent[0]="<img src='http://lib.store.yahoo.net/lib/everything-neon/testi1.png' /><br />Thanks for  your help We received the sign and are happy with it!<br />Roxie<br /><br /><div align='right'><strong>R Edwards</strong>,<br />November, 2010</div>";
fcontent[1]="<img src='http://lib.store.yahoo.net/lib/everything-neon/testi2.png' /><br />The sign is beautiful! I  believe it will full fill all the expectations; the color is right, the size is  right, it is almost identical to the drawing only better; I could not be  happier. It took some faith on my part  working with a company online that I didn't know, and it worked out  wonderfully. And, it arrived in plenty of time for  Thanksgiving. Thank you very much, Im  grateful, and happy!<br /><br /><div align='right'><strong>Francis, Lorrie</strong><br />November, 2010</div> ";
fcontent[2]="<img src='http://lib.store.yahoo.net/lib/everything-neon/testi3.png' /><br />I wanted you to see how my game room (1/3 of it) turned out. Everyone  loves it as it really makes the game room special. The sign is very special  (and very pretty) and thanks to you guys for your part! Best  wishes...Paul White<br /><br /><div align='right'><strong>Paul White</strong><br />November, 2010</div>";
fcontent[3]="<img src='http://lib.store.yahoo.net/lib/everything-neon/testi4.png' /><br />It arrived today and looks awesome! Thank you and Happy  Holidays.<br /><br /><div align='right'><strong>Lisa Townsend</strong><br />December, 2010</div>";
fcontent[4]="<img src='http://lib.store.yahoo.net/lib/everything-neon/testi5.png' /><br />It turned  out great!<br /><br /><div align='right'><strong>Susan Wiggs</strong><br />September, 2010</div>";
fcontent[5]="<img src='http://lib.store.yahoo.net/lib/everything-neon/testi6.png' /><br />Wanted to let you  know that i received the neon sign today and i absolutely LOVE  IT!!!! i can't tell you how many companies told me this  couldn't be done but you guys did it. it is just perfect and is EXACTLY  what i wanted. My thanks and compliments to you and your team for  the outstanding job! Thanks again  for the FANTASTIC sign I truly appreciate the effort, artistry and hard work  that went into creating it!<br /><br /><div align='right'><strong>Daryn Coleman</strong><br />June, 2010</div>";
fcontent[6]="<img src='http://lib.store.yahoo.net/lib/everything-neon/testi7.jpg' /><br />We received shipment on  the sign a little while ago.  We are thrilled!  Of course Dave  thinks I am brilliant.  Thank you and your staff for making me so.  Dave has already picked the perfect wall in his car shop for it.<br /><br />Your Company has picked their staff well,  people that know what Customer Service and quality is all about.<br /><br /><div align='right'><strong>Patsey Gentry</strong><br />March, 2011</div></div>";


closetag='</div>';

var fwidth='130px'; //set scroller width
var fheight='auto'; //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

