/*** 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]="Lu Lacerda: Saiba o que rolou no Free Jazz";
link[0]="http://www.watch.com";
time[0]=4000;
fade[0]=500;

mess[1]="Internet e Tecnologia: tudo sobre o XP";
link[1]="http://www.watch.com";
time[1]=4000;
fade[1]=500;

mess[2]="Ataque: Brasil está na final da Copa";
link[2]="http://www.watch.com";
time[2]=4000;
fade[2]=500;

mess[3]="Correção: a notícia anterior era falsa";
link[3]="http://www.watch.com";
time[3]=4000;
fade[3]=500;

mess[4]="Automania: andamos no Peugeot 307";
link[4]="http://www.watch.com";
time[4]=4000;
fade[4]=500;

mess[5]="Concorra a uma viagem ao Afeganistão";
link[5]="http://www.javascripts.com";
time[5]=4000;
fade[5]=500;

colors=new Array()
colors[0]='#FFFFFF'
colors[1]='#FFF4E4'
colors[2]='#FFE661'
colors[3]='#FFD699'
colors[4]='#FFC773'
colors[5]='#FFB84D'
colors[6]='#FFA825'
colors[7]='#FF9900'
colors[8]='#FF6600'

var fadespeed=150;
var fadeout=1;
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);}
}


