Although area elements inherit the oncontextmenu event by way of the object hierarchy, they do not respond to right-click events in Microsoft Internet Explorer. It is possible however to imitate the desired behavior by using the onfocus and onblur events to determine the currently selected region and trigger the appropriate action in the context menu handler of the img itself. Don't forget to retain the context menu event attribute on the area elements for cross-browser scenarios.
<script type="text/javascript">
var selectedArea = null;
function activate(e,f) {
selectedArea = f ? e : null;
}
function menu(e) {
if (selectedArea)
alert('right-click: ' + selectedArea.id);
else {
// cross-browser case
if (e.tagName == 'AREA')
alert('right-click: ' + e.id);
else
alert('right-click: ' + e.tagName);
}
return false;
}
</script>
<map id="Map0">
<area id="Area1"
shape="rect" coords="100, 50, 200, 150" href="..."/>
</map>
<img src="..." usemap="#Map0" />