var mess=new Array();
var time=new Array();
var fade=new Array();
var link=new Array();

/*** Enter the text to be faded. ***/

mess[0] = "Website Updated 01.15.2012 - Added new album and videos.";
link[0] = "0";
time[0] = 2000;
fade[0] = 200;

/*** Here you put the colors to be used in the fade. You can ofcourse add as many as liked by entering: ***/
/*** " colors[incrementing number]='hexcode' " incrementing the number from 6.                          ***/
/*** Color 6 will be the last on fadein and vice versa on fadeout ;-) Make first color match background ***/
colors=new Array()
colors[0]='#000000'
colors[1]='#080808'
colors[2]='#101010'
colors[3]='#181818'
colors[4]='#202020'
colors[5]='#282828'
colors[6]='#303030'
colors[7]='#383838'
colors[8]='#404040'
colors[9]='#484848'
colors[10]='#505050'
colors[11]='#585858'
colors[12]='#606060'
colors[13]='#686868'
colors[14]='#707070'
colors[15]='#787877'
colors[16]='#808080'
colors[17]='#888888'
colors[18]='#909090'
colors[19]='#989898'
colors[20]='#A0A0A0'
colors[21]='#A8A8A8'
colors[22]='#B0B0B0'
colors[23]='#B8B8B8'
colors[24]='#C0C0C0'
colors[25]='#C8C8C8'
colors[26]='#D0D0D0'
colors[27]='#D8D8D8'
colors[28]='#E0E0E0'
colors[29]='#E8E8E8'
colors[30]='#F0F0F0'
colors[31]='#F8F8F8'
colors[32]='#FFFFFF'

/*** Enter here the speed between changes in color. The shorter time yieds the smoother fade. ***/
var fadespeed=100;
/*** 0 = just fadein's, no fadeout. 1 = fade in and out. 2 = only fadeouts                    ***/
var fadeout=1;
/*** Do you wish the link to be presented with a picture? Note the path for the pic if yes.   ***/
var path=""

var count = 0; var newsno = 0; var pause = 0; var progress = 0; var first = 0; var pic;
(path != "") ? pic = "<br><IMG border='0' src='" + path + "'>" : pic = "";

function fade_in() {
    first = 1; if (link[newsno] == 0) document.all("txtNews").innerHTML = "<FONT color='" + colors[count] + "'>" + mess[newsno].substring(0, mess[newsno].length) + "</FONT>";
    else document.all("txtNews").innerHTML = "<A href='" + link[newsno] + "' target='idokument' style='text-decoration: none'><FONT color='" + colors[count] + "'>" + mess[newsno].substring(0, mess[newsno].length) + "</FONT></A>" + pic;  //width='20' height='26'
    count++; if (count != colors.length) { progress = 0; pause = fadespeed; } else {
        if (fadeout == 0) { pause = time[newsno]; progress = 0; count = 0; newsno++; }
        else { progress = 1; pause = time[newsno]; } if (newsno >= mess.length) { newsno = 0; } 
    } watchit();
}

function fade_out() {
    document.all("txtNews").innerHTML = "<FONT color='" + colors[count] + "'>" + mess[newsno].substring(0, mess[newsno].length) + "</FONT>";
    count--; if (count != -1) { progress = 1; pause = fadespeed; }
    else {
        pause = fade[newsno]; progress = 0; count = 0; first = 0; newsno++;
        if (newsno >= mess.length) { newsno = 0; } 
    } watchit();
}

function watchit() {
    if (progress == 0) { if ((fadeout == 2) && (first == 0)) count = mess.length - 1; if (count <= colors.length) aktiv = setTimeout("fade_in()", pause); }
    if ((progress == 1) && (fadeout >= 1)) { clearTimeout(aktiv); if (count >= colors.length) count = colors.length - 1; if (count != -1) aktiv = setTimeout("fade_out()", pause); }
}
