﻿
function GetString(strLangId) 
{
    var strFilename = "languages/" + g_strLang + ".xml";
	var xmlLang;
	try
	{
	    xmlLang = SimLoadDocument(strFilename);
	}
	catch(e)
	{
	    alert("Error loading language file:\r" + strFilename + "\r\n" + e);
		return "lang file not found. " + strLangId ;
    }
	
	elmWord = xmlLang.selectSingleNode("//WORD [@id=\"" + strLangId + "\"]");

	if (elmWord == null)
	{
		alert("lang id not found: " + strLangId);
		return "lang id not found: " + strLangId;
	}
	else
	{
		var strValue = elmWord.getAttribute("value");
		if (strValue == "cdata")
		{
			strValue = elmWord.childNodes[0].text;
		}	
		return strValue;
	}
}