hi Allan
welcome to the forum...
i am not that hot on Perl so i cant give you any specific help on that....however, having said that, what you require is, of course, fully implementable in Javascript....
I myself am thinking of adapting windows suite for my own needs and have been thinking about the issues you mention here.....
it depends whether you using the stand-alone windows version or the dhtml suite implementation as to how you handle the window states :-
1) to code position of windows on screen Alf has created generic methods (in the dhtml_suite implementation) for example slideWindowToXAndY.... but it would be easy to have a little function to set the XY coordinates of the parent Window DIV.
2) Now with regards to your windows ..... i am assuming that once you close a window you either no longer require it or you want to be able to re-invoke it?
But it doesnt really matter.....
somewhere you have to have a variable which stores the currently active window activeWindow say. this is just an index to the windowsArray. This changes when you click on another window or close a window or create a new one
Now when you close this window you have to have some algorithm to make the activeWindow another one (if another exists) ... this could be either the next open window in the list (you know which it would be from activeWindow...if this was 2 then active window would = 3 [if 3 doesnt exist then 1
] or basically the first one ie activeWindow = 1.
When you create a new window this automatically becomes the activeWindow.. (you would set it yourself when you create it) you can position this new window using the javascript functions (left and top or any other way) if you want them in predetermined locations
it is not that easy if you are not that au fait with JS but not that tricky either
if you dont want to have windows reinvoked and dont want to clog up array every time you close a window you could bubble the window references down in windowsArray so you have no unnecessary wastage. ie if you delete 2 and you have 5 windows 3 takes position of 2 4 takes position of 3 etc)
if you want to be able to reinvoke them you, of course, have to have some way of recording whether a window is visible or hidden ( this is done simple using style.display == 'none')
Alex