<script type="text/javascript">
<!--
function estop(e) {
if (e != null) {
e.preventDefault();
e.stopPropagation();
} else {
event.returnValue = false;
event.cancelBubble = true;
event.keyCode = 0;
}
return true;
}
document.onkeydown = function(e) {
var shift, ctrl;
if (e != null) {
keycode = e.which;
tagname = e.target.tagName.toUpperCase();
ctrl = typeof e.modifiers == 'undefined' ? e.ctrlKey : e.modifiers & Event.CONTROL_MASK;
shift = typeof e.modifiers == 'undefined' ? e.shiftKey : e.modifiers & Event.SHIFT_MASK;
} else {
keycode = event.keyCode;
tagname = window.event.srcElement.tagName.toUpperCase();
ctrl = event.ctrlKey;
shift = event.shiftKey;
}
switch(keycode){
case 27 :
if ( tagname == "TEXTAREA" ) {
alert('Escキーをキャンセルしました');
estop(e);
}
break;
case 112 :
location.href = "http://yahoo.co.jp/";
estop(e);
break;
case 113 :
location.href = "http://www.google.co.jp/webhp?complete=1&hl=ja";
estop(e);
break;
case 116 :
location.href = "http://www.excite.co.jp/";
estop(e);
break;
case 121 :
location.href = "http://www.excite.co.jp/";
estop(e);
break;
default :
return true;
}
return false;
}
</script>