var FLASH_INSTALLED = 2;
var flashinstalled = 0;
var flashversion = 0;

MSDetect = "false";
if (navigator.plugins && navigator.plugins.length) {
	x = navigator.plugins["Shockwave Flash"];
	if (x) {
		flashinstalled = FLASH_INSTALLED;
		if (x.description) {
			y = x.description;
			flashversion = y.charAt(y.indexOf('.')-1);
		}
	}	else {
		flashinstalled = 1;
  }
	if (navigator.plugins["Shockwave Flash 2.0"])	{
		flashinstalled = FLASH_INSTALLED;
		flashversion = 2;
	}
} else if (navigator.mimeTypes && navigator.mimeTypes.length) {
	x = navigator.mimeTypes['application/x-shockwave-flash'];
	if (x && x.enabledPlugin) {
		flashinstalled = FLASH_INSTALLED;
  } else {
		flashinstalled = 1;
  }
} else {
	MSDetect = "true";
}

// IE flash detection.
if (IE) {
	for(var i=7; i>0; i--){
		flashversion = 0;
    flashinstalled = 0;
		try{
			var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
			flashversion = i;
      flashinstalled = FLASH_INSTALLED;
			break;
      //return;
		}
		catch(e){
      flashinstalled = 1;
		}
	}
}
