var a,b,address_temp,address;

address_temp = document.getElementById("pirates3_mmsaddress").innerHTML;

a = address_temp.indexOf("<SPAN>");
b = address_temp.indexOf("</SPAN>");

if(a<0)
{
   a = address_temp.indexOf("<span>");
}
if(b<0)
{
   b = address_temp.indexOf("</span>");
}

address = address_temp.substring(a+6,b);

var wmpTags;

//decide explorer version
var Ie_ver=navigator["appVersion"].substr(22,1);

//decide explorer name
var Browser=navigator.appName;

if (Browser=="Microsoft Internet Explorer"){
	wmpTags = '<object classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" '
		+  'standby="Loading Microsoft Windows Media Player components..." '
		+  'width="320" height="201" id="meidawmp"> '
		+  '<param name="URL" value="'
		+  address
		+  '" /> '
		+  '<param name="autoStart" value="true" /> '
		+  '<param name="uiMode" value="full" /> '
		+  '<param name="enabled" value="true" />'
		+  '<param name="fullScreen" value="false" /> '
		+  '<param name="mute" value="false" />'
		+  '<param name="volume" value="100" />'
		+  '<param name="playcount" value="1" />'
		+  '<param name="enableContextMenu" value="true" />'
		+  '<param name="stretchToFit" value="false" />'
		+  '<param name="rate" value="1" />'
		+  '<param name="windowlessVideo" value="false" />'
		+  '<\/object>';
}
else{
	wmpTags =  '<object classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6" '
			+  'standby="Loading Microsoft Windows Media Player components..." '
			+  'width="320" height="181" id="meidawmp"> '
			+  '<embed src="'
			+  address
			+  '" '
			+  'autostart="1" uimode="full" enabled="1" fullscreen="0" mute="0" volume="100" playcount="1" enablecontextmenu="1" '
			+  'stretchtofit="0" rate="1" windowlessvideo="0" samifilename="" captioningid="" ' 
			+  'width="320" height="181"'
			+  ' allowScriptAccess="always" '
			+  'type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/alldownloads.aspx" />'
			+  '<\/object>';
}

document.getElementById("pirates3_wmp").innerHTML = wmpTags;