Get correct windows

I’ve got a problem rcovering the window.

Each time I park down a window i put It a a position on the bottom of the page.

Each time that a window parks up I have to review all the postions of thw windows to put the on the rigth position without leaving spaces between them.

For this, I iterate al the dhxWins object but whe i go out of the function the window that is pointed is the last window created instead the one which is aclling the function.

Is there a way to recover then winload one on leaving the function?

here is my code:

winload.attachEvent(“onParkDown”, function(win) { //Al minimizar la ventana situar abajo    

//Decrementar el contador de minimizadas

numpark = 0;

dhxWins.forEachWindow(function(winP) {

//si est� parked eliminamos los espacion entre las que quedan parked            if ( (winP.getText() != win.getText()) && winP.isParked()){

                            //colocar la venta en la posici�n parked

                            winP.setPosition( 200 * numpark, document.body.clientHeight - 37);

                            //Incrementar el contador de minimizadas

                            numpark = ++numpark;                            



                    win.setDimension(winWidth, winHeight);


                    return true;

                }); … 36&a=11794