// JavaScript Document


var clickMessage = "For Blacks Road Self Storage logo or photo release information, please contact us.";


function disableRightClick(e) 
{
	if (document.all) {
		if (event.button == 2 || event.button == 3) {
			if (event.srcElement.tagName.toLowerCase() == "img") {
				alert(clickMessage);
				return false;
			}
		}
	}
	else if (document.getElementById) {
		if (e.which == 3 && e.target.tagName.toLowerCase() == "img") {
			alert(clickMessage)
			return false;
		}
	}
	else if (document.layers) {
		if (e.which == 3) {
			alert(clickMessage);
			return false;
		}
	}
	
	return true;
}

function applyImageListeners()
{
	for (i = 0; i < document.images.length; i++) {
		if (document.images[i].onmousedown != null) {
			oldOnmousedown = document.images[i].onmousedown;
			document.images[i].onmousedown = function () {
				disableRightClick();
				oldOnmousedown();
			};
		} else {
			document.images[i].onmousedown = disableRightClick;
		}
	}
}

if (document.all) {
	document.onmousedown = disableRightClick;
} else if (document.getElementById) {
	document.onmouseup = disableRightClick;
} else if (document.layers) {
	applyImageListeners();
}


