Fade = {
	
	/* time to transition from blue to yellow, in seconds */
	_transitionTime: 20,

	/* fading in or fading out */
	_up: true,

	/* init */
	init: function()
	{
		setStyle($('alternate'), {'opacity':0, 'filter': 'alpha(opacity = 0)'});
		
		$('alternate').style.visibility = 'visible';

		setInterval("Fade.fadeBody();", Fade._transitionTime * 10);
	},

	/* fade function */
	fadeBody: function()
	{
		var opacity = $('alternate').style.opacity;
		
		opacity = parseFloat(opacity);

		/* increment the opacity if we are fading to yellow */		
		if(Fade._up == true)
		{
			opacity = opacity + parseFloat(0.01);
		}
		else
		{
			opacity = opacity - parseFloat(0.01);
		}

		/* the maximum opacity has been reached, make sure we fade the other direction and set a new opacity */
		if(opacity > 0.99)
		{
			Fade._up = false;
		}

		/* the minimum opacity has been reached, make sure we fade the other direction and set a new opacity */
		if(opacity < 0.01)
		{
			Fade._up = true;
		}
		
		var ieOpacity = opacity * 100;
				
		setStyle($('alternate'), {'opacity': opacity, 'filter': 'alpha(opacity = ' + ieOpacity + ')'});
		
		$('alternate').style.opacity = opacity;
		
	}
}

/* execute init when the page has loaded */
addLoadEvent(Fade.init);


