Move toggleAdvanced function to models.js