function displayInfo(){alert('Tasto indietro disabilitato!');}
var oldOnbeforeunload = window.onbeforeunload;
window.onbeforeunload = displayInfo;
history.forward(1);
window.onbeforeunload = oldOnbeforeunload;

// Disabilitazione del tasto destro del mouse per impedisce che tornino indietro
function clickIE() {
	if (document.all) {
		alert("Tasto Bloccato"); 
		return false;
	}
}
function clickNS(e) {
	if (document.layers||(document.getElementById&&!document.all)) {
 		if (e.which==2||e.which==3) {
 			alert("Tasto Bloccato");
 			return false;
 		}
 	}
 }

if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS;	
	}
else{
	document.onmouseup=clickNS;
	document.oncontextmenu=clickIE;
}
document.oncontextmenu=new Function("alert('Tasto Bloccato');return false");
 
// Disabilitazione dei tasti F5, CANC, ALTR+FrecciaSx
	
var altDown=false;
    // Firefox
 if (typeof window.event == 'undefined'){
   	document.onkeypress = function(e){   		   		
 		var test_var=e.target.nodeName.toUpperCase();
 		if (e.target.type) 
 			var test_type=e.target.type.toUpperCase();
 		 		 		
 		var isCampoEditabile = false; 		
 		if ((test_var == 'INPUT' && (test_type == 'TEXT' || test_type == 'PASSWORD')) || test_var == 'TEXTAREA')
 			isCampoEditabile = true;
 		
 		var block = false;
 		if(e.keyCode == 116){	// F5
 			block = true;
 		}
 		else if((e.keyCode == 37 || e.keyCode == 8) && !isCampoEditabile) {	//<- || DEL
 			block = true;
 		}	
 		if(block) {
 			alert("Tasto Bloccato");
 	  		e.preventDefault();  	  		
 		}
 		else {
 	  		return e.keyCode;
 	  	}
   	}
 }
 else {	//IE
 	
   document.onkeydown = function()
   {
   		var test_var=event.srcElement.tagName.toUpperCase();
   		
 		if (event.srcElement.type) 
 			var test_type=event.srcElement.type.toUpperCase();
 			
 		var isCampoEditabile = false;
 		if ((test_var == 'INPUT' && (test_type == 'TEXT' || test_type == 'PASSWORD')) || test_var == 'TEXTAREA')
 			isCampoEditabile = true; 		 		
 		
 		if(event.keyCode == 18)
 			altDown=true;
 		
 		var block = false;
 		if(event.keyCode == 116)
 		{	// F5
 			block = true;
 		}
 		else if(altDown && event.keyCode == 37) {
 			block = true;
 		}
 		else if(event.keyCode == 8 && !isCampoEditabile) 
 		{	//<- || DEL
 			block = true;
 		}	
 		
 		if(block) 
 		{
 			alert("Tasto Bloccato");
 			altDown=false;
 	  		window.event.keyCode = 505;  	  		
 	  		return false; 	  		
 		}
 		else 
 		{
 	  		return event.keyCode;
 	  	} 		
   }
   
   document.onkeyup = function() 
   {
   		window.status=event.keyCode		
		altDown=false;
   } 
 }	
