var Type = 'Z';
function StartFloat() {
if(document.all) {
	document.all.AdFloater.style.pixelLeft = '0'; //document.body.clientWidth - document.all.AdFloater.offsetWidth;
	document.all.AdFloater.style.visibility = 'visible';
	Type = 'A';
	}
else if(document.layers) {
	document.AdFloater.left = '0'; //window.innerWidth - document.AdFloater.clip.width - 16;
	document.AdFloater.visibility = 'show';
	Type = 'B';
	}
else if(document.getElementById) {
	document.getElementById('AdFloater').style.left = '0';//(window.innerWidth - 35) + 'px';
	document.getElementById('AdFloater').style.visibility = 'visible';
	Type = 'C';
	}
if (document.all) { window.onscroll = Float; }
else { setInterval('Float()', 100); }
}
function Float() {
if (Type == 'A') { document.all.AdFloater.style.pixelTop = document.body.scrollTop; }
else if (Type == 'B') { document.AdFloater.top = window.pageYOffset; }
else if (Type == 'C') { document.getElementById('AdFloater').style.top = window.pageYOffset + 'px'; }
} 
/***********************************************
*
* Function    : getColor
*
* Parameters  :	start - the start color (in the form "RRGGBB" e.g. "FF00AC")
*			end - the end color (in the form "RRGGBB" e.g. "FF00AC")
*			percent - the percent (0-100) of the fade between start & end
*
* returns	  : color in the form "#RRGGBB" e.g. "#FA13CE"
*
* Description : This is a utility function. Given a start and end color and
*		    a percentage fade it returns a color in between the 2 colors
*
* Author	  : www.JavaScript-FX.com
*
*************************************************/
function getColor(start, end, percent){
	function hex2dec(hex){return(parseInt(hex,16));}
	function dec2hex(dec){return (dec < 16 ? "0" : "") + dec.toString(16);}
	var r1 = hex2dec(start.slice(0,2)), g1=hex2dec(start.slice(2,4)), b1=hex2dec(start.slice(4,6));
	var r2 = hex2dec(end.slice(0,2)),   g2=hex2dec(end.slice(2,4)),   b2=hex2dec(end.slice(4,6));
	var pc = percent/100;
	var r  = Math.floor(r1+(pc*(r2-r1)) + .5), g=Math.floor(g1+(pc*(g2-g1)) + .5), b=Math.floor(b1+(pc*(b2-b1)) + .5);
	return("#" + dec2hex(r) + dec2hex(g) + dec2hex(b));
}
/************************************************/

//var colors = new Array("339966", "FF0000", "00FF00", "0000FF", "FFFF00", "FF00FF", "00FFFF");
//var colors = new Array("000000", "7C7C7C", "FF0000", "CBCBCB", "0000FF", "DCDCDC");
//var colors = new Array("737373", "0000FF", "737373", "FF0000");
//var colors = new Array("007FFF", "228B22", "CC0000","FF4F00","FFFF00");
//var colors = new Array("007FFF", "C0C0C0" ,"CC0000","FF4F00","FFFF00");
//var colors = new Array("CC0000","FF4F00","FFFF00");
var colors = new Array("FC3737","FF4F00","FCFC00");
var start  = colors[0];
var end    = colors[0];
var index  = 0;
var cindex = 0;
var faderObj = new Array();

function fadeSpan()
{
	if(index == 0)
	{
		start = end;
		end = colors[ cindex = (cindex+1) % colors.length ];
	}

  var data = new Date();
  var Hh, Mm, Ss, OraCorrente;
  Hh = data.getHours() + ":";
  Mm = data.getMinutes() + ":";
  Ss = data.getSeconds();
  OraCorrente = Hh + Mm + Ss;
  
//	document.getElementById("fadingText").style.color = getColor(start, end, index);
	for(var i=0 ; i<faderObj.length ; i++) {
			//faderObj[i].style.color = getColor(start, end, index);
			faderObj[i].style.background = getColor(start, end, index);
	}
		
	index = (index+2) % 100;

	setTimeout("fadeSpan()", 50);
}
function fadeAll()
{
	for(var i=0 ; i<arguments.length ; i++)
		faderObj[i] = document.getElementById(arguments[i]);
	  
	fadeSpan();
	  	
}
function JSFX_StartEffects()
{
	fadeAll("AdFloater");
}

