var points = 0;

var correct_position_id = 1;

function answer(position_id) {
  if (position_id == correct_position_id) {
    show('correct');   
    hide('positions');
    hide('position_' + position_id);
    points++;
  } else {
    show('incorrect');
    hide('positions');
  }
}

function next_question() {
  hide('correct');
  hide('incorrect');
  show('positions');
  hide('photo_' + correct_position_id);
  correct_position_id++;
  if (document.getElementById('photo_' + correct_position_id)) {
    show('photo_' + correct_position_id);
  } else {
    document.getElementById('SexPositionsPoints').value = points;
    document.getElementById('sp_form').submit();
  }
}

function show(id) {
  document.getElementById(id).style.display='block';
}

function hide(id) {
  document.getElementById(id).style.display='none';
}