var gfi = {
    debug: true,

    pageContext : '',

    pages : {

    },

    /**
     * gfi.forms will try to add validation and other events to forms on the sites
     *
     * Add forms to this list to override events that get called
     */
    formConfigs : {},

    /**
     * add new form configs in other js scripts
     * @param obj
     */
    addFormConfig : function(obj) {
        this.formConfigs = $extend(obj, this.formConfigs);
    },

    /**
     * add new objects to a namespace
     * @param ns
     * @param object
     */
    register: function(ns, object) {
        var props = ns.split('.');
        var obj = this;

        /**
         * loop down the tree from window get the prop for each part of the namespace
         * if one doesnt exist just create an empty object and use that
         * if we are at the final part of the namespace set this to the object passed in
         */
        for (var i = 0; i < props.length; i++) {
            if (i == props.length - 1) {
                obj = obj[props[i]] = object;
            } else if (typeOf(obj[props[i]]) === 'null') {
                obj = obj[props[i]] = {};
            } else {
                obj = obj[props[i]];
            }
        }
    },

    /**
     * our main load method for the app
     *
     * this is the only thing that should be called on domready this in turn should call every thing else
     * some things may not have actually been loaded yet through the registry so actually return a function to call
     */
    load : function() {
        // set up ui elements
        gfi.ui.init();

        // setup forms
//        gfi.forms.init();

        // specific page inits
    },

    log : function(msg) {
        if (this.debug && window.console) {
            window.console.log(msg);
        }
    }
};

