
function gf_determine_FLASHv ( argi_FLASHv_goal ) // called from HTML; 
  { 
    
	if ( argi_FLASHv_goal == undefined )
      { 
	    alert("gf_determine_FLASHv , PROBLEM !!!!!!!!  no   argi_FLASHv_goal  provided");
	  } ;
	  
	
	//gf_handle_message_appending( ";;;;;FLASH DETECTION BEGIN ... "  ) ;
	//gf_ri( "detect_flash_version.js , gf_determine_FLASHv " ) ;
	
	var lvi_version = gf_call_JS_FLASHv_checkers( argi_FLASHv_goal ) ;
	
	return lvi_version ;
  } ;

//----------------------------------------------------------------
function gf_call_JS_FLASHv_checkers( argi_FLASHv_goal )
  { var lvi_version = -1 ;
    
    lvi_version_A = gf_JS_check_FLASHv_IE ( argi_FLASHv_goal ) ; // hopefully it is 8.5++
	//gf_handle_message_appending( "method_A : " + lvi_version_A  ) ;
	gf_ri( "detect_flash_version.js , gf_call_JS_FLASHv_checkers , version_A : " + lvi_version_A  ) ;
			
	lvi_version_B = gf_JS_check_FLASHv_NS ( )  ; // hopefully it is 8.5++
	//gf_handle_message_appending( "method_B : " + lvi_version_B  ) ;
	gf_ri( "detect_flash_version.js , gf_call_JS_FLASHv_checkers , version_B : " + lvi_version_B  ) ;
		
	var lvi_max = 	Math.max( lvi_version , Math.max( lvi_version_A , lvi_version_B ) ) ;
	//alert ("max : " + lvi_max ) ;	
	return lvi_max ;
  }
  
//----------------------------------------------------------------
 
//-------------------------------------------------------------------------------------------
function gf_JS_check_FLASHv_IE ( argi_FLASHv_goal )
  {	var isInstalled = false ;
	var lvi_version = -1    ;
	
	if ( window.ActiveXObject ) 
	  { //gf_ri( "detect_flash_version.js , gf_JS_check_FLASHv_IE , ActiveXObject : " + window.ActiveXObject ) ;
	    var lvo_control = null;
   		
		for ( var lvi_i = argi_FLASHv_goal  ;  lvi_i > 0 ;  lvi_i-- )
		  { //gf_ri( "detect_flash_version.js , gf_JS_check_FLASHv_IE , version : " + lvi_i ) ;
		    try // NOT WORKING ON IE8 ???????????
		      { lvo_control = new ActiveXObject( 'ShockwaveFlash.ShockwaveFlash.' + lvi_i  );
			    //gf_ri( "detect_flash_version.js , gf_JS_check_FLASHv_IE , control : " + lvo_control ) ;
				break ;
   		      } 
		    catch ( e ) 
		      { //return;
   		      }
		  } ;
		  
		if ( lvo_control ) 
		  { var lvs_version = lvo_control.GetVariable( '$version' ).substring( 4 )                    ;
		    //gf_ri( "detect_flash_version.js , gf_JS_check_FLASHv_IE , lvs_version : " + lvs_version ) ;
    		
			var lva_version = lvs_version.split( ',' )                                                ;
			//gf_ri( "detect_flash_version.js , gf_JS_check_FLASHv_IE , lva_version : " + lva_version ) ;
    		
			lvi_version     = parseFloat( lva_version[ 0 ] + '.' + lva_version[ 1 ] )                 ;
   		  }
      } 
    else 
      { 
      }
	
	//alert ( "gf_JS_check_FLASHv_IE , lvi_version : " + lvi_version + " ; lvs_version : " + lvs_version );
	return lvi_version ;
  } ;

//-----------------------------------------------------------------------------------
//check for Flash Player X 
//check the navigator.plugins array exists, IE for Windows will fail on this. 
function gf_JS_check_FLASHv_NS()
  { var lvs_version = ""  ;
	var lvi_version = -1  ;
	
	if(  navigator.plugins  &&   navigator.plugins.length > 0  )
      { var lva_plugins = navigator.plugins  ;
	    var lvi_length  = lva_plugins.length ;
        for ( var lvi_i = 0 ; lvi_i < lvi_length ; lvi_i++ ) //loop through all the plugins installed  
          { var lvs_plugin    = lva_plugins[ lvi_i ];
            var lvn           = lvs_plugin.name;
            var lvs_desc_temp = lvs_plugin.description;
            //alert("lvs_plugin.description : " + lvs_plugin.description );
		
		    var lva_plugin_props = lvs_desc_temp.split(" "); 
            //             Shockwave Flash 10.0 r32		    
			//          [0]Shockwave [1]Flash [2]10.0 [3]r32
			if (  lva_plugin_props[ 0 ] == "Shockwave"   &&   lva_plugin_props[1] == "Flash"  ) 
              { //alert("lvs_plugin.description : " + lvs_plugin.description );
			  //some version of Flash Player was found
		        var lvs_version      = lva_plugin_props[ 2 ]     ;
			    var lvi_version_temp = parseFloat( lvs_version ) ;
                // need to break this loop as some browsers may have two versions installed 
                //  eg my Firebird release has r65 and r79 installed! 
			    if ( lvi_version_temp > lvi_version )
			      { lvi_version = lvi_version_temp ;
			        lvs_desc    = lvs_desc_temp    ;
			      } ;
                //break; 
              } ;
          } ;
      } ;
	  
	//alert ( "gf_JS_check_FLASHv_NS , lvi_version : " + lvi_version + " ; lvs_desc : " + lvs_desc  );
	return lvi_version ;
  } ;

//-------------------------------------------------------------------------------------------


//-------------------------------------------------------------------------------------------

/*   VBscript REFERENCE


''  ***; this is for IE 5, 5.5, 6 ; VBScript searches ActiveX components installed
''  all non-*** ignore the VBScript
''heck for Flash Player X      
''script for IE on Win32 systems 
	   
         
Function gf_VB_check_FLASHv_IE_method_1()
  '''''''''''''WORKS FOR SHOCKWAVE 7 AND 8 BUT NOT 8.5+
  ''msgbox "gf_VB_check_FLASHv_method_1" 
  
  ' Catch and ignore errors
  on error resume next
  
  Dim lvo_FLASH_control , lvi_FLASHv
  lvi_FLASHv = 0
  
  
  ' Step down through possible versions starting with version 8.'
  ' (You could set this number higher to plan for future versions of the Shockwave Player)'
  Dim lvi_i
  For lvi_i = 20 To 1 Step -1
    ' Set up the classname for the version that we're trying'
    ''msgbox "gf_VB_Get_FLASHv , lvi_i : " & lvi_i
	Dim lvn_class
    lvn_class = "ShockwaveFlash.ShockwaveFlash." + CStr( lvi_i )
    
	' Try to create a control of that version'
    Set lvo_FLASH_control = CreateObject( lvn_class )
    
	' If we succeeded...'
    if ( IsObject( lvo_FLASH_control ) ) then
      ' ...then set our version and stop trying.'
      lvi_FLASHv = lvi_i
      Exit For
	  
    end if
	 
  Next
  Set lvo_FLASH_control = Nothing
  
  
  	
  ' Set the return value for the function'
  ''msgbox "gf_VB_check_FLASHv_IE_method_1 : " &  lvi_FLASHv 
  gf_VB_check_FLASHv_IE_method_1 = lvi_FLASHv
end Function


*/

