/**
* For: forbid right click menu,hot key
* Author xuf
* Date 2011-1-25
* Version 0.1
*/


function click(e) { 
 if (document.all) { 
  if (event.button==1||event.button==2||event.button==3) { 
   oncontextmenu='return false'; 
  } 
 } 
 if (document.layers) { 
  if (e.which == 3) { 
   oncontextmenu='return false'; 
  } 
 } 
} 
if (document.layers) { 
 document.captureEvents(Event.MOUSEDOWN); 
} 

document.onmousedown=click; //禁用右键功能
document.oncontextmenu = new Function("return false;")    

 
var travel=true 
var hotkey=17   /* hotkey即为热键的键值,是ASII码,这里99代表c键 */ 
if (document.layers) 
document.captureEvents(Event.KEYDOWN) 
function forbiddenHotKey(e)      //禁用热键功能
{ 

  if (document.layers) { 
    if (e.which==hotkey&&travel)
    { 
      //alert("Press Key Error!");  
     }
  } 
 else if (document.all){ 
  if (event.keyCode==hotkey&&travel){ 
  //alert("The key is forbidden!"); 
  }
 } 
} 
  //如果调用热键功能，请将下语句打开
 //document.onkeydown=forbiddenHotKey    

