
/***********************************************
* 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 = 6000; //set delay between message change (in miliseconds)
var maxsteps=0; // 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(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 align="left" id="ddtestimonial">'; //set opening tag, such as font declarations
fcontent[0]="<p>Dear BestPriceProperties	(REF 401)<br>We are very pleased to have sold our villa through an enquiry to your website. We also appointed an Estate Agent to help us sell; but we had more enquiries through your website than through the Agent. We have recommended you to several of our friends who are considering selling. Well done BPP!<br>Yours sincerely,  C.D. Quesada</p>";
fcontent[1]="<p><font color='#800000'>We had our property (REF340) with a number of local agents but to no avail.<br>Thanks to your website, we have now sold our property to a Russian couple who found your site in Russia. Fantastic that you really are marketing to the global market.<br>Mr & Mrs Curmi, Torrevieja.</font></p>";
fcontent[2]="<p>Many thanks Bestprice for your help in selling our property(Ref. 583).  It was sold to the first viewer that came through your website who incidentally came from Canada.<br>Thanks again,B. and D. Torrevieja.</p>";
fcontent[3]="<p><font color='#800000'>Dear BestPriceproperties,<br>Just to let you know we have now sold our property.<br>Thank you for your help, we had the property with 3 agents, but only got enquiries from you and sold to the couple from Poland.<br>Thanks,<br>Mr Daltrey, Essex.</font></p>";
fcontent[4]="<p>Hello<br>Just to let you know that the property Ref 512 has been sold. We have accepted a full price offer from a couple who contacted us from your web site.<br>Our decision to advertise on your web site was the best decision we have made in the selling of our property, from the helpfulness of your staff, to the quality of the contacts that allowed us to sell to the second people who contacted us via your web site. Many thanks for your help, and we would recommend any one wishing to sell to use your site.<br>Mike & Pat Berridge</p>" 
fcontent[5]="<p><font color='#800000'>Dear Richard<br>I would like to thank you and any staff you have for all your help in the sale of my property.  Several agents had my property on their books but nothing was forthcoming, propbably due to the excesive amount of commission they want.  Without Bestpriceproperties I would still be trying to sell.<br>So once again thank you for all you help, it's a site I would recommend to all my friends who are thinking of selling.  Regards.  Maureen Evans</font></p>" 
fcontent[6]="<p>Hello BestPrice.<br>Many thanks for all the contacts you have forwarded to me (far more then the local agents), and it surprises me how many people use your web site.  I am sure that when I eventually sell, it will be from one of your contacts.  Once again, many thanks.  I will send you a feedback when I have something definite.<br>Yours,<br>Sheila</p>" 
fcontent[5]="<p><font color='#800000'>Hi Richard  RE: 728<br>I must of had about 14 inquires from bestprice with allot wanting to view.<br>I was pleased with so many in just 2 weeks.<br> Regards.<br>Maurice</font></p>" 
closetag='</div>';

var fwidth='400px'; //set scroller width
var fheight='100px'; //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] + ")");
}

