function trim(text)
{
  if (text != null)
  {
    while (text.substring(0, 1) == ' ')
    {
      text = text.substr(1);
    }
    while (text.substring(text.length - 1, text.length) == ' ')
    {
      text = text.substring(0, text.length - 1);
    }
  }
  return text;
}

function hasValue(obj)
{
  if (obj == null)
  {
    return false;
  }
  value = obj.value;
  if ((value == null) || (trim(value) == ""))
  {
    return false;
  }
  return true;
}

function getObject(formName, objName)
{
  return eval("document." + formName + "." + objName);
}
