(function($) {
var fadeInSpeed = 600;
var fadeOutSpeed = 200;
$('.rollover').each(function() {
this.onImage = $(this).attr('src').replace(/^(.+)(\.[a-z]+)$/,"$1"+'_o'+"$2");
this.onHtml = $('<img src="'+this.onImage+'" alt="" style="position: absolute; opacity: 0;" />');
$(this).before(this.onHtml);
$(this).hover(
function(){
$(this).stop().animate({'opacity': 0}, fadeInSpeed);
$(this).prev().stop().animate({'opacity': 1}, fadeInSpeed);
},
function(){
$(this).stop().animate({'opacity': 1}, fadeOutSpeed);
$(this).prev().animate({'opacity': 0}, fadeOutSpeed);
}
);
});
})(jQuery);