Fixed function in javascript in the example to make it CS