var current = 0;
var previous = 0;
var items = new Array();
var nrOfItems;
var itemInterval;

function rotate() {
	current = (previous + 1) % nrOfItems;
	items[previous].hide();
	if(items[current]) items[current].show();
	previous = current;
}

$(function() {
	nrOfItems = $('.rotator').size();
	for(var i =  0; i < nrOfItems; i++) { items[i] = $('.rotator').eq(i); }
	items[current].css('display', 'list-item');
	itemInterval = setInterval(rotate, 5000);
});
