dealing with sub menu in 2.5

as i had to many selection for one menu i decided to use a system with sub menus

see py file in given link ( too large to copy it in post )

http://cid-348ad7d85dee0c79.office.live.com/self.aspx/Scripttrig1/multitrig6.py

this script is working so you can run it and see the menu and sub menus!

this is a major modification to the add solid script
but it has the right structure i think

but don’t understand all the inner working yet !

now how and where do i

1 - detect which sub menu has been selected
2 - which item in this sub menu has been selected ?
3 - and where should i detect menu selection and then how to execute the right functions or class for each selection

Thanks & happy 2.5