function detectFlash() {  
  if (navigator.plugins) {
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
      var flashVersion = parseInt(flashDescription.substring(16));
      flash2Installed = flashVersion == 2;    
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion == 7;
      flash8Installed = flashVersion == 8;
      flash9Installed = flashVersion >= 9;
    }
  }
  for (var i = 2; i <= maxVersion; i++) {  
    if (eval("flash" + i + "Installed") == true) actualVersion = i;
  }
  if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 4;  
  if (actualVersion >= requiredVersion) {
    if (useRedirect) {
      if(jsVersion > 1.0) {
        window.location.replace(flashPage);  
      } else {
        window.location = flashPage;
      }
    }
    hasRightVersion = true;                
  } else {  
    if (useRedirect) {
      if(jsVersion > 1.0) {
        window.location.replace((actualVersion >= 2) ? upgradePage : noFlashPage);
      } else {
        window.location = (actualVersion >= 2) ? upgradePage : noFlashPage;
      }
    }
  }
 
  if(!hasRightVersion || (is_mac && is_opera)) {	
	  	// Adds a static picture to the web site - allways add the static for opera on a mac, opera has issues with layering content over flash objects
		document.write('<style type="text/css" media="screen">div#frame {height:152px;padding:23px 24px 0 0;background-image: url('+myURL+'images/layout/header/frame.gif);}h2 {display:block;background-image:url('+myURL+'flash/3dAnims/'+my3dAnim+'.jpg);}</style>'); 
  } else {
	  	// Add the container for the Flash banner if we have the correct version of flash
	  	document.write('<style type="text/css" media="screen">div#frame {height:175px;}h2 {display:none;}</style>'); 
  }
}
detectFlash();