You should set the style inline with out relying on javascript as some users may have javascript turned off.
<div <?php if($_GET['id'] == 'X'){ ?>style="display: block;"<?php } ?>>
your div content
</div>
with an else as requested
<div style="<?php if($_GET['id'] == 'X'){ ?>display: block;<?php } else { ?>display: none;<?php } ?">
your div content
</div>
you could also use a predefined css class
based on your comment about having way to many to do a switch if you need to mix it up just insert this
<script language="javascript">
document.getElementById('<?php echo $_GET['id']; ?>').style.display = "block";
</script>