AJAX.registerTeardown("keyhandler.js",function(){$("#table_columns").die("keydown");$("table.insertRowTable").die("keydown")});AJAX.registerOnload("keyhandler.js",function(){$("#table_columns").live("keydown",function(a){onKeyDownArrowsHandler(a.originalEvent)});$("table.insertRowTable").live("keydown",function(a){onKeyDownArrowsHandler(a.originalEvent)})});function onKeyDownArrowsHandler(c){c=c||window.event;var d=(c.srcElement||c.target);if(!d){return}if(d.tagName!="TEXTAREA"&&d.tagName!="INPUT"&&d.tagName!="SELECT"){return}if(navigator.userAgent.toLowerCase().indexOf("applewebkit/")!=-1){if(c.ctrlKey||c.shiftKey||!c.altKey){return}}else{if(!c.ctrlKey||c.shiftKey||c.altKey){return}}if(!d.id){return}var h=d.id.split("_");if(h[0]!="field"||typeof h[2]=="undefined"){return}var a=h[2],g=h[1];var b=null;switch(c.keyCode){case 38:g--;break;case 40:g++;break;case 37:a--;break;case 39:a++;break;default:return}var f="field_"+g+"_"+a;b=document.getElementById(f);if(!b){f="field_"+g+"_"+a+"_0";b=document.getElementById(f)}if(!b){return}b.focus();if(b.tagName!="SELECT"){b.select()}c.returnValue=false};