
	var requiredVersion = 5;
	var useRedirect = false;
	var flash2Installed = false;    // boolean. true if flash 2 is installed
	var flash3Installed = false;    // boolean. true if flash 3 is installed
	var flash4Installed = false;    // boolean. true if flash 4 is installed
	var flash5Installed = false;    // boolean. true if flash 5 is installed
	var flash6Installed = false;    // boolean. true if flash 6 is installed
	var flash7Installed = false;    // boolean. true if flash 7 is installed
	var flash8Installed = false;    // boolean. true if flash 8 is installed
	var flash9Installed = false;    // boolean. true if flash 9 is installed
	var flash10Installed = false;    // boolean. true if flash 10 is installed
	var flash11Installed = false;    // boolean. true if flash 11 is installed
	var flash12Installed = false;    // boolean. true if flash 12 is installed
	var maxVersion = 12;             // highest version we can actually detect
	var actualVersion = 0;          // version the user really has
	var hasRightVersion = false;    // boolean. true if it's safe to embed the flash movie in the page
	var jsVersion = 1.0;            // the version of javascript supported

	// Check the browser...we're looking for ie/win
	var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    // true if we're on ie
	var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // true if we're on windows
	
	// This is a js1.1 code block, so make note that js1.1 is supported.
	jsVersion = 1.1;
	
	// Write vbscript detection on ie win. IE on Windows doesn't support regular
	// JavaScript plugins array detection.
	if(isIE && isWin){
	  document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	  document.write('on error resume next \n');
	  document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
	  document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
	  document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
	  document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
	  document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
	  document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');  
	  document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');  
	  document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');  
	  document.write('flash10Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n');  
	  document.write('flash11Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.11"))) \n');  
	  document.write('flash12Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.12"))) \n');  
	  document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
	}


function flashDespatch(strRedirectPage, flashParametersObj, requiredVersion) {  
	
  if (navigator.plugins) {
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {
      // Some version of Flash was found. Time to figure out which.
      // Set convenient references to flash 2 and the plugin description.
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      // DEBUGGING: uncomment next line to see the actual description.
      // alert("Flash plugin description: " + flashDescription);
      
      // var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1)); -- old code, worked up until Flash 10	  
	  var flashVersion = parseInt(flashDescription.split(".")[0].split(" ")[2]); // will work indefinitely
	  
      flash2Installed = flashVersion == 2;    
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion == 7;
      flash8Installed = flashVersion == 8;
      flash9Installed = flashVersion == 9;
      flash10Installed = flashVersion == 10;
      flash11Installed = flashVersion == 11;
      flash12Installed = flashVersion >= 12;
    }
  }
  
  // set actualVersion to highest detected version.
  for (var i = 2; i <= maxVersion; i++) {  
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }//end for

  // webTV  
  if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 3;  

  // create the redirect overide query string
  var strRedirectQueryString = ""
  if (blnOveride == true){
	strRedirectQueryString = "?Overide=1"
  }//endif


  
  // DEBUGGING: uncomment next line to display flash version
  //alert("version detected: " + actualVersion);



// act on our results
	if (actualVersion >= requiredVersion || blnForceFlash == true) {
		hasRightVersion = true;
		// add future MX content redirection here
		drawFlash(flashParametersObj)
	} else {
		if(jsVersion > 1.0) {
	        //window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
			window.location.replace(strRedirectPage + strRedirectQueryString)
      	} else {
			//window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
			window.location = strRedirectPage + strRedirectQueryString
		}
	}
}









function drawFlash(flashParametersObj) {
	// added flashVars to embed output 10/8/06
	
	//alert("running DrawFlash")
	
	// set default parameters
	strName = "mainMovie"
	strFileName = "flashCrossroads.swf"
	strQueryString = "?ie=" + isIE
	strWidth = 760
	strHeight = 750
	strBGcolor = false
	strFlashVars = ""


	//overwrite default paramters with any variables in the flashParametersObj argument
	var strParameters = ""
	for (var i in flashParametersObj){
		strParameters += i + "="+flashParametersObj[i]+"\n"
		this[i] = flashParametersObj[i]
	}//end for
	//alert(strParameters)

	if (flashParametersObj.strContentPath != undefined) strQueryString += "&homepage=" + flashParametersObj.strContentPath
	
	
	strOutput = '<object '
	strOutput+= '  classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '
	strOutput+= '  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" '
	strOutput+= '  width='+ strWidth +' '
	strOutput+= '  height='+ strHeight +' '
	strOutput+= '  name="' + strName +'" '
	strOutput+= '  id="' + strName +'"'
	strOutput+= '>'
	
	strOutput+= '<param name=movie value="' + strFileName + strQueryString +'">'
	strOutput+= '<param name=menu value=false>'
	strOutput+= '<param name=quality value=high>'
	strOutput+= '<param name="salign" value="T">'
	if (strBGcolor != false) { strOutput+= '<param name="bgcolor" value="' + strBGcolor + '">' }
	if (strFlashVars != false) { strOutput+= '<param name="flashVars" value="' + strFlashVars + '">' }

	
	strOutput+= '<embed '
	strOutput+= '	src="' + strFileName + strQueryString + "&" + strFlashVars +'" '
	strOutput+= '	menu=false '
	strOutput+= '	quality=high  '
	strOutput+= '	width='+ strWidth +' '
	strOutput+= '	height='+ strHeight +' '
	strOutput+= '	SWLIVECONNECT=true '
	strOutput+= '	name=' + strName +' '
	strOutput+= '   id="' + strName +'"'
	strOutput+= '	salign="T"'
	if (strBGcolor != false) { strOutput+= '	bgcolor=' + strBGcolor + ' '}
	strOutput+= '>'
	strOutput+= '</embed> '
	
	strOutput+= '</object>'



	// what to do now
	document.write(strOutput)
	//alert(strOutput)




}//drawFlash


