Taking out JavaScript hide_elements function into a dedicated JavaScript file for tests