// JavaScript Document

$(document).ready(function(){$('#message').hide();$('#response-1').hide();$('#response-2').hide();$('#response-3').hide();$('#response-4').hide();$('#response-5').hide();$("input:checkbox:checked").attr("checked","");$('#flu-quiz-form').submit(function(){$mild_symptom_count=$('input[name=mild]').filter(':checked').length;$severe_symptom_count=$('input[name=severe]').filter(':checked').length;$has_fever=$('#check-box-1:checked').val()!=null;if($severe_symptom_count>0){$('#flu-quiz').hide();$('#response-2').fadeIn('slow')}else if($mild_symptom_count==0){$('#message').slideDown('slow');$('#message').html('<p>Please select a symptom</p>')}else if($has_fever==true){if($mild_symptom_count==1){$('#flu-quiz').hide();$('#response-3').fadeIn('slow')}else if($mild_symptom_count==2){$('#flu-quiz').hide();$('#response-3').fadeIn('slow')}else{$('#flu-quiz').hide();$('#response-1').fadeIn('slow')}}else if($mild_symptom_count<3){$('#flu-quiz').hide();$('#response-3').fadeIn('slow')}else{$('#flu-quiz').hide();$('#response-1').fadeIn('slow')}return false});$('.flu-quiz-form-resubmit').submit(function(){$('#message').hide();$('#response-1').hide();$('#response-2').hide();$('#response-3').hide();$('#response-4').hide();$('#response-5').hide();$('#flu-quiz').fadeIn('slow');$("input:checkbox:checked").attr("checked","");return false});$('.high-risk').click(function(){$('#flu-quiz').hide();$('#response-1').hide();$('#response-2').hide();$('#response-3').hide();$('#response-4').hide();$('#response-5').fadeIn('slow');return false})});  
