
/*
Disable right click script II (on images)- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/

function disableclick(e) {
	
	if (document.all) {
		if (event.button==2||event.button==3) {
			if (event.srcElement.tagName=="IMG") {
				alert("Right click is disabled on images");
				return false;
			}
		}
	}
	else if (document.layers) {
		if (e.which == 3) {
			return false;
		}
	}
	else if (document.getElementById){
		if (e.which==3 && e.target.tagName=="IMG"){
			return false;
		}
	}
}

function associateImages() 
{
	var i;
	var images = document.images;
	for (i = 0; i < images.length; ++i)
	{
		images[i].onmousedown = disableclick;
		images[i].onmouseup   = disableclick;
		images[i].oncontextmenu = function(){return false;};
	}
	
	document.onmousedown = disableclick;
}

if (document.all)
document.onmousedown=disableclick;	
else if (document.getElementById)
document.onmousedown=disableclick;
else if (document.layers)
associateImages();
