I'm surprised that this doesn't produce an error. I've never seen functions declared like so:
PHP Code:
function onKeyPressed(keychar, character)
if (character == "9"){
show();
}
When I first looked at this, it looked like you defined
show() inside of
onKeyPressed(). I suggest using braces where you can. This would make it a lot clearer:
PHP Code:
function onKeyPressed(keychar, character)
{ // Added a brace here ...
if (character == "9")
{
show();
}
} // .. and here