jQuery code will not run unless stepped through with Firebug

jQuery code will not run unless stepped through with Firebug

I have a problem with some jQuery code. For some reason it will not run automatically when its supposed to however when stepping through with Firebug it works fine?

I put a breakpoint on the code that's not firing automatically and then press play on Firebug and it works fine if I take away this breakpoint or close down Firebug it does not run? Can somebody please help, I've searched the internet but not found anything relevant.

The code should run when I click a link which will create a jQuery tab on my main page and open an external page onto this tab - The external page also includes jQuery to run a lightbox so had to put an id on the link that I click to activate the lightbox code (this is the code that wont fire without the breakpoint).

Link: 

     <a onclick="createNewTab('dhtmlgoodies_tabView1','Remote Access','','RemoteAccess.html',true);return false" id="lightbox_load">Remote Access</a>

Code not running:

    $(function(){
        // Lighbox Link
        $('#lightbox_load').click(function(){
        $('#RemoteAccessGallery a').lightBox({fixedNavigation:true});        }); });