This may solve your problem.
<html>
<head>
<script type="text/javascript">
if (document.addEventListener) {
element.addEventListener('contextmenu', function(e) {
alert("You've tried to open context menu"); //here you draw your own menu
e.preventDefault();
}, false);
} else {
document.attachEvent('oncontextmenu', function() {
alert("You've tried to open context menu");
window.event.returnValue = false;
});
}
</script>
</head>
<body>
Lorem ipsum...
</body>
</html>