<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Ken Tholke, kentholke@firstsaga.com. -->

<!-- Begin
// add as many or as few messages as you would like
var msg=new Array()
msg[0]="Welcome to the ERCC Website";
msg[1]="Essex Roads CC welcomes members and non-members...";
msg[2]="...on up-coming rides to the following events in 2010";
msg[3]="This year's events in ... click \"<A target='_blank' href='./pdfs/ERCC programme of all events for this year.pdf'>Event Calendar!</A>\"";
msg[4]="Welcome to the ERCC Website";
msg[5]="Essex Roads CC welcomes members and non-members...";
msg[6]="...on up-coming rides to the following events in 2010";
msg[7]="This year's events in ... click \"<A target='_blank' href='./pdfs/ERCC programme of all events for this year.pdf'>Event Calendar!</A>\"";
msg[8]="Try our \"<A target='_self' href='./pages/offroading.htm'>Off-Road rides</A>\"";
msg[9]="Order our \"<A target='_self' href='./pages/clubkit.htm'>Club Kit </A>\"";


//How to insert a message with a link
//msg[x]="Just type in \"<A href='http://javascript.internet.com/'>javascript.internet.com</A>\"";

// set your first set of colors.  Use as many or as few as you wish.
var colors1=new Array("ffffff", "eeeeff", "ddddff", "ccccff", "bbbbff", "aaaaff", "9999ff",
"8888ff", "7777ff", "6666ff", "5555ff", "4444ff", "3333ff","2222ff", "1111ff", "0000ff")

//set your second set of colors
// *** must have exactly the same number of colors as the array above ***
var colors2=new Array("ffffff", "ffeeee", "ffdddd", "ffcccc", "ffbbbb", "ffaaaa", "ff9999",
"ff8888", "ff7777", "ff6666", "ff5555", "ff4444", "ff3333", "ff2222", "ff1111", "ff0000")

//set the height of the display in pixels
high=25;

//set the width of the display in pixels
wide=750;

//set the pixel coordinates for the upper left hand corner of the display
Xpos=2;
Ypos=10;

// move the display away from the edges of the background
pad=15;

// set the background color of the display
bgcol="ffffff";

//add a background image if you want.
// *** for no image, just leave empty quotes (ex. cellbg=""; ) ***
cellbg="";

// set the font
fntFam="arial";
fntSize=14;

// set how how many seconds you want the message to stay remain at totality.
pause=5;

// Do not edit these values below!!!
icolor=0;
mcolor=1;
imsg=0;
spWidth=wide-(2*pad);
totality=false;
glowing=true;
var theMsg="";
var cellcontent="";
pause=pause*1000;

if (cellbg.length>4)
  {cellbg=" background="+cellbg}
else
  {cellbg="";}

function doPause(){
  totality=false;
  t=setTimeout("changecolor()",pause);
}

function initiate(){

  getContentColor();
  getMsg();
  getCellContent();

  if (document.getElementById('msgfade')){
    mfade = document.getElementById('msgfade');
  }

  if (document.getElementById('msgbg')){
    var m = document.getElementById('msgbg');
    m.innerHTML=cellcontent;
    if (mfade != null){
      mfade.innerHTML=theMsg;
    }
    t=setTimeout("changecolor()",20);
  }
}

function changecolor(){
  if(totality==true){
    doPause();
  }
  else{
    getMsg();
    getContentColor();

    if (mfade != null){
      mfade.innerHTML=theMsg;
      t=setTimeout("changecolor()",20);
    }
  }
}

function getFadeColor(){
  icolor=icolor-1;
  if(mcolor==1){
    contentcolor=colors1[icolor];
  }
  else{
    contentcolor=colors2[icolor];
  }
}

function getGlowColor(){
  icolor=icolor+1;
  if(mcolor==1){
    contentcolor=colors1[icolor];
  }
  else{
    contentcolor=colors2[icolor];
  }
}

function changemsg(){
  if(imsg==msg.length-1){
    imsg=0;
    mcolor=1;
  }
  else if(imsg != msg.lenght-1 && mcolor==1){
    imsg=imsg+1;
    mcolor=0;
  }
  else{
    imsg=imsg+1;
    mcolor=1;
  }
}

function getContentColor(){
  if(icolor==colors1.length-1 && glowing==true){
    getFadeColor();
    glowing=false;
    totality=true;
  }
  else if(icolor < colors1.length && glowing==true){
    getGlowColor();
  }
  else if(icolor < 1 && glowing==false){
    changemsg();
    getGlowColor();
    glowing=true;
  }
  else{
    getFadeColor();
  }
}

function getMsg() {
  theMsg="<span style='text-align:center; color:"+contentcolor+"; "
      +"position: absolute; left:"+Xpos+"px; top:"+Ypos+"px; "
      +"font-size:"+fntSize+"pt; font-family:"+fntFam+"; width:"+spWidth+";'>"
  theMsg+="<b>"+msg[imsg]+"</b></span>"
}

function getCellContent(){
  cellcontent="<TABLE height="+high+" width="+wide+" bgcolor="+bgcol
      +" cellpadding=0 cellspacing=0><TR><TD"+cellbg+"> </TD></TR></TABLE>"
}

//  End -->