A javascript event manager.