I was finally able to reproduce the problem in a simpler page, and track down the cause. The framed page is from a very old web site. In order to try to get maximum compatibility, I was setting the document mode of the master page to IE7 standards:
In this state, it appears the mouse button up event is sent to the framed page (because once the left pane is collapsed, the mouse cursor is now over the framed page), and the framed page seems to interpret that as a mouse click event and responds to it.
When I took out the above AddHeader statement, the problem disappeared.
Hopefully leaving the document mode at IE9 standards instead won't cause any rendering problems in the framed page and I can consider this problem solved.