Onclick play embedded video

I wrote this to trigger the video when an image is clicked, but it doesnt work. Any help?

#movie {}
#img {}
<embed type="application/x-vlc-plugin" name="VLC" target="mymovie.webm" id="movie" > </embed>
<img src=myimage.jpg" id="img" />
  var v = document.getElementById("movie");
  var i = document.getElementById("img");
  i.onclick = function() {

As far as i can see javascript doesn’t support the .[B]play/B method but i did find the source to a script that looks to be working perfectly.