Same task as in lesson 5 but now for the global checkbox.
Since some of the functions will be used multiple times we would like to store them in variables to define them only once.
- event delegation
- triggering events
- refactoring to reduce code duplication