Okay... I got your ZIP and figured out your problem.
In the ZIP you sent me, it "appears" as though there are only 5 files in Images/HomePage:
quote2.gif
quote2.gif
quote3.gif
quote4.gif
quote5.gif
However, there are actually 6 files in this directory. (You can confirm this by stepping through the code and inspecting the value of fileList.Length, which is 6.)
If you step through and inspect the value of fileList, you will see the 6th file is the
Thumbs.db file.
Thumbs.db is a hidden operating system file, so by default you cannot see it in Windows Explorer. If you disable the option that hides protected operating system files, you will be able to see it right away.
As I mentioned, Thumbs.db is the last file in this directory. So, whenever randomFileIndex = 5, it pulls Thumbs.db from the directory, which of course will not display in the browser.
I confirmed this on the client side by using FireBug to inspect your HomePage div when it came up empty.
Code:
<div id="ctl00_cpMainContent_HomePage" class="Quotes" style="background: transparent url(Images/HomePage/Thumbs.db) repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"> </div>
Solution -- get rid of that thumbs.db file. Problem solved.
P.S. I fixed your solution and sent it back to you.