function setActiveQuestion (i, total) {
  var question = document.getElementById('question_' + i);
  question.className = 'inactive';
  for (j = 0; j < 4; j++) {
    var radio = document.getElementById('answers_' + i + '_' + j);
    radio.onclick = null;
  }
  if ((i+1) < total) {
    var next = document.getElementById('question_' + (i+1));
    next.className = 'active';
    for (j = 0; j < 4; j++) {
      var radio = document.getElementById('answers_' + (i+1) + '_' + j);
      radio.onclick = new Function('setActiveQuestion(' + (i+1) + ', ' + total + ')');
      radio.disabled = false;
    }
  }
  else {
    var submit_off = document.getElementById('submit_off');
    submit_off.style.display = 'none';
    var submit_on = document.getElementById('submit_on');
    submit_on.disabled = false;
    submit_on.style.display = '';
  }
}
