title: Creating a simple youtube video player using javascript
body: <p>I'm trying to create a simple youtube player using some javascript. Example is here:</p>
  <p><a href="http://jsfiddle.net/YX8pQ/6/" rel="nofollow noreferrer">http://jsfiddle.net/YX8pQ/6/</a></p>
  <p>I've got the basic functionality working (kinda) using click functions to toggle the visibility of each iframe.</p>
  <p>HOWEVER:</p>
  <blockquote>
  <ol>
  <li><p>When clicking each thumbnail in succession, loading the iframes becomes a bit buggy; sometimes the video you click doesn't load, and sometimes (no idea why!) a different video loads.</p>
  </li>
  <li><p>When clicking a different thumbnail, currently-playing videos keep on loading.</p>
  </li>
  </ol>
  </blockquote>
  <p>Is there a more elegant/robust way of doing this? It's a pretty simple function but I can't seem to work out a better way to make this work.</p>