var c1 = 0;
var c2 = 0;
var c3 = 0;
var c4 = 0;
var c5 = 0;
var c6 = 0;
var c7 = 0;
var c8 = 0;
var c9 = 0;
var c10 = 0;

function determine(form,callingfield)
{
  if(callingfield == "question1")
  {
    c1 = 0;
    if(form.question1[0].checked)
      c1 = form.question1[0].value;
    else
    {
         if(form.question1[1].checked)
        c1 = form.question1[1].value;
      else
        c1 = form.question1[2].value;
    }
  }

  if(callingfield == "question2")
  {
    c2 = 0;
    if(form.question2[0].checked)
      c2 = form.question2[0].value;
    else
    {
      if(form.question2[1].checked)
        c2 = form.question2[1].value;
      else
        c2 = form.question2[2].value;
    }
  }

  if(callingfield == "question3")
  {
    c3 = 0;
    if(form.question3[0].checked)
      c3 = form.question3[0].value;
    else
    {
      if(form.question3[1].checked)
        c3 = form.question3[1].value;
      else
        c3 = form.question3[2].value;
    }
  }

  if(callingfield == "question4")
  {
    c4 = 0;
    if(form.question4[0].checked)
      c4 = form.question4[0].value;
    else
    {
      if(form.question4[1].checked)
        c4 = form.question4[1].value;
      else
        c4 = form.question4[2].value;
    }
  }

  if(callingfield == "question5")
  {
    c5 = 0;
    if(form.question5[0].checked)
      c5 = form.question5[0].value;
    else
    {
      if(form.question5[1].checked)
        c5 = form.question5[1].value;
      else
        c5 = form.question5[2].value;
    }
  }

  if(callingfield == "question6")
  {
    c6 = 0;
    if(form.question6[0].checked)
      c6 = form.question6[0].value;
    else
    {
      if(form.question6[1].checked)
        c6 = form.question6[1].value;
      else
        c6 = form.question6[2].value;
    }
  }

  if(callingfield == "question7")
  {
    c7 = 0;
    if(form.question7[0].checked)
      c7 = form.question7[0].value;
    else
    {
    if(form.question7[1].checked)
      c7 = form.question7[1].value;
    else
      c7 = form.question7[2].value;
    }
  }

  if(callingfield == "question8")
  {
    c8 = 0;
    if(form.question8[0].checked)
      c8 = form.question8[0].value;
    else
    {
      if(form.question8[1].checked)
        c8 = form.question8[1].value;
      else
        c8 = form.question8[2].value;
    }
  }

  if(callingfield == "question9")
  {
    c9 = 0;
    if(form.question9[0].checked)
      c9 = form.question9[0].value;
    else
    {
      if(form.question9[1].checked)
        c9 = form.question9[1].value;
      else
        c9 = form.question9[2].value;
    }
  }

  if(callingfield == "question10")
  {
    c10 = 0;
    if(form.question10[0].checked)
      c10 = form.question10[0].value;
    else
    {
      if(form.question10[1].checked)
        c10 = form.question10[1].value;
      else
        c10 = form.question10[2].value;
    }
  }
}

function there(n1,n2,n3,n4,n5,n6,n7,n8,n9,n10)
{
  var there = true;
  if((n1==0) || (n2==0) || (n3==0) || (n4==0) || (n5==0) || (n6==0) || (n7==0) || (n8==0) || (n9==0) || (n10==0))
    there = false;
    return there;
}

function show(n1,n2,n3,n4,n5,n6,n7,n8,n9,n10)
{
  var n =parseInt(n1)+parseInt(n2)+parseInt(n3)+parseInt(n4)+ parseInt(n5)+parseInt(n6)+parseInt(n7)+parseInt(n8)+parseInt(n9)+parseInt(n10);

    if(there(n1,n2,n3,n4,n5,n6,n7,n8,n9,n10))
      if(n >=23)
        alert("A Distance Learning course is a real possibility for you.\n\n"+
        "Regardless of your score, we still recommend that you talk\n"+
        "to an SCC academic counselor before you register.");

      else
      {
        if(n >=15 && n <=22)
          alert("Distance Learning courses may work for you, but you may need to make\n"+
          "a few adjustments in your schedule and study habits to succeed.\n\n"+
          "We recommend that you talk to an SCC academic counselor before you register.");
        else
        {
          alert("Distance Learning courses may not currently be the best alternative for you;\n\n "+
          "We recommend that you talk to an SCC academic counselor.");
        }
      }
    else
      confirm("You must answer all the questions for this to be scored properly.");
}

function resetit()
{
  var resetit = confirm("Do you want to reset the quiz and start again?");
  return resetit;
}