Intermittent jQuery Errors
<p>I'm having some odd and intermittent errors, which I assume are related to my jQuery.  I made a simple content preloader that renders all the images for an application and then displays the content once it is completed.  Below is the script:</p>

<p><a href="http://pastie.org/2684587" rel="nofollow">http://pastie.org/2684587</a> - PHP Code </p>

<p><a href="http://pastie.org/2684593" rel="nofollow">http://pastie.org/2684593</a> - JS Code</p>

<p>The PHP code runs first, of course.  The script searches through the <code>images</code> directory and renders all the images and hides them.  <code>$i</code> is incremented when an image put into the page.</p>

<p>When this is done, it is supposed to set off the event listener (tied for both 'load' and 'error') at the bottom of the page.  It first sets the <code>max_loaded</code> var to the amount of images put into the page and then the listener should trigger.</p>

<p>The jQuery then modifies a loading bar according to how far along a JS var is incremented.  When it the page is done loading or is through with errors, it should display my application's content.</p>

<p>This works on occasion, with most errors coming from IE.  I have had reports from several users that it fails across all latest browsers.  Strangely enough, it works fine for others in the latest browsers.</p>

<p>Is there something I'm missing here?  I do get the error on occasion in IE, but there are never any errors displayed in Dev Mode.  I'm at a loss.</p>

<p>The problem is that it will load some content, but not all.  The loading bar ends up stalling at any percentage.  Sometimes it'll go through, sometimes it won't.</p>
