var langstr = new Array();

function translateString(str)
{
//  alert(langstr[str]);
  return langstr[str];
}

function writeTranslation(str, element)
{
  var tmp;
  
  tmp = translateString(str);
  if (tmp) document.write(tmp);
}

function openPrefsPopup(e)
{
  var width = 400;
  var height = 500;
  var marginX = 20;
  var marginY = 30;
  var url = 'Prefs.asp';
  var options;
  var x;
  var y;
  var screenX = e.screenX;
  var screenY = e.screenY;

  // closeInfoPopup(); // close any window previously opened

  // check screen right side boundary
  if (screen.availWidth - screenX > width + marginX)
  {
    // popup at right side of cursor
    x = screenX + marginX;
  }
  else
  {
    // popup at left side of cursor
    x = screenX - (width + marginX);
  }

  // check screen lower boundary
  if (screen.availHeight - screenY > height + marginY)
  {
    // popup below cursor
    y = screenY + marginY;
  }
  else
  {
    // popup above cursor
    y = screenY - (height + marginY);
  }

  options = 'top=' + y + ',left=' + x + ',toolbar=no,status=no,menubar=no,scrollbars=yes,width=' + width + ',height=' + height;

  prefsWindow=window.open(url, 'prefsWindow', options);

  prefsWindow.focus();

  return false;
}

