if(event.type == 'mousedown' && event.button == 2)
alert("Sorry, your right mouse button has been
document.onmousedown = noRightClick;
In this case, every time the user clicks the right mouse button, the event will be intercepted by the noRightClick() function, and the normal system behaviour will be replaced with an alert box containing a cease-and-desist message. This usually has more decorative value than anything else - any reasonably adept Web user can still get to the source of your Web page - but it serves to demonstrate the basic concept here.