function IE() {	
	if (event.button == 2) {
		return false;
	}
	return true;
}

function NS(e) {
	if (document.layers || document.getElementById && !document.all) {
		if (e.which == 2 || e.which == 3) {
			return false;
		}
	}
	return true;
}

if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=NS();
}
else if (document.all && !document.getElementById) {
	document.onmousedown=IE();
}

document.oncontextmenu = new Function("return false;");
//document.oncontextmenu = new Function("alert(this is a test!); return false;");