/*
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
*/

var clickmessage="Right-click has been disabled to prevent unauthorized copying of this image."

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

function associateimages(){
	for(i=0;i<document.images.length;i++)
	document.images[i].onmousedown=disableclick;
}

if (document.all)
	document.onmousedown=disableclick
else if (document.getElementById)
	document.onmouseup=disableclick
else if (document.layers)
	associateimages()

// Judy's additions to open deviates enlargement windows
var sStatus = window.status
function ShowStatus(sMsg) {
// put the status message in the window's status bar.
    window.status = sMsg
}
function ShowStatusEnlarge() {
	window.status = "Click this image to see a larger version"
}
function RestoreStatus(){
	window.status = sStatus
//	return true
}

var newWindow
function makeNewWindow(sFile, isVertical) {
	if (newWindow) {
		if (! newWindow.closed) {
			newWindow.close()
		}
		newWindow = null
	}
	if (isVertical) {
		newWindow = window.open(sFile.toString(), "", "height=700,width=550,top=50,left=50")
	} else {
		newWindow = window.open(sFile.toString(), "", "height=550,width=650,top=50,left=50")
	}
/*
	if (! newWindow || newWindow.closed) {
		// get just the filename from the url
		sFile = sFile.toString()
		var i = sFile.indexOf("/")
		while (i != -1) {
			sFile = sFile.substring(i+1, sFile.length)
			i = sFile.indexOf("/")
		}
		if (isVertical) {
			newWindow = window.open("lg/" + sFile, "", "height=700,width=550,top=50,left=50")
		} else {
			newWindow = window.open("lg/" + sFile, "", "height=550,width=650,top=50,left=50")
		}
	}
	else {
		//bring the new window to the foreground
		newWindow.focus()
	}
*/
}


