

/***********************************************
* 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 = 9000; //set delay between message change (in miliseconds)
var maxsteps=40; // number of steps to take to change from start color to endcolor
var stepdelay=40; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(74,95,138); // start color (red, green, blue)
var endcolor=new Array(255,255,255); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div>'; //set opening tag, such as font declarations
fcontent[0]="Being busy professionals didn’t allow us much time to purchase an investment condo in Kelowna but your local knowledge and contacts made very efficient use of our time. Your \"one stop shopping\" with Financing, Conveyance and Insurance made our investment seamless and stress free. Many thanks.<br><br> Dr. Joe & Alna De Beer.";
fcontent[1]="Thanks for your patience and \"no pressure\" style of doing business. After seeing many houses we wondered if we would ever find a house but you never gave up. Your listening skills and attention to detail certainly helped find our new home and neighbourhood, which we love. Thanks.<br><br> Steve & Maureen Lee";
fcontent[2]="We can\’t thank you enough for the hard work and dedication you showed when finding our new home. From start to finish you were there, looking after all of the details making our move so organized stress free for us. We really appreciate it. Thanks. <br><br>Scott & Renee Baldwin";
fcontent[3]="I'm so pleased with the property you found for us! Your energy on my behalf confirmed that I had found the right Realtor to work with. Thank you once again.<br><br>Bill Mark";
fcontent[4]="Thank you for your diligence and attention to every minute detail. You conduct business in an efficient way and were accessible whenever we needed you. You made me feel like everything was well in hand at all times. It's clear that you understood what I was looking for and that you took my interests to heart. <br><br>Meredith Dally";
fcontent[5]="Thank you so much for all your help and hard work in selling our condo. You made it a very pleasant experience and were always only a phone call away!<br><br>Diane and Ted";
fcontent[6]="Cory and I are so grateful we met met you. We can't wait to have you in our new FIRST HOME!!<br><br>Amy, Cory, Beau, and Texan";
fcontent[7]="Our daughter Kerrie loves the condo and has been taking tennis lessons and using the court and Gym on regular basis. It is the perfect spot for her.<br><br>Steve and Joan Niemeier";
fcontent[8]="Thanks a bunch for selling our home. We really appreciated your easy going no hassle approach to selling homes. You go the extra mile on all the little things to make us feel very comfortable. You and your dad are both class acts and we will highly recommend you to our friends.<br><br>Wayne, Sheri and Leslie Strong";
closetag='</div>';

var fwidth='175px'; //set scroller width
var fheight='225px'; //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