YUI.add("event-nav-keys",function(e){var t={enter:13,esc:27,backspace:8,tab:9,pageUp:33,pageDown:34,left:37,up:38,right:39,down:40,space:32};e.Object.each(t,function(t,n){e.Event.define({type:n,on:function(e,n,r,i){var s=i?"delegate":"on";n._handle=e[s]("keydown",function(e){e.keyCode===t&&r.fire(e)},i)},delegate:function(){this.on.apply(this,arguments)},detach:function(e,t){t._handle.detach()},detachDelegate:function(){this.detach.apply(this,arguments)}})})},"2011.02.02-21-07",{requires:["event-synthetic"]}),YUI.add("moodle-format_grid-gridkeys",function(e,t){M.format_grid=M.format_grid||{},M.format_grid.gridkeys=M.format_grid.gridkeys||{},M.format_grid.gridkeys={currentGridBox:!1,currentGridBoxIndex:0,findfocused:function(){var e=document.activeElement;return!e||e==document.body?e=null:document.querySelector&&(e=document.querySelector(":focus")),M.format_grid.gridkeys.currentGridBox=!1,e&&e.id&&e.id.indexOf("gridsection-")>-1&&(M.format_grid.gridkeys.currentGridBox=!0,M.format_grid.gridkeys.currentGridBoxIndex=parseInt(e.id.replace("gridsection-",""),10)),M.format_grid.gridkeys.currentGridBox},init:function(t){e.on("esc",function(e){e.preventDefault(),M.format_grid.icon_toggle(e)}),e.on("enter",function(e){M.format_grid.gridkeys.currentGridBox&&(e.preventDefault(),e.shiftKey?M.format_grid.icon_toggle(e):M.format_grid.icon_toggle(e))}),e.on("tab",function(){setTimeout(function(){M.format_grid.gridkeys.findfocused()&&M.format_grid.tab(M.format_grid.gridkeys.currentGridBoxIndex)},250)}),e.on("space",function(e){M.format_grid.gridkeys.currentGridBox&&(e.preventDefault(),M.format_grid.icon_toggle(e))}),e.on("left",function(e){e.preventDefault(),t.rtl?M.format_grid.next_section(e):M.format_grid.previous_section(e)}),e.on("right",function(e){e.preventDefault(),t.rtl?M.format_grid.previous_section(e):M.format_grid.next_section(e)})}}},"@VERSION@",{requires:["event-nav-keys"]});
