function T(S)
{
  while(S.charAt(0) == ' ')
    S = S.substring(1, S.length);
  while(S.charAt(S.length - 1) == ' ')
    S = S.substring(0, S.length - 1);
  while((S.length > 1) && (S.charAt(0) == '0') && (S.charAt(1) != '.'))
    S = S.substring(1, S.length);
  return S;
}

function R(n)
{
  var i;
  var res;
  res = true;
  if(n.charAt(0) == '-')
    n = nsubstring(1, n.length)
  for(i = 0; i < n.length; i++)
    if(((n.charAt(i) < '0') || (n.charAt(i) > '9')) && (n.charAt(i) != '.'))
      res = false;
  return res;
}

function I(n)
{
  var i;
  var res;
  res = true;
  if(n.charAt(0) == '-')
    n = nsubstring(1, n.length)
  for(i = 0; i < n.length; i++)
    if((n.charAt(i) < '0') || (n.charAt(i) > '9'))
      res = false;
  return res;
}

function PN(T)
{
  var i;
  var res;
  res = true;
  for(i = 0; i < T.length; i++)
    if(((T.charAt(i) < '0') || (T.charAt(i) > '9')) && 
       (T.charAt(i) != ',') && 
       (T.charAt(i) != '-') &&
       (T.charAt(i) != ' ') &&
       (T.charAt(i) != ','))
      res = false;
  return res;
}

function d(s) {return document.getElementById(s);}
function toggleDisplay(o)
{
  for(i = 0; i < FormCount; i++)
    DisplayOff(d(FormName[i]), o);
  n = o.nodeName.toLowerCase();
  t = (
        n == "span"
        || n == "img"
        || n == "a"
      ) ? "inline" : "block";

  if(o.style)
      o.style.display =
        (o.style.display == t) ? "none" : t;
}

function DisplayOn(o)
{
  n = o.nodeName.toLowerCase();
  t = (
        n == "span"
        || n == "img"
        || n == "a"
      ) ? "inline" : "block";
  if(o.style)
    o.style.display = t;
}

function DisplayOff(o, ex)
{
  n = o.nodeName.toLowerCase();
  if(o != ex)
  if(o.style)
    o.style.display = "none";
}

function al(o, msg)
{
  alert(msg);
  o.focus();
  return false;
}
