
var WMPVer = "unknown"; 
var fHasWMP = false;          // True if either WMP v6.4 or v7+ found
var fHasWMP64 = false;        // True if WMP v6.4 found
var fHasWMP7 = false;         // True if WMP v7+ (8, 9, 10) found

if (bd.is_win && bd.activex) {
	//document.writeln("<"+"div style='visibility:hidden'>");
	document.writeln("<OB"+"JECT classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95  codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715\" height=1 id=WMP64 width=1 VIEWASTEXT"+"><"+"/"+"OBJECT"+">");
	document.writeln("<OB"+"JECT classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6  codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=7,0,0,1954\" height=1 id=WMP7 width=1 VIEWASTEXT"+"><"+"/"+"OBJECT"+">");
	//document.writeln("<"+"/div>");
	
	if (bd.is_ie) {
		document.writeln("<SCR"+"IPT language=\"VBScript\">");
		document.writeln("<"+"!--");
		document.writeln("fHasWMP64=false");
		document.writeln("fHasWMP7=false");
		document.writeln("	On error resume next");
		document.writeln("	fHasWMP64 = (WMP64.FileName=\"\")  ' WMP64 was create above via OBJECT tag else this returns False.");
		document.writeln("	fHasWMP7 = (WMP7.URL = \"\")       ' WMP7 was create above via OBJECT tag else this returns False. "); 
		document.writeln("//--"+">");
		document.writeln("<"+"/SCR"+"IPT>");
	} else {	// gecko trickery
//		alert('aq')
		document.writeln("<SCR"+"IPT language=\"JavaScript\" type=\"text/javascript\">");
		document.writeln("try { var u = findElement(\"WMP7\").URL; fHasWMP7 = true;");
		document.writeln("} catch (e) { fHasWMP7 = false; }");
		document.writeln("if (!fHasWMP7) {");
		document.writeln("try { var u = findElement(\"WMP64\").FileName; fHasWMP64 = true;");
		document.writeln("} catch (e) { fHasWMP64 = false; } }");
		document.writeln("//-"+"->");
		document.writeln("<"+"/SCR"+"IPT>");
	}
	document.writeln("<SCR"+"IPT language=\"JavaScript\" type=\"text/javascript\">");
	document.writeln("<"+"!--");
	document.writeln("	var fHasWMP=true;   // Will set to false below if not found");
	document.writeln("");
	document.writeln("	if( typeof fHasWMP7 != \"undefined\" && fHasWMP7 ) WMPVer=findElement(\"WMP7\").versionInfo; // Has 7.0+ (e.g 8.x, 9.x)");
	document.writeln("	else if( typeof fHasWMP64 != \"undefined\" && fHasWMP64 ) WMPVer=\"6.4\";");
	document.writeln("	else {");
	document.writeln("	   WMPVer=\"unknown\";");
	document.writeln("	   fHasWMP=false;");
	document.writeln("	} ");  
	//document.writeln("alert(fHasWMP64);");
	document.writeln("//-"+"->");
	document.writeln("<"+"/SCR"+"IPT>");
}