
document.onkeydown = function()
{
/*
(ctrlKey == true && keyCode == 82)      ---禁止 Ctrl+R 刷新
(keyCode == 116)                        ---禁止 F5 刷新
(ctrlKey == true && keyCode == 116)     ---禁止 Ctrl+F5 刷新
*/
//window.alert(event.keyCode);
 var k = event.keyCode;
 if((event.ctrlKey == true && k == 82) || (k == 116) || (event.ctrlKey == true && k == 116))
 {
//return (window.confirm("关闭?"));
 event.keyCode = 0;
 event.returnValue = false;
 event.cancelBubble = true;
 }
}

/*下面是防止鼠标右击*/
if (window.Event) 
  document.captureEvents(Event.MOUSEUP); 

function nocontextmenu() 
{
event.cancelBubble = true
event.returnValue = false;

return false;
}

function norightclick(e) 
{
if (window.Event) 
{
  if (e.which == 2 || e.which == 3)
   return false;
}
else
  if (event.button == 2 || event.button == 3)
  {
   event.cancelBubble = true
   event.returnValue = false;
   return false;
  }

}

document.oncontextmenu = nocontextmenu;  // for IE5+
document.onmousedown = norightclick;  // for all others