/*************************************************************************************
This script made by and copyrighted to Peter Svendsen.
This script may be used freely as long as this message is intact
*************************************************************************************/

var mess=new Array();
var time=new Array();
var fade=new Array();
var link=new Array();

mess[0]="Tijdens Dance-Valley 2006 waren 33 Phoenix can. palmen van 2,50 meter te zien in een opzwepend decor.";
link[0]="0";
time[0]=4000;
fade[0]=0;

mess[1]="Nu zijn diverse exclusieve buiten palmen te zien op Cirque de Soleil te Brussel ~~ België ~~.";
link[1]="0";
time[1]=4000;
fade[1]=0;

mess[2]="GrowingArt, sfeermakers met rendement!";
link[2]="0";
time[2]=4000;
fade[2]=0;

mess[3]="Eind Juli hebben we de NK Beachsoccer aangekleden met diverse palmen.";
link[3]="0";
time[3]=4000;
fade[3]=0;

mess[4]="Kerstbomen compleet geplaatst? Neem dan contact met ons op.";
link[4]="0";
time[4]=4000;
fade[4]=0;

mess[5]="Zeer binnenkort is onze aanbod in Kersdecoraties te zien in onze assortimentslijst.";
link[5]="0";
time[5]=4000;
fade[5]=0;

/*** 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]='#999966'
colors[1]='#A7A77A'
colors[2]='#B6B692'
colors[3]='#C6C6AA'
colors[4]='#D2D2BD'
colors[5]='#DDDDCC'
colors[6]='#EEEEE6'
colors[7]='#FFFFFF'

/*** Enter here the speed between changes in color. The shorter time yieds the smoother fade. ***/
/*** Better if more than the original 6 colors in colorarray.                                 ***/
/*** E.g. 12 fadecolors and fadespeed of approx. 100                                          ***/
var fadespeed=100;

/*** Do you want fadeout as well? Or just a fadein of a new text? Or maybe just fadeout!      ***/
/*** 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.   ***/
/*** If you don't want a picture along with the presentation of the link, just enter "" .     ***/
var path=""

/*************************************************************************************
Here comes the 'privat part'......................    Don't change ANYTHING below this.
**************************************************************************************/
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);}
}


