Add JavaScript functions