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

var fcontent=new Array();
begintag='<div style="padding: 0px 15px 0px 15px; text-align: justify; font-family:Arial, Helvetica, sans-serif; font-weight:bold; font-size:18px;text-shadow: #4388aa 0px 1px 0px; ">'; //set opening tag, such as font declarations
fcontent[0]="Combining excellent proven solutions with our expertise, the solutions offer exceptional results and proven competitive advantage.";
fcontent[1]="&quot;Hays have benefited from improved efficiency, communication and quality&quot; <br /><br /> Carole Hodgson, Hays Travel";
fcontent[2]="&quot;The introduction of Goldmine and QuoteWerks has played a major part in the doubling of my departments global sales since the introduction of the two systems.&quot; <br /><br /> Nigel Bleackley, Stork Cooperheat";
fcontent[3]="&quot;The Microsoft Dynamics CRM Event Manager Accelerator is exceptional.  We use this tool for managing our many conferences, delegate badges and lists.&quot;<br /><br />The Information Centre NHS";
fcontent[4]="&quot;Caltech understand what we require of our software and are always flexible and responsive in their dealings with us, offering us the support we require.&quot; <br /><br />Steve Hambleton, General Manager, The Sheffield Royal Society for the Blind";
fcontent[5]="&quot;You just ask for something and it's done.  Caltech have given us an exceptional system, their ideas and influence to use the system effectively, really work for GG Glass.&quot;";
fcontent[6]="&quot;The transformation was achieved when we took on GoldMine, making us leaner and meaner.  It was revolutionary.&quot;<br /><br /> Chris Benson, Managing Director Betech 100pt";
fcontent[7]="&quot;Without a doubt, CRM has helped our business.  We invested in CRM from day one.&quot; <br /><br />Paul Harrison, Managing Director, AM Training Solutions";
fcontent[8]="The best thing about working with Caltech was they took time to understand our business.<br /><br />The Information Centre NHS";
fcontent[9]="The Microsoft Dynamics CRM demonstration was very powerful and we were excited about what this solution could do for Hays Travel<br /><br />Carole Hodgson Hays Travel";
fcontent[9]="The experience of Caltech right from the 1st call with my account manager through to the deployment of GoldMine, then to after care has been second to none.<br /><br />Seaward Electronic Ltd";

closetag='</div>';

var fwidth='465px'; //set scroller width
var fheight='200px'; //set scroller height

var fadelinks=0;  //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;

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
