JS function:
function play(audiourl){
document.getElementById('playerRegion').innerHTML=
'<object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"'
+'type="codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902""'
+'type="standby="Loading Microsoft Windows Media Player components...""'
+'type="application/x-oleobject" width="230" height="45">'
+'<param name="showControls" value="true">'
+'<param name="ShowStatusBar" value="-1">'
+'<param name="fileName" value="'+audiourl+'">'
+'<embed type="application/x-mplayer2" width="230" height="45"'
+'showcontrols="true" src="'+audiourl+'"><//embed><//object>';
document.getElementById('playImage').innerHTML="";
}
html:
<div id="playerRegion" > </div><div id="playImage" ><a onclick="play(this.href);return false" href="#defaulturl#">Play Audio<img border="0" src="/images/play.gif" width="20" height="20" /></a></div>