// add the extension translations
PluginObject.Util.ExtensionTranslation.WindowsMediaPlayer = ['wmv', 'wma', 'wvx', 'wax', 'asf', 'asx'];
PluginObject.Util.AliasTranslation.WindowsMediaPlayer = ['wmp', 'mediaplayer', 'windowsmedia', 'windowsmediaplayer', 'windowsmp'];

PluginObject.Plugins.WindowsMediaPlayer = function()
{
};

PluginObject.Plugins.WindowsMediaPlayer.prototype = {
	
	options:{
		upgrade_url			: 'http://www.microsoft.com/windows/windowsmedia/download/AllDownloads.aspx',
		_class_id			: 'clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6',
		_type				: 'application/x-mplayer2'
	},
	
	_initiate: function(constructor, src, options)
	{
//		merge the default options with the plugin defaults
		PluginObject.Util.mergeObjects(constructor.options, this.options || {});
		
		constructor.installed = this._getPlayerVersion(constructor);
		if(options.bgcolor) 
		{ 
			constructor.addParam('bgcolor', options.bgcolor); 
		}
	},
	
	_getPlayerVersion: function(constructor)
	{
		var PlayerVersion = false;
		if(navigator.mimeTypes && navigator.mimeTypes["application/x-mplayer2"] && navigator.mimeTypes["application/x-mplayer2"].enabledPlugin)
		{
			PlayerVersion = true;
		}
		else
		{
			execScript('on error resume next: mpObj = IsObject(CreateObject("MediaPlayer.MediaPlayer.1"))','VBScript');
			PlayerVersion = mpObj;
		}
		return PlayerVersion;
	},
	
	_detect: function(constructor)
	{
		return (constructor.installed)
	}
	
};