// The following script is from: 
// http://www.adobe.com/devnet/flashplayer/articles/future_detection_print.html
//
// If called with no parameters this function returns a floating point value 
// which should be the version of the Flash Player or 0.0 
// ex: Flash Player 6r65 returns 6.65
// If called with reqMajorVer, reqMinorVer returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer) 
{
  reqVer = parseFloat(reqMajorVer + "." + reqMinorVer);
  // loop backwards through the versions until we find the newest version      
  for (i=25;i>0;i--) {      
    if (isIE && isWin && !isOpera) {
      versionStr = VBGetSwfVer(i);
    } else {
      versionStr = JSGetSwfVer(i);
    }
    
    if (versionStr == -1) {
      return false;
    } else 
      if (versionStr != 0) {
	if(isIE && isWin && !isOpera) {
	  tempArray = versionStr.split(" ");
	  tempString = tempArray[1];
	  versionArray = tempString .split(",");
	  
	  versionMajor = versionArray[0];
	  versionMinor   = versionArray[2];
	  
	  versionString = versionMajor + "." + versionMinor;
	  versionNum = parseFloat(versionString);
	} else {
	  versionNum = versionStr;
	}
	return (versionNum >= reqVer ? true : false );            
      }
  }
  return (reqVer ? false : 0.0);
}
