Calling a javascript function from another .js file
<p>I have two external .js files. The first contains a function. The second calls the function.</p>

<p>file1.js</p>

<pre><code>$(document).ready(function() {

    function menuHoverStart(element, topshift, thumbchange) {

        ... function here ...

    } 

});
</code></pre>

<p>file2.js</p>

<pre><code>$(document).ready(function() {

    setTimeout(function() { menuHoverStart("#myDiv", "63px", "myIMG"); },2000); 

});
</code></pre>

<p>The trouble is that this is not running the function. I need the two separate files because file2.js is inserted dynamically depending on certain conditions.  This function works if I include the setTimeout... line at the end of file1.js</p>

<p>Any ideas?</p>
