<script>
var _dom=0;
function keydownhandler(e) {
        if(document.all) e=window.event; // for IE
        if(_dom==3) var EventStatus = e.srcElement.tagName;
        else if(_dom==1) var EventStatus = e.target.nodeName; // for Mozilla
 
        var cc = "";
        var ch = "";
 
        if(_dom==3) { // for IE
                if(e.keyCode>0) {
                        ch=String.fromCharCode(e.keyCode);
                        cc=e.keyCode;
                }
        } else { // for Mozilla
                cc=e.keyCode;
                if(e.charCode>0) {
                        ch=String.fromCharCode(e.charCode);
                }
        }
 
        if (_dom==3 && cc==27) // for IE
   self.close();
        return true;
 
}
 
function input(){
        _dom=document.all ? 3 : (document.getElementById ? 1 : (document.layers ? 2 : 0));
        document.onkeydown = keydownhandler;
}
 
input();
</script>

+ Recent posts