¿Cómo detener un reproductor de YouTube al ocultar el iframe?

Tengo un div oculto que contiene un video de YouTube en un<iframe>. Cuando el usuario hace clic en un enlace, este div se hace visible, el usuario debería poder reproducir el video.

Cuando el usuario cierra el panel, el video debe detener la reproducción. ¿Cómo puedo conseguir esto

Código

<!-- link to open popupVid -->
<p><a href="javascript:;" onClick="document.getElementById('popupVid').style.display='';">Click here</a> to see my presenting showreel, to give you an idea of my style - usually described as authoritative, affable and and engaging.</p>

<!-- popup and contents -->
<div id="popupVid" style="position:absolute;left:0px;top:87px;width:500px;background-color:#D05F27;height:auto;display:none;z-index:200;">

  <iframe width="500" height="315" src="http://www.youtube.com/embed/T39hYJAwR40" frameborder="0" allowfullscreen></iframe>

  <br /><br /> 
  <a href="javascript:;" onClick="document.getElementById('popupVid').style.display='none';">
  close
  </a>
</div><!--end of popupVid -->

Respuestas a la pregunta(28)

Su respuesta a la pregunta