[jQuery] adding additional code to $(document).ready(function() causes hide to stop working

[jQuery] adding additional code to $(document).ready(function() causes hide to stop working


I am trying to use a checkbox to cause a div to show. The checkbox id
is 'dd_yes'. I am new to jQuery and javascript is not one of my
strengths.
as long as I only have the $(id/class).hide(); code within the $
(document).ready(function() brackets, the divs are hidden. As soon as
I add the click(function) code, the hide no longer works.
Here is the code:
$(document).ready(function() {
$('div.dd').hide();
$('div.gar').hide();
$('#dd_yes').click(function(){
if($(this).is(":checked") ){
$('div.dd').show();
}
else{
$('div.dd).hide();
}
}
$('div.dd2').hide();
$('div.gar2').hide();
});
div.dd2 and div.gar2 are divs inside of the dd and gar divs and should
remain hidden even if dd and gar are toggled.