// JavaScript Document

var delay = 2000; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=297; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(204,0,51); // start color (red, green, blue)
var endcolor=new Array(0,0,0); // end color (red, green, blue)

var fcontent=new Array();
//begintag='<div class="text" style="font-style:italic;">'; //set opening tag, such as font declarations

fcontent[0]='&quot;I was walking out TOTALLY understanding why this place gets such high praise from many of you Citysearchers! This is my ninth trip here and the consistent quality I receive time after time is what has me standing up and raving to you about!&quot;<br /><strong>- lindafranks24, Citysearch </strong>';

fcontent[1]='&quot;I&acute;m a routine waxer and a former Aesthetician. For those who have yet to wax and you are thinking about waxing, then take my advice and be sure to go here.&quot;<br /><strong>- gilesp, Citysearch </strong>';

fcontent[2]='&quot;...Studio Urban Wax is a quality place&quot; <br /><strong>- beanjim, Citysearch</strong>';

fcontent[3]='&quot;I compete in various triathlons throughout the year. It is difficult to find great service. This is one such place that...&quot;<br /><strong>- james012, Citysearch</strong>';
 
fcontent[4]='&quot;Being a first time waxer (for my wedding) I was very nervous but Rebekah was professional, quick and did a wonderful job!&quot;<br /> <strong>- ragbrat, Citysearch</strong>';

fcontent[5]='&quot;Best wax place. I get my arms waxed there and legs.  I luv the way I feel waxing.&quot;<br /><strong>- sunnylane, Citysearch  </strong>';

fcontent[6]='&quot;This was my first Brazilian experience and my nervousness dissipated in the comfortable atmosphere and professional ease of Studio Urban Wax. Highly recommended!&quot;<br /> <strong>- melanniem, Citysearch </strong>';

fcontent[7]='&quot;my brows are beautiful and they make me feel great.&quot;<br />  <strong>- luvdugs, Citysearch </strong>';

fcontent[8]='&quot;I have been going to Rebekah for my waxing since the beginning of this spring and I feel very comfortable to recommend her services.&quot;<br /><strong>- lolajo, Citysearch </strong>';

fcontent[9]='&quot;Find a way to become a regular here...&quot;<br /><strong>- lucyqueenbee </strong>';

fcontent[10]='&quot;I have my brows done every two weeks and each time they do a great job.&quot;<br /><strong>- Schercoa, Citysearch </strong>';
 
//closetag='</div>';

var fwidth='450px'; //set scroller width
var fheight='125px'; //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 = fcontent[index]; //begintag+fcontent[index]+closetag
    if (fadelinks)
      linkcolorchange(1);
   colorfade(1, 15);
  }
  else if (ie4)
    document.all.fscroller.innerHTML= fcontent[index]; //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)
//alert ('step 1');
  document.write('<div id="fscroller" style="font-style:italic;height:' + fheight + '"></div>'); /* style="border:0px solid black; width:' + fwidth + '*/

if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent
