<?php
/**
 * Display Adsense for Games preloader
 *
 * @package WordPress
 * @subpackage MyArcadeTheme
 */
?>
<script type="text/javascript">
  function removeAdSwf() {
    document.getElementById("predivloader").style.display = "none";
    jQuery("#myarcade_game, .game-ctrl").show();
  }
  function noAdsReturned() {
    document.getElementById("predivloader").style.display = "none";
    jQuery("#myarcade_game, .game-ctrl").show();
  }
</script>

<!--Start of Preloader call -->
<div id="predivloader">
  <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0"
  width="500" height="500" id="preloader" align="middle">
    <!--allowScriptAccess must always be set to always-->
    <param name="allowScriptAccess" value="always" />
    <param name="allowFullScreen" value="false" />
    <param name="movie" value="<?php echo get_template_directory_uri(); ?>/inc/ima3_preloader_1.5.swf" />
    <param name="quality" value="high" />

    <param name="bgcolor" value="#ffffff" />
    <param name="flashvars" value="<?php echo urlencode('adTagUrl=http://googleads.g.doubleclick.net/pagead/ads?ad_type=video_image_text_flash&client='.myarcadetheme_get_option('adsense_for_games_client').'&videoad_start_delay=0&description_url='.get_permalink().'&max_ad_duration=40000&hl=en&adtest=on'); ?>">

    <embed src="<?php echo get_template_directory_uri(); ?>/inc/ima3_preloader_1.5.swf"
      quality="high" bgcolor="#000000"
      width="500" height="500"
      name="preloader"
      align="middle" allowScriptAccess="always"
      allowFullScreen="false"
      type="application/x-shockwave-flash"
      flashVars="<?php echo urlencode('adTagUrl=http://googleads.g.doubleclick.net/pagead/ads?ad_type=video_image_text_flash&client='.myarcadetheme_get_option('adsense_for_games_client').'&videoad_start_delay=0&description_url='.get_permalink().'&max_ad_duration=40000&hl=en&adtest=on'); ?>"
      pluginspage="http://www.adobe.com/go/getflashplayer" />
  </object>
</div>