Loading random .swf's into .html document

**Desired outcome: **
When person goes to site (http://www.jayminnickinteractive.com) they are presented with a different .swf file each time they visit or refresh the page - currently I have three different .swf files that can served up.

What I’ve done so far to make this outcome a reality:
I included a javascript array in the .html document that selects one of three .swf files to present in the page. Here is the javascript:
[COLOR=Olive]<script language=“javascript”>
<!–
files = new Array();
files[0] = “crayolas_pre.swf”;
files[1] = “ice_cream_pre.swf”;
files[2] = “drinks_pre.swf”;
index = Math.floor(Math.random() * files.length);
movie = files[index];
// now write out the object and embed tags replacing the filename with the variable movie
document.write(’<object classid=“clsid:D27CDB6E-AE6D-11cf-96B8-444553540000” codebase=“http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0” width=800 height=600>’);
document.write(’<param name=movie value="’ + movie + ‘"> <param name=quality value=high> <param name=bgcolor value=#ffffff> <param name=“menu” value=“false”>’);
document.write(’<embed src="’ + movie + ‘" quality=high bgcolor=#ffffff menu=false width=800 height=600 type=“application/x-shockwave-flash” pluginspage=“http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash”></embed>’);
document.write(’</object>’);
//–>
</script>[/COLOR]

Problem: This works fine if you are using Firefox, Safari, etc. HOWEVER, if you are using IE then the page is completely blank. I tried using a if IE conditional statement to serve up another .swf if the browser was IE, but that didn’t work either.
Here’s the code for that as well:
[COLOR=Olive]<!–[if IE]>
<object classid=“clsid:D27CDB6E-AE6D-11cf-96B8-444553540000” codebase=“http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0” width=“800” height=“600”>
<param name=“movie” value=“drinks_pre.swf” />
<param name=“quality” value=“high” />
<embed src=“drinks_pre.swf” quality=“high” pluginspage=“http://www.macromedia.com/go/getflashplayer” type=“application/x-shockwave-flash” width=“800” height=“600”></embed>
</object>
<script type=“text/javascript” src=“fixit.js”></script>
<![endif]–>
[/COLOR]