Jquery plugin problem
<p>I've been editing a JQuery plugin 'airport' and have run into a problem;</p>

<p>I want the div to clear at the point mentioned in the code, but when I use $(self).empty(); the code just stops. (mid way down the code).</p>

<p>Here is my code: </p>

<pre><code>function($){ 
 $.fn.extend({  
     airport: function(array) {

        var self = $(this);
        var chars = ['a','b','c','d','e','f','g',' ','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','-'];
        var longest = 0;
        var items = items2 = array.length;

        function pad(a,b) { return a + new Array(b - a.length + 1).join(' '); }

        $(this).empty();

        while(items--)
            if(array[items].length &gt; longest) longest = array[items].length;

        spans = longest;
        while(spans--)
            $(this).prepend("&lt;span class='c" + spans + "'&gt;&lt;/span&gt;");    


        function testChar(a,b,c,d){
            if(c &gt;= array.length)
                setTimeout(function() { testChar(0,0,0,0); }, 500);             
            else if(d &gt;= array[c].length)
                //Div should be cleared here...
                setTimeout(function() { testChar(0,0,c+1,0); }, 500);
            else {
                $(self).find('.c'+a).html((chars[b]==" ")?"&amp;nbsp;":chars[b]);
                setTimeout(function() {
                    if(b &gt; chars.length)
                        testChar(a+1,0,c,d+1);
                    else if(chars[b] != array[c].substring(d,d+1).toLowerCase())
                        testChar(a,b+1,c,d);
                    else
                        testChar(a+1,0,c,d+1);
                }, 20);
            }
        }
        testChar(0,0,0,0);
    } 
}); 
</code></pre>

<p>})(jQuery);</p>

<p>Please tell me how to clear the div of all content. Thanks in advance!</p>
