fix freezing in IE

customer submitted fix to ensure that the application doesn't freeze in
IE after closing a pane (for example 'Legend') and attempting to reopen
it.

tested the behavior, reproed, and confirmed that this is a good fix.

http://forums.arcgis.com/threads/5357-Sample-Javascript-Viewer?p=353103#post353103