﻿
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 124;
// -----------------------------------------------------------------------------

// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);

// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

function RenderSwf(src, width, height, id, bgColor, scriptAccess, flashVars, transparent)
{
    if (transparent == null) { transparent = false; }
    var wMode = (transparent ? "transparent" : "opaque");
    if ( hasProductInstall && !hasRequestedVersion ) {
	    // DO NOT MODIFY THE FOLLOWING FOUR LINES
	    // Location visited after installation is complete if installation is required
        //document.location.href = ROOT_PATH + '/sys/sys_flashinstall.aspx';
        HasFlash(true);
	    
    } else if (hasRequestedVersion) {
	    // if we've detected an acceptable version
	    // embed the Flash Content SWF when all tests are passed
	    AC_FL_RunContent(
			    "src", src,
			    "width", width,
			    "flashVars", flashVars,
			    "height", height,
			    "align", "middle",
			    "id", id,
			    "quality", "high",
			    "bgcolor", bgColor,
			    "name", id,
			    "wmode", wMode, 
			    "allowScriptAccess", scriptAccess,
			    "type", "application/x-shockwave-flash",
			    "pluginspage", "http://www.adobe.com/go/getflashplayer"
	    );
	    HasFlash(true);
      } else {  // flash is too old or we can't detect the plugin
//        var alternateContent = 'Alternate HTML content should be placed here. '
//  	    + 'This content requires the Adobe Flash Player. '
//   	    + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
//        document.write(alternateContent);  // insert non-flash content

      //document.location.href = ROOT_PATH + '/sys/sys_flashinstall.aspx';
      HasFlash(false);
      }
  }

  function HasFlash(hasFlash) {
//      if (hasFlash) {
//          window.document.getElementById('hidHasFlash').value = 'true';
//      }
//      else {
//          window.document.getElementById('hidHasFlash').value = 'false';
//      }
  }