(function(d){d.fn.__bind__=d.fn.bind;d.fn.__unbind__=d.fn.unbind;d.fn.__find__=d.fn.find;var c={version:"0.7.9",override:/keypress|keydown|keyup/g,suspended:!1,triggersMap:{},specialKeys:{27:"esc",9:"tab",32:"space",13:"return",8:"backspace",145:"scroll",20:"capslock",144:"numlock",19:"pause",45:"insert",36:"home",46:"del",35:"end",33:"pageup",34:"pagedown",37:"left",38:"up",39:"right",40:"down",109:"-",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",
123:"f12",191:"/"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":":","'":'"',",":"<",".":">","/":"?","\\":"|"},newTrigger:function(b,c,d){var a={};a[b]={};a[b][c]={cb:d,disableInInput:!1};return a}};c.specialKeys=d.extend(c.specialKeys,{96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/"});d.fn.find=function(b){this.query=b;return d.fn.__find__.apply(this,arguments)};d.fn.unbind=function(b,
e,l){d.isFunction(e)&&(l=e,e=null);if(e&&"string"===typeof e)for(var a=(this.prevObject&&this.prevObject.query||this[0].id&&this[0].id||this[0]).toString(),f=b.split(" "),g=0;g<f.length;g++)delete c.triggersMap[a][f[g]][e];return this.__unbind__(b,l)};d.fn.bind=function(b,e,l){var a=b.match(c.override);if(d.isFunction(e)||!a||null==e)return this.__bind__.apply(this,arguments);var f=null,g=d.trim(b.replace(c.override,""));g&&(f=this.__bind__(g,e,l));"string"===typeof e&&(e={combi:e});if(e.combi)for(g=
0;g<a.length;g++){var f=a[g],h=e.combi.toLowerCase(),n=c.newTrigger(f,h,l),k=(this.prevObject&&this.prevObject.query||this[0].id&&this[0].id||this[0]).toString();n[f][h].disableInInput=e.disableInInput;c.triggersMap[k]?c.triggersMap[k][f]||(c.triggersMap[k][f]=n[f]):c.triggersMap[k]=n;var p=c.triggersMap[k][f][h];p?p.constructor!==Array?c.triggersMap[k][f][h]=[p]:c.triggersMap[k][f][h][p.length]=n[f][h]:c.triggersMap[k][f][h]=[n[f][h]];this.each(function(){var a=d(this);a.attr("hkId")&&a.attr("hkId")!==
k&&(k=a.attr("hkId")+";"+k);a.attr("hkId",k)});f=this.__bind__(a.join(" "),e,c.handler)}return f};c.findElement=function(b){if(!d(b).attr("hkId")&&(d.browser.opera||d.browser.safari))for(;!d(b).attr("hkId")&&b.parentNode;)b=b.parentNode;return b};c.suspend=function(b){this.suspended=b;return this};c.handler=function(b){var e=c.findElement(b.currentTarget),e=d(e),l=e.attr("hkId");if(l){for(var l=l.split(";"),a=b.which,f=b.type,g=c.specialKeys[a],h=!g&&String.fromCharCode(a).toLowerCase(),n=b.shiftKey,
k=b.ctrlKey,p=b.altKey||b.originalEvent.altKey,m=null,a=0;a<l.length;a++)if(c.triggersMap[l[a]][f]){m=c.triggersMap[l[a]][f];break}if(m&&(n||k||p?(a="",p&&(a+="alt+"),k&&(a+="ctrl+"),n&&(a+="shift+"),(g=m[a+g])||h&&(g=m[a+h]||m[a+c.shiftNums[h]]||"shift+"===a&&m[c.shiftNums[h]])):g=m[g]||h&&m[h],g)){h=!1;for(a=0;a<g.length;a++){if(g[a].disableInInput&&(m=d(b.target),e.is("input")||e.is("textarea")||e.is("select")||m.is("input")||m.is("textarea")||m.is("select")))return!0;c.suspended||(h=h||g[a].cb.apply(this,
[b]))}return h}}};window.hotkeys=c;return d})(jQuery);
