Huh, Just posted something similar .
But you should simply be able to call the function directly from Hype if it is in the external head. i.e. in the external html head. you have :
function modalbox ( ){
// your code..
}
And in a Hype function you just make the call to it.
modalbox ( )