function detectFlash()
{
   this.isFlash = function()
   {
      if( this.detectByNavigatorPlugins() ) return true;
      if( this.detectByActiveX() ) return true;

      return false;
   }

   this.detectByNavigatorPlugins = function()
   {
      if( !navigator.plugins || !navigator.plugins['Shockwave Flash'] ) return false;

      var flashDescription = navigator.plugins["Shockwave Flash"].description;
      var indexOfStop = flashDescription.indexOf( '.' );
      
      this.flashVersion = parseInt( flashDescription.substring( indexOfStop - 2, indexOfStop ) );

      return true;
   }
 
   this.detectByActiveX = function()
   {
      if( typeof (ActiveXObject) != 'function' ) return false;

      for( i = 12 ; i != 2 ; i-- )
      {
         try
         {
            new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i  );
            this.flashVersion = i;

            return true;
         }
         catch(e){}
      }
      
      return false;
   }
}