/* =========================================================================

JavaScript Source File -- Created with SAPIEN Technologies PrimalSCRIPT (TM)

NAME: flashdetect.js

AUTHOR: m , m
DATE  : 28/03/2002

COMMENT: detect if flash lpayer is installed

============================================================================ */
var version;

function FlashPlayerDetect()
{
	if (navigator.plugins && navigator.plugins.length)
	{
		x = navigator.plugins["Shockwave Flash"];
		if (x)
		{
			this.installed = true;
			if (x.description)
			{
				y = x.description;
				this.version = y.charAt(y.indexOf('.')-1);
			}
		}
	
		if (navigator.plugins["Shockwave Flash 2.0"])
		{
			this.installed = true;
			this.version = 2;
		}
	}
	else if (navigator.mimeTypes && navigator.mimeTypes.length)
	{
		x = navigator.mimeTypes['application/x-shockwave-flash'];
		if (x && x.enabledPlugin)
			this.installed = true;
	}
	else if (FlashisActiveX(version) ){
		/*
		for(var i=6;i>0;--i) {
			try {
				var player = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
				this.installed = true;
				this.version = i;
				this.implementation = "activex";
				break;
			}	
			catch(e) {
				
			}
		}
		*/
	
		this.installed = true;
		this.version = version;
		this.implementation = "activex";
	}
}


function FlashPlayer() 
{
	this.installed = false;	
	this.version = 0;
	this.implementation = "plugin";
	
	this.detect = FlashPlayerDetect;
	
	return this;
}

