I could be really wrong, it's been a while, but does removing '.gani' help?
I could also again be way off, things may have changed, but you could try prefixing the variable 'theNumber' with 'temp.' rather than 'var'? I remember that being the way to initialise variables within the scope of a function.
A good, basic debugging tool is using 'echo' to check whether certain parts of your code are being executed. It's also useful for dumping state. I'm sure I remember there being a proper debugger written in GS some where too that may be useful.
One thing you could try is:
PHP Code:
echo player.gani;
To see what the value currently is. It may also be 'player.ani'.