function writePlayer(fileName, width, height)
{
	var agent = navigator.userAgent.toLowerCase();
	var firefox = agent.indexOf("firefox") >= 0;
	var chrome = agent.indexOf("chrome") >= 0;
	var mac = agent.indexOf("macintosh") >= 0;
	var width = width == undefined ? 320 : width;
	var height = height == undefined ? 64 : height;

	if(mac)
		height = 64;

	if(firefox || chrome)
		document.write("<object id=\"MediaPlayer\" type=\"application/x-ms-wmp\" width=\"" + width + "\" height=\"" + height + "\">");
	else
		document.write("<object id=\"MediaPlayer\" classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" width=\"" + width + "\" height=\"" + height + "\">");
		
	document.write("<param name=\"autoStart\" value=\"true\">");
	document.write("<param name=\"volume\" value=\"100\">");
	document.write("<param name=\"url\" value=\"" + fileName + "\">");
	document.write("<param name=\"uiMode\" value=\"full\">");
	document.write("<param name=\"invokeURLs\" value=\"false\">");
	//document.write("<embed type=\"application/x-mplayer2\" id=\"MediaPlayer\" name=\"MediaPlayer\" pluginspage=\"http://www.microsoft.com/windows/mediaplayer/en/default.asp\" volume=\"100\" autoStart=\"true\" uiMode=\"full\" src=\"" + fileName + "\" width=\"" + width + "\" height=\"" + height + "\" invokeURLs=\"false\"></embed>");
	document.write("</object>");
	
	initializePlayer();
}

function initializePlayer()
{
	document.getElementById("MediaPlayer").settings.invokeURLs = false;
}
