
jQuery.fn.Transition = function (url) {

    var img = this;
    var offset = img.position();
    img.after('<img id="topimg" />');
    var topimg = $('#topimg');
    topimg.css('margin-top', img.css('margin-top'));
    topimg.attr('src', url);
    topimg.css({
        'display': 'none',
        'position': 'absolute',
        'top': offset.top,
        'left': offset.left,
        'z-index': img.css('z-index')
    });
    img.fadeOut('slow');
    topimg.fadeIn('slow', function () {
         img.fadeIn(1);
         img.attr('src', url);
         topimg.remove();
    });
};
