window reference

I opened a window and attached an url.

Problem:

How can i close the window from the attached url and how can i send variables to the page opened the window like opener?

You can refference main window from loaded dhtmlxWindow as parent
    parent.dhxWins.window(id).close();

The content of dhtmlxWindow has not info about ID of window element, so it not possible to detect ID of window from its content

Thanks