I'm actually building a lottery like game with an opt-in form that tells if you can play or not. I'm using custom html/css/jquery to setup the form as I can't do this properly in C2. So when the form is submitted, I do some ajax to register the user before he can play. Then I need to call a game function to launch the right layout etc.
I managed to trick this, changing a textbox value inside C2 from my custom JS, and on C2 listening for the textbox value to change :
<img src="http://api.imajao.com/photo/EDJDI.png" border="0" />
but this is not a proper way to do this simple thing^^