jQuery.fn.center = function(target) {
    if (!target) {
        target = window;
    }
    // Always return each...
    return this.each( function() {
        var t = $(this);
        var p = $(target);

        t.css( {
            'position' :'absolute',
            'left' :p.width() / 2 - t.width() / 2,
            'top' :p.height() / 2 - t.height() / 2
        });

    });
};