$(function() {
	var rotatorsInit = 0;
	
	$('.rotatorImages').each(function() {
		rotateImages('#rotator' + rotatorsInit++);
	})
})

function rotateImages(elem)
{
	var imagesTotal = 0;
	var currentImage = 0;

	$(elem + ' li').each(function() {
		++imagesTotal;
		$(elem + ' li').hide();
	});
	
	$(elem + ' li:eq(' + currentImage + ')').show();
	setInterval(function() {
		if($.browser.msie)	{
			$(elem + ' li:eq(' + currentImage++ + ')').hide();
		}
		else		
			$(elem + ' li:eq(' + currentImage++ + ')').fadeOut(500);
		
		if (currentImage >= imagesTotal)
			currentImage = 0;
		
		if($.browser.msie)	{
			$(elem + ' li:eq(' + currentImage++ + ')').show();
		}
		else
			$(elem + ' li:eq(' + currentImage + ')').fadeIn(500);
		
	}, 4000);
}
