ÿþ 
 / /   m o o c k   f p i   [ f . l a s h   p . l a y e r   i . n s p e c t o r ]  
 / /   v e r s i o n :   1 . 3 . 5  
 / /   w r i t t e n   b y   c o l i n   m o o c k  
 / /   c o d e   m a i n t a i n e d   a t :   h t t p : / / w w w . m o o c k . o r g / w e b d e s i g n / f l a s h / d e t e c t i o n / m o o c k f p i /  
 / /   t e r m s   o f   u s e   p o s t e d   a t :   h t t p : / / w w w . m o o c k . o r g / t e r m s /  
  
 / /  
 v a r   r e q u i r e d v e r s i o n   =   6 ;  
 / /  
  
 v a r   u s e R e d i r e c t   =   f a l s e ;  
  
 / /   S y s t e m   g l o b a l s  
 v a r   f l a s h 2 I n s t a l l e d   =   f a l s e ;         / /   b o o l e a n .   t r u e   i f   f l a s h   2   i s   i n s t a l l e d  
 v a r   f l a s h 3 I n s t a l l e d   =   f a l s e ;         / /   b o o l e a n .   t r u e   i f   f l a s h   3   i s   i n s t a l l e d  
 v a r   f l a s h 4 I n s t a l l e d   =   f a l s e ;         / /   b o o l e a n .   t r u e   i f   f l a s h   4   i s   i n s t a l l e d  
 v a r   f l a s h 5 I n s t a l l e d   =   f a l s e ;         / /   b o o l e a n .   t r u e   i f   f l a s h   5   i s   i n s t a l l e d  
 v a r   f l a s h 6 I n s t a l l e d   =   f a l s e ;         / /   b o o l e a n .   t r u e   i f   f l a s h   6   i s   i n s t a l l e d  
 v a r   f l a s h 7 I n s t a l l e d   =   f a l s e ;         / /   b o o l e a n .   t r u e   i f   f l a s h   7   i s   i n s t a l l e d  
 v a r   f l a s h 8 I n s t a l l e d   =   f a l s e ;         / /   b o o l e a n .   t r u e   i f   f l a s h   8   i s   i n s t a l l e d  
 v a r   m a x V e r s i o n   =   8 ;                           / /   h i g h e s t   v e r s i o n   w e   c a n   a c t u a l l y   d e t e c t   2 0 0 5  
 v a r   a c t u a l V e r s i o n   =   0 ;                     / /   v e r s i o n   t h e   u s e r   r e a l l y   h a s  
 v a r   h a s R i g h t V e r s i o n   =   f a l s e ;         / /   b o o l e a n .   t r u e   i f   i t s   s a f e   t o   e m b e d   t h e   f l a s h   m o v i e   i n   t h e   p a g e  
 v a r   j s V e r s i o n   =   1 . 0 ;                         / /   t h e   v e r s i o n   o f   j a v a s c r i p t   s u p p o r t e d  
  
 / /   C h e c k   t h e   b r o w s e r . . . w e ' r e   l o o k i n g   f o r   i e / w i n  
 v a r   i s I E   =   ( n a v i g a t o r . a p p V e r s i o n . i n d e x O f ( " M S I E " )   ! =   - 1 )   ?   t r u e   :   f a l s e ;         / /   t r u e   i f   w e ' r e   o n   i e  
 v a r   i s W i n   =   ( n a v i g a t o r . a p p V e r s i o n . i n d e x O f ( " W i n d o w s " )   ! =   - 1 )   ?   t r u e   :   f a l s e ;   / /   t r u e   i f   w e ' r e   o n   w i n d o w s  
  
 / /   - - d e a c t i v a t e d - T h i s   i s   a   j s 1 . 1   c o d e   b l o c k ,   s o   m a k e   n o t e   t h a t   j s 1 . 1   i s   s u p p o r t e d .  
 j s V e r s i o n   =   1 . 1 ;  
  
 / /   W r i t e   v b s c r i p t   d e t e c t i o n   o n   i e   w i n .   I E   o n   W i n d o w s   d o e s n ' t   s u p p o r t   r e g u l a r  
 / /   J a v a S c r i p t   p l u g i n s   a r r a y   d e t e c t i o n .  
 i f ( i s I E   & &   i s W i n ) {  
     d o c u m e n t . w r i t e ( ' < s c r ' + ' i p t   l a n g u a g e = " V B S c r i p t " >   \ n ' ) ;  
     d o c u m e n t . w r i t e ( ' o n   e r r o r   r e s u m e   n e x t   \ n ' ) ;  
     d o c u m e n t . w r i t e ( ' f l a s h 2 I n s t a l l e d   =   ( I s O b j e c t ( C r e a t e O b j e c t ( " S h o c k w a v e F l a s h . S h o c k w a v e F l a s h . 2 " ) ) )   \ n ' ) ;  
     d o c u m e n t . w r i t e ( ' f l a s h 3 I n s t a l l e d   =   ( I s O b j e c t ( C r e a t e O b j e c t ( " S h o c k w a v e F l a s h . S h o c k w a v e F l a s h . 3 " ) ) )   \ n ' ) ;  
     d o c u m e n t . w r i t e ( ' f l a s h 4 I n s t a l l e d   =   ( I s O b j e c t ( C r e a t e O b j e c t ( " S h o c k w a v e F l a s h . S h o c k w a v e F l a s h . 4 " ) ) )   \ n ' ) ;  
     d o c u m e n t . w r i t e ( ' f l a s h 5 I n s t a l l e d   =   ( I s O b j e c t ( C r e a t e O b j e c t ( " S h o c k w a v e F l a s h . S h o c k w a v e F l a s h . 5 " ) ) )   \ n ' ) ;      
     d o c u m e n t . w r i t e ( ' f l a s h 6 I n s t a l l e d   =   ( I s O b j e c t ( C r e a t e O b j e c t ( " S h o c k w a v e F l a s h . S h o c k w a v e F l a s h . 6 " ) ) )   \ n ' ) ;      
     d o c u m e n t . w r i t e ( ' f l a s h 7 I n s t a l l e d   =   ( I s O b j e c t ( C r e a t e O b j e c t ( " S h o c k w a v e F l a s h . S h o c k w a v e F l a s h . 7 " ) ) )   \ n ' ) ;  
     d o c u m e n t . w r i t e ( ' f l a s h 8 I n s t a l l e d   =   ( I s O b j e c t ( C r e a t e O b j e c t ( " S h o c k w a v e F l a s h . S h o c k w a v e F l a s h . 8 " ) ) )   \ n ' ) ;  
     d o c u m e n t . w r i t e ( ' < / s c r ' + ' i p t \ >   \ n ' ) ;   / /   b r e a k   u p   e n d   t a g   s o   i t   d o e s n ' t   e n d   o u r   s c r i p t  
 }  
  
 / /   N e x t   c o m e s   t h e   s t a n d a r d   j a v a s c r i p t   d e t e c t i o n   t h a t   u s e s   t h e    
 / /   n a v i g a t o r . p l u g i n s   a r r a y .   W e   p a c k   t h e   d e t e c t o r   i n t o   a   f u n c t i o n   s o   i t   l o a d s  
 / /   b e f o r e   w e   r u n   i t .  
  
 f u n c t i o n   d e t e c t F l a s h ( )   {      
     / /   I f   n a v i g a t o r . p l u g i n s   e x i s t s . . .  
     i f   ( n a v i g a t o r . p l u g i n s )   {  
         / /   . . . t h e n   c h e c k   f o r   f l a s h   2   o r   f l a s h   3 + .  
         i f   ( n a v i g a t o r . p l u g i n s [ " S h o c k w a v e   F l a s h   2 . 0 " ]  
                 | |   n a v i g a t o r . p l u g i n s [ " S h o c k w a v e   F l a s h " ] )   {  
  
             / /   S o m e   v e r s i o n   o f   F l a s h   w a s   f o u n d .   T i m e   t o   f i g u r e   o u t   w h i c h .  
              
             / /   S e t   c o n v e n i e n t   r e f e r e n c e s   t o   f l a s h   2   a n d   t h e   p l u g i n   d e s c r i p t i o n .  
             v a r   i s V e r s i o n 2   =   n a v i g a t o r . p l u g i n s [ " S h o c k w a v e   F l a s h   2 . 0 " ]   ?   "   2 . 0 "   :   " " ;  
             v a r   f l a s h D e s c r i p t i o n   =   n a v i g a t o r . p l u g i n s [ " S h o c k w a v e   F l a s h "   +   i s V e r s i o n 2 ] . d e s c r i p t i o n ;  
  
             / /   D E B U G G I N G :   u n c o m m e n t   n e x t   l i n e   t o   s e e   t h e   a c t u a l   d e s c r i p t i o n .  
             / / a l e r t ( " F l a s h   p l u g i n   d e s c r i p t i o n :   "   +   f l a s h D e s c r i p t i o n ) ;  
              
             / /   A   f l a s h   p l u g i n - d e s c r i p t i o n   l o o k s   l i k e   t h i s :   S h o c k w a v e   F l a s h   4 . 0   r 5  
             / /   W e   c a n   g e t   t h e   m a j o r   v e r s i o n   b y   g r a b b i n g   t h e   c h a r a c t e r   b e f o r e   t h e   p e r i o d  
             / /   n o t e   t h a t   w e   d o n ' t   b o t h e r   w i t h   m i n o r   v e r s i o n   d e t e c t i o n .    
             / /   D o   t h a t   i n   y o u r   m o v i e   w i t h   $ v e r s i o n   o r   g e t V e r s i o n ( ) .  
             v a r   f l a s h V e r s i o n   =   p a r s e I n t ( f l a s h D e s c r i p t i o n . c h a r A t ( f l a s h D e s c r i p t i o n . i n d e x O f ( " . " )   -   1 ) ) ;  
            
             / /   W e   f o u n d   t h e   v e r s i o n ,   n o w   s e t   a p p r o p r i a t e   v e r s i o n   f l a g s .   M a k e   s u r e  
             / /   t o   u s e   > =   o n   t h e   h i g h e s t   v e r s i o n   s o   w e   d o n ' t   p r e v e n t   f u t u r e   v e r s i o n  
             / /   u s e r s   f r o m   e n t e r i n g   t h e   s i t e .  
             f l a s h 2 I n s t a l l e d   =   f l a s h V e r s i o n   = =   2 ;          
             f l a s h 3 I n s t a l l e d   =   f l a s h V e r s i o n   = =   3 ;  
             f l a s h 4 I n s t a l l e d   =   f l a s h V e r s i o n   = =   4 ;  
             f l a s h 5 I n s t a l l e d   =   f l a s h V e r s i o n   = =   5 ;  
             f l a s h 6 I n s t a l l e d   =   f l a s h V e r s i o n   = =   6 ;  
             f l a s h 7 I n s t a l l e d   =   f l a s h V e r s i o n   = =   7 ;  
             f l a s h 8 I n s t a l l e d   =   f l a s h V e r s i o n   > =   8 ;  
         }  
     }  
  
 	 i f   ( f l a s h 2 I n s t a l l e d )   a c t u a l V e r s i o n   =   2 ;  
 	 i f   ( f l a s h 3 I n s t a l l e d )   a c t u a l V e r s i o n   =   3 ;  
 	 i f   ( f l a s h 4 I n s t a l l e d )   a c t u a l V e r s i o n   =   4 ;  
 	 i f   ( f l a s h 5 I n s t a l l e d )   a c t u a l V e r s i o n   =   5 ;  
 	 i f   ( f l a s h 6 I n s t a l l e d )   a c t u a l V e r s i o n   =   6 ;  
 	 i f   ( f l a s h 7 I n s t a l l e d )   a c t u a l V e r s i o n   =   7 ;  
 	 i f   ( f l a s h 8 I n s t a l l e d )   a c t u a l V e r s i o n   =   8 ;  
      
     / /   L o o p   t h r o u g h   a l l   v e r s i o n s   w e   a r e   c h e c k i n g ,   a n d  
     / /   s e t   a c t u a l V e r s i o n   t o   h i g h e s t   d e t e c t e d   v e r s i o n .  
      
     / /   I f   w e ' r e   o n   w e b t v ,   t h e   v e r s i o n   s u p p o r t e d   i s   2   ( p r e - s u m m e r 2 0 0 0 ,    
     / /   o r   3 ,   p o s t - s u m m e r 2 0 0 0 ) .   N o t e   t h a t   w e   d o n ' t   b o t h e r   s n i f f i n g   v a r i e t i e s  
     / /   o f   w e b t v .   Y o u   c o u l d   i f   y o u   w e r e   s a d i s t i c . . .  
     i f ( n a v i g a t o r . u s e r A g e n t . i n d e x O f ( " W e b T V " )   ! =   - 1 )   a c t u a l V e r s i o n   =   3 ;      
      
     / /   D E B U G G I N G :   u n c o m m e n t   n e x t   l i n e   t o   d i s p l a y   f l a s h   v e r s i o n  
     / / a l e r t ( " v e r s i o n   d e t e c t e d :   "   +   a c t u a l V e r s i o n ) ;  
  
  
     / /   W e ' r e   f i n i s h e d   g e t t i n g   t h e   v e r s i o n   o n   a l l   b r o w s e r s   t h a t   s u p p o r t   d e t e c t i o n .  
     / /   T i m e   t o   t a k e   t h e   a p p r o p r i a t e   a c t i o n .  
  
     / /   I f   t h e   u s e r   h a s   a   n e w   e n o u g h   v e r s i o n . . .  
     i f   ( a c t u a l V e r s i o n   > =   r e q u i r e d v e r s i o n )   {          
         h a s R i g h t V e r s i o n   =   t r u e ;                                  
     }   e l s e   {      
         / /   T h e   u s e r   d o e s n ' t   h a v e   a   n e w   e n o u g h   v e r s i o n .  
     }  
 }  
  
 d e t e c t F l a s h ( ) ;     / /   c a l l   o u r   d e t e c t o r   n o w   t h a t   i t ' s   s a f e l y   l o a d e d .      
  
 
