WP has a checked() function to help with this: http://codex.wordpress.org/Function_Reference/checked