Code that runs before anything declared as local can't "see" it.
Move your fromGT function declaration to before you start creating the buttons (or at least before the SetScripts(xxx) section)
You should be getting errors so I would also suggest intalling
BugSack and
Bugrabber to help detecting them.