/**
 * Provide system messages through ajax calls. Initially created to provide "site undergoing maintenance" messages.
 *
 * @author Bob Matlin bmatlin@matlinsoftwareservices.com
 * @created 5/9/2010
 *
 * copyright 2010 TABS4CE 
 */

/* requires tabsjs.js, jquery.js */

(function() {
tabsjs.system = function(spec) {
    var that = TABSJS(spec);

    var message;

    /**
     * Get a site wide message. Pages must have a container with the ID "site-message".
     * Expects that there will always be a returned message even if it is empty.
     *
     * If there is a message, it should go in its own container.
     */
    var getSiteMessage = function() {
        var ajx = $.get("/system/site.html",function(data) {
                $('#site-message').html(data);
            });

    };
    that.getSiteMessage = getSiteMessage;

    return(that);
}
})();

$(document).ready(function($) {
    var _tabsSystemMsg = tabsjs.system();
    _tabsSystemMsg.getSiteMessage();
});