/***********************************************
* 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=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,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>'; //set opening tag, such as font declarations
fcontent[0]="<em>Hi All, Just thought I'd send a quick note to say thanks for what was quite possibly the best bargain I've ever had in my life!  I purchased a Dell D530s desktop which, specced up the same from Dell, costs just over £400.  The price from you?  Under £250 inc. VAT and delivery!  Really really impressed and I've reccommended you to no end of people and will continue to do so for ever more! Keep up the good work and expect to see me on your order books in future!</em><br /><strong>Regards, Anthony Beanlands</strong>";
fcontent[1]="<em>Superb thanks allot Guy's ordered 3 TFT Screens from you after being let down by another Company on delivery ( they had not got stock ) not only were you cheaper but wow the delivery arrived at my door the following day, saved me a lot of Money and great service, Will use you again and again</em><br /><strong>Thanks Again Andrew Ashmore DSG Group.</strong>";
fcontent[2]="<em>Just a note to say thanks for the great service on my order , The laptop is fantastic value for money got here faster than my local Pizza delivery and saved me over &pound;100 from anywhere else in the UK  Look forward to buying my next bit of hardware,</em><br /><strong>Mark Higgins Leicester</strong>";
fcontent[3]="<em>Thanks to tech at ITC got my first PC from you last week arrived all safe and sound and great value , but not only that i had a problem loading my operating system and your on line knowledge base saved me a lot of hassle after speaking to you at the on line live support, will be ordering my next stuff from you without any doubt</em><br /><strong>Many Thanks Jason Xander.</strong>";
fcontent[4]="<em>Guys yet again you have come up trumps needed the 30 systems delivered to my customer direct within 3 days you got them there in 2 and saved me &pound;2000 on retail price Now my 9th order with you and you always keep your promise fantastic, See you soon</em><br /><strong>Phil Stent Computer Reseller and Brokers LTD</strong>";
fcontent[5]="<em>Like to say thanks to Richard in sales , advised me honestly about my new Dell laptop i told him what i wanted to do with it and he changed my idea on model within 10 Mins at the on line sales support area , saved me &pound;160 and the laptop does exactly what he said it would if not better</em><br /><strong>Sue James Pots and Plants</strong>";
fcontent[6]="<em>Great service again on the printers the refurbished 30 x HP's are all installed in the building all worked first time and looked like new. </em><br /><strong>Cheers Simon Meason ***** PLC</strong>";
fcontent[7]="<em>Just like to say how refreshing it is to deal with a Company in the Uk who can supply exactly what they have listed on the site , i have been buying from various UK Companies over the last 6 years and always seems to be problems , now my third order with you and i always get what i ordered on time as listed and ALWAYS cheaper than any other supplier !! Great Web Site as well so easy to use</em><br /><strong>Christopher St'john</strong>";
fcontent[8]="<em>Like to say thanks for the great service and price , would not had got the laptop from you until i was recommended by our IT Guy , cannot imagine how you can be so much cheaper on my Dell Laptop and give such brill service</em><br /><strong>Sean McNamara</strong>";
fcontent[9]="<em>Just to let you know that my Dell PC was delivered AT 1pm.UPS had been somewhat “faffing around” so far this morning but, thanks to your help earlier, I’ve since managed to solve their hiccup.I’ve just unpacked it and everything seems to be here.All in all, I’m really, really impressed with your set up at ITC, and am very appreciative of the help & efficiency across your business departments so I thought I’d let you know that too.</em><br /><strong>Regards Robert Clark</strong>";
fcontent[10]="<em>Dear ITC Sales This is just a quick note to say THANKS for your speedy delivery service.My laptop was delivered and I had it installed and running just 36 hours after ordering it! Speedy efficient and helpful-great service.</em><br /><strong>Julie Wilson Eastshaw Enterprises</strong>";
fcontent[11]="<em>Hi ITC.A Big Thank you for your excellent all-round service.This has been the most efficient computer buy I have every made. I am delighted with my Dell Laptop. It will make sorting out individual and community problems more efficient and therefore help to give individuals a better quality of life.</em><br /><strong>Thank you.Margaret Allen</strong>";
fcontent[12]="<em>Just got my 8th yes 8th Dell Factory Second from you , this stuff has to be bargain of the century yet again exactly as described in terms of the marks or condition, and again I get more bits than you listed on the item. Loaded great again thanks also for the requested utility disk that arrived in the post within 3 days. Thanks to Richard in Tek support for that.</em><br /><strong>Nigel Adams IT Admin</strong>";
closetag='</div>';

var fwidth='100%'; //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 (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent

