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

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

	init: function()
	{
		if(navigator.userAgent.match('MSIE 6') != null)
		{
			return;
		}
		/* IE is stupid */	
		$('alternate').setOpacity(0);		
		$('alternate').style.visibility = 'visible';

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

	fadeBody: function()
	{
		var opacity = $('alternate').getOpacity();
		
		if(Fade._up == true)
		{
			opacity += 0.01;
		}
		else
		{
			opacity -= 0.01;
		}

		/* IE does not understand equal to 1, apparantly */
		if(opacity > 0.99)
		{
			Fade._up = false;
			return;
		}

		if(opacity < 0.01)
		{
			Fade._up = true;
			return;
		}

		$('alternate').setOpacity(opacity);
	}
}

Element.observe(window, "load", Fade.init);

