1) I think you want raw ~q rather than raw -q
2) It appears that you have menu options, but no menu definition.
3) Your dialog init and sclick events are both missing closing braces, and you have no code for the init event.
I'll see about coding something for you after dinner.