var delay = 4000;
var maxsteps=30;
var stepdelay=40;
var startcolor= new Array(171,225,225);
var endcolor=new Array(0,0,0);

var fcontent=new Array();
begintag='<div style="padding: 5px; font-size: 11px; font-family: Geneva, Arial, Helvetica, sans-serif;">'; 
fcontent[0]="<b>...thorough engagement with some exciting new perspectives on organizations...</b><br><br>David Sims, <br>Professor of Organizational Behaviour,<br>Cass Business School";
fcontent[1]="<b>...a book that I would recommend to any leader.</b><br><br>Andy Duff,<br>Group Chief Executive RWE npower";
fcontent[2]="<b>...legitimises the informal, conversational style that has served me so well throughout my career..</b><br><br>Lord Tunnicliffe,<br>CBE, Chairman of the Rail Safety and Standards Board";
fcontent[3]="<b>...offers an exciting new vision of organisational dynamics that highlights the powerful role played by everyday conversations in making change happen..</b><br><br>Adrian Moorhouse,<br>MBE, Olympic Gold Medallist and M D of Lane4";
fcontent[4]="<b>Chris Rodgers's ideas provide for a much richer understanding of why and how change really happens, and more importantly how it can best be managed.</b><br><br>Guy Eccles,<br>Board Director of Human Resources,<br>Screwfix Direct";
fcontent[5]="<b>I found this book very readable. It has the rare merit of being theoretically robust and of great practical value.</b><br><br>Bill Critchley,<br>Organisation Consultant and Director of the Ashridge Masters in Organisation Consulting";
fcontent[6]="<b>A fantastic book on organizational change... </b><br><br>Bonni Stachowiak,<br>Professor, Vanguard University,<br>Southern California";
closetag='</div>';

var fwidth='200';
var fheight='200';

var fadelinks=1;
var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;

//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++
}

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);
  }
}

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);
	
  }   
}
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
