Change embedded .mov using onclick="document.getElementsByName

I want to be able to click on a link and it change a picture and movie file on that page. The picture changes but the video will not.

The code for the links list is:

      <li onmouseover="'pointer';" onmouseout="'auto';" onclick="document.getElementById('im').src='images/ace1.jpg', document.getElementById('im2').src='movies/'">Ace 1</li>
      <li onmouseover="'pointer';" onmouseout="'auto';" onclick="document.getElementById('im').src='images/ace2.jpg', document.getElementsById('im2').src='movies/'">Ace 2</li>

The code for the picture and movie holders is this:
  <p><img src="images/ace1.jpg" id="im" width="376" height="280"></p>
  <p><embed src="movies/" id="im2" width="737" height="560" autoplay="false" ></p>
Robert FrancisDirector of Continuous ImprovementAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Robert FrancisDirector of Continuous ImprovementAuthor Commented:
This example doesn't resemble what I am doing, and since I know nothing about JavaScript, I am lost.
Try this :

we use : SetURL(url)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript">
	function changeMovie(moviename) {
		movie = document.getElementById("im2");
		original_url = movie.GetURL();
		url = original_url.substring(0,original_url.lastIndexOf('/')+1) + moviename;


    <li onmouseover="'pointer';" onmouseout="'auto';" onclick="document.getElementById('im').src='images/ace1.jpg';changeMovie('');">Ace 1</li>
    <li onmouseover="'pointer';" onmouseout="'auto';" onclick="document.getElementById('im').src='images/ace2.jpg';changeMovie('');">Ace 2</li>

<p><img src="images/ace1.jpg" id="im" width="376" height="280"></p>
<p><embed src="movies/" id="im2" width="737" height="560" autoplay="false" ></p>


Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Robert FrancisDirector of Continuous ImprovementAuthor Commented:
Awesome. One last question. When I first load the page the move does not automatically start. But when I click on the link, the movies do automatically start. Any ideas how to stop this?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Digital Audio

From novice to tech pro — start learning today.