Wait for function to finish before ajax call starts
<p>I'm pretty sure I'm being stupid here as it's approaching the end of the day. But when I submit my form (generated dynamically) how would I first complete the close function before I try and open my new lightbox with ajax. At the moment they happen simultaniously so my close function is closing the lighbox I'm trying to open.</p>

<pre><code>// Submit form
$(":submit").live('click', function() {

    // Prevent default
    event.preventDefault();

    // Close previous lightbox
    lb.close();

    // Open new lightbox
    $.ajax({
        // Blah blah blah
    });

});
</code></pre>

<p>Thanks</p>
