Method 1
var message= "";
///////////////////////////////////
function Clickie () {if (document.all) {(message), return false;}}
function Clickns (e) {if
(document.layers| | (Document.getelementbyid&&!document.all)) {
if (e.which==2| | e.which==3) {(message), return false;}}}
if (document.layers)
{document.captureevents (Event.mousedown);d ocument.onmousedown=clickns;}
Else{document.onmouseup=clickns;document.oncontextmenu=clickie;}
Document.oncontextmenu=new Function ("return false")
Method 2
Right-click Start
if (window. Event)
Document.captureevents (Event.mouseup);
function Nocontextmenu () {
Event.cancelbubble = True
Event.returnvalue = false;
return false;
}
function Norightclick (e) {
if (window. Event) {
if (E.which = 2 | | e.which = 3)
return false;
}
Else
if (Event.button = 2 | | event.button = = 3) {
Event.cancelbubble = True
Event.returnvalue = false;
return false;
}
}
Document.oncontextmenu = Nocontextmenu; For ie5+
Document.onmousedown = Norightclick; For all others
Prevent text from being selected
var omitformtags = ["Input", "textarea", "select"]
Omitformtags = Omitformtags.join ("|")
function Disableselect (e) {
if (Omitformtags.indexof (e.target.tagname.tolowercase ()) = = 1)
return False
}
function reenable () {
return True
}
if (typeof Document.onselectstart!= "undefined")
Document.onselectstart = new Function ("return false")
else {
Document.onmousedown = Disableselect
Document.onmouseup = reenable
}