


// Page setup
$(document).ready(function() {
	
	$('fieldset').hide();
	$('#1').show();

});




// Show / Hide different fieldsets depending on which section is clicked
$(document).ready(function() {
	
	//SHOW basic
	$('.show_1').click(function() {
		
		// Change progress highlight with .current
		$('#progress').children().removeClass('current');
		$('li.show_1').addClass('current');
		
		// Change visible fieldset
		$('fieldset').hide();
		$('#1').fadeIn();
		
	});
	
	//SHOW insured
	$('.show_2').click(function() {
		
		// Change progress highlight with .current
		$('#progress').children().removeClass('current');
		$('li.show_2').addClass('current');
		
		// Change visible fieldset
		$('fieldset').hide();
		$('#2').fadeIn();
		
	});
	
	//SHOW claimant
	$('.show_3').click(function() {
		
		// Change progress highlight with .current
		$('#progress').children().removeClass('current');
		$('li.show_3').addClass('current');
		
		// Change visible fieldset
		$('fieldset').hide();
		$('#3').fadeIn();
		
	});
	
	//SHOW facts
	$('.show_4').click(function() {
		
		// Change progress highlight with .current
		$('#progress').children().removeClass('current');
		$('li.show_4').addClass('current');
		
		// Change visible fieldset
		$('fieldset').hide();
		$('#4').fadeIn();
		
	});
	
	//SHOW injuries
	$('.show_5').click(function() {
		
		// Change progress highlight with .current
		$('#progress').children().removeClass('current');
		$('li.show_5').addClass('current');
		
		// Change visible fieldset
		$('fieldset').hide();
		$('#5').fadeIn();
		
	});
	
	//SHOW witnesses
	$('.show_6').click(function() {
		
		// Change progress highlight with .current
		$('#progress').children().removeClass('current');
		$('li.show_6').addClass('current');
		
		// Change visible fieldset
		$('fieldset').hide();
		$('#6').fadeIn();
		
	});
	
});




// facts section show/hide quesitons
$(document).ready(function() {

	$('#police_report_questions').hide();
	$('#facts_police_report').change(function() {
		var police = $(this).val();
		if( police == 'yes') {
			$('#police_report_questions').slideDown();	
		} else {
			$('#police_report_questions').slideUp();
		}
	});
	
	$('#tickets_issued_questions').hide();
	$('#facts_tickets_issued').change(function() {
		var police = $(this).val();
		if( police == 'yes') {
			$('#tickets_issued_questions').slideDown();	
		} else {
			$('#tickets_issued_questions').slideUp();
		}
	});

});



// show/hide quesitons
$(document).ready(function() {

	$('#police_report_questions').hide();
	$('#facts_police_report').change(function() {
		var theValue = $(this).val();
		if( theValue == 'yes') {
			$('#police_report_questions').slideDown();	
		} else {
			$('#police_report_questions').slideUp();
		}
	});
	
	$('#tickets_issued_questions').hide();
	$('#facts_tickets_issued').change(function() {
		var theValue = $(this).val();
		if( theValue == 'yes') {
			$('#tickets_issued_questions').slideDown();	
		} else {
			$('#tickets_issued_questions').slideUp();
		}
	});
	
	$('#injured1_questions').hide();
	$('#injured2_questions').hide();
	$('#injured3_questions').hide();
	$('#injuries_number').change(function() {
		
		var theValue = $(this).val();
		if( theValue == 1) {
			$('#injured1_questions').show();
			$('#injured2_questions').hide();
			$('#injured3_questions').hide();
		} else if ( theValue == 2 ) {
			$('#injured1_questions').show();
			$('#injured2_questions').show();
			$('#injured3_questions').hide();
		} else if ( theValue == 3 ) {
			$('#injured1_questions').show();
			$('#injured2_questions').show();
			$('#injured3_questions').show();
		} else {
			$('#injured1_questions').hide();
			$('#injured2_questions').hide();
			$('#injured3_questions').hide();
		}
		
		
	});

});
