
function getAuthor(fs) {
  var authID = fs.options(fs.selectedIndex).value;
  if (authID != 0) {
    var URL = "display_author_bio.php?aid=" + authID + "&pid=1";
    popUp(URL,'Biography',440,360,400,400,1);
  }
}

function popUp(u, n, w, h, l, t, s) {
	var URL = u;
	var Name = n;
	var winparams = "location=0,menubar=1,toolbar=0,resizable=1" +
	",width=" + w + ",height=" + h + ",left=" + l + ",top=" + t +
	",scrollbars=" + s;
	pop = window.open(URL,Name,winparams);
	pop.focus();
}

function isRadioChecked(radioObj) {
  var isChecked = false;
  for (var j = 0; j < radioObj.length; j++) {
    if (radioObj[j].checked) {
      isChecked = true;
    }
  }
  return isChecked;
}

function checkTestFields(f) {
  var ok = true;
	for (var i = 0; i < f.length; i++) {
    if (f[i].type == "radio") {
      var radios = f[f[i].name];
      if (! isRadioChecked(radios) ) {
        ok = false;
      }
    }
	}
	if (ok) {
		return true;
	} else {
		alert("You must answer each test question.");
		return false;
	}
}

function checkEvalFields(f) {
  var ok = true;
    for (var i = 0; i < f.length; i++) {
      if (f[i].type == "radio") {
        var radios = f[f[i].name];
        if (! isRadioChecked(radios) ) {
          ok = false;
        }
      }
    }
	if (ok) {
		return true;
	} else {
		alert("Please answer each evaluation question \n(comments are optional).");
		return false;
	}
}
