$(document).ready(function(){
   	$('.pera a').imgPreview({
    	containerID: 'imgPreviewWithStyles',
    	/* Change srcAttr to rel: */
    	srcAttr: 'rel',
    	imgCSS: {
    	    // Limit preview size:
   	    	height: 100
    	},
    	// When container is shown:
    	onShow: function(link){
        	// Reset image:
        	$('img', this).stop().css({opacity:0});
        	$('<span>' + $(link).attr("title") + '</span>').appendTo(this);
    	},
    	// When image has loaded:
    	onLoad: function(){
        	// Animate image
        	$(this).animate({opacity:1}, 300);
    	},
    	// When container hides: 
    	onHide: function(link){
        	// Animate link:
        	//$(link).stop().animate({opacity:1});
        	$('span', this).remove();
    	}
	});
});
