This issue is partially answered in my new post: Rich Text Box issue (bug)
However, another question remains unanswered. I would really like to know the proper way to code instructions to elements in my site header. Previously I had always put them in the masterPage.js (site) file (see my code snippet above). But recently these instructions began causing syntax errors on pages with no header (like lightboxes) because there are no such elements on those pages. So there must be a better way. Can anyone show me how to do it properly?
Cheers,
Bill