
var limit = 1;
var timeLimit = 5; // sek
var start = 0;

function animate(el)
{
	var items = [];
	var a = start;

	for (var i = 0; i <= limit-1; i++) {
		if (a === (el.length-1)) {
			items[i] = a;
			a = 0;
		} else {
		  items[i] = a++;
		}
	}

	el.each(function(index){
		if (jQuery.inArray(index, items) !== -1) {
			$(this).fadeIn('slow').css('display', 'block');
		} else {
		  	$(this).css('display', 'none');
		}
	});
		
	start = (start === el.length-1) ? 0 : ++start;
}

$(function(){

	animate($('#animate1 li'));
	setInterval("animate($('#animate1 li'))", timeLimit*1000);

	//animate($('#animate2 li'));
	//setInterval("animate($('#animate2 li'))", timeLimit*1005);

});


