function myrecycle($hook) {
	var $nav = $('<div class="nav"></div>').insertAfter($hook);
	$hook.cycle({
		fx:     'scrollRight',
		speed:   300,
		timeout: 0,
		pager:   $nav,
		next:    $hook,
		pagerAnchorBuilder: function(index, el) {
			return '<a href="#"></a>'; // whatever markup you want
		},
		after: onAfter
	});
}

function onAfter(curr, next, opts, fwd) {
	var index = opts.currSlide;
	$('#prev')[index == 0 ? 'hide' : 'show']();
	$('#next')[index == opts.slideCount - 1 ? 'hide' : 'show']();
	//get the height of the current slide
	var ht = $(this).height();
	//set the container's height to that of the current slide
	$(this).parent().animate({ height: ht });
}
