function detectFlash() {
	if (navigator.plugins && navigator.plugins.length)
	{
		x = navigator.plugins["Shockwave Flash"];
		if (x)
		{
			flashInstalled = 2;
			if (x.description)
			{
				y = x.description;
				flashVersion = y.charAt(y.indexOf('.')-1);
			}
		}
		else
			flashInstalled = 1;
		if (navigator.plugins["Shockwave Flash 2.0"])
		{
			flashInstalled = 2;
			flashVersion = 2;
		}
	}
	else if (navigator.mimeTypes && navigator.mimeTypes.length)
	{
		x = navigator.mimeTypes['application/x-shockwave-flash'];
		if (x && x.enabledPlugin)
			flashInstalled = 2;
		else
			flashInstalled = 1;
	}

	if (useRedirect) {							// if the redirection option is on, load the flash page
		if (flashVersion >= requiredVersion) { 		// user has a new enough version
			window.location.replace(flashPage);	// use replace() so we don't break the back button
		} else {	// user doesn't have a new enough version.
			window.location.replace((flashVersion >= 2) ? upgradePage : noFlashPage);
		}
	}
}

detectFlash();	// call our detector now that it's safely loaded