[jQuery] plugins leaving jquery namespace in bind function

[jQuery] plugins leaving jquery namespace in bind function


i posted a bit earlier but i've synthesized the problem a bit. in the
code below, one would expect the variables mb2 and mb3 to contain the
same things as each other. however, mb3, which wraps the same element
with jQuery inside of the bound function, ends up just being an
unextended jQuery object, while mb2 has all the extended functionality
provided by any plugins on the page.
    function makeMenubar(w,wid,c) {
        var menu = $("##"+w+"Header");
        menu.append("<a class='close' id='"+w+"_close'/>");
        menu.append("<div class='menubutton' id='"+w+"_menubutton'></div>");
        var mb = $("##"+w+"_menubutton");
        $("##"+w+"_menubutton").click(function(e) {
        var mb2 = mb;
        var mb3 = $(this);
        fileMenu(w,e.clientX,e.clientY,c,m);    });
        $("##"+w+"_close").click(function() {closeWidget(wid,w);});
    }
does this make sense to anyone or ring a bell?