Any right click code should be put into the template, so that it is included throughput the page.

I would suggest adding it to the header file.