var toDec = new Array ()
toDec ['0'] = 0
toDec ['1'] = 1
toDec ['2'] = 2
toDec ['3'] = 3
toDec ['4'] = 4
toDec ['5'] = 5
toDec ['6'] = 6
toDec ['7'] = 7
toDec ['8'] = 8
toDec ['9'] = 9
toDec ['a'] = 10
toDec ['b'] = 11
toDec ['c'] = 12
toDec ['d'] = 13
toDec ['e'] = 14
toDec ['f'] = 15
var toHex = new Array ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f')
// function fadeOut (c, index, hl) {

function fader (to, current, doNext, next, hideCurrent) {
	if (!hideCurrent) hideCurrent = false	
	if (document.all [current + "Div"].style.color == to) {
		if (doNext) {
		document.all [current + "Div"].style.visibility = "hidden"
		document.all [next + "Div"].style.visibility = "visible"
		setTimeout("fader ('#333333','" + next + "',false)", 50)
		} 
		else if (hideCurrent) {
		document.all [current + "Div"].style.visibility = "hidden"
		} 
		else {

		// document.all ["dirtDiv"].style.visibility = "hidden"
		}
		} else {
		var color = fade (document.all [current + "Div"].style.color, to)
		document.all [current + "Div"].style.color = color
		/* if (nn) {
		document.all.headline.document.open ()
		document.all.headline.document.write ("<font class='headlineNoColor' color='" + color + "'>" + hl + "</font>")
		document.all.headline.document.close ()
		*/
		setTimeout("fader ('" + to + "','" + current + "'," + doNext + ",'" + next + "'," + hideCurrent + ")", 40)
		}}

		function fadeIn (to, from, index, hl) {
		if (document.all.headline.style.color == to) {
		setTimeout("fadeOut ('" + from + "'," +  index + ",'" + hl + "')", 4000)
		} else {
		var color = fade (document.all.headline.style.color, to)
		document.all.headline.style.color = color
		if (nn) {
			document.all.headline.document.open ()
			document.all.headline.document.write ("<font class='headlineNoColor' color='" + color + "'>" + hl + "</font>")			
			document.all.headline.document.close ()
		}
		setTimeout("fadeIn ('" + to + "','" + from + "'," + index + ",'" + hl + "')", 50)
	      	}}

		function fade (from, to) {
		var f_r1 = parseInt(toDec[from.charAt(1)])
		var f_r2 = parseInt(toDec[from.charAt(2)])
		var f_g1 = parseInt(toDec[from.charAt(3)])
		var f_g2 = parseInt(toDec[from.charAt(4)])
		var f_b1 = parseInt(toDec[from.charAt(5)])
		var f_b2 = parseInt(toDec[from.charAt(6)])
		var t_r1 = parseInt(toDec[to.charAt(1)])
		var t_r2 = parseInt(toDec[to.charAt(2)])
		var t_g1 = parseInt(toDec[to.charAt(3)])
		var t_g2 = parseInt(toDec[to.charAt(4)])
		var t_b1 = parseInt(toDec[to.charAt(5)])
		var t_b2 = parseInt(toDec[to.charAt(6)])
		if (f_r1 != t_r1) f_r1 = f_r1 + ((f_r1 > t_r1) ? -1 : 1)
		if (f_r2 != t_r2) f_r2 = f_r2 + ((f_r2 > t_r2) ? -1 : 1)
		if (f_g1 != t_g1) f_g1 = f_g1 + ((f_g1 > t_g1) ? -1 : 1)
		if (f_g2 != t_g2) f_g2 = f_g2 + ((f_g2 > t_g2) ? -1 : 1)
		if (f_b1 != t_b1) f_b1 = f_b1 + ((f_b1 > t_b1) ? -1 : 1)
		if (f_b2 != t_b2) f_b2 = f_b2 + ((f_b2 > t_b2) ? -1 : 1)
		return ("#" + toHex[f_r1] + toHex[f_r2] + toHex[f_g1] + toHex[f_g2] + toHex[f_b1] + toHex[f_b2])
		}
