/**
 * @class App对象全局名称空间
 * @constructor
 */
var App = window.App || {};

/**
 * Returns the namespace specified and creates it if it doesn't exist
 *
 * egova.namespace("property.package");
 * egova.namespace("EGOVA.property.package");
 *
 * Either of the above would create egova.property, then
 * egova.property.package
 * @method 
 * @param  {String} ns The name of the namespace
 * @return {Object} A reference to the namespace object
 */
App.namespace = function(ns) {

    if (!ns || !ns.length) {
        return null;
    }

    var levels = ns.split(".");
    var nsobj = App;

    for (var i=(levels[0] == "App") ? 1 : 0; i<levels.length; i=i+1) {
        nsobj[levels[i]] = nsobj[levels[i]] || {};
        nsobj = nsobj[levels[i]];
    }

    return nsobj;
};

App.namespace("page");
App.namespace("util");

