document.observe('dom:loaded',function(){ 

	if ($('age_2').checked) {
            $('incident2Block').show();
        }
        
	if ($('age_3').checked) {
            $('incident2Block').show();
            $('incident3Block').show();
        }
        
        if (($('incident1_y').checked) || ($('incident2_y').checked) || ($('incident3_y').checked)) {
            $('incidentDescBlock').show();
        }
        
        Event.observe('age_1','click', function() { 
		$('incident2Block').hide();
		$('incident3Block').hide();
                checkOptions();
	}); 

        Event.observe('age_2','click', function() { 
		$('incident2Block').show();
		$('incident3Block').hide();
                checkOptions();
	}); 

        Event.observe('age_3','click', function() { 
		$('incident2Block').show();
		$('incident3Block').show();
                checkOptions();
	}); 

        Event.observe('incident1_y','click', checkOptions);
        Event.observe('incident1_n','click', checkOptions);

        Event.observe('incident2_y','click', checkOptions);
        Event.observe('incident2_n','click', checkOptions);

        Event.observe('incident3_y','click', checkOptions);
        Event.observe('incident3_n','click', checkOptions);

});

function checkOptions() {

    if (($('incident1_y').checked) || ($('incident2_y').checked) || ($('incident3_y').checked)) {
        $('incidentDescBlock').show();
    }
    else {
        $('incidentDescBlock').hide();
    }
}

