Starts to implement new function in insert_event.js.