/*

In the head:
<script type="text/javascript" src="javascripts/activex_workaround.js"></script>

In the body:
<div id="flash_content"></div>
<script language="JavaScript" type="text/JavaScript">
	embedFlash('flash_content', 'my_flash_file.swf', 400, 200);
</script>

*/

function workAroundEmbed(DivTag, CodeToInsert) {

        if (document.getElementById) {

                // This browser supports 'getElementByID'
                var WorkaroundHTML = document.getElementById(DivTag);
                WorkaroundHTML.innerHTML = CodeToInsert;

        } else {

                // This browser is older and does not
                // support 'getElementByID'
                document.write(CodeToInsert);

        }

 }

function embedFlash(div_id, filename, width, height) {
  width_height = ' width="' + width + '"' + ' height="' + height + '" ';
  html =  '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"'
  html += width_height
  html += '><param name="movie" value="'
  html += filename
  html += '"><param name="quality" value="high"><embed src="'
  html += filename
  html += '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"'
  html += width_height
  html += '></embed></object>';
  workAroundEmbed(div_id, html);
}
