Refactor javascript usage for inmuebles webpage