Var scope on the same line Is there a better way I can code this? It's old code and I'm not sure makes sense today. JSLint gives me a lot of errors too. I don't have experience with JavaScript and I would like to optimize this snippet. 

Any suggestion? Maybe I can achieve better code with JQuery? 

&lt;script type="text/javascript"&gt;
// &lt;![CDATA[
    var jump_page = '{LA_JUMP_PAGE}:',
    var on_page = '{ON_PAGE}';
    var per_page = '{PER_PAGE}';
    var base_url = '{A_BASE_URL}';
    var style_cookie = 'phpBBstyle';
    var style_cookie_settings = '{A_COOKIE_SETTINGS}';
    var onload_functions = new Array();
    var onunload_functions = new Array();

    /**
    * Find a member
    */
    function find_username(url)
    {
        popup(url, 760, 570, '_usersearch');
        return false;
    }

    /**
    * New function for handling multiple calls to window.onload and window.unload by pentapenguin
    */
    window.onload = function()
    {
        for (var i = 0; i &lt; onload_functions.length; i++)
        {
            eval(onload_functions[i]);
        }
    };

    window.onunload = function()
    {
        for (var i = 0; i &lt; onunload_functions.length; i++)
        {
            eval(onunload_functions[i]);
        }
    };

// ]]&gt;
&lt;/script&gt;


This is how an handler is called for example:

&lt;script type="text/javascript"&gt;
// &lt;![CDATA[
    /**
    * Change language
    */
    function change_language(lang_iso)
    {
        document.forms['register'].change_lang.value = lang_iso;
        document.forms['register'].submit.click();
    }

    &lt;!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_REFRESH --&gt;
    onload_functions.push('apply_onkeypress_event()');
    &lt;!-- ENDIF --&gt;

// ]]&gt;
&lt;/script&gt;
The modern way to attach onLoad and onUnload handlers is to use window.addEventListener('load', onloadFunction) and window.addEventListener('unload', onunloadFunction).  Unlike window.onload, you can attach multiple handlers, saving you the work of writing your own support for multiple handlers.

Unfortunately, Internet Explorer only added support for addEventListener() in IE 9.  Therefore, you'll probably need a shim.  That would be a common shim that supports a standard interface, rather than your own hack, so I would still consider it an improvement.