Improve advanced search

The JS can still be improved by:
- doing a check of the first-level checkboxes after page load
- not waiting for the document to fully load, otherwise there's a
couple seconds after page load where the checkboxes can be checked
without the script doing its job.