/***********************************************
* Fading Scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
var delay = 4000;
var maxsteps=30;
var stepdelay=40;
var startcolor= new Array(0,109,170);
var endcolor=new Array(255,255,255);
var fcontent=new Array();
begintag='<div style="padding:5px;text-align:left;">';
fcontent[0]='<span class="smHD2">What\'s new?</span><br />New on the MarineBio Network...';
fcontent[1]='<a href="http://marinebio.org/gallery/video/Beaked-Whales.asp">Beaked Whales video added to library, simply amazing...</a>';
fcontent[2]='<a href="http://marinebio.org/Oceans/red-list-species.asp">Threatened and Endangered Species</a> updated...';
fcontent[3]='Happy Holidays from all of us at MarineBio!';
fcontent[4]='The <a href="http://marinebio.org/shop/">Ocean Gear Shop</a> has been updated in time for the holidays.';
fcontent[5]='Species, shark conservation, and deep sea info in progress.';
fcontent[6]='<a href="http://marinebio.org/news.asp">Hourly News</a> updated. <a href="https://secure.groundspring.org/dn/index.php?aid=11032">Join the MarineBio Conservation Society &raquo;</a>';
fcontent[7]='Species and groups content development continues...';
fcontent[8]='<a href="http://marinebio.org/blog/">Blog</a> mobile version live. <a href="https://secure.groundspring.org/dn/index.php?aid=11032">Join the MarineBio Conservation Society &raquo;</a>';
fcontent[9]='<a href="http://marinebio.org/blog/?p=616">Happy World Oceans Day!</a> Updates in progress...';
fcontent[10]='<a href="http://planktonforums.org/">Forums</a>/<a href="http://marinebio.org/blog/">blog</a>/<a href="http://marinebio.org/gallery/video/">video library</a> updated. <a href="https://secure.groundspring.org/dn/index.php?aid=11032">MarineBio Conservation Society &raquo;</a>';
fcontent[11]='<a href="http://marinebio.org/species_in_review.asp">Species group data reviews</a> and grant research continues...';
fcontent[12]='<a href="https://secure.groundspring.org/dn/index.php?aid=11032">MarineBio Conservation Society members/donations rising &raquo;</a>';
fcontent[13]='<a href="http://marinebio.org/MarineBio/internships.asp">Volunteer program in the works....</a>';
fcontent[14]='<a href="http://marinebio.org/gallery/video/">MarineBio marine life video library updated. Over 100 selected videos!</a>';
fcontent[15]='<a href="http://marinebio.org/gallery/video/Aquanaut.asp">Flight of the Aquanaut video added to the video library &raquo;</a>';
closetag='</div>';
var fwidth='150px';
var fheight='60px';
var fadelinks=1;
var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;
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++}
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);}}
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);}}
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;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