var oldInitGeneral = init; init = function(args) { oldInitGeneral.apply(this, [args]); // if there's a logon box, set the username input field in focus var logonForm = document.getElementById('logon'); if (logonForm && logonForm.NewUserName) { logonForm.NewUserName.focus(); } if (!lteIE6) { $('').attr({ type: 'hidden', name: 'datatable', value: '1' }).appendTo('#header_search'); $('#user_list_link').each(function() { var href = $(this).attr('href'); href += (href.indexOf('?') < 0) ? '?' : '&'; href += 'datatable=1'; $(this).attr('href', href); }); } $('form input.default_action').each(function() { var defaultSubmitButton = $(this); $(this).parents('form').find('input').keypress(function(event) { if (event.which == 13) // the Enter key { defaultSubmitButton.click(); return false; } else { return true; } }); }); };