Update core/components/advsearch/model/advsearch/advsearchform.class.php

Added conditional so that if user chose 0 for addJs, inline js would not be output. This is because advsea var was not initialized as the prior js files were not loaded.

I've also added the js to check advsea for undefined as an extra measure, since this would be prove useful if your intentions were to allow access to these vars even if addJs was 0. In that case, you can remove my first change, while keeping the js.