/***********************************************
* Fading Scroller- (C) 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 = 200; //set delay between message change (in miliseconds)
var maxsteps=100; // number of steps to take to change from start color to endcolor
var stepdelay=100; // 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(127,120,110); // end color (red, green, blue)
var fcontent=new Array();
begintag='<div style="padding:20px 40px 20px 32px;">'; //set opening tag, such as font declarations
fcontent[0]="1930s - The first light guns appear";
fcontent[1]="1952 - manual hand wheels move electronic cursor markings for radar tracking";
fcontent[2]="1953 - JOHNNIAC used to develop digitizing tablets for computer input";
fcontent[3]="circa 1957 - The first light pen on the Lincoln TX-0 computer at the MIT Lincoln Laboratory.";
fcontent[4]="1963 - Ivan Sutherland\'s prototype of the GUI with Sketchpad using a light pen on Lincoln Laboratory\'s TX-2 computer at M.I.T";
fcontent[5]="1963-74 - Doug Englebart and Bill English invent a wooden cased wheel mouse";
fcontent[6]="1966 - Orbit X-Y Ball Tracker installed in military air traffic control towers.";
fcontent[7]="1968 - Doug Englebart presents his NLS (oN Line System) and 3-button plastic housed compter mouse and keyset";
fcontent[8]="1972 - Xerox developed a graphical user interface (GUI) with a mouse on their experimental Alto computer";
fcontent[9]="1974 - IBM 8080 computer released";
fcontent[10]="1975 - the Altair 8800, first successful personal computer, controlled by switches";
fcontent[11]="1976 - Wozniac's Apple&nbsp;I personal computer uses a keyboard to enter data, and a TV as a monitor";
fcontent[12]="1977 - the Apple&nbsp;II personal computer produces sound and color graphics";
fcontent[13]="1977 - David Thornburg attached his touch tablet, the precursor of the KoalaPad, to an Alto";
fcontent[14]="1977 - Stephen Bristow invented the joystick game controller working for Atari";
fcontent[15]="1978 - Atari was the first to use a trackball for an arcade game";
fcontent[16]="1981 - IBM's first personal computer&ndash; released with a command line interface";
fcontent[17]="1981 - Xerox marketed its 8010 GUI with Star software and a 2-button mouse";
fcontent[18]="1982 - VisiCorp announces the VisiOn graphical user interface (GUI).";
fcontent[19]="1982 - Mouse Systems releases first mouse for the PC, an optical mouse";
fcontent[20]="1982 - KoalaPad, touch tablet with a Stylus to draw and replace joysticks on Apple&nbsp;IIs and Atari 8-bit.";
fcontent[21]="1982 - Commodore 64 with no mouse support - supported paddles &amp; the standard digital (Atari VCS type) joysticks.";
fcontent[22]="1983 - Atari 400 and 800 home computers still use joysticks&mdash; rejected the Hawley mouse";
fcontent[23]="1983 - Apple unveils its Lisa computer with a graphical user interface (GUI) and single-button mouse";
fcontent[24]="1983 - Microsoft's first mouse, a bus mouse with card and software for $200.";
fcontent[25]="1983 - Jack Hawley creates his Mark II X063X 3-button mouse from the Mouse House";
fcontent[26]="1984 - Macintosh computer with one-button mouse and a GUI";
fcontent[27]="1984 - The Microsoft serial mouse and software";
fcontent[28]="1985 - Steve Jobs starts NeXT Computer, produces a UNIX OS in a black case with a matching black mouse";
fcontent[29]="1986 - GEOS [Graphical Environment Operating System] introduced for the C-64.";
fcontent[30]="1986 - Atari ST comes equipped with its own mouse, a 'joystick emulator'";
fcontent[31]="1986 - Commodore 1350 Mouse for the C128 - joystick emulation only";
fcontent[32]="1987 - IBM PS/2 creates a new mouse interface with a round connector";
fcontent[33]="1987 - Microsoft 'dove bar' mouse";
fcontent[34]="1996 - USB (Universal Serial Bus) 'hot swappable' with high speed transfers &amp; multiple devices";
fcontent[35]="1997 - Microsoft PC 97 standard defines Purple for keyboards and green for mice plugs";
closetag='</div>';

var fwidth='210px'; //set scroller width
var fheight='100px'; //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="color:#eff7ef;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