function showFlash(doc, uri, name, params, theme, fontFamily,
                   EAEnabled, wmode, frameWidth, frameHeight, windowId) {
   if(!checkFlashPlayer()) {
      return;
   }

   var isExploreView = name.indexOf("ExploreView") != -1;
   isNetscape = navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length;

   var protocol = (window.location.protocol.indexOf("https") == 0)
      ? "https" : "http";

   var thtml='';
   var inner = "";
   var inDashboard = window.inDashboard ||
      ("" + window.location).indexOf("resetdashboard") != -1;

   thtml += "<div id=objdiv style=\"width:100%;height:100%\">";

   if(!isNetscape) {
      inner +="<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' " +
         "codebase='" + protocol + "//download.macromedia.com/pub/" +
         "shockwave/cabs/flash/swflash.cab#version=8,0,0,0' id='" + name +
         "' width='100%' height='100%' align='left'>";

      inner +="<param name='allowScriptAccess' value='sameDomain' />";
      inner +="<param name='movie' value='" + uri +
         "?op=Resource&name=" + name + "' />";
      inner +="<param name='quality' value='high' />";
      inner +="<param name='flashVersion' value='8' />";
      inner +="<param name='salign' value='TL' />";
      inner +="<param name='FlashVars' value='" + params + "' />";
      inner +="<param name='bgcolor' value='#ffffff' />";

      //Because in safari and IE, if the wmode parame don't be set, the flash will
      //mask the iframe and div which should under it. So the womode parame
      //value must be set.

      if(!isExploreView) {
         inner +="<param name='wmode' value='transparent' />";
      }
      else if(navigator.userAgent.toLowerCase().indexOf("chrome") != -1) {
         // fix bug1268419305999,
         // if navigator is Google Chrome, set wmode to opaque
         inner +="<param name='wmode' value='opaque' />";
      }

      if(windowId) {
         inner +="<param name='windowId' value='" + windowId + "' />";
      }

      inner +="<param name='scale' value='showall' />";
      inner +="<param name='theme' value='" + theme + "' />";
      inner +="<param name='fontFamily' value='" + fontFamily + "' />";
      inner +="<param name='EAEnabled' value='" + EAEnabled + "' />";

      if(frameWidth != undefined && frameWidth != null &&
         frameHeight != undefined && frameHeight != null) {
         inner +="<param name='frameWidth' value='" + frameWidth + "' />";
         inner +="<param name='frameHeight' value='" + frameHeight + "' />";
      }

      inner += "</object>";
   }
   else {
      var setWMode = " ";

      if(!isExploreView) {
         setWMode = "wmode=\"transparent\" ";
      }
      else if(navigator.userAgent.toLowerCase().indexOf("chrome") != -1) {
         // fix bug1268419305999,
         // if navigator is Google Chrome, set wmode to opaque
         setWMode = "wmode=\"opaque\" ";
      }

      thtml +="<embed src=\"" + uri + "?op=Resource&name=" + name +
         "\" quality=\"high\" " + " salign=\"TL\" " + "FlashVars=\"" + params +
         "\" bgcolor=\"#ffffff\" id=\"emid\" width=\"100%\" height=\"100%\" " +
         "swLiveConnect=true name=\"" + name + "\" " +
         "allowScriptAccess=\"sameDomain\" scale=\"showall\" " +
         "type=\"application/x-shockwave-flash\" " + setWMode +
         "align=\"left\" pluginspage=\"" + protocol +
         "//www.macromedia.com/go/getflashplayer\" ";

      if(frameWidth != undefined && frameWidth != null &&
         frameHeight != undefined && frameHeight != null)
      {
         thtml +="frameWidth=\"" + frameWidth + "\" frameHeight=\"" +
            frameHeight + "\" ";
      }

      if(wmode != undefined && wmode != null && !isExploreView) {
         thtml +=" wmode=\"" + wmode + "\" ";
      }

      if(windowId) {
         thtml +=" windowId=\"" + windowId + "\" ";
      }

      thtml +="/>";
   }

   if(inDashboard) {
      thtml += inner;
   }

   thtml += "</div>";
   thtml += "<script>";
   thtml += "var _flashLoaded = false;";
   thtml += "function setObjDiv() {\n";

   // delay the creation of flash object so onbeforeunload works before the
   // flash is fully initialized
   if(!inDashboard && inner.length > 0) {
      thtml += "document.getElementById('objdiv').innerHTML = \"" +
         inner + "\";\n";
   }

   thtml += "}</script>";
   doc.write(thtml);
}
