I've got a client on a Mac who wants right-click disabled so people don't easily take her images. Disabling a right-click for a PC is easy, but on a Mac it's not really a right-click (even if there's a 2-button mouse), it's a ctrl-click. After many hours of trial and error, I have finally got the code that will work in both platforms and on several browsers. I thought I'd share it.

(Yes, I understand that there really is no way to prevent an advanced web-user from downloading images and text, but the client really wants this to at least prevent some of the people)
I have included the code below:
This code goes between javascript tags in between the html head tags section
<!--
//Disable right mouse click Script
var message="Function Disabled!";
function clickIE4(){if (event.button==2){alert(message);return false;}}
function clickNS4(e){if (document.layers||document.getElementById&&!document.all){if (e.which==2||e.which==3){alert(message);return false;}}}
if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS4;}
else if (document.all&&!document.getElementById){document.onmousedown=clickIE4;}
document.oncontextmenu=new Function("alert(message);return false")
//Disable ctrl key
if (document.all){
document.onkeydown = function (){
var key_ctrl = ctrlKey; // 17 is also ctrl Key
if (key_ctrl==event.keyCode){
alert(message);
return false;
}
}
}
// -->