Redefining variable
<p>Hello I have code which replaces <code>document.write</code>, makes a buffer and than pushes buffer into the document:</p>

<pre><code>var lazyLoad = (function () {

    var CONFIG = {
        block: '',
        url: ''
    };

    function work(){
        buffer = ''
        d.write = d.writeln = function(s){ 
                                    buffer += s
                                }
        d.open = d.close = function(){}
        s = d.createElement('script');       
        s.setAttribute('type','text/javascript');
        s.setAttribute('src',CONFIG.url);
        d.getElementById(CONFIG.block).appendChild(s)
        s.onload = function () {
            window.setTimeout(function() {

                console.warn(CONFIG.block + ' ' + buffer)
                d.getElementById(CONFIG.block).innerHTML += buffer;
                buffer = '';
            }, 0);
       }
    }

    return {
            init: function (options) {
                $.extend(CONFIG, options);

                window.d = document
                window.onload = function(){
                    work()
                }
            }

    }

})();
</code></pre>

<p>If I init it once:</p>

<pre><code>lazyLoad.init({
            url: 'http://test1.com/test1.js',
            block: DIVID1
        })
</code></pre>

<p>But if I call it again with other parameters:</p>

<pre><code>lazyLoad.init({
                url: 'http://test2.com/test2.js',
                block: DIVID2
            })
</code></pre>

<p>First init wont work. <code>buffer</code> will be empty. Where is my mistake? </p>
