function trim(text) {
  if (text.length > 0) {
    while (text.substring(0,1) == ' ')
      text = text.substring(1, text.length);
    while (text.substring(text.length - 1, text.length) == ' ')
      text = text.substring(0, text.length - 1);
  };
  return text;
}

function getElement(id) {
  if (document.getElementById)
    return document.getElementById(id);
  else if (document.all)
    return document.all[id];
  return null;
}

function button(obj, state) {
  obj.id = state ? "button_hilite" : null;
}