The right-click invokes the context menu within most standard browsers; therefore, you can use the "oncontextmenu" listener to handle right-click events. The listener should return false if you do not want it to display the standard browser context menu after invoking your JS code.
Here's some sample html that handles left and right clicks on an image.
<html>
<head>
<script type="text/javascript">
function handleRightClick() {
alert("Got right click!");
};
function handleLeftClick() {
alert("Got left click!");
};
</script
</head>
<body>
<img src="http://thefuturebuzz.com/pics/the-matrix.jpg" onclick="handleLeftClick(this);" oncontextmenu="handleRightClick(this); return false;" />
</body>
</html>
For more information, check out http://www.w3schools.com/html5/html5_ref_eventattributes.asp