var delay = 6000; //set delay between message change (in miliseconds)
var maxsteps=30; // 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,250,250); // start color (red, green, blue)
var endcolor=new Array(220,220,220); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div style="font: normal 11px Arial; 	margin-left: 95px;	padding-top: 30px; margin-right: 20px;">'; //set opening tag, such as font declarations

fcontent[0] = "Thank you for organising the above event which ran superbly. Not only were we very pleased with the organisation, every one of the artistes went out of their way to ensure that we had an excellent evening. In summary, I am delighted that we used the services of your organisation and artistes and would not hesitate in recommending your services to others   <b>Barclaycard</b>.";
fcontent[1] = "Thank you for arranging the entertainment for the KPMG guests at last year's dinner. The evening was a resounding success, a combination of delightful surroundings, professional staff, excellent catering and the distinguished entertainers you kindly organised.<b>KPMG</b>";
fcontent[2] = "Thank you for all your help in arranging the entertainment for our annual dealer meeting. We would like to express how much our guests and our management and dealer team enjoyed the show.   <b>Carphone Warehouse</b>";
fcontent[3] = "Lastly but more importantly, thank you for co-ordinating all of our arrangements and contributing to the success of our conference.   <b>The Market Research Society</b>";
fcontent[4] = "A note to thank you for the arrangements that you made for our function at the Natural History Museum last Tuesday. Bobby Davro and the Covent Garden String Quartet were both a great success and Colin Wood really came through at short notice. Once again, many thanks for your contribution to making the evening the great success that it was and we look forward to doing business with you again in the future...   <b>Monarch Airlines</b>";
fcontent[5] = "The entertainment recommended by you was superb and our guests certainly enjoyed themselves. I do hope to have the pleasure of working with Norman Phillips Organisation again next year.   <b>Holiday Inn</b>";
fcontent[6] = "I felt I must put pen to paper to thank you for all of your help with the launch of the new Jaguar S Type. We were thrilled with both the band and the magicians who were all very co-operative and certainly helped create the atmosphere that we were looking for at such an important event. We were delighted with the success of both the evenings and we will be in touch with you to discuss the next launch.   <b>Rybrook Jaguar</b>";
fcontent[7] = "Our golden jubilee ball proved a great success and was thoroughly enjoyed by all who attended. May we thank you for all your help for providing the artistes for Seaton and Brighton which proved very successful.   <b>Axminster Carpets LTD</b>";
fcontent[8] = "Thank you for all your help in organising our Pitman Training Group Dinner entertainment. The event was a great success and the artistes that you provided were a tremendous addition to the evening.   <b>Pitman Training Group Plc</b>";
fcontent[9] = "Thank you for your recommendation of artistes to perform at our recent sales conference at Alton Towers. Both were excellent and their skills were second to none, so friendly that everyone had a wonderful time. I would be happy to use your organisation again and would certainly recommend your services to my colleagues.   <b>John Menzies Distribution</b>";
fcontent[10] = "The day was a great success - the crowds of people said it all and the entertainment went down brilliantly. Thanks for all your help with organising our special day..   <b>The Pallasades Shopping Centre, Birmingham</b>";
fcontent[11] = "The word thanks really seems so small compared with the tremendous contribution that you and your team made at the BSM Conference last week. Please pass our thanks to all of the artistes for not only did they help make our conference a huge success but they enjoyed themselves as well.   <b>British School of Motoring</b>";
fcontent[12] = "Thank you for all your help in finding a suitable artiste for our senior manager's long service dinner. I appreciated your help and advice in the planning of the function, particularly as our approach was made at such short notice. Organising such an event can be fraught with problems and it's reassuring that the entertainment was one area which was in such good hands.   <b>Royal Mail</b>";

closetag='</div>';

var fwidth='120px'; //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" ></div>');

if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent