I use callback.
function readyVisorFotos(){
$("a[rel^='prettyPhoto']").prettyPhoto({show_title:false,autoplay_slideshow: true,slideshow: 5000,callback: function(){UItoTop();}});
$(".clipping a[rel^='prettyPhoto']").prettyPhoto({show_title:true,autoplay_slideshow: true,slideshow: 5000,callback: function(){UItoTop();}});
$(".noticiabrief a[rel^='prettyPhoto']").prettyPhoto({show_title:false,callback: function(){UItoTop();}});
}
function UItoTop(){
var defaults = {
containerID: 'toTop', // fading element id
containerHoverID: 'toTopHover', // fading element hover id
scrollSpeed: 1200,
easingType: 'linear'
};
$().UItoTop({ easingType: 'easeOutQuart' });
}