3. Select tool from javascript.
The Action Manager code (as created when recording with ScriptingListener.plugin) should be helpful for this.
1. Tabs at the very top for access to different panel layers.
Shouldn’t that be handled with html in an html panel?
2. Open menu item with button connected to javascript.
Do you mean actually expand the menu or just trigger some menu item?
In the second case I think it should be possible by DOM, but again Action Manager code might be useful.