Put js code for autocompleter outside of default.js

This is needed to use autocompleter in others templates and it avoid to load default.js