I am trying to write a small java script that will turn on / off background music on my web page. I have it working in FireFox and other browsers, but can not get it to work in IE and version.

It is pretty simple so far, you click on a button called "start video" and it turns off the music. When you hit the button called "Stop video" it turns the music back on. It is also using an ajax script for an iframe, both java and ajax working together.

Can anyone help me figure out what I am doing wrong. I have tried so many different senarios I am out of ideas. Maybe I am going about this wrong?

Here is my script:

<script type="text/javascript">

function stopSound(){

function playSound() {
document.getElementById('bgsound').src='../video/RollerPop.wav'; }

<embed src="../video/RollerPop.wav" id="bgsound" autostart=true loop=true volume=100 hidden=true><noembed><bgsound src="../video/RollerPop.wav" loop="-1" volume="100" delay="0" hidden="true"/></noembed>

<a href="javascript:ajaxpage('mainVideo.cfm','rightcolumn');" onClick="stopSound()">link></a>

<a href="javascript:ajaxpage('mainVideo1A.cfm','rightcolumn');" onClick="playSound()">link2</a>


If you need to ajax part of the script I can make that available. I omitted it for the sake of trying to make this easy to follow.

Can anyone help me figure out why I can't get this to work in IE?

Thank you.