Problem with div while loading flash ad with javascript

hi,

i have a small issue. i have games portal in that portal i am trying to add google flash ads before the game loads. everything is working fine but the problem is i have taken two divs with game content loading in one div and ad content loading in another div.

i am first loading the ad content before the game loads and after this i am loading the game content. both are working fine. but the ad content is flicking like its loading two times. its a big issue.

Ad and game loading code
<!-- ads div –>
<div id=“ads” style=“display:inline”>

&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="618" height="500"&gt;
       &lt;param name="movie" value="http://www.startonlinegames.com/swf/google2-FullSlot_adsCs5.swf" /&gt;
         &lt;param name="quality" value="high" /&gt;
          &lt;param name="allowScriptAccess" value="always" /&gt;
          &lt;param name="wmode" value="opaque"/&gt;
            &lt;embed src="http://www.startonlinegames.com/swf/google2-FullSlot_adsCs5.swf"  allowScriptAccess="always" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="618" height="500" /&gt;
                
&lt;/object&gt;
&lt;/div&gt;
    
            &lt;!-- Game div --&gt;
            
   &lt;div id='gamecontent' style='height:550px; visibility:hidden; display:none'&gt; 
    
            &lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="700" height="570"&gt;
                &lt;param name="movie" value="http://www.startonlinegames.com/swf/games/&lt;?php echo $playGameRow['filename'];?&gt;" /&gt;
                &lt;param name="quality" value="high" /&gt;
                &lt;param name="allownetworking" value="internal"&gt;
                &lt;embed src="http://www.startonlinegames.com/swf/games/&lt;?php echo $playGameRow['filename'];?&gt;" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" allownetworking="internal" width="700" height="&lt;?php echo $playGameRow['height'];?&gt;"&gt;
                &lt;/embed&gt;
          &lt;/object&gt;
    &lt;/div&gt;

javascript code:

&lt;script type="text/javascript"&gt;
    			function turn_vis_on(id) { 
				if (document.getElementById) { // DOM3 = IE5, NS6 
					document.getElementById(id).style.display = 'inline'; 
					obj = document.getElementById(id); 
					obj.style.visibility = "visible"; 
					} 
    			} 
				function turn_vis_off(id){ 
					if (document.getElementById) { // DOM3 = IE5, NS6 
						document.getElementById(id).style.display = 'none'; 
						obj = document.getElementById(id); 
						obj.style.visibility = "hidden"; 
					} 
				} 
				function ShowHide() 
				{ 
					turn_vis_off("ads");
					turn_vis_on("gamecontent");
					
				}
				document.getElementById("ads").style.zIndex = 100;
				//timeoutID = setTimeout(ShowHide, 30000);    
    		&lt;/script&gt;

Can anyone please look into this and let me know the mistake i made. for reference you can see this url StartOnlineGames.com - Playing*Online Cricket 2011