It has to go in a custom footer (not html module) to work*. The source, which also has some interesting thoughts on the desirability of disabling right click, is below:
http://javascript.about.com/library/blnoright.htm
*Using in a custom footer:replace all code in xslt box with this:
]]>