var WMP7 = false;
var pStr = "";
var playerWidth = 420;
var playerHeight = 236;

//if (!IE) setVideoState(true)
if (videoURL!='-1'){
	//document.write ("<p>"+videoURL +"</p>")
	//var videoURL = "http://www.tv2regionerne.dk/video.asp?r=8&amp;Id=240048"
	if ( !NS && !opera){
		try{
			WMP7 = new ActiveXObject('WMPlayer.OCX');
		}catch(e){
			WMP7 = false;
		}
	}
	// Windows Media Player 7 Code
	
	if ( WMP7 ){
			//window.status = 'Windows Media Player 7 Code';
			pStr += '<OBJECT ID=regPlayer10 ';
			pStr += ' CLASSID=CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6';
			pStr += ' standby="Loading Microsoft Windows Media Player components..."';
			pStr += ' TYPE="application/x-oleobject" width="' + playerWidth + '" height="' + playerHeight + '">';
			pStr += '<PARAM NAME="url" VALUE="'+ videoURL +'">';
			pStr += '<PARAM NAME="AutoStart" VALUE="true">';
			pStr += '<PARAM NAME="ShowControls" VALUE="0">';
			pStr += '<PARAM NAME="stretchToFit" VALUE="1">';
			pStr += '<PARAM NAME="uiMode" VALUE="none">';
			pStr += '<PARAM NAME="backgroundColor" VALUE="white">';
			pStr += '</OBJECT>';
	}else{
			
			// Windows Media Player 6.4 Code
			//IE Code
			//window.status = 'Windows Media Player 6.4 Code (Netscape)';
			pStr += '<OBJECT ID=regPlayer10 ';
			pStr += 'CLASSID=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95 ';
			pStr += 'CODEBASE=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 ';
			pStr += 'standby="Loading Microsoft Windows Media Player components..." ';
			pStr += 'TYPE="application/x-oleobject" width="' + playerWidth + '" height="' + playerHeight + '">';
			pStr += '<PARAM NAME="FileName" VALUE="'+ videoURL +'">';
			pStr += '<PARAM NAME="AutoStart" VALUE="true">';
			pStr += '<PARAM NAME="ShowControls" VALUE="0">';
			pStr += '<PARAM NAME="stretchToFit" VALUE="1">';
			//Netscape code
			pStr += ' <Embed';
			pStr += ' pluginspage="http://www.microsoft.com/windows/windowsmedia/"';
			pStr += ' src="'+ videoURL +'"';
			pStr += ' name=regPlayer10';
			pStr += ' ID=regPlayer10';
			pStr += ' showcontrols=1';
			//pStr += ' SendOpenStateChangeEvents=1';
			pStr += ' SendErrorEvents=0';
			pStr += ' stretchToFit=1';
			pStr += ' width='+ playerWidth;
			pStr += ' height='+ playerHeight;
			pStr += '>';
			pStr += '</OBJECT>';
		
	}
	document.write (pStr);
	
}
