app = {

components: new Object(),

translations: new Object(),

loadPage: function(requestPath, withToken)
	{
	if (withToken == true)
		{
		document.getElementById('loadPage').action = app.absoluteUrl + app.baseUrl + requestPath;
		document.getElementById('loadPage').page_token.value = app.pageToken;
		document.getElementById('loadPage').submit();
		}
	else
		window.location = app.absoluteUrl + app.baseUrl + requestPath;
	},

loadJs: function(requestPath)
	{
	Ext.Msg.wait('Please wait', 'Loading...');

	var oScript = document.createElement("script");
	oScript.src = app.baseUrl + requestPath;
	document.body.appendChild(oScript);
	},

requireJs: function(requestPath)
	{
	Ext.Msg.wait('Please wait', 'Loading...');

	var requireScript = document.createElement("script");
	requireScript.src = app.absoluteUrl + app.jsScriptsPath + "/" + requestPath;
	
	if (Ext.isIE)
		requireScript.onreadystatechange = function()
			{
			if (requireScript.readyState == 'loaded' || requireScript.readyState == 'complete')
				app.initAfterRequireJs();
			};
	else
		requireScript.onload = function(){app.initAfterRequireJs()};

	document.body.appendChild(requireScript);
	},
	
init: function(){},

initAfterRequireJs: function(){}
}

