var wAnalyzeResult;

var stringCache = new Array();
function translate(string)
{
  if (stringCache[string])
  {
    return stringCache[string];
  }
  var regexp = /<(\/){0,1}localized>/gi;
  stringStripped = string.replace(regexp, '');
  if (wAnalyzeResult)
  {
    var stringReturn = wAnalyzeResult.TUTranslate(stringStripped);
    stringCache[string] = stringReturn;
    return stringReturn;
  }
  else
  {
    return stringStripped;
  }
}

function initTranslation()
{
  $('.localized').each(
    function ()
    {
      $(this).html(translate($(this).html()));
    }
  );
}

function execApp(application, param)
{
  if (wAnalyzeResult)
  {
    wAnalyzeResult.StartTUApp(application, param);
  }
}
