Restore project selector's auto-switch behavior

The regression was caused by adding a div around the project selector
form (commit f28225acbe28cd04b3a94a3793dba4d969aeac7f) with the same id
as the child fieldset, so the jQuery selector in common.js could no
longer find the select or the button.

Assigning a different id to the div resolves the problem.

Fixes #17489
Optimize project selector auto-switch script

Simplify the jQuery code by making use of the affected elements' id
instead of a .children() call.