$(document).ready(function(){
	for (i = 1; i < 100; i++) {
	  if ($("#question" + i).length > 0) {
			$("#question" + i).hide();
		} else {
			break;
		}
  }
  
  $("#result").hide();
  
});
	var loadUrl = "result.php";
	var ajax_load = "<img class='loading' src='img/load.gif' alt='loading...' />";
	
function nextquestion(question_id) {
	$("#question" + question_id).hide();
	question_id++;
	if ($("#question" + question_id).length > 0) {
		$("#question" + question_id).fadeIn("slow");
	} else {
		$("#result").fadeIn("slow");
		$("#germs").click(function () { 
		$.ajax({  
			type: "POST",
			url: "result.php",
			data: $("#germs").serialize(),
			success: function(resultText){
				$("#result").html(resultText);
			},
			error: function() {
				alert('Oops, something went wrong. Please refresh the page.');
			}
		});
		return false;
		});
	}
	
}
