var SERVER_ADDR = "http://211.95.206.134/XRingPool/";
var objString;

objString = '<OBJECT classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" id=MediaPlayer6 name=MediaPlayer6'
	+ 'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"'
	+ 'standby="Loading Microsoft?Windows?Media Player components..." type="application/x-oleobject"'
	+ 'style="LEFT:0px; TOP:0px; width:0px; height:0px; visibility:hidden" VIEWASTEXT>'
	+ '<PARAM NAME="AutoStart" VALUE="0">'
	+ '<PARAM NAME="PlayCount" VALUE="99">'
	+ '<param name="ShowControls" value="False">'
	+ '<param name="ShowStatusBar" value="False">'
	+ '<embed type="application/x-mplayer2"'
	+ 'pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/"'
	+ 'src="events2.asx" name="MediaPlayer6" width="160" height="120" autostart="0" showcontrols="0">'
	+ '</OBJECT>\n'
	+ '<OBJECT ID="MediaPlayer7" CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'
	+ 'standby="Loading Microsoft Windows Media Player components..."'
	+ 'TYPE="application/x-oleobject" width="200" height="200"'
	+ 'style="LEFT:0px; TOP:0px; width:0px; height:0px; visibility:hidden" VIEWASTEXT>'
	+ '<PARAM NAME="AutoStart" VALUE="false">'
	+ '<PARAM NAME="PlayCount" VALUE="99">'
	+ '<PARAM NAME="uiMode" VALUE="invisible">'
	+ '</OBJECT>';

document.write(objString);

var fHasWMP64 = (MediaPlayer6.FileName != null)
var fHasWMP7 = (MediaPlayer7.URL != null)

if( fHasWMP7 ) WMPVer = MediaPlayer7.versionInfo; // Has 7.0+ (e.g 8.x, 9.x)
else if( fHasWMP64 ) WMPVer = "6.4";
else
   WMPVer="unknown";

//alert('fHasWMP64 ==> ' + fHasWMP64 + '.....fHasWMP7 ==> ' + fHasWMP7);
//alert('WMPVer: ' + WMPVer);
/*
function prelisten(code)
{
	var path = code.substring(0, 4) + '/' + code.charAt(4) + '/' + code.substring(5, 8) + '/' + code.charAt(13) + '/asf/';
	var url = SERVER_ADDR + path + code + '.asf';
        if(WMPVer.charAt(0) == '6'||WMPVer.charAt(0) == '7'||WMPVer.charAt(0) == '8')
	{
		window.MediaPlayer6.Filename = url;

		if(window.MediaPlayer6.ErrorCode != 0)
			alert(window.MediaPlayer6.ErrorDescription);
		else
			window.MediaPlayer6.Play();

	}
	else
	{
			window.MediaPlayer7.URL = url;

		if(MediaPlayer7.error.errorCount != 0)
			alert(MediaPlayer7.error.item(0).errorDescription);
		else
			window.MediaPlayer7.controls.play();
	}
}
*/
function prelisten(code)
{ 
  window.open('prelisten.jsp?id='+code, '', 'left=200,top=200,width=260,height=50,resizable=yes');
}