/*
CHANGE LOG:
100414-MD	made it work in firefox and ie
110824-MD	using new code that also works in chrome
*/

var isNS = (navigator.appName == "Netscape") ? 1 : 0;  
if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);  

function mischandler(){   return false; }  

function mousehandler(e){ 	
	var myevent = (isNS) ? e : event; 	
	var eventbutton = (isNS) ? myevent.which : myevent.button;    
	if((eventbutton==2)||(eventbutton==3)) return false; 
} 

document.oncontextmenu = mischandler; 
document.onmousedown = mousehandler; 
document.onmouseup = mousehandler;

/*
// Set the message for the alert box
var message="Right-mouse click has been disabled.";
function click(e) {
	if (document.all) {
		if (event.button==2||event.button==3) {
			alert(message);
			return false;
		}
	} else {
		if (e.button==2||e.button==3) {
			e.preventDefault();
			e.stopPropagation();
			alert(message);
			return false;
		}
	}
}

if (document.all) { // for IE
	document.onmousedown=click;
} else { // for FF
	document.onclick=click;
}
*/
