/*******************************************************
FLASH DETECTION ****************************************
*******************************************************/

// 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;");
}


/*******************************************************
********************************************************
************** END OF FLASH DETECT 2.5 *****************
********************************************************
*******************************************************/



//Make sure the Flash version is checked everytime the page is loaded
window.onload=CheckFlash;


function CheckFlash()
{

   //document.getElementById("flashheader").innerHTML="test string";
   //alert("The CheckFlash Function Fired");

	if (flash.ver[7])
	{
	    // if Flash 7.0 or newer is installed, do Flash 7.0 stuff.
	    //alert ("Flash 7 or Newer Detected\nYour Version: " + flash.version)
	    //document.getElementById("flashheader").innerHTML="<div align=center><b><font size=1>You need flash to view this website correctly. Click the Get Flash Player button</font></b><br><a target=_blank href=http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash><img src=flash/alternate.gif border=0></a></div>"
	}
	    else if (flash.installed)
	{
	    // do older Flash stuff
	    //alert ("Flash Version: " + flash.version)
	    document.getElementById("flashheader").innerHTML="<div align=center><b><font size=1>You need flash to view this website correctly. Click the Get Flash Player button</font></b><br><a target=_blank href=http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash><img src=flash/alternate.gif border=0></a></div>"
	}
	    else
	{
	    // Flash is NOT installed.  Do something else.
	    //alert ("Flash not installed!")
	    document.getElementById("flashheader").innerHTML="<div align=center><b><font size=1>You need flash to view this website correctly. Click the Get Flash Player button</font></b><br><a target=_blank href=http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash><img src=flash/alternate.gif border=0></a></div>"
	}

}