Nit: I think using `panel.setAttribute("noautofocus", !options.focus);` below would be simpler.