Uncaught TypeError: Object #<Event> has no method 'split'
<p>I'm writing a Javascript function to preload pictures on a website.</p>

<pre><code>function preload(images) {
if (document.images) {
        var i = 0;
        var imageArray = new Array();
        imageArray = images.split(';');
        var imageObj = new Image();
        for(i=0; i&lt;=imageArray.length-1; i++) {
        imageObj.src=images[i];
        }
    }
}
preload('img1.jpg;img2.jpg;img3.jpg');
</code></pre>

<p>It's giving me an error: 
    Uncaught TypeError: Object # has no method 'split'</p>

<p>What is causing this? How can i fix it?</p>

<p>Please let me know if I should provide more information,
Thanks!</p>
