var GwTools =
{
	// function:	loadJsFile(filename)
	// Params:	filename: The script file to load
	// Retval:	(none)
	// Descr:	This function can be used to add a JavaScript file after the page was loaded.
	//		That's useful when more js files are needed than the HTML templates in the static directory
	//		include
	loadJsFile: function(filename)
	{
		var e = document.createElement("script");
		e.setAttribute("type", "text/javascript");
		e.setAttribute("src", filename);
		if(typeof e !== "undefined")
		{
			document.getElementsByTagName("head")[0].appendChild(e);
		}
	},

	// function:	loadCssFile(filename)
	// Params:	filename: The css file to load
	// Retval:	(none)
	// Descr:	This function can be used to add a CSS file after the page was loaded.
	//		That's useful when more CSS files are needed than the HTML templates in the static directory
	//		include
	loadCssFile: function(filename)
	{
		var e = document.createElement("link");
		e.setAttribute("rel", "stylesheet");
		e.setAttribute("type", "text/css");
		e.setAttribute("href", filename);
		if(typeof e !== "undefined")
		{
			document.getElementsByTagName("head")[0].appendChild(e);
		}
	},

	// function:	getLanguage()
	// Params:	(none)
	// Retval:	The language string of the current language
	// Descr:	Returns the current language string as specified in the URL
	getLanguage: function()
	{
		return document.location.href.search(/lang=de/i) != -1 ? "de" : "en";
	},

	// function:	getTranslation()
	// Params:	en: The English version of a string
	//		de: The German version of the string
	// Retval:	The string in the current language
	// Descr:	Gets a list of all translations of a string into all supported languages and chooses the
	//		one that fits the currently selected language
	getTranslation: function(en, de)
	{
		switch(GwTools.getLanguage())
		{
		case "de":
			return de;
		case "en":
		default:
			return en;
		}
	},

	// function:	hideThrobber()
	// Params:	(none)
	// Retval:	(none)
	// Descr:	Hides any loading animation on the current site
	hideThrobber: function()
	{
		$("#throbber").hide();
	}
};

