// Create each namespace in the path if it doesn't already exists.
if (typeof Lib == 'undefined') {
    Lib = {};
}

if (!Lib.Utils) {
    Lib.Utils = {};
}

/**
* author: njminsh (Nate Minshew)
* date created: 10/06/2005
* description:
*   This is a javascript object that performs utility functions on a namespace.
*/
Lib.Utils.NamespaceUtils = {};

/**
* author: njminsh (Nate Minshew)
* date created: 10/06/2005
* access level: public
* description: This method takes a namespace classpath and creates any levels of the namespace that have not already
*   been created.
*
*   ie: 'Lib.Utils.JSAN'
*
* @param classpath - String representing a namespace path.
*/
Lib.Utils.NamespaceUtils.createIfNecessary = function(classpath) {
    var namespaces = classpath.split('.');
    var currentNamespace = "";
    for (var i = 0; i < namespaces.length; i++) {
        currentNamespace = currentNamespace + namespaces[i];
        var classdef = eval(currentNamespace);
        if (typeof classdef == 'undefined') {
            eval(currentNamespace + " = {}");
        }
        currentNamespace = currentNamespace + ".";
    }
}