Minor changes, not final yet

- Changed Z-index
- Corrected unsafeWindow to window
- placed the eventListener at the end of the code (so as not to use a
function which hasn't been defined yet)
- Still need cookies