function show(elementName)
{
  var theElement = document.getElementById(elementName);
  if ( theElement ) { theElement.style.display = ''; }
}

function hide(elementName)
{
  var theElement = document.getElementById(elementName);
  if ( theElement ) { theElement.style.display = 'none'; }
}

function showAndHide(elementNameToShow, elementNameToHide)
{
  show(elementNameToShow);
  hide(elementNameToHide);
}

function showAndHideRadioGroup(radioGroupName)
{
  var theRadioGroup = document.getElementById(radioGroupName);

  if ( theRadioGroup.type != 'radio')
  {
    alert(radioGroupName + ' is NOT a radio group. It is a(n) ' + theRadioGroup.type);
  }
  else
  {
    var radio = document.getElementsByName(radioGroupName);

    for (var i = 0; i < radio.length; i++)
    {
      radioOnclick = radio[i].onclick + '; if ( ' + radio[i].checked + ' ){ anonymous(); }';
      eval(radioOnclick);
    }
  }
}

function showSelectedOptionOnly(selectBoxName, elementBaseID)
{
  var theSelectBox = document.getElementById(selectBoxName);

  if ( theSelectBox.tagName != 'SELECT')
  {
    alert(theSelectBox.name + ' is NOT a select box. It is a(n) ' + theSelectBox.tagName);
  }
  else
  {
    for (var i = 0; i < theSelectBox.options.length; i++ )
    {
      elementToShowOrHide = elementBaseID + theSelectBox.options[i].value;

      if ( theSelectBox.options[i].selected )
      {
        show( elementToShowOrHide );
      }
      else
      {
        hide( elementToShowOrHide );
      }
    }
  }
}