
/*
 * Detects whether the user's Web browser has the Flash plug-in or ActiveX control installed, and if so, what version
 * The Initial Developer of the Original Code is Leon S. Koshelev <leon_koshelev@yahoo.com>
 * Contributor(s): 
 * Version 0.020_02 (alpha) 20.04.2002
 * Visit http://www.web-master.spb.ru/free_lib/ for the latest version of this software.
 * Copyright (c) 2001 Leon S. Koshelev, Web-Master Co., Saint-Petersburg, Russia. All Rights Reserved.
 * This library is opensource software and distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
 * Permission to use, copy, modify, and distribute this software for any purposes and without fee is hereby granted provided that this copyright notice appears in all copies.
 */

//-----------------------------------------------------------------------

// This script will work in Navigator 3+, Explorer 4+, Opera 5+.

var FlashPlayer=new Object();

if (isNS3||isNS4)
{
	if (navigator.mimeTypes.length > 0)
	{
		plugin=navigator.mimeTypes["application/x-shockwave-flash"];
		if (plugin) {
			with(plugin.enabledPlugin) {
				FlashPlayer.MajorVersion=parseInt(description.substr(name.length));
			}
		}
	}
}

if (isOB)
{
	if (navigator.plugins.length > 0)
	{
		plugin=navigator.plugins["Shockwave Flash"];
		if (plugin) {
			FlashPlayer.MajorVersion=parseInt(plugin.description.substr(plugin.name.length));
		}
	}
}

if (isIE)
{
	var VBScript=0;

	with(document)
	{
		writeln('<Script Language="VBScript">');
		writeln('VBScript=1');
		writeln('Function MM_FlashPlayerMajorVersion()');
		writeln('	On Error Resume Next');
		writeln('	For i = 6 To 1 Step -1');
		writeln('		b = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))');
		writeln('		If b Then Exit For');
		writeln('	Next');
		writeln('	MM_FlashPlayerMajorVersion=CStr(i)');
		writeln('End Function');
		writeln('</Scr'+'ipt>');
	}

	if (VBScript>0)
	{
		FlashPlayer.MajorVersion=MM_FlashPlayerMajorVersion();
	}
}
