-function add_event(e, type, fn, c) {
- var ret = 0;
- if (e.addEventListener) e.addEventListener(type, fn, c)
- else if (e.attachEvent) e.attachEvent('on' + type, fn)
- else e['on' + type] = fn;
-}
-
-function do_load_events() {
- for (var name in window.a_onload_functions) add_event(window, "load", window.a_onload_functions[name], false);
- for (var name in window.a_onsubmit_functions) add_event(window, "submit", window.a_onsubmit_functions[name], false);
- for (var name in window.a_onfocus_functions) add_event(window, "focus", window.a_onfocus_functions[name], false);
+function getElementByIndirectName(name){
+ var e = document.getElementsByName(name)[0];
+ if (e) return document.getElementsByName(e.value)[0];
+}
+
+function focus_by_name(name){
+ var f = getElementByIndirectName(name);
+ if (focussable(f)) {
+ set_cursor_position(f.name);
+ return true;
+ }
+ return false;