document.onmousedown = whichButton;
if(document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown = whichButton;

function whichButton(e) {
  if(document.all) {
    if(event.button == 2) {
      alert("The images on this site are copyrighted.");
    }
  }
  else {
    if(e.which == 3) {
      alert("The images on this site are copyrighted.");
      return false;
    }
  }
}