title: Javascript to embed flash object in html not working
body: <p>I am trying to display some html embedding a SWF object using javascript.</p>
  
  <p>The script works fine without the SWF object.  Howevever, when the object is included in the html inserted into the div the script no longer runs.</p>
  
  <p>If anyone can suggest fix or spot error, I would greatly appreciate it.</p>
  
  <p>Here is jsfiddle.</p>
  
  <p><a href="http://jsfiddle.net/UJpQ4/" rel="nofollow">http://jsfiddle.net/UJpQ4/</a></p>
  
  <p>Code (same as jsfiddle):</p>
  
  <p>html:</p>
  
  <pre><code>&lt;a href="javascript:void(0)" onclick="takeProfilePic('0');"&gt;Show Flash&lt;/a&gt;
  &lt;a href="javascript:void(0)" onclick="takeProfilePic('1');"&gt;Do not show flash&lt;/a&gt;
  &lt;tr&gt;&lt;td colspan=2 align="center"&gt;&lt;div id="takepic"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>javascript:</p>
  
  <pre><code>function takeProfilePic(type) {
  //   alert(type);
  if (type==0)
    {
     var target = 'takepic';
     var photo = '&lt;tr&gt;&lt;td colspan=2 align="center"&gt;hello&lt;/td&gt;&lt;/tr&gt;';
  document.getElementById(target).innerHTML = photo;
  return false;
    }
      else if (type==1) {
          var target = 'takepic';
     var photo = '&lt;tr&gt;&lt;td colspan=2 align="center"&gt;&lt;a href="stepthree.php"&gt;&lt;img src="images/collapse.gif" border=0&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=2 align="center"&gt;NO FLASH OBJECT HERE&lt;/td&gt;&lt;/tr&gt;';
    document.getElementById(target).innerHTML = photo;
  return false;      
      }     
  }
  </code></pre>