var pos = 0, index = 0, tickerlev, timer, timer0 = null
var R, G, B, Rs, Gs, Bs, Rf, Gf, Bf, Rm, Gm, Fm
var til = tickerInterLevel

function tickerGo() {
	tickerlev = 
		document.layers
			? document.layers.fading-ticker
			: document.getElementById
				? document.getElementById("fading-ticker")
				: document.all.fading-ticker
	Rs = hexToDec(tickerStartColor.substring(0,2))
	Gs = hexToDec(tickerStartColor.substring(2,4))
	Bs = hexToDec(tickerStartColor.substring(4,6))
	Rf = hexToDec(tickerFinalColor.substring(0,2))
	Gf = hexToDec(tickerFinalColor.substring(2,4))
	Bf = hexToDec(tickerFinalColor.substring(4,6))
	R = (Rf-Rs)/til
	G = (Gf-Gs)/til
	B = (Bf-Bs)/til
	Rm = Rf
	Gm = Gf
	Bm = Bf
	tickerStart()
}

function tickerStart() {
	Rm = Rm+R
	Gm = Gm+G
	Bm = Bm+B
	switch (pos) {
		case 0:
			tickerlev.innerHTML = tickerNews[index][0]
			Rm=Rs 
			Gm=Gs 
			Bm=Bs 
			break
		case til:
			tickerlev.innerHTML = '<a href="'+tickerNews[index][1]+'">'+tickerNews[index][0]+'</a>'
			index++
			if (index == tickerNews.length) index = 0
			Rm=Rf 
			Gm=Gf 
			Bm=Bf 
			break
		default:
	}
	tickerlev.style.color = '#'+decToHex(parseInt(Rm,10))+decToHex(parseInt(Gm,10))+decToHex(parseInt(Bm,10))
	pos = pos == til ? 0 : pos + 1
	if (timer0) clearTimeout(timer)
	timer = setTimeout("tickerStart()",pos==0?tickerStop:tickerSpeed)
	timer0 = true
}


function hexToDec(hex) { 
	return parseInt(hex,16)
}

hexChar = ['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f']

function decToHex(dec) {
	quotient = parseInt(dec/16,10)
	remainder = dec -(quotient*16)
	ret = hexChar[quotient]+hexChar[remainder]
	return ret
}



