/***********************************************
* 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 = 8000; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=50; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(219,232,241); // start color (red, green, blue)
var endcolor=new Array(0,0,0); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div align=left>'; //set opening tag, such as font declarations

fcontent[0]="Did you know that there are over 6000 sponge species in the oceans of the world but only a few (less than 10) are commercially fished?";

fcontent[1]="Did you know that natural sponges were once considered a plant but were reclassified an animal approximately 60 years ago?";

fcontent[2]="Did you know that sponges are hermaphrodites, meaning that they produce both a sperm and an egg?";

fcontent[3]="Did you know that at one time, natural sponges were the largest agricultural crop in the State of Florida?";

fcontent[4]="Did you know that the first documented use of natural sponges dates back to approximately 400 BC?";

fcontent[5]="Did you know that there is a minimum size required of 5 inches on all sponges fished in the waters of the State of Florida?";

fcontent[6]="Did you know that you properly paint a wall from the ceiling down, but should wash a wall from the baseboard up, in order to prevent streaking?";

fcontent[7]="Did you know that Sea Wool sponges received their name because of the “fleecy” feel of the sponges when wet?";

fcontent[8]="Did you know that Grass sponges received their name because they are found primarily within sea grass beds?";

fcontent[9]="Did you know that the more water absorbent a sponge is, the more it will expand when wet and shrink when dry?";

fcontent[10]="Did you know that the cell structure of the natural sponge is nearly as basic as that of the single celled amoeba?";

fcontent[11]="Did you know that the natural sponge has no central nervous system, but acts more similarly to a colony of single cell organism?";

fcontent[12]="Did you know that the word chamois is the French name of an alpine animal that is no longer used to produce the commercial chamois product?";

fcontent[13]="Did you know that only fish oil tanned sheepskin can be called chamois in the United States market?";

fcontent[14]="Did you know that the Federal Trade Commission in 1964 in their Opinion No. 1 defined what can and cannot be called a chamois?";

fcontent[15]="Did you know that chamois is proven to be the least abrasive material to use to dry any surface?";

fcontent[16]="Did you know that chamois, because it is used wet, can dry golf grips even in a rainstorm, long after a towel is rendered useless?";

fcontent[17]="Did you know that chamois comes from the inner split (endodermal layer) of the sheepskin?";

fcontent[18]="Did you know that chamois leather is the choice of photographers, from amateur to professionals, to keep lenses clean without scratching?";

fcontent[19]="Did you know that Hollywood cameramen keep their lenses clean with genuine chamois leather?";

closetag='</div>';

var fwidth='100%'; //set scroller width
var fheight='100%'; //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=Math.floor(Math.random()*15+1); //15 is the ceiling ;


/*Rafael Raposo edited function*/
//function to change content
function changecontent(){
  if (index>=fcontent.length)
    index=1
  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=Math.floor(Math.random()*15+1); //15 is the ceiling 
}

// 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
