jQuery.subscribe = function (eventName, obj, fn) {
    $(window).bind(eventName, function () {
        obj[ fn ].apply( obj, Array.prototype.slice.call(arguments,1) );
    });
    return jQuery;
}

jQuery.publish = function (eventName) {
    $(window).trigger( eventName, Array.prototype.slice.call(arguments,1) );
    return jQuery;
}
