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