It's starting to sound like this juggling act needs to be a browser feature. Actually, it should probably be a standards thing, but let's not get crazy.