var _keyMap=[];document.onkeyup=keyHandler;function setKeybinding(a,b){if(typeof _keyMap[a]=="undefined"){_keyMap[a]=[]}if(typeof b=="function"){_keyMap[a].push(b)}else{_keyMap[a].push(new Function("e","key",b+"(e, key);"))}}function keyHandler(c){c=c||window.event;var b;if(c.keyCode){b=c.keyCode}else{if(c.which){b=c.which}}if(_keyMap[b]){for(var a=0;a<_keyMap[b].length;++a){if(_keyMap[b][a](c,b)){c.returnValue=false;if(typeof c.preventDefault=="function"){c.preventDefault()}else{c.returnValue=true}break}}}};