var MYAPP = MYAPP || {};

/**
 * namespace を構築する.
 * @param {string} ns_string 名前.
 * @return {Object} namespace.
 */
MYAPP.namespace = function(ns_string) {
    var parts = ns_string.split('.'),
    parent = MYAPP,
    i;

    // strip redundant leading global
    if (parts[0] === 'MYAPP') {
        parts = parts.slice(1);
    }

    for (i = 0; i < parts.length; i += 1) {
        // create property of it dosn't exixt
        if (typeof parent[parts[i]] === 'undefined') {
            parent[parts[i]] = {};
        }
        parent = parent[parts[i]];
    }
    return parent;
};
