function setFrmElemState(formName, elemName, state) {
  if (document.forms[formName] &&
      document.forms[formName].elements[elemName])
  {
    document.forms[formName].elements[elemName].disabled = (state == 0);
  }
}

function hidePageElem(elemName) {
  elem = document.getElementById(elemName);
  if (elem) {
    elem.style.visibility = 'hidden';
    return 1;
  } else
    return 0;
}

function showPageElem(elemName) {
  elem = document.getElementById(elemName);
  if (elem) {
    elem.style.visibility = 'visible';
    return 1;
  } else
    return 0;
}

function bodyOnLoad() {
  for (f = 0; f < document.forms.length; f++) {
    if (document.forms[f].initializationScript)
     document.forms[f].initializationScript();
  }
}

function help(topic, subtopic)
{
    help_win_width = 740;
    help_win_height = 400;

    win_location = '/help.asp' + '?topic=' + topic;

    helpWindow = window.open('', 'helpWindow',
      'width=' + help_win_width + ',height=' + help_win_height +
      ',dependent=yes,hotkeys=no'
    );
    if (helpWindow.helpTopicDepth) {
      helpWindow.frames["helpBody"].location.href = win_location + '&d=' +
	(helpWindow.helpTopicDepth + 1) + (subtopic ? '#' + subtopic : '')
    } else {
      helpWindow.location.href = win_location + (subtopic ?
	'&subtopic=' + subtopic : '') + '&frames=1';
    }
    helpWindow.focus();
}
