dhtmlxLayout not resizing when resizing window.

Hello,

I have the following code:

<style type="text/css">
#CMS__window_element_contents {
     position:                                    absolute;
     top:                                         94px;
     bottom:                                      53px;
     width:                                       auto;
     height:                                      auto;
     left:                                        0px;
     right:                                       0px;
     background-image:                            url('./skins/%CMS_skinID%/img/cmswindow__main_bg.png');
     background-repeat:                           repeat-x;
     overflow:                                    auto;
     padding:                                     30px;
}
</style>


    <div id="CMS__window_element_contents"></div>
    <script>
         var CMSWINLayout_main = new dhtmlXLayoutObject("CMS__window_element_contents", "2U", "<?php echo $_CMSCONFIG['GUI_dhtmlXLayout_skin']; ?>");
         CMSWINLayout_main.cells("a").setWidth(300);
         CMSWINLayout_main.cells("b").hideHeader();
         CMSWINLayout_main.cells("a").setText("User menu");
    </script>

When I resize my browser window, the CMSWINLayout_main does not update its size, so it stays the same size as it did upon initialization.

How can I solve this? Is there a functionality which I can run on ?

Thank you!

A solution on my own question which seems to work fine in both IE, Firefox and Chrome:

    <script>
         var CMSWINLayout_main = new dhtmlXLayoutObject("CMS__window_element_contents", "2U", "<?php echo $_CMSCONFIG['GUI_dhtmlXLayout_skin']; ?>");
         CMSWINLayout_main.cells("a").setWidth(300);
         CMSWINLayout_main.cells("b").hideHeader();
         CMSWINLayout_main.cells("a").setText("User menu");

         // This one will solve my problem!
         document.body.onresize = function () {
              CMSWINLayout_main.setSizes();
         }
    </script>

Hello,

the solution is good. But probably it would be better to set timeout - to call setSizes() method once (when the window has been already resized).