title: How to show/hide flash object using javascript
body: <p>I want to embed this timer in a website. Basically I generated a timer from this <a href="http://www.oneplusyou.com/bb/countdown" rel="nofollow">website</a>. Then I would use this code and inject it to an html page. The code works great, however I only want to use this timer for some specific case (ie, using if-else) as followed:</p>
  
  <pre><code>&lt;script&gt; 
  
  flash = '&lt;object type=&amp;quot;application/x-shockwave-flash&amp;quot; data=&amp;quot;http://www.oneplusyou.com/bb/files/countdown/countdown.swf?co=000000&amp;bgcolor=ffffff&amp;date_month=10&amp;date_day=26&amp;date_year=0&amp;un=DEAL ENDS&amp;size=normal&amp;mo=10&amp;da=26&amp;yr=2014&amp;quot; width=&amp;quot;250&amp;quot; height=&amp;quot;100&amp;quot;&gt;&lt;param name=&amp;quot;movie&amp;quot; value=&amp;quot;http://www.oneplusyou.com/bb/files/countdown/countdown.swf?co=000000&amp;bgcolor=ffffff&amp;date_month=10&amp;date_day=26&amp;date_year=0&amp;un=DEAL ENDS&amp;size=normal&amp;mo=10&amp;da=26&amp;yr=2014&amp;quot; /&gt;&lt;param name=&amp;quot;bgcolor&amp;quot; value=&amp;quot;#ffffff&amp;quot; /&gt;&lt;/object&gt;';`
  
      if (new Date().getHours() &lt; 20) {
          document.write(flash);
      }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>But then I'll get this error <code>no plugin available to display this content</code></p>
  
  <p>So how would I built something like this another way, or maybe there's a fix for this</p>
  
  <p>THanks</p>