function cancelKey(evt) {
	if (evt.preventDefault) {
		evt.preventDefault();
		return false;
	} else {
		evt.keyCode = 0;
		evt.returnValue = false;
	}
}

function showDown(evt) {
	evt = (evt) ? evt : ((event) ? event : null);
	if (evt) {
		if (event.keyCode == 8 && (event.srcElement.type != "text" && event.srcElement.type != "textarea" && event.srcElement.type != "password")) {
			// When backspace is pressed but not in form element
			cancelKey(evt);
		} else if (event.keyCode == 116) {
			// When F5 is pressed
			cancelKey(evt);
		} else if (event.ctrlKey && (event.keyCode == 78 || event.keyCode == 82)) {
			// When ctrl is pressed with R or N
			cancelKey(evt);
		}
	}
}

// Additional code for NS
if (navigator.appName=="Netscape") {
	document.addEventListener("keypress",showDown,true);
}