Execute javascript when another function exists
<p>I'm writing two scripts in an web environment where I don't have control over the order in which they are loaded.  Let's say the two scripts are called <code>MyUtil</code> and <code>DoSomething</code>.</p>

<p><code>MyUtil</code> contains utilities that I will bind to the <code>window</code> object using <code>window.myUtil = myUtil</code>.  I'm then going to call methods of <code>myUtil</code> from within <code>DoSomething</code>.</p>

<p>If <code>MyUtil</code> is loaded first, everything will work. If it's loaded second, <code>window.myUtil</code> will be <code>undefined</code>.</p>

<p>How can I modify the code in <code>DoSomething</code> (and/or MyUtil) to wait until <code>window.myUtil</code> exists before <code>DoSomething</code> executes its code?</p>

<p><em>NB: I'm using jQuery 1.2.3.</em> </p>
