Using JavaScript addEventListener for a Window Object: an Example