/*
Filename:  norightclick_img.js
Desc:      Disbale context menu clicks for single image
Copyright: Relevant Arts Enterprise, Inc. <http://www.relevantarts.com/>
Author:    John A. Lock <jlock@relevantarts.com>
Created:   2003-Apr-23
Modified:  
*/

// Check the mouse button and ignore it if it's a context click
function NoRightClick(e) {
	// Capture the button clicked
	if (window.Event) {
			Button = e.which;
	}
	else {
		Button = window.event.button;
	}
	// If it's a context click, ignore it
	if (Button == 2 || Button == 3 || Button == 4) {
		alert("Context clicks inhibited on images.");
		return false;
	}
	else {
		return true;
	}
}

function InitTrap() {
	if (!(document.getElementById || document.all || document.layers)) return;
	if (navigator.appName.indexOf("Netscape") != -1) {
		document.captureEvents(Event.MOUSEDOWN);
		document.captureEvents(Event.MOUSEUP);
	}
	for (Ctr=0;Ctr<document.images.length;Ctr++) {
		if (navigator.appName.indexOf("Netscape") != -1) {
			document.images[Ctr].onmousedown = function() {return false};
			document.images[Ctr].onmouseup = NoRightClick;
		}
		else {
			document.images[Ctr].onmousedown = NoRightClick;
			document.images[Ctr].onmouseup = function() {return false};
		}
	}
}
