/***********************************************
* 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 = 15000; //set delay between message change (in miliseconds)
var maxsteps=60; // number of steps to take to change from start color to endcolor
var stepdelay=60; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(234,237,230); // start color (red, green, blue)
var endcolor=new Array(0,0,0); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div class="newsScroller">'; //set opening tag, such as font declarations
fcontent[0]="Everyone is so nice and friendly. Dr Roach is so sweet-- I grew up hating the dentist's office and always associated it with PAIN! But I have never had a bad or painful experience at your office. I love you guys!!<br /> <strong>- Debbie Stokey</strong>";
fcontent[1]="Your office and staff have always been friendly, respectful and professional. With regard to dental procedures, I consistently reveive explanations for each step to its conclusion. This really helps with the stress levels. All of you do a great job.<br />Sincerely,<br /> <strong>Ray Sasaki </strong>";
fcontent[2]="The professionalism and skill of Dr. Bruce Roach and his team (Tina, Debby, Percine) have provided me with not just great service, but have made me feel very comfortable and relaxed on every visit.";
fcontent[3]="Thank you for the kind service. I especially appreciate that Dr. Roach does not do unnecessary dental work. He does not try to \"sell\" dental service, but rather fixes problems when appropriate and provides knowledgeable trustworthy service. This keeps me a loyal patient.";
fcontent[4]="I love how everyone is so low key and friendly (ESP how Dr. Roach's dentirstry is painless-- SO unlike my childhood experiences!!)  We have been with Bruce since we moved here in '85 and I appreciate his knowledge and care--he never does anything that is not needed. The staff is wonderful and consistent, which also says a lot for a practice. <br />Thanks!<br /><strong> Jan Bonnell</strong>";
fcontent[5]="I love calling the office to make or reschedule an appointment because I get to speak with Debbie and she is the jolly in Jollyville Dental! She is the kindest, happiest and sweetest person you could ever meet. My family and I just love her!! The assistant Tina is also a sweet lady that will put you at ease. These two women are simply the BEST! They are a great team at Dr. Roach's office.";
fcontent[6]="You all are so friendly and Dr. Roach is truly a pain free dentist!! <br /><strong>Megan Stanley</strong>";
fcontent[7]="Y'all are awesome! :) My visit was calm and easy. Dr. Roach and Tina put me at ease for my last bit of tooth work, esp. the extraction. Thank you very much for all you've done. ^.^ <br /><strong>~Elizabeth Roark</strong>";
fcontent[8]="The staff at Jollyville Dental is THE BEST! I have been seeing Dr. Roach on and off about 35 years. He always has kind people in his office who care. <br /><strong>Sandi B.</strong>";
fcontent[9]="Very comfortable environment and super friendly staff.";
fcontent[10]="Ms. Debby is so friendly and just awesome! Whenever I need to schedule or have a conflict with my schedule she is just sweet and makes it work. She is a gem! I have never met anyone so happy on the phone or in person. Dr. Roach and Tina are just great together.";
fcontent[11]="No wait and the staff were honest about the tooth color needing a touch up.";
fcontent[12]="Friendly staff, good care.";
fcontent[13]="Dr. Roach and his staff and assistants seem to really enjoy their jobs, each other, and their patients. I also love the \"can do\" attitude when I must reschedule appointments. I feel very taken care of from the first minute to the last. Thanks, Dr. Roach and staff.<br /> <strong>- Cyndi T.</strong>";
fcontent[14]="Very friendly and courteous staff. Always helpful and easy to work with for scheduling, etc. ";
fcontent[15]="friendly, knowledgable, personable, good \"bedside manner.\"";
fcontent[16]="The entire staff really works hard to make you feel welcomed and important...The service my family receives with the excellent dental care are the main reason we have not looked for a dentist closer to our home area...When my children do not complain about going to the dentist then the drive is well worth it and they do not complain! Excellent Job!";
fcontent[17]="Always friendly and cheerful";
fcontent[18]="You guys are great, thank you";

closetag='</div>';

var fwidth='350px'; //set scroller width
var fheight='150px'; //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