Tell me, why do javascript developers feel a need to bunch their code together? I mean a few newlines aren't goanna make much of a difference for download time....
Anyway, I'm not a javascript person (only had some formal education in Java) but the code below should work.
Haven't tested it though, so no guarantees.
What it now does is simply performes a stop function on the sound object before playing it, this should ensure it always starts from the beginning.
I don't know if this will work on files you're not already playing though... let me know...
And copy and paste that URL of the site.
Code:
<script language="JavaScript">
<!--
//v3.0
function MM_controlSound(x, _sndObj, sndFile)
{
var i;
var method = "";
var sndObj = eval(_sndObj);
if (sndObj != null)
{
if (navigator.appName == 'Netscape')
{
method = "play";
}
else
if (window.MM_WMP == null)
{
window.MM_WMP = false;
for(i in sndObj)
{
if (i == "ActiveMovie")
{
window.MM_WMP = true;
break;
}
}
}
if (window.MM_WMP){
{
method = "play";
}
else if (sndObj.FileName)
{
method = "run";
}
}
}
if (method)
{
eval(_sndObj+".stop()");
eval(_sndObj+"."+method+"()");
}
else
{
window.location = sndFile;
}
}
//-->
</script>