var gTewonderClasses = new Object();
var gTewonderGlobalObjects = new Object();
var gTewonderGlobalFunctions = new Object();
{
	gTewonderGlobalFunctions.addGlobalFunction = (function(iName, iFunction) {
		gTewonderGlobalFunctions[iName] = iFunction;
	});
	
	gTewonderGlobalFunctions.addGlobalFunction("addGlobalObject", (function(iName, iObject) {
		gTewonderGlobalObjects[iName] = iObject;
	}));
	
	gTewonderGlobalFunctions.addGlobalFunction("addClass", (function(iClassPath, iFunction) {
		var pathArray = iClassPath.split(".");
		var currentObject = gTewonderClasses;
		var currentArray = pathArray;
		for(var i = -1; ++i < (currentArray.length-1);) {
			var currentName = currentArray[i];
			if(currentObject[currentName] == undefined) {
				currentObject[currentName] = new Object();
			}
			currentObject = currentObject[currentName];
		}
		currentObject[pathArray[(pathArray.length-1)]] = iFunction;
	}));	
}