$(document).ready(function()
{
	var current_small_slide = 1;
	
	var small_slide_count = $('#small_slideshow div.slide').length;

	function small_slide_rotate()
	{
	
		if(current_small_slide == small_slide_count)
		{
		
			 $('#slide_' + current_small_slide).animate({
				top: '-=150'
			 }, 1000,function(){
				$('#slide_' + current_small_slide).animate({
					top: '+=300'
				 }).hide();
				current_small_slide = 1;
			  });
			  
			  $('#slide_1').show().animate({
					top: '-=150'
				 },1000);	
				 
		}
		
		else
		{
		
			$('#slide_' + current_small_slide).animate({
				top: '-=150'
			}, 1000, function(){			
				$('#slide_' + current_small_slide).animate({
					top: '+=300'
				 }).hide();
				 current_small_slide++;
			});
			
			
			$('#slide_' + parseInt(current_small_slide+1)).show().animate( {
				top: '-=150'
			 }, 1000);
			
		}
		
	}
	
	setInterval(small_slide_rotate, 5000);
});
