var delay = 7000; //set delay between message change (in miliseconds)
var maxsteps=60; // number of steps to take to change from start color to endcolor
var stepdelay=25; // 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 fcontenttestimonial=new Array();
begintag=''; //set opening tag, such as font declarations
fcontenttestimonial[0]="&nbsp;<br /><span style='font-size:18px;font-weight:bold;'>&quot;...I've never taken tools (into customer's) records, to show them what we can do for them... &quot;</span><br /><br /><span style='color:#413D69;'>Mark Zablotsky, DDS<br />Sacramento, CA</span>"
fcontenttestimonial[1]="&nbsp;<br /><span style='font-size:18px;font-weight:bold;'>&quot;...An effective way to communicate to our patients...&quot;</span><br /><br /><span style='color:#413D69;'>DeWitt Wilkerson, DMD<br />St. Petersburg, FL</span>"
fcontenttestimonial[2]="&nbsp;<br /><span style='font-size:18px;font-weight:bold;'>&quot;...XCPT allows the patient to understand really what treatment is necessary...&quot;</span><br /><br /><span style='color:#413D69;'>Kenneth Schweizer, DDS<br />Sarasota, FL</span>"
fcontenttestimonial[3]="&nbsp;<br /><span style='font-size:18px;font-weight:bold;'>&quot;XCPT is easy to use...&quot;</span><br /><br /><span style='color:#413D69;'>Maurice Salama, DMD<br />Atlanta, GA</span>"
fcontenttestimonial[4]="&nbsp;<br /><span style='font-size:18px;font-weight:bold;'>&quot;...A valuable tool...Very intuitive, easy to use...&quot;</span><br /><br /><span style='color:#413D69;'>Joel L. Rosenlicht, DMD<br />Manchester, CT</span>"
fcontenttestimonial[5]="&nbsp;<br /><span style='font-size:18px;font-weight:bold;'>&quot;...EXCEPTIONAL! This is the first program where patients really 'get it'!...&quot;</span><br /><br /><span style='color:#413D69;'>Andrew Alpert, DMD<br />Aventura, FL</span>"
fcontenttestimonial[6]="&nbsp;<br /><span style='font-size:18px;font-weight:bold;'>&quot;...Customize the recommended treatment in a visual form...&quot;</span><br /><br /><span style='color:#413D69;'>Edmond Bedrossian, Diplomate, ABOMS<br />San Francisco, CA</span>"
fcontenttestimonial[7]="&nbsp;<br /><span style='font-size:18px;font-weight:bold;'>&quot;...The treatment plan is easily illustrated. Patients can visualize their treatment...&quot;</span><br /><br /><span style='color:#413D69;'>Marc Nevins, DMD, MMSc<br />Boston, MA</span>"
fcontenttestimonial[8]="&nbsp;<br /><span style='font-size:18px;font-weight:bold;'>&quot;...On average (XCPT) has added twelve additional implants per month to my production...&quot;</span><br /><br /><span style='color:#413D69;'>Ryan Taylor, DDS, MS<br />Sarasota, FL</span>"
fcontenttestimonial[9]="&nbsp;<br /><span style='font-size:18px;font-weight:bold;'>&quot;...Very clever and real ingenious...&quot;</span><br /><br /><span style='color:#413D69;'>Kerry Voit, DDS<br />Chicago, IL</span>"
fcontenttestimonial[10]="&nbsp;<br /><span style='font-size:18px;font-weight:bold;'>&quot;...An immensely effective tool in communicating comprehensive dentistry to our patients...&quot;</span><br /><br /><span style='color:#413D69;'>Shanaka L. Weerasooriya, DDS<br />Englewood, FL</span>"
closetag='';

var fwidth='214px'; //set scroller width
var fheight='250px'; //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>=fcontenttestimonial.length)
    index=0
  if (DOM2){
    document.getElementById("fscrollertestimonial").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("fscrollertestimonial").innerHTML=begintag+fcontenttestimonial[index]+closetag
    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 15);
  }
  else if (ie4)
    document.all.fscrollertestimonial.innerHTML=begintag+fcontenttestimonial[index]+closetag;
  index++
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

function linkcolorchange(step){
  var obj=document.getElementById("fscrollertestimonial").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("fscrollertestimonial").style.color=getstepcolor(step);
    if (fadelinks)
      linkcolorchange(step);
    step++;
    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
  }else{
    clearTimeout(fadecounter);
    document.getElementById("fscrollertestimonial").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="fscrollertestimonial" 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

