Javascript can only close windows that were opened using Javascript in FF without modifying the config. To change your config to allow this:
go to "about
:config"
and set the value of "dom.allow_scripts_to_close_windows" to true.
To make your windows close in FF (and IE7) browsers without modifying the config
here is a nice workaround