/***********************************************
* 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 = 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=40; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(36,127,178); // start color (red, green, blue)
var endcolor=new Array(255,255,255); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div style="font: 100%; tahoma, verdana, arial; padding: 5px;">'; //set opening tag, such as font declarations
fcontent[0]="<b>Customer Testamonials:</b><br />&quot;Thanks for the fibre repair work, the call-out service is second to none!&quot;";
fcontent[0]="<b>Customer Testamonials:</b><br />&quot;The new door entry system is exactly what we required, many thanks&quot;";
fcontent[0]="<b>Customer Testamonials:</b><br />&quot;Thanks for the IP cameras, I can now see the workshop floor from home!&quot;";
fcontent[0]="<b>Customer Testamonials:</b><br />&quot;Eurocoms installed a new fibre backbone for the School, everything went smoothly, thanks again&quot;";
fcontent[0]="<b>Customer Testamonials:</b><br />&quot;Eurocoms have always been our chosen structured cabling company, they go out of their way to ensure our satisfaction&quot;";
fcontent[1]="<b>Customer Testamonials:</b><br />&quot;Eurocoms recently completed a 2,500 Cat6 point installation for us, I would have no hesitation in recommending Eurocoms for any cabling works, excellent workmanship&quot;";
fcontent[1]="<b>Customer Testamonials:</b><br />&quot;Eurocoms recently designed our fibre optic infrastructure, now we have great speed accessing our main server from our remote building, thanks again for your help&quot;";
fcontent[1]="<b>Customer Testamonials:</b><br />&quot;Many thanks for the latest install, if only all solutions companies were this responsive to customer needs!&quot;";
fcontent[2]="<b>Customer Testamonials:</b><br />&quot;Thanks so much for all your hardwork, I cannot believe you managed to cable our office at such short notice, youve saved us!&quot;";
fcontent[3]="<b>Customer Testamonials:</b><br />&quot;Thanks again for all your help and support!&quot;";
fcontent[4]="<b>Customer Testamonials:</b><br />&quot;Thanks again for your help. The Success Maker Room is exactly what we were looking for&quot;";
fcontent[5]="<b>Customer Testamonials:</b><br />&quot;Can I just say how pleased I am with the install - Your engineers were nothing short of superb!&quot;";
fcontent[6]="<b>Customer Testamonials:</b><br />&quot;Just a quick note to say thanks for all your hard work&quot;";
fcontent[7]="<b>Customer Testamonials:</b><br />&quot;Well what can i say, excellent service, super fast install, all in all excellent!&quot;";
fcontent[8]="<b>Customer Testamonials:</b><br />&quot;We are so pleased with the work eurocoms has completed, we will certainly be using them again&quot;";
fcontent[9]="<b>Customer Testamonials:</b><br />&quot;The phone system is absolutely fantastic, everything we could ever need, thanks so much&quot;";
fcontent[10]="<b>Customer Testamonials:</b><br />&quot;I would like to say a huge CHEERS to you, for your support, time and patience&quot;";
fcontent[11]="<b>Customer Testamonials:</b><br />&quot;I just wanted to say thanks again for the installation of our Panasonic phone system, it is exactly what we required&quot;";
fcontent[12]="<b>Customer Testamonials:</b><br />&quot;Eurocoms installed our computer network and telephone system, overall we are very pleased&quot;";
fcontent[13]="<b>Customer Testamonials:</b><br />&quot;The CCTV system Eurocoms installed for us was the most cost effective solution offered, thanks again!&quot;";
fcontent[14]="<b>Customer Testamonials:</b><br />&quot;Thanks again for the cabling, top install!&quot;";
fcontent[15]="<b>Customer Testamonials:</b><br />&quot;We are delighted with our new site, eurocoms have made a huge difference to our business&quot;";
fcontent[16]="<b>Customer Testamonials:</b><br />&quot;You have been nothing but helpful, I am going to tell everyone about you!&quot;";
fcontent[17]="<b>Customer Testamonials:</b><br />&quot;Just a line to say thank you very much for the work & effort you have put in to getting our network sorted out&quot;";
fcontent[18]="<b>Customer Testamonials:</b><br />&quot;We have been working alongside eurocoms to help us run our network for over 2 years now and have received excellent service&quot;";
fcontent[19]="<b>Customer Testamonials:</b><br />&quot;Our head teacher is very happy with the wireless access in her office. Excellent Service&quot;";
fcontent[20]="<b>Customer Testamonials:</b><br />&quot;Many thanks to the team, first class everytime!&quot;";
fcontent[21]="<b>Customer Testamonials:</b><br />&quot;What I’ve got now which I never had before is peace of mind&quot;"; 
fcontent[22]="<b>Customer Testamonials:</b><br />&quot;It was essential we found a system which could cover both our sites&quot;";
fcontent[23]="<b>Customer Testamonials:</b><br />&quot;We now use Eurocoms as the sole provider of data cabling within the School, they never let us down!&quot;";
fcontent[24]="<b>Customer Testamonials:</b><br />&quot;Emails in the staff room, whatever next! Thanks from everyone at the School&quot;";
closetag='</div>';

var fwidth='200px;'; //set scroller width
var fheight='115px'; //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: none; 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
