$(function (){ 	

	var speed = 5000;
	var run = setInterval('rotate2()', speed);		

	var item_width = $('.sud-el').outerWidth(); 
	var left_value = item_width * (-1); 
		
	$('.sud-el:first').before($('.sud-el:last'));
	$('#sud-inner').css({'marginLeft' : left_value});

	$('#prev').click(function() {           
		var left_indent = parseInt($('#sud-inner').css('marginLeft')) + item_width;         
		$('#sud-inner:not(:animated)').animate({'marginLeft' : left_indent}, 500,function(){          	
			$('.sud-el:first').before($('.sud-el:last'));
			$('#sud-inner').css({'marginLeft' : left_value});		
		});       
		return false;			
	});
 
	$('#next').click(function() {
		var left_indent = parseInt($('#sud-inner').css('marginLeft')) - item_width;
		$('#sud-inner:not(:animated)').animate({'marginLeft' : left_indent}, 500, function () {
			$('.sud-el:last').after($('.sud-el:first'));
			$('#sud-inner').css({'marginLeft' : left_value});		
		});
		return false;		
	});        
	
	$('#sud, #next, #prev').hover(		
		function() {
			clearInterval(run);
		}, 
		function() {
			run = setInterval('rotate2()', speed);	
		}
	); 
	
});

function rotate2() {
	$('#next').click();
}
