Q:

How to close DOJO layout elements programatically

This applies to ArcGIS Server JavaScript API 2.4.  The Build Application Layouts help file shows how to lay out a page with elements held within separate containers. 
How can I programatically close a Content Pane when the user presses a button? 
For example in this map, how could I close the rightPane div, and have the map expand to fill the vacant space (ie, hide the Table of Contents)?  
ESRI are doing it on the My Map viewer so it must be possible.  The X in the top-right of the Details panel contains this markup:
<a title="Close" href="JavaScript:esri.arcgisonline.map.main.hideLeftContentPanel();">
    <img border="0" src="images/close.gif">
</a>

How can I find out what that button is doing, and would that help? 
Thanks

A:

Ok, what you want to do is use the dojox.layout. ExpandoPane, then you will do a method like this in your :
dojo.connect(dijit.byId('myExpandoPage'), 'resize', resizeMap);

This will tell your app to use the resizeMap method each time the pane gets resized.  I use this in several of my apps and it works pretty slick, and can be tweaked nicely with css.