var wait = 8000;
var i = 0;

window.onload = function(){
	news_results();
	setInterval("news_results()", wait);
}

function news_results(){
	new Ajax.Updater('news_text', base_url+'welcome/show_news', {method: 'post', postBody:'num='+ i, onComplete: fade_control()});
	i++;
	if(i > 2){
		i = 0;
	}
}

function fade_on(){
	Effect.Appear('news_text', { duration:1, from:0.0, to:1.0 });
}

function fade_off(){
	Effect.Fade('news_text', { duration:1, from:1.0, to:0.0 });
}

function fade_control(){
	setTimeout("fade_off()", wait/1.25);
	fade_on();
}
