function openFlashFile(flashPopUp) {
	detectFlashPlayer(flashPopUp);
}

function detectFlashPlayer(flashPopUp) {
	
		// This script will test up to the following version.
		flash_versions = 20;

		// Initialize variables and arrays
		var flash = new Object();
		flash.installed = false;
		flash.version='0.0';

		// Dig through Netscape-compatible plug-ins first.
		if (navigator.plugins && navigator.plugins.length) {
			for (x=0; x < navigator.plugins.length; x++) {
				if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
					flash.version = navigator.plugins[x].description.split('Shockwave Flash ')[1];
					flash.installed = true;
					break;
				}
			}
		}

		// Then, dig through ActiveX-style plug-ins afterwords
		else if (window.ActiveXObject) {
			for (x = 2; x <= flash_versions; x++) {
				try {
					oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
					if(oFlash) {
						flash.installed = true;
						flash.version = x + '.0';
					}
				}
				catch(e) {}
			}
		}

		// Create sniffing variables in the following style: flash.ver[x]
		// Modified by mjac
		flash.ver = Array();
		for(i = 4; i <= flash_versions; i++) {
			eval("flash.ver[" + i + "] = (flash.installed && parseInt(flash.version) >= " + i + ") ? true : false;");
		}
		
		//if (flash.ver[6])
		//{
		//	// if Flash 6.0 or newer is installed, do Flash 6.0 stuff.
		//}
		//else if (flash.installed)
		if (flash.installed || navigator.appName == 'Microsoft Internet Explorer')
		{
			// Flash is installed or Browser is IE (IE will prompt for download using CodeBase tag in Flash Object)
			openFlashPopUpWindow(flashPopUp);
		}
		else
		{
			// Flash is NOT installed.  
			pleaseDownloadFlashPlayer();
		}

	}	

	function openFlashPopUpWindow(flashPopUp) {
	
		// center the popup on the user's screen
		var PopUpWidth  = 600;
		var PopUpHeight = 350;
		var flashURL = '';
		
		var availWidth = screen.availWidth;
		var availHeight = screen.availHeight;
			
		var destX = (availWidth - PopUpWidth)/2	
		var destY = (availHeight - PopUpHeight)/2
		
		var strParameterList = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=' + PopUpWidth + ',height=' + PopUpHeight + ',screenX=' + destX + ',screenY=' + destY + ',left=' + destX + ',top=' + destY;
		
		switch(flashPopUp)
			{
			case 'NexProfilerToolFeatures':
				flashURL = '/Images/FlashDemo/NexProfilerTool/Flash_NexProfilerIntro.asp';
			default:
				flashURL = '/Images/FlashDemo/NexProfilerTool/Flash_NexProfilerIntro.asp';
			}
		
		var obj_popupwindow = window.open(flashURL, 'PopUpFlashWindow',strParameterList);
		obj_popupwindow.focus(); 
	}	
	
	function pleaseDownloadFlashPlayer() {
	
		alert('Your browser does not have the Flash player software installed necessary to view this demo.  You will now be redirected to the Flash player download page. Once installed please load this page again.');
		window.location.replace = "http://www.macromedia.com/go/getflashplayer";
	}