var flashInstalled = null;
var flashVersion = 0;
MSDetect = false;

// Alternate Browser detection
try {
	if (navigator.plugins && navigator.plugins.length) {
		x = navigator.plugins["Shockwave Flash"];
		if (x) {
			flashInstalled = true;
			if (x.description) {
				y = x.description;
				flashVersion = y.charAt(y.indexOf('.')-1);
			}
		}
		else
			flashInstalled = false;
			
		if (navigator.plugins["Shockwave Flash 2.0"]) {
			flashInstalled = true;
			flashVersion = 2;
		}
	}
	else if (navigator.mimeTypes && navigator.mimeTypes.length) {
		x = navigator.mimeTypes['application/x-shockwave-flash'];
		if (x && x.enabledPlugin)
			flashInstalled = true;
		else
			flashInstalled = false;
	}
	else
		MSDetect = true;		
}
catch(e) {
	throw e;
}

// IE Detection
if (MSDetect) {
	for(var i=0; i<7; i++) {
		flashVersion = 0;
		try {
			var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
			flashVersion = i;															
		}
		catch(e) {																	
		}
	}
	if (flashVersion != 0)
		flashInstalled = true;
	else
		flashInstalled = false;
}		