/*********************************************************************
AwWP-04 Detector
	Authorware Web Player 2004 Detection script
	detect presence of the authorware web player version 2004
	author: andrew lucking 2004-12-20
	use / modify freely
	
isAwWebPlayer2004() returns true if the Authorware Web Player 2004 is detected
*********************************************************************/
function isAwWebPlayer2004(){
	var aw_web_player = false;
	if (navigator.plugins && navigator.plugins.length){ // plugins (netscape)
		var plugin_count = navigator.plugins.length;
		for (i = 0; i < plugin_count; i++) {
			if (navigator.plugins[i].name == "Authorware Web Player"){ // authorware plugin detected
				if (navigator.plugins[i].description == "Macromedia Authorware Web Player Netscape plug-in, version 2004 "){ // detect 2004 version of plugin
					aw_web_player = true;
				}
				break;
			}
		}
	} else { // activex (IE)
		try {
			var ax = new ActiveXObject("Macromedia.AuthorwareShockwaveControl.1"); // create ax object
			if (typeof(ax) == "object"){
				// wp object was created
				/* hack alert
					the 2004 web player added a few methods to the activex control
					so to determine if 'ax' is an instance of the 2004 player we
					check to see if one of those methods is a member of the object. */
				if ( typeof(ax.GetVariable) != "undefined" ){
					aw_web_player = true; // GetVariable method is available so this is v.2004
				}
			}
		}
		catch (e) {
	       	//
		}
	}
	return aw_web_player;
}
