Trying to calculate a selection value from a radio group and values from other fields. Any 'Name' input adds a value to the Total. I need the value from the radio group to be added to that total. Here is the HTML:

HTML Code:
          <input type="radio" name="sponsorship" value="3000" id="sponsor1" />
        <br />
          <input type="radio" name="sponsorship" value="1500" id="sponsor2" />
        <br />
          <input type="radio" name="sponsorship" value="1000" id="sponsor3" />
        <br /></td>
      <td>Name 1 <INPUT NAME="Name_1" TYPE="TEXT" id="name1" onchange="updatecost(1, 50)" onkeyup="updatecost(1, 50)" VALUE="" size="30"></td>
      <td><INPUT NAME="cost_1" TYPE="TEXT" VALUE="" size="4" id="cost1"></td>
      <td>Name 2<INPUT NAME="Name_2" TYPE="TEXT" id="name2" onchange="updatecost(2, 50)" onkeyup="updatecost(2, 50)" VALUE="" size="30"></td>
      <td><INPUT NAME="cost_2" TYPE="TEXT" VALUE="" size="4" id="cost2"></td>
      <td>Name 3<INPUT NAME="Name_3" TYPE="TEXT" id="name3" onchange="updatecost(3, 50)" onkeyup="updatecost(3, 50)" VALUE="" size="30"></td>
      <td><INPUT NAME="cost_3" TYPE="TEXT" VALUE="" size="4" id="cost3"></td>
      <td colspan="4">Total:
        <INPUT NAME="Total" id="Total" TYPE="TEXT" VALUE="" size="8" onFocus="this.form.elements[0].focus()" >
        <INPUT TYPE="HIDDEN" onchange="totalcost()" onkeyup="totalcost()"></td>
  <input type="RESET" name="Reset" value="Reset" />
And here is the js:

<script language="JavaScript" type="text/javascript">
function getRadioValue(name) {
    var group = document.getElementsByName('sponsorship');
    for (var i=0;i<group.length;i++) {
        if (group[i].checked) {
            return group[i].value;
    return '';

function updatecost(num, dollars) {
    var text = document.getElementById("name" + num);
    var cost = document.getElementById("cost" + num);
    if (!text) return;
    if (!cost) return;
    if (text.value == "") {
        cost.value = "";
    else {
        cost.value = dollars;
function totalcost() {
    var total = 0;
    for (var i = 1; i <= 3; i++) {
        var cost = document.getElementById("cost" + i);
        if (cost.value) total += Number(cost.value);

    document.getElementById("Total").value = total;

What am I missing? By the way, in case it is not clear, I am a JS novice, so I fully accept criticism that helps me understand a more fundamental error in my approach. Simple is best for me: ;-) Thank you in advance.