/***********************************************
* 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 = 2000; //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 class="ProjectsText">'; //set opening tag, such as font declarations

fcontent[0]="Anti-aliasing Signal Analysis system - Patent Applied For (dti Smart Award Winners 2001-2002)";
fcontent[1]="Auto self regulating micro-controller Magnetic Non-Destructive Testing Control Units (DTI assisted project)";
fcontent[2]="7,500 Amp cpu controlled high current pulser (Ross & Catherall plc, Vickers)";
fcontent[3]="Spark Erosion precision machinery (Eroda)";
fcontent[4]="Gas Monitoring CPU Control Units (Molecular Controls Ltd)";
fcontent[5]="Gas Pipe Fusion Controller used when laying underground gas pipes, cpu controlled (BG)";
fcontent[6]="Hearing Enhancing Devices and Loop Systems, 'Sonata' and 'Symphony' (Portland College for the Disabled)";
fcontent[7]="Tote Betting system, multiple displays and microprocessor terminals (Nottingham Sports Stadium)";
fcontent[8]="Oil Rig stress data logging (Hodder Holdings)";
fcontent[9]="Oil Mist Detection, logging for explosive conditions onboard ships (KFP, Kidde Fire Protection)";
fcontent[10]="Fire Alarm Repeater logging (KFP)";
fcontent[11]="Gauss Magnetic Level Detectors, MAGNETEC - Peak & RMS versions (Aircraft, Non-Destructive Testing)";
fcontent[12]="Peak, RMS & Average Hall Effect Current and Magnetic Flow Analog Digital Meters and Gauss Probes (NDT)";
fcontent[13]="CCU - Central Control Unit for remote control of 32 i/o lines, 8 a/d inputs and 2 d/a outputs via serial port";
fcontent[14]="Car Generator regulator system (Congreaves)";
fcontent[15]="Locomotive Dead-Man’s Handle (Rolls Royce)";
fcontent[16]="Fibre Optic and Microprocessor Level Detection Units for the Petro-Chemical Industry (Meta Export)";
fcontent[17]="Heater Controllers (Pig farming industry)";
fcontent[18]="Turkey Auto Counting system using fibre optic sensors (Bernard Matthews Ltd)";
fcontent[19]="Chemists Auto Ordering system via telephone lines (Barclays & Sons)";
fcontent[20]="Interfaces and Software - specialised (Ministry of Agriculture, Rutherford Labs, Atomic Research Establishment)";
fcontent[21]="Data Logging/Analysis systems (Health & Safety Executive)";
fcontent[22]="Spectrophotometry system for glass (Pilkingtons PLC)";
fcontent[23]="Chemical Integrator system (Health & Safety Executive)";
fcontent[24]="Factory Plant Control (Raleigh Cycles)";
fcontent[25]="Particle Size Capture and Measurement (Cadbury Schweppes)";
fcontent[26]="Graphics Studio (Sture Johannesson - Swedish artiste)";
fcontent[27]="Plastic Film Heat Sealing Unit for the packaging industry (UK & Export)";
fcontent[28]="PresFax 100 Keypad for schools and industry (originally distributed by Schofield & Sims, UK)";
fcontent[29]="Cmos ROM/RAM data storage for the Apple Computer (UK & Export)";
fcontent[30]="Input/Output Interface for the Apple Computer (UK & Export)";
fcontent[31]="RGB Colour system for the Apple Computer, Peacock (UK & Export)";
fcontent[32]="Kitchen Design system (KI)";
fcontent[33]="Machine Analysis in Plastic Injection Moulding Factories (McAlpines Ltd)";
fcontent[34]="'Fly Counter' remote logger and analyser using IR and microcontrollers";
fcontent[35]="'CatWatch' microcontroller unit to safely scare away cats from gardens";
fcontent[36]="Probation Services 'client' auto-reporting and statistical programs";

closetag='</div>';

var fwidth='600px'; //set scroller width
var fheight='30px'; //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:0px solid black;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