function validateForm() {
  var q1Value = 0;
  var q2Value = 0;
  var q3Value = 0;
  var q4Value = 0;
  var q5Value = 0;
  var total

  var allowSubmit = true;

  for (i=0;i<document.frmSubmit.q1.length;i++) 
  { 
        if (document.frmSubmit.q1[i].checked) 
        { 
           q1Value = parseInt(document.frmSubmit.q1[i].value); 

        } 
  } 
  
  for (i=0;i<document.frmSubmit.q2.length;i++) 
  { 
        if (document.frmSubmit.q2[i].checked) 
        { 
           q2Value = parseInt(document.frmSubmit.q2[i].value);  

        } 
  } 
  
  for (i=0;i<document.frmSubmit.q3.length;i++) 
  { 
        if (document.frmSubmit.q3[i].checked) 
        { 
           q3Value = parseInt(document.frmSubmit.q3[i].value);  

        } 
  } 
  for (i=0;i<document.frmSubmit.q4.length;i++) 
  { 
        if (document.frmSubmit.q4[i].checked) 
        { 
           q4Value = parseInt(document.frmSubmit.q4[i].value); 

        } 
  } 
  
  for (i=0;i<document.frmSubmit.q5.length;i++) 
  { 
        if (document.frmSubmit.q5[i].checked) 
        { 
           q5Value = parseInt(document.frmSubmit.q5[i].value);  

        } 
  } 

  
if ((q1Value ==0) || (q2Value ==0) || (q3Value ==0) || (q4Value ==0)  || (q5Value ==0)) {
  allowSubmit = false;
  }
            
  
  if (!allowSubmit) {
    alert("Please complete the quiz to determine your Drive Safe Personality");
    return false;
    }
  else {
    return true;
  }

}

function clickCalc() {

  var q1Value = 0;
  var q2Value = 0;
  var q3Value = 0;
  var q4Value = 0;
  var q5Value = 0;
  var strScore;
  var total;

  for (i=0;i<document.frmSubmit.q1.length;i++) 
  { 
        if (document.frmSubmit.q1[i].checked) 
        { 
           q1Value = parseInt(document.frmSubmit.q1[i].value); 
        } 
  } 
  
  for (i=0;i<document.frmSubmit.q2.length;i++) 
  { 
        if (document.frmSubmit.q2[i].checked) 
        { 
           q2Value = parseInt(document.frmSubmit.q2[i].value);  
        } 
  } 
  
  for (i=0;i<document.frmSubmit.q3.length;i++) 
  { 
        if (document.frmSubmit.q3[i].checked) 
        { 
           q3Value = parseInt(document.frmSubmit.q3[i].value);  
        } 
  } 
  for (i=0;i<document.frmSubmit.q4.length;i++) 
  { 
        if (document.frmSubmit.q4[i].checked) 
        { 
           q4Value = parseInt(document.frmSubmit.q4[i].value);  
        } 
  } 
  
  for (i=0;i<document.frmSubmit.q5.length;i++) 
  { 
        if (document.frmSubmit.q5[i].checked) 
        { 
           q5Value = parseInt(document.frmSubmit.q5[i].value);  
        } 
  } 
  
  total = q1Value + q2Value + q3Value + q4Value + q5Value;
  
  strScore = "Your score: " + total.toString() + " point"
  if (total != 1) {
    strScore = strScore + "s"
  }
  document.getElementById('score').innerHTML=strScore;
  document.getElementById('totalScore').value = total;
}