
function playIt(filename,stretch)
{
	if (MediaPlayer)
	{
		MediaPlayer.URL = filename;
		if (stretch)
		{
			MediaPlayer.stretchToFit = true;
		}
		else
		{
			MediaPlayer.stretchToFit = false;
		}
		MediaPlayer.controls.play();
	}
}

function createPlayer(filename,width,height,volume)
{
	var WMP7;

	if ( navigator.appName != "Netscape" ){
	     WMP7 = new ActiveXObject('WMPlayer.OCX');
	}
	
	// Windows Media Player 7 Code
	if ( WMP7 )
	{
		 // works for windows media player 7, 9, and 10
		 document.write ('<OBJECT ID=MediaPlayer ');
	     document.write (' CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6');
	     document.write (' standby="Loading Microsoft Windows Media Player components..."');
	     document.write (' TYPE="application/x-oleobject" width="' + width + '" height="' + height + '">');
		 if (filename)
		 {
			document.write ('<PARAM NAME="url" VALUE="' + filename + '">');
		 }
	     document.write ('<PARAM NAME="AutoStart" VALUE="true">');
	     document.write ('<PARAM NAME="ShowControls" VALUE="1">');
	     document.write ('<PARAM NAME="uiMode" VALUE="full">');
		 if (volume>0)
		 {
			document.write ('<PARAM NAME="Volume" VALUE="' + volume + '">');
		 }
	     document.write ('</OBJECT>');
	}
	
	// Windows Media Player 6.4 Code
	else
	{
	     //IE Code
	     document.write ('<OBJECT ID=MediaPlayer ');
	     document.write ('CLASSID=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 ');
	     document.write ('CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 ');
	     document.write ('standby="Loading Microsoft Windows Media Player components..." ');
	     document.write ('TYPE="application/x-oleobject" width="' + width + '" height="' + height + '">');
	     if (filename)
		 {
			document.write ('<PARAM NAME="FileName" VALUE="' + filename + '">');
		 }
	     document.write ('<PARAM NAME="AutoStart" VALUE="true">');
	     document.write ('<PARAM NAME="ShowControls" VALUE="1">');
		 if (volume>0)
		 {
			document.write ('<PARAM NAME="Volume" VALUE="' + volume + '">');
		 }

	     //Netscape code
	     document.write ('    <Embed type="application/x-mplayer2"');
	     document.write ('        pluginspage="http://www.microsoft.com/windows/windowsmedia/"');
	     if (filename)
		 {
			document.write ('        filename="' + filename + '"');
		 }
	     document.write ('        src="http://ncnetshow/station1.asx"');
	     document.write ('        Name=MediaPlayer');
	     document.write ('        ShowControls=1');
	     document.write ('        ShowDisplay=1');
	     document.write ('        ShowStatusBar=1');
	     document.write ('        width=' + width);
	     document.write ('        height=' + height + '>');
	     document.write ('    </embed>');
	
	     document.write ('</OBJECT>');
	}
}
