$(document).ready(function () {
			function onAfter(curr, next, opts) {
    		var index = $(this).parent().children().index(this);
    		$('#prev')[index == 0 ? 'show' : 'show']();
    		$('#next')[index == opts.slideCount - 1 ? 'show' : 'show']();
			}				
				$('#imatges').cycle({ 
				fx: 'fade', 
				speed: 'normal', 
				timeout: 0, 
				next: '#next, #imatges',
				prev: '#prev',
				after: onAfter,
				pause: 'mouseout'
			});
	});
