document.oncontextmenu=new Function("return false");
window.history.forward(1);

if(navigator.userAgent.indexOf("MSIE")!=-1){
    //for IE
    document.onkeydown=function(){	
    	if(	(window.event.keyCode==116)	 			//F5
    		||(window.event.keyCode==27)	 			//ESC
    		||(window.event.ctrlKey && window.event.keyCode==78)  	//Ctrl-N
    	   	||(window.event.ctrlKey && window.event.keyCode==79)  	//Ctrl-O
    	){
    		//remap keyCode to an unused value
    		window.event.keyCode=0;
    		return false;
    	}

    	//Not to disable backspace if entering data in textbox and textarea 
    	if(	(window.event.keyCode==8)				//Backspace			 			
    		&&(document.activeElement.getAttribute("type")!="text")
    		&&(document.activeElement.getAttribute("type")!="textarea")
            &&(document.activeElement.getAttribute("type")!="password")
    	){
    		//remap keyCode to an unused value
    		window.event.keyCode=0;
    		return false;
    	}
    }
}else{
    //for firefox
    document.onkeypress=function(evt){	
    	if( evt.keyCode==27     //ESC
            ||evt.keyCode==116  //F5
        ){
            return false;
        }
        
        if( (evt.ctrlKey && evt.which==110)  	//Ctrl-N
    	   	||(evt.ctrlKey && evt.which==111)  	//Ctrl-O
            ||(evt.ctrlKey && evt.which==114)  	//Ctrl-R(reload page)
            ||(evt.ctrlKey && evt.which==116)  	//Ctrl-T(new tab)
            ||(evt.ctrlKey && evt.which==117)  	//Ctrl-U(view page source)
    	){
            return false;
    	}

    	//Not to disable backspace if entering data in textbox and textarea 
    	if(	(evt.which==8)				//Backspace			 			
    		&&(document.activeElement.getAttribute("type")!="text")
    		&&(document.activeElement.getAttribute("type")!="textarea")
            &&(document.activeElement.getAttribute("type")!="password")
    	){
			return false;
    	}
    }   
}