You also don't need to define functions inside the document ready function, you could just define outside of the ready() callback. Eg,
// This script loads from another external file
// run something else
I think in your example by defining it inside the callback of .ready() you'd have a chicken and egg thing going, you could never be sure the function would be defined when you actually want to use it, so try defining your functions first outside of .ready().