Do you know what is wrong with this JS code:

function close(item) {

alert('I am closing: ' + item);

document.getElementById(item).style.display = 'none';

if (item == 'free_paid') {
document.getElementById('reason_paid').style.display = 'none';

I am calling it via a click on form radio input, such as:

<input type="radio" name="free_choice" value="yes" <?php if (isset($free_choice) AND ($free_choice == 'free')) {echo 'checked'; } ?> onclick="close('reason_paid')"> For Free

Also, is there a good Javascript Editor / Debugger you recommend?