function onAfterPics(curr, next, opts) {
        var index = $(this).parent().children().index(this);
        $('#prev2')[index == 0 ? 'hide' : 'show']();
        $('#next2')[index == opts.slideCount - 1 ? 'hide' : 'show']();
}

$(function() {
        $('#showpics').cycle({
                fx:     'fade',
                timeout: 0,
                after:   onAfterPics,
                next:   '#next2',
                prev:   '#prev2'
        });
        $('#showpics a').lightBox();
});
