function count() 
{
//var list=document.querySelectorAll("input:checked");
//alert(list.length);

  var score=0;
  var a=0;

// -2 for the button and input field at the end of the form
  var b=document.form.elements.length-2;
  while(a<b) 
    {
      if (document.form.elements[a].checked==true) 
        score++;
      a++;
    }

  score=(score/b)*10000;
  score=Math.round(score)/100;

  document.form.result.value=score+'%';

}
