OK! it works. Thanks a lot. Here's the JSL that swiches "h2" on and off.
namesdefaulttohere(1);
shw2=1;
w=newwindow("w",
h1=hierbox("h1",
b2=buttonbox("b2",
shw2=1-shw2;
h2<<visibility(
if(shw2==0,
"hidden",
"visible"
)
)
),
h2=hierbox("h2",
h3=hierbox("h3")
)
)
);
h1<<ChangeType("hierarchy");