MVIDetection = function() { } 

MVIDetection.Initialize = function()
{	
	var agnt = navigator.userAgent.toLowerCase();
	
	var isWindows = ((agnt.indexOf("win") != -1) || (agnt.indexOf("32bit") != -1));;
	var isIe = (agnt.indexOf("msie") != -1);
	var isMos = (navigator.appName.indexOf("Netscape") != -1);
	
	if (!isWindows || isMos)
	{
		var mvi_tm = '';
		for (var i=0; i < navigator.mimeTypes.length; i++)
			mvi_tm += navigator.mimeTypes[i].type.toLowerCase();
		
		MVIDetection["application/x-director"] = MVIDetection.VBScriptDetect("application/x-director", mvi_tm);
		MVIDetection["application/x-shockwave-flash"] = MVIDetection.VBScriptDetect("application/x-shockwave-flash", mvi_tm);
		MVIDetection["video/quicktime"] = MVIDetection.VBScriptDetect("video/quicktime", mvi_tm);
		MVIDetection["audio/x-pn-realaudio-plugin"] = MVIDetection.VBScriptDetect("audio/x-pn-realaudio-plugin", mvi_tm);
		MVIDetection["application/x-mplayer2"] = MVIDetection.VBScriptDetect("application/x-mplayer2", mvi_tm);
	}
	else if (isWindows && isIe)
	{
		MVIDetection["SWCtl.SWCtl.1"] = MVIDetection.VBScriptDetect("SWCtl.SWCtl.1");
		MVIDetection["ShockwaveFlash.ShockwaveFlash.1"] = MVIDetection.VBScriptDetect("ShockwaveFlash.ShockwaveFlash.1");
		MVIDetection["Quicktime.Quicktime"] = MVIDetection.VBScriptDetect("Quicktime.Quicktime");
		MVIDetection["rmocx.RealPlayer G2 Control.1"] = MVIDetection.VBScriptDetect("rmocx.RealPlayer G2 Control.1");
		MVIDetection["wmplayer.ocx"] = MVIDetection.VBScriptDetect("wmplayer.ocx");
	}
}

MVIDetection.MozillaDetect = function(pluginName, pTypes)
{
	if (pTypes.indexOf(pluginName) != -1 && (navigator.mimeTypes[pluginName].enabledPlugin != null))
		return '1';
	return '0';
}

MVIDetection.VBScriptDetect = function(pluginName)
{
	mvi_find = false;
	document.write('<SCR' + 'IPT LANGUAGE=VBScript>\n on error resume next \n mvi_find = IsObject(CreateObject("' + pluginName + '")) </SCR' + 'IPT>\n');
	if (mvi_find) return '1';
	return '0';
}

MVIDetection.Initialize();
