if (typeof(MPlayerPlugin) === 'undefined')
{
	MPlayerPlugin = { };

	MPlayerPlugin.isPluginInstalled = function()
	{
		if (window.ActiveXObject)
		{
			var plugin = false;
			try {
				plugin = new ActiveXObject("CorsairLogic.clplayer");
			} catch (e) {
				return false;
			}
			if (plugin)
				return true;
		}
		else if (navigator.plugins)
		{
			try {
				navigator.plugins.refresh(false);
			} catch (e) {
			}
			if (typeof(navigator.plugins["clplayer"]) != "undefined")
				return true;
			else
				return false;
		}
		return false;
	};
	
	MPlayerPlugin.waitForInstall = function()
	{
		if (MPlayerPlugin.isPluginInstalled())
			MPlayerPlugin.showPopup(false);
		else
			setTimeout(function() { MPlayerPlugin.waitForInstall(); }, 1000);
	};
	
	MPlayerPlugin.showPopup = function(show)
	{
		if (show)
		{
			document.getElementById("mplayer_shadow").style.display = "block";
			document.getElementById("mplayer").style.display = "block";
			
		}
		else
		{
			document.getElementById("mplayer_shadow").style.display = "none";
			document.getElementById("mplayer").style.display = "none";
		}
	};
	
	MPlayerPlugin.injectPlugin = function()
	{
		MPlayerPlugin.showPopup(true);
		MPlayerPlugin.waitForInstall();
	};
}
