$(document).ready(function() {
    $('.slideshow').cycle({
		fx: 'fade',
		next:   '#next2', 
		prev:   '#prev2',
		after:   onAfter, 
		sync: 1,
		nowrap: 1,
		timeout: 0
	});
    $('.slideshow').cycle({

		after:   onAfter, 
		timeout: 0
	});
});

function onAfter(curr, next, opts) {
    var index = opts.currSlide;
    $('#prev2')[index == 0 ? 'hide' : 'show']();
    $('#next2')[index == opts.slideCount - 1 ? 'hide' : 'show']();
}