Все работает!
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>test</title>
</head>
<body>
<img src="http://javascript.ru/forum/images/ca_serenity/misc/logo.gif">
<script>
document.getElementsByTagName("img")[0].oncontextmenu = function (event) {
event = event || window.event;
event.preventDefault ? event.preventDefault() : event.returnValue = false;
alert(event.type);
};
</script>
</body>
</html>