Then read the Hype documentation and tutorials on how to attach javascript functions to Hype since this is a unique process in and of itself. Not hard though you just need to understand the Where to attach, When to call the function and The What to call it on.
Hope this helps.
PS 2 of the other members @MarkHunte, and @gasspence of the forum have a really neat thread about javascript I just came across.