// Check if Windows Media Player 7.1 is installed
function getWmp() {

	plugInFound = false
	// activeXFound = false

	// Check for the WMP plugin - Can check only if it's installed
	// Note that only WMP 7.1 takes in account Mozilla Browsers such as N6.1
	plugInFound = getPlugIn("Windows","Media","Player","Plug-in")

	// Revised for SP2
	// This code checks to see if the current browser being used is
	// Internet Explorer running on SP2.
	var g_fIsSP2 = (window.navigator.userAgent.indexOf("SV1") != -1)
	
	// Check if WMP 7 ActiveX is installed
	// Note that CLSID of WMP 6.4 is : 22D6F312-B0F6-11D0-94AB-0080C74C7E95
	if (document.all) {activeXFound = getIEComponent("6BF52A52-394A-11d3-B153-00C04F79FAA6")} else {activeXFound=false}
	
	if (plugInFound || activeXFound || g_fIsSP2) {return true} else {return false}	
}
// Parse plugins collection with strings to find
// User has to pass strings to be found in plugin name and description
// Ex. "Shockwave","Flash","5"
function getPlugIn() {

	
	// search for the right plugin among all those have been installed
	allFound = false
    plugInsCollection = navigator.plugins
	
	for (i=0;i<plugInsCollection.length;i++) {

		// Get plugin description
        plugInDescription = " " + plugInsCollection[i].description
		plugInName = " " + plugInsCollection[i].name

		for (j=0;j<arguments.length;j++) {
		
			if (plugInDescription.indexOf(" " + arguments[j])!=-1 || plugInName.indexOf(" " + arguments[j])!=-1) {
				//document.writeln(arguments[j] + " found !<br/>")
				allFound = true
			} else {
				allFound = false
				break
			}
		}
		
		// Send back the search result
		if (allFound) {return true}
    }

	// Send back the search result
	return false
}

// Use the Client Capabilities behavior to check IE component installation
function getIEComponent(activeXClsId) {
	return oClientCaps.isComponentInstalled("{" + activeXClsId + "}","componentId")
}
