var rotationInterval = 5000;
var leftIndex        = 1;
var rightIndex       = 1;

$(document).ready(function() {
	if($("#dataLeft > div.box").length > 1) {
		window.setInterval(function(){
			
			$('#rotLeft').slideUp('normal', function() {
				$(this).empty().append(
					$($('#dataLeft').children().get(leftIndex)).clone()
				).slideDown('slow');
			});
				
			if(++leftIndex >= $('#dataLeft').children().length) {
				leftIndex = 0;				
			}
			
		},rotationInterval);
	}
	if($("#dataRight > div.box").length > 1) {
		window.setInterval(function(){
			
			$('#rotRight').slideUp('normal', function() {
				$(this).empty().append(
					$($('#dataRight').children().get(rightIndex)).clone()
				).slideDown('slow');
			});
				
			if(++rightIndex >= $('#dataRight').children().length) {
				rightIndex = 0;				
			}
			
		},rotationInterval);
	}
});