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;
	}));	
}

function getWindowHeight(){
	var height = 0;
	if (typeof(window.innerWidth) == 'number'){
		height = window.innerHeight;
	}
	else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
		height = document.documentElement.clientHeight;
	}
	else if(document.body && (document.body.clientWidth || document.body.clientHeight)){
		height = document.body.clientHeight;
	}
	return height;
}