/***********************************************
* 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 = 8500; //set delay between message change (in miliseconds)
var maxsteps=40; // number of steps to take to change from start color to endcolor
var stepdelay=50; // 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 class="clientspeak">'; //set opening tag, such as font declarations
fcontent[0]=' “Thanks for always being so patient, explaining HTML to me, and fixing every little detail. I would recommend you highly to anyone looking for a website re-design...”<div class="clientname1">Sonya Dreizler ,</div><div class="clientname2">Protected Investors of America</div>';

fcontent[1]=' “The work is done promptly, and efiiciently - and his custom management applications have been an invaluable asset for our clients web sites. Its great to work with a forward-thinking company that delivers on their promises...”<div class="clientname1">Dan Antonelli</div><div class="clientname2"> Graphic D-Signs</div>';

fcontent[2]=' “I have really been impressed with the level of support your company has provided, all I have heard from you is “sure, we can do that, we will make it work”!...”<div class="clientname1">Andrew S. Nudelman</div> <div class="clientname2">Director of Marketing, Home Health Products</div>';

fcontent[3]=' “The web based CRM application you built for us is great. We are now able to provide much better customer service to our clients because we have their entire order, telephone, and email history all in one place...”<div class="clientname1">Shana Conway </div> <div class="clientname2">Blue Evolution</div>';

fcontent[4]=' “I just wanted to give you a quick note to let you know that I have been working on the management site entering new items for the past two days and everything is working flawlessly...”<div class="clientname1">Lara Burke</div> <div class="clientname2">Buy Rite Inc</div>';

fcontent[5]=' “ADCway attention to detail and tenacity working with us for just over a year on a very complex project is a real testament to their abilities. They are highly motivated and creative at problem-solving situations.”<div class="clientname1">Joel Denver</div> <div class="clientname2">All Access Music Group</div>';

fcontent[6]=' “The professionals at ADCway were straightforward, honest and timely in meeting all deadlines. They also proved helpful and attentive when we needed help and the quality of their work exceeded expectations...”<div class="clientname1">John J. Murphy</div> <div class="clientname2">Southwestern Research, Inc</div>';

fcontent[7]=' “ADCway are the most professional, focused, and on-task web development professionals I haveve ever worked with. In the past five-plus years of our online presence, we have had many false starts and dead ends with other vendors...”<div class="clientname1">Peggy Borgman</div> <div class="clientname2">Wynne Business</div>';

fcontent[8]=' “ADCway helped us get noticed through their search engine optimization services, which resulted in our signing the biggest distribution deal in our company history...”<div class="clientname1">John Scheall</div> <div class="clientname2">Wine Consolidators</div>';

fcontent[9]=' “Working with ADCway has been nothing short of amazing an exceptional find!”<div class="clientname1">Phyllis Tedeschi</div> <div class="clientname2">Luxe Med Spa</div>';

fcontent[10]=' “ADCway have proven exceptionally adept and competent web developers! They have delivered exactly what was requested and has met key deadlines each time I have worked with they...”<div class="clientname1">McKay Stewart</div> <div class="clientname2">The Web Saint</div>';

closetag='</div>';

var fwidth='212px'; //set scroller width
var fheight=''; //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:none;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
