current_page = 1; 

$(document).ready(function(){
	
  for (i = 1; i < 10; i++) {
	  if ($('.page' + i).length > 0) {
			if (i > 1) $('.page' + i).hide();
		} else {
			break;
		}
  }	
	$('#submit_button').hide();
	
	$('#next_button').click(function(){
		transition();
	});
	
	$('#hand').click(function(){
		if (current_page == 5) {
			$('#quiz_form').submit();
			return false;
		}
		transition();
		return false;
	});
	
});

function transition() {
	$('.page' + current_page).hide();
	current_page++;
  if ($('.page' + current_page).length > 0) {
		$('#header').hide();
		$('#questions').css('height','1015px')
		$('.page' + current_page).show();
		$('#fill').css('width',current_page * 49 + 'px');
		
		$.scrollTo('#top',500);		
		
		if (current_page == 5) {
			$('#next_button').hide();
			$('#submit_button').show();
		}
	}
}

function show_html() {
	$('#html').hide();
	$('#html_code').show();
}