$(document).ready(function() {
	var speed = 8000;
	var run = setInterval('rotate()', speed);	
	
	var item_width = 353;
	var left_value = item_width * (-1); 
	var sayi = $(".images ul li").length;
	$('.images li:first').before($('.images li:last'));
	$('.images ul').css({'left' : left_value, 'width' : item_width*sayi});

	$('.prev1').click(function() {           
		var left_indent = parseInt($('.images ul').css('left')) + item_width;
		clearInterval(run);
		$('.images ul').animate({'left' : left_indent}, 500,function(){    
			$('.images li:first').before($('.images li:last'));           
			$('.images ul').css({'left' : left_value});
		});      
		run = setInterval('rotate()', speed);    
		return false;     
	});
	$('.next1').click(function() {
		var left_indent = parseInt($('.images ul').css('left')) - item_width;
		clearInterval(run);
		$('.images ul').animate({'left' : left_indent}, 500, function () {
			$('.images li:last').after($('.images li:first'));                 	
			$('.images ul').css({'left' : left_value});
		});
		run = setInterval('rotate()', speed);    
		return false;
	});        
	$('.images').hover(
		function() {
			clearInterval(run);
		}, 
		function() {
			run = setInterval('rotate()', speed);	
		}
	); 
});
function rotate() {
	$('.next1').click();
}


