if (document.all) { } else if (document.getElementById) { document.captureEvents(Event.MOUSEDOWN) } else if (document.layers) { document.captureEvents(Event.MOUSEDOWN) } document.onmousedown = mousedown_handler function mousedown_handler(mouse_event) { // This is the message that will appear var no_right_click = "Sorry, right-clicking is not allowed!" if (document.all) { //Probably Internet Explorer 4 and later if (event.button == 2 || event.button == 3) { alert(no_right_click) return false } } else if (document.getElementById) { // Probably Netscape 6 and later if (mouse_event.which == 3) { alert(no_right_click) return false } } else if (document.layers) { // Probably Netscape 4 if (mouse_event.which == 3) { alert(no_right_click) return false } } }