The standard way to keep this kind of connection is using closures.
For example if you write
function make_timer()
{
    var x = document.createElement("div");
    var count = 0;
    setInterval(function(){
        count += 1;
        x.textContent = count;
    }, 1000);
    return x;
}
every call to make_timer will create an independent DOM node in which the content every second will be incremented. But how can the timer callback remember which is the node that needs to be incremented? The answer is that what is passed to setInterval indeed is not a function but a closure, i.e. a function plus some variables (count and x in this case).
Languages like Java or C++ don't have this concept, but that happens is the the function that is created also it's said to "capture" local variables if they are from an outer scope and it will keep them "alive" even if the outer function that ceated them ends (i.e. when the function make_counter exits).
The very same can be used for ajax requests. What you normally do is just passing the window object to the function that submits the request and a callback closures will be used as completion and error callbacks. The closures will have access to the respective window objects when the answers come back from the server.
Edit
If you really want to use IDs then of course you can... in your example they are store in an array so the array must be traversed to look for the exact ID...
var windowid=$("#guiid").val();
for (var i=0; i<window_manager.windows.length; i++)
    if (window_manager.windows[i].id == windowid)
        window_manager.windows[i].gui();
Using an object instead of an array would be better because in that case the search could be reduced to a single like:
var windowid=$("#guiid").val();
window_manager.windows[windowid].gui();
Note however that in many cases numeric IDs for are not needed in Javascript because where you would store the window id you could store instead the reference to the window object itself, and for callbacks there is no need of complex machinery for providing context (like it's necessary in C++ or Java) because you have closures.
     
    
windowshould be a reserved word.........