function trap_response(e) 
{
 if (navigator.appName == 'Netscape' && e.which) return false;
 else if (event.button) return false;
 return true;
}

function disableCtrlKeyCombination(e)
{
 //list all CTRL + key combinations you want to disable
 var forbiddenKeys = new Array('a', 'n', 'c', 'x', 'v', 'j');
 var key;
 var isCtrl;

 if(window.event) {
  key = window.event.keyCode;     //IE
  if(window.event.ctrlKey) isCtrl = true;
  else isCtrl = false;
 }
 else {
  key = e.which;     //firefox
  if(e.ctrlKey) isCtrl = true;
  else isCtrl = false;
 }

 //if ctrl is pressed check if other key is in forbidenKeys array
 if(isCtrl) {
  for(i=0; i<forbiddenkeys .length; i++) {
   //case-insensitive comparation
   if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase()) return false;
  }
 }
 return true;
}
 
document.onKeyPress="return disableCtrlKeyCombination(event);" 
document.onKeyDown="return disableCtrlKeyCombination(event);"

function trap_ignore()
{
 return true;
}

function untrap(e)
{
 document.onmousedown=null;
 return true;
}

function trap(e)
{
 document.onclick=trap_response;
 document.onmousedown=trap_response;
}

function detrap(e)
{
 document.onclick=trap_ignore();
 document.onmousedown=trap_ignore();
}


