Things we do and things we see shortly before we fall asleep are most apt to influence our dreams.