document.observe('dom:loaded', function() {
	//list fading
	if($('ref_list')){
		ul = $('ref_list');
		setTimeout("updateList(ul)", 5000);
	}
});

/**
 * makes a list of item fading and showing one by one
 * @param ul
 * @return void
 */
function updateList(ul) {
	// rotera mellan <li>s som har spel
	
	var active = $(ul).down('.active');
	var next = $(active).next();
	
	if (!next) {
		// börja om från början
		var next = $(ul).down('li');
	}
	
	$(active).fade({
		afterFinish: function() {
			$(active).removeClassName('active');
			$(next).addClassName('active');
			$(next).appear();
			
			setTimeout("updateList(ul)", 5000);
		}
	});
	
}

