function translate(id)
{
	return uiText[id];
}

function ui(id)
{
	document.write(uiText[id]);
}

function uiReplace(id, control, value)
{
	return uiText[id].replace(control, value);
}

function uiReplaceNumber(id, value)
{
	return uiReplace(id, "[#]", value);
}


function translateFrom(choices, lang)
{
	if (typeof choices == "undefined")
	{
		return "";
	}

	for (var i in choices)
	{
		if (i == lang)
		{
			return choices[i];
		}
	}

	if (lang != "en")
	{
		return translateFrom(choices, "en");
	}
}