

/* Argument form: the form being read from.
   Result:        a string.   

   Reads from the form object passed as the first
   argument, the value of the radio button named
   by the second. 

   Example:
     readRadioButton( document.forms[0], 'married' );
*/
function readRadioButton(form, name)
{
  var elements = form.elements;
  for (var i=0; i<elements.length; i++) {
    var element = elements[i];
    if (element.name == name && element.checked)
      return element.value;
  }
  return true;
}

