/***********************************************
* 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 = 100; //set delay between message change (in miliseconds)
var maxstepsA=30;
var maxstepsB=30; // number of steps to take to change from start color to endcolor
var stepdelayA=40;
var stepdelayB=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(16,20,127); // end color (red, green, blue)
var readTime = 12000;
var fcontent=new Array();
begintag='
'; //set opening tag, such as font declarations
fcontent[0]="
- If welfare recipients want to dole out the dollar bills at a...
";
fcontent[1]="
- FORTUNE -- The liquid securities alone on Apple\'s balance sh...
";
fcontent[2]="
- \"Independent Street\" blog will no longer be updated.
";
closetag='
';
var fwidth='120px'; //set scroller width
var fheight='200px'; //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)
linkcolorchange1(1);
setTimeout("colorfade1(1, 15)", readTime);;
}
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 linkcolorchange1(step){
var obj=document.getElementById("fscroller").getElementsByTagName("A");
var objA=document.getElementById("fscroller").getElementsByTagName("LI");
if (obj.length>0){
for (i=0;i0){
for (i=0;i0){
for (i=0;i0){
for (i=0;i 0) {
newcolor1[i] = startcolor[i]-(Math.round((diff1/maxstepsA))*step);
} else {
newcolor1[i] = startcolor[i]+(Math.round((Math.abs(diff1)/maxstepsA))*step);
}
}
return ("rgb(" + newcolor1[0] + ", " + newcolor1[1] + ", " + newcolor1[2] + ")");
}
function getstepcolor2(step) {
var diff2
var newcolor2=new Array(3);
for(var i=0;i<3;i++) {
diff2 = (startcolor[i]-endcolor[i]);
if(diff2 > 0) {
newcolor2[i] = endcolor[i]+(Math.round((diff2/maxstepsA))*step);
} else {
newcolor2[i] = endcolor[i]-(Math.round((Math.abs(diff2)/maxstepsA))*step);
}
}
return ("rgb(" + newcolor2[0] + ", " + newcolor2[1] + ", " + newcolor2[2] + ")");
}
if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent