function EmbedPlayer(frameId, isChapter)
{
	document.write('<EMBED TYPE=application/x-mplayer2 ');
	document.write('NAME=WMVPlayer ');
	document.write('Id=WMVPlayer ');
	document.write('PluginsPage=http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/ ');

	// Get url and replace %20 with spaces
	var url = new String(document.URL);
	url = url.replace(/%20/g,' ');

	// Replace Frame_<num>.htm with the PlayList name
	var frameName;
	if (isChapter == true)
	{
		frameName = new RegExp('Chapter_Frame_' + frameId + '.htm');
	}
	else
	{
		frameName = new RegExp('Frame_' + frameId + '.htm');
	}

	var playListName;
	if (isChapter == true)
	{
		playListName = 'Chapter_PlayList_' + frameId + '.wvx';
	}
	else
	{
		playListName = 'PlayList_' + frameId + '.wvx';
	}
	url = url.replace(frameName, playListName);

	document.write('FILENAME="' + url + '" ');
	document.write('BaseUrl="" ');
	document.write('DEFAULTFRAME=FrameMacEvents ');
	document.write('WIDTH=100% ');
	document.write('HEIGHT=100% ');
	document.write('CURRENTPOSITION=0 ');
	document.write('InvokeURLS=1 ');
	document.write('SHOWSTATUSBAR=1 ');
	document.write('SHOWDISPLAY=0 ');
	document.write('SHOWGOTOBAR=0 ');
	document.write('ShowControls=1 ');
	document.write('ShowTracker=1 ');
	document.write('EnableTracker=1 ');
	document.write('EnablePositionControls=1 ');
	document.write('ShowPositionControls=0 ');
	document.write('AutoStart=1 ');
	document.write('AutoSize=0 ');
	document.write('DisplayMode=4 ');
	document.write('>');
}
