Adding auto-rotate to existing function

Anyone have any ideas on how to add an auto rotate to an existing clickable photo feature?

I would like to mod the code before having to rebuild the feature. Here is the code for the pre-built feature:


function homeFeatureClick(event)
{
	if (!$(this).parent().hasClass('selected'))
	{
		var selected = $('#feature .feature.selected');
		var thumb = $(this);
		var index = $('#feature_thumbs a').index(thumb);
		var feature = $('.feature').eq(index);
		
		selected.find('.feature_details').slideUp(500, function() {
			// Hide current thumbnail
			$('#feature_thumbs li.selected').animate({width: 81}, {duration: 500, easing: 'swing', complete: function () {
				var color = $(this).children('a').attr('rel');
				$(this).removeClass(color + '_selected selected').find('div').hide();
			}});

			// slide out clicked thumbnail
			thumb.parent().find('div').show();
			var color = thumb.attr('rel');
			thumb.parent().addClass(color + '_selected selected').animate({width: 341}, {duration: 500, easing: 'swing'});
			
			// fade out current photo
			selected.removeClass('selected').fadeOut(500);
			
			// fade in new photo
			feature.addClass('selected').fadeIn(500, function () {
				// slide up details when complete
				feature.find('.feature_details').slideDown(500);
			});
			
		});
	}
	
	return false;
}

Thanks so much.