function calculate_finaid()
{
   var totalpoints = 0
   
   var actif = document.forms[1].actif
   var satif = document.forms[1].satif
   var act = document.forms[1].act
   var sat = document.forms[1].sat
   var gpa = document.forms[1].gpa
   var acthidden = document.getElementById('acthidden')
   var sathidden = document.getElementById('sathidden')
   var sonowwhat = document.getElementById('sonowwhat')
   
      if (actif.checked)
      {
         sat.selectedIndex = 0
         acthidden.style.display = ''
         sathidden.style.display = 'none'
         var totalpoints = (gpa.value * 25 + act.value * 2.78)
         if (gpa.value > 0 && act.value > 0) sonowwhat.style.display = ''
      }
      else if (satif.checked)
      {
         act.selectedIndex = 0
         sathidden.style.display = ''
         acthidden.style.display = 'none'
         var totalpoints = (gpa.value * 25 + sat.value * 2.78)
         if (gpa.value > 0 && sat.value > 0)  sonowwhat.style.display = ''
      }
   if (totalpoints >= 176)
   {
      scholarshipamount = 9000
   }
   else if (totalpoints >= 164 && totalpoints < 176)
   {
      scholarshipamount = 7000
   }
   else if (totalpoints >= 145 && totalpoints < 164)
   {
      scholarshipamount = 6000
   }
   else
   {
      scholarshipamount = 0
   }
   return scholarshipamount
}

function update_totals()
{
   var totalfinaid = Math.round((calculate_finaid())*100)/100

   var readonly = new Array()
   readonly[0] = new Array(document.forms[1].totalfinaid,totalfinaid)
   for (i=0;i<readonly.length;i++)
   {
      readonly[i][0].value = Math.round((parseFloat(readonly[i][1] * 100))*100)/100
      
         readonly[i][0].value = '$' + readonly[i][1] + '.00'
      if (readonly[i][0].value == '$9000.00')
      {
         readonly[i][0].value = '$9,000.00'
      }
      else if (readonly[i][0].value == '$7000.00')
      {
         readonly[i][0].value = '$7,000.00'
      }
      else if (readonly[i][0].value == '$6000.00')
      {
         readonly[i][0].value = '$6,000.00'
      }
   }
}

function reset_values()
{
   update_totals()
}