ie=document.all?1:0
nts=document.layers?1:0

//The delay between the fades (in milliseconds) smaller value gives less time:
betweendelay=5000

//Do you wan't it to start over on the first one when it's gone trought all the news?
//(set to 0 if not)
var loop=1

//What font do you wan't it use?
FontFace='Verdana'

//What font-size (in pixel)?
FontSize=11

//Do you wan't it to fade out aswell? 1 for on, 0 for off
fadeback=0

//Set the colors, first color is same as background, last color is the color it stops at:
//You can have upto 7 colors, set the ones you wan't use to 0
colors=new Array()
colors[0]='#FFFFCC'
colors[1]='#FFEC99'
colors[2]='#FFCC33'
colors[3]='#D3A200'
colors[4]='#CC0000'
colors[5]='#800000'
colors[6]='#0000FF'

news=new Array()

news[0]=new Array()
news[0]["text"]="Aggiornata la sezione 'Coro' nella pagina dei Collaboratori"
news[0]["link"]="collaboratori.asp?sez=coro"

news[1]=new Array()
news[1]["text"]="26 febbraio 2011: Pellegrinaggio in Cattedrale per il IV Centenario"
news[1]["link"]="docs/cattedrale2011.pdf"


/*Dont change anything below this!
*********************************************************************************/
fadeInit=new Function("oNews=new makeObj('divNews','divCont'); fadeNews(0)")
function makeObj(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.'
    this.css=(nts) ? eval(nest+'document.'+obj):eval(obj+'.style')
    this.writeref=(nts) ? eval(nest+'document.'+obj+'.document'):eval(obj);		
	this.fadeIt=b_fadeIt
    this.obj = obj + "Object"; 	eval(this.obj + "=this")	
}
function b_fadeIt(text,link,font,size,speed,fn,num,c0,c1,c2,c3,c4,c5,c6){
	if(num<arguments.length && arguments[num]!=0){
		writetext='<a href="'+link+'" style="text-decoration:none; font-size:'+size+'px">'
		+'<font face="'+font+'" color="'+arguments[num]+'">'+text+'</font></a>'
		if(nts){this.writeref.write(writetext); this.writeref.close()}
		if(ie) this.writeref.innerHTML=writetext		
		num++
		setTimeout(this.obj+'.fadeIt("'+text+'","'+link+'","'+font+'",'+size+','+speed+',"'
		+fn+'",'+num+',"'+c0+'","'+c1+'","'+c2+'","'+c3+'","'+c4+'","'+c5+'","'+c6+'")',speed)
	}else setTimeout('eval('+fn+')',betweendelay)
}
function fadeNews(num){
	if(num<news.length){
		fn=fadeback?'fadeBack('+num+')':'fadeNews('+(num+1)+')';
		oNews.fadeIt(news[num]["text"],news[num]["link"],FontFace,FontSize,100,fn,7,
		colors[0],colors[1],colors[2],colors[3],colors[4],colors[5],colors[6])
	}else if(loop)fadeNews(0)
}
function fadeBack(num){
	if(num>=0){
		oNews.fadeIt(news[num]["text"],news[num]["link"],FontFace,FontSize,100,'fadeNews('+(num+1)
		+')',7,colors[6],colors[5],colors[4],colors[3],colors[2],colors[1],colors[0])
	}
}
onload=fadeInit;
