ÿþv a r   b a s e   =   " h t t p : / / b l s t j . m s n . c o m / b r / " ;  
  
  
 f u n c t i o n   $ i m p o r t ( p a t h ,   c a l l b a c k )   {  
         v a r   i   =   0 ;  
         v a r   p a t t e r n   =   n e w   R e g E x p ( " / c s l \ / j s \ / \ d + / j q u e r y ( - ) ? [ 0 - 9 . ] * j s / g i " ) ;  
         v a r   i s E x i s t e d   =   f a l s e ;  
  
         v a r   s c r i p t s   =   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 ( " s c r i p t " ) ;  
  
         f o r   ( i ;   i   <   s c r i p t s . l e n g t h ;   i + + )   {  
                 i f   ( s c r i p t s [ i ] . s r c . s e a r c h ( p a t t e r n )   >   0 )   {  
                         i s E x i s t e d   =   t r u e ;  
                         b r e a k ;  
                 }  
         }  
  
         i f   ( ! i s E x i s t e d )   {  
                 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 . t y p e   =   " t e x t / j a v a s c r i p t " ;  
  
                 i f   ( s c r i p t . r e a d y S t a t e )   {     / / I E  
                         s c r i p t . o n r e a d y s t a t e c h a n g e   =   f u n c t i o n ( )   {  
                                 i f   ( s c r i p t . r e a d y S t a t e   = =   " l o a d e d "   | |  
                                         s c r i p t . r e a d y S t a t e   = =   " c o m p l e t e " )   {  
                                         s c r i p t . o n r e a d y s t a t e c h a n g e   =   n u l l ;  
                                         c a l l b a c k ( ) ;  
                                 }  
                         } ;  
                 }   e l s e   {     / / O t h e r s  
                 s c r i p t . o n l o a d   =   f u n c t i o n ( )   {  
                                 c a l l b a c k ( ) ;  
                         } ;  
                 }  
  
                 s c r i p t . s r c   =   b a s e   +   p a t h ;  
                 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 ] . a p p e n d C h i l d ( s c r i p t ) ;  
         }  
 }  
  
 v a r   E S _ S P E C _ U P P E R   =   n e w   A r r a y ( ' Á ' ,   ' É ' ,   ' Í ' ,   ' Ó ' ,   ' Ú ' ,   ' Ñ ' ,   ' Ü ' ) ;  
 v a r   E S _ S P E C _ L O W E R   =   n e w   A r r a y ( ' á ' ,   ' é ' ,   ' í ' ,   ' ó ' ,   ' ú ' ,   ' ñ ' ,   ' ü ' ,   ' ¿ ' ,   ' ¡ ' ) ;  
 v a r   E S _ S P E C _ U P P E R _ U N I C O D E   =   n e w   A r r a y ( ' & # 1 9 3 ; ' ,   ' & # 2 0 1 ; ' ,   ' & # 2 0 5 ; ' ,   ' & # 2 1 1 ; ' ,   ' & # 2 1 8 ; ' ,   ' & # 2 2 0 ; ' ,   ' & # 2 0 9 ; ' ,   ' & # 2 2 0 ; ' ) ;  
 v a r   E S _ S P E C _ L O W E R _ U N I C O D E   =   n e w   A r r a y ( ' & # 2 2 5 ; ' ,   ' & # 2 3 3 ; ' ,   ' & # 2 3 7 ; ' ,   ' & # 2 4 3 ; ' ,   ' & # 2 5 0 ; ' ,   ' & # 2 5 2 ; ' ,   ' & # 2 4 1 ; ' ,   ' & # 2 4 3 ; ' ,   ' & # 1 9 1 ; ' ,   ' & # 1 6 1 ; ' ) ;  
 v a r   E S _ S P E C _ U P P E R _ A L I A S   =   n e w   A r r a y ( ' & A a c u t e ; ' ,   ' & E a c u t e ; ' ,   ' & I a c u t e ; ' ,   ' & O a c u t e ; ' ,   ' & U a c u t e ; ' ,   ' & N t i l d e ; ' ,   ' & U u m l ; ' ) ;  
 v a r   E S _ S P E C _ L O W E R _ A L I A S   =   n e w   A r r a y ( ' & a a c u t e ; ' ,   ' & e a c u t e ; ' ,   ' & i a c u t e ; ' ,   ' & o a c u t e ; ' ,   ' & u a c u t e ; ' ,   ' & n t i l d e ; ' ,   ' & u u m l ; ' ,   ' & i q u e s t ' ,   ' & i q u e s t ' ) ;  
  
 v a r   M a g i c M o d u l e K e y w o r d s   =   f u n c t i o n ( )   {  
         v a r   _ s e l f   =   t h i s ;  
         v a r   m a t c h K e y w o r d s ;  
         v a r   w o r d l i s t ;  
  
         f u n c t i o n   M a g i c M o d u l e K e y w o r d s ( )   {  
         }  
  
         t h i s . f e t c h K e y w o r d s   =   f u n c t i o n ( s e l e c t o r )   {  
                 m a t c h K e y w o r d s   =   n e w   A r r a y ( ) ;  
                 w o r d l i s t   =   n e w   A r r a y ( ) ;  
  
                 v a r   p a t t e r n   =   a r g u m e n t s [ 1 ]   ?   a r g u m e n t s [ 1 ]   :   t h i s . c r e a t e P a t t e r n ( ) ;  
                                  
                 v a r   i   =   0 ;  
                 v a r   i t e m s   =   $ ( s e l e c t o r ) ;  
                 / /   v a r   w o r d l i s t   =   n e w   A r r a y ( ) ;  
                 f o r   ( i   =   0 ;   i   <   i t e m s . l e n g t h ;   i + + )   {  
                         v a r   l i s t   =   t h i s . s e a r c h K e y w o r d s ( i t e m s . g e t ( i ) . i n n e r H T M L ,   p a t t e r n ) ;  
                         / /                         f o r   ( j   =   0 ;   j   <   l i s t . l e n g t h ;   j + + )   {  
                         / /                                 w o r d l i s t . p u s h ( l i s t [ j ] ) ;  
                         / /                         }  
                 }  
  
                 v a r   k e y w o r d s L i s t   =   n e w   A r r a y ( ) ;  
                 f o r   ( i   =   0 ;   i   <   m a t c h K e y w o r d s . l e n g t h ;   i + + )   {  
                         k e y w o r d s L i s t . p u s h ( m a t c h K e y w o r d s [ i ] ) ;  
                 }  
                 f o r   ( i   =   0 ;   i   <   w o r d l i s t . l e n g t h ;   i + + )   {  
                         k e y w o r d s L i s t . p u s h ( w o r d l i s t [ i ] ) ;  
                 }  
  
                 r e t u r n   k e y w o r d s L i s t ;  
         }  
  
         t h i s . s e a r c h K e y w o r d s   =   f u n c t i o n ( s t r ,   p a t t e r n )   {                  
                 v a r   w o r d l i s t   =   n e w   A r r a y ( ) ;  
                 v a r   r e g   =   n e w   R e g E x p ( p a t t e r n ,   " g " ) ;  
                 v a r   i   =   0 ;  
                 v a r   f i r s t w o r d ;  
  
                 v a r   r e s u l t   =   s t r . m a t c h ( r e g ) ;  
  
                 i f   ( r e s u l t   ! =   n u l l   & &   r e s u l t   ! =   " " )   {  
                         f o r   ( i   =   0 ;   i   <   r e s u l t . l e n g t h ;   i + + )   {  
                                 m a t c h K e y w o r d s . p u s h ( r e s u l t [ i ] ) ;  
                         }  
                 }  
                 e l s e   {  
                         i f   ( s t r . r e p l a c e ( / ^ \ s + | \ s + $ / ,   " " ) . i n d e x O f ( "   " )   >   0 )   {  
                                 f i r s t w o r d   =   s t r . s u b s t r i n g ( 0 ,   s t r . i n d e x O f ( "   " ) ) ;  
                         }  
                         e l s e   {  
                                 f i r s t w o r d   =   s t r ;  
                         }  
                         i f   ( f i r s t w o r d   ! =   n u l l   & &   f i r s t w o r d   ! =   " " )   {  
                                 w o r d l i s t . p u s h ( f i r s t w o r d ) ;  
                         }  
                 }  
  
                 / /                 r e t u r n   w o r d l i s t ;  
         }  
  
         t h i s . c r e a t e P a t t e r n   =   f u n c t i o n ( )   {  
                 v a r   p a t t e r n   =   " " ;  
                 v a r   w o r d   =   t h i s . c r e a t e W o r d P a t t e r n ( ) ;  
                 p a t t e r n   =   w o r d . c o n c a t ( " ( \ \ s + ( " ,   w o r d ,   " | [ 0 - 9 ] + ) ) + " ) ;  
                 r e t u r n   p a t t e r n ;  
         }  
  
         t h i s . c r e a t e W o r d P a t t e r n   =   f u n c t i o n ( )   {  
                 v a r   i   =   0 ;  
                 v a r   l e a d i n g _ s t r   =   " ( " ;  
                 f o r   ( i   =   0 ;   i   <   E S _ S P E C _ U P P E R . l e n g t h ;   i + + )   {  
                         l e a d i n g _ s t r   =   l e a d i n g _ s t r . c o n c a t ( E S _ S P E C _ U P P E R [ i ] ,   " | " ) ;  
                 }  
  
                 f o r   ( i   =   0 ;   i   <   E S _ S P E C _ U P P E R _ A L I A S . l e n g t h ;   i + + )   {  
                         l e a d i n g _ s t r   =   l e a d i n g _ s t r . c o n c a t ( E S _ S P E C _ U P P E R _ A L I A S [ i ] ,   " | " ) ;  
                 }  
  
                 f o r   ( i   =   0 ;   i   <   E S _ S P E C _ U P P E R _ U N I C O D E . l e n g t h ;   i + + )   {  
                         l e a d i n g _ s t r   =   l e a d i n g _ s t r . c o n c a t ( E S _ S P E C _ U P P E R _ U N I C O D E [ i ] ,   " | " ) ;  
                 }  
  
                 l e a d i n g _ s t r   =   l e a d i n g _ s t r . c o n c a t ( " [ A - Z ] ) " ) ;  
  
                 v a r   o t h e r _ s t r   =   " ( " ;  
                 f o r   ( i   =   0 ;   i   <   E S _ S P E C _ L O W E R . l e n g t h ;   i + + )   {  
                         o t h e r _ s t r   =   o t h e r _ s t r . c o n c a t ( E S _ S P E C _ L O W E R [ i ] ,   " | " ) ;  
                 }  
  
                 f o r   ( i   =   0 ;   i   <   E S _ S P E C _ L O W E R _ A L I A S . l e n g t h ;   i + + )   {  
                         o t h e r _ s t r   =   o t h e r _ s t r . c o n c a t ( E S _ S P E C _ L O W E R _ A L I A S [ i ] ,   " | " ) ;  
                 }  
  
                 f o r   ( i   =   0 ;   i   <   E S _ S P E C _ L O W E R _ U N I C O D E . l e n g t h ;   i + + )   {  
                         o t h e r _ s t r   =   o t h e r _ s t r . c o n c a t ( E S _ S P E C _ L O W E R _ U N I C O D E [ i ] ,   " | " ) ;  
                 }  
  
                 o t h e r _ s t r   =   o t h e r _ s t r . c o n c a t ( " [ a - z 0 - 9 . ] | " ,   l e a d i n g _ s t r ,   " ) " ) ;  
  
                 r e t u r n   l e a d i n g _ s t r . c o n c a t ( o t h e r _ s t r ,   " * " ) ;                  
         }  
 }  
  
 f u n c t i o n   s h o w M a g i c M o d u l e ( m o v i e ,   p a r a m )   {  
         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 " ,   l o a d e d ,   f a l s e ) ;  
         e l s e   i f   ( w i n d o w . a t t a c h E v e n t )  
                 w i n d o w . a t t a c h E v e n t ( " o n l o a d " ,   l o a d e d ) ;  
         e l s e  
                 w i n d o w . o n l o a d   =   l o a d e d ;  
  
  
         f u n c t i o n   f i l t e r K e y w o r d ( k e y w o r d s ,   e x c l u s i o n )   {  
                 i f   ( ! e x c l u s i o n )   r e t u r n   k e y w o r d s ;  
  
                 v a r   e x c l u s i o n s   =   e x c l u s i o n . s p l i t ( " , " ) ;  
                 v a r   r e s u l t   =   n e w   A r r a y ( ) ;  
  
                 f o r   ( v a r   i   =   0 ;   i   <   k e y w o r d s . l e n g t h ;   i + + )   {  
                         v a r   i n c l u d e   =   t r u e ;  
  
                         f o r   ( v a r   j   =   0 ;   j   <   e x c l u s i o n s . l e n g t h ;   j + + )   {  
                                 i f   ( k e y w o r d s [ i ]   = =   e x c l u s i o n s [ j ] )   {                                          
                                         i n c l u d e   =   f a l s e ;  
                                         b r e a k ;  
                                 }  
                         }  
  
                         i f   ( i n c l u d e )   r e s u l t . p u s h ( k e y w o r d s [ i ] ) ;  
                 }  
  
                 r e t u r n   r e s u l t ;  
         }  
  
  
         f u n c t i o n   l o a d e d ( )   {  
                 $ i m p o r t ( " c s l / j s / 1 / j q u e r y - 1 . 2 . 6 . j s " ,   f u n c t i o n ( )   {  
                         v a r   j s o n   =   e v a l ( ' ( '   +   p a r a m   +   ' ) ' ) ;  
                         v a r   s e l e c t o r   =   " h 1   s t r o n g " ;  
                         i f   ( j s o n . s e l e c t o r   ! =   " " )   {  
                                 s e l e c t o r   =   j s o n . s e l e c t o r ;  
                         }  
  
                         / /   c h e c k   s e l e c t o r   k e y w o r d  
                         v a r   k e y L i s t   =   n e w   M a g i c M o d u l e K e y w o r d s ( ) ;  
                         v a r   l i s t   =   k e y L i s t . f e t c h K e y w o r d s ( s e l e c t o r ) ;  
  
                         / /   c h e c k   k e y w o r d   w i t h   e x c l u t i o n  
                         i f   ( ! l i s t [ 0 ] )   {  
                                 l i s t   =   k e y L i s t . f e t c h K e y w o r d s ( s e l e c t o r ,   k e y L i s t . c r e a t e W o r d P a t t e r n ( ) . r e p l a c e ( " * " ,   " + " ) ) ;  
                                 l i s t   =   f i l t e r K e y w o r d ( l i s t ,   j s o n . k e y w o r d e x c l u d e ) ;  
                         }  
  
                         / /   c h e c k   p a r a m   o v e r w r i t e   k e y w o r d  
                         i f   ( ! l i s t [ 0 ]   & &   j s o n . k e y w o r d )   {  
                                 l i s t [ 0 ]   =   j s o n . k e y w o r d ;  
                         }  
  
                         / /   c h e c k   u r l   o v e r w r i t e   k e y w o r d  
                         i f   ( ! l i s t [ 0 ] )   {  
                                 v a r   r e s u l t   =   w i n d o w . l o c a t i o n . t o S t r i n g ( ) . m a t c h ( / k e y = ( [ ^ & ] * ) / ,   " g " ) ;  
  
                                 i f   ( r e s u l t   & &   r e s u l t [ 1 ] )   {  
                                         l i s t [ 0 ]   =   r e s u l t [ 1 ] ;  
                                 }  
                                 e l s e   {  
                                         r e t u r n ;  
                                 }  
                         }  
  
                         v a r   r e g   =   n e w   R e g E x p ( " _ _ _ _ K E Y W O R D _ _ _ _ " ,   " g i " ) ;  
                         v a r   r e s u l t   =   p a r a m . r e p l a c e ( r e g ,   l i s t [ 0 ] ) ;  
  
                         r e g   =   n e w   R e g E x p ( " ' \ \ w + ' \ \ s * : \ \ s * ' [ ^ ' ] * ' " ,   " g " ) ;  
  
                         i t e m s   =   r e s u l t . m a t c h ( r e g ) ;  
                         v a r   f l a s h v a r s   =   " " ;  
                         v a r   p o s   =   0 ;  
  
                         f o r   ( i   =   0 ;   i   <   i t e m s . l e n g t h ;   i + + )   {  
                                 p o s   =   i t e m s [ i ] . i n d e x O f ( " : " ) ;  
                                 n a m e   =   i t e m s [ i ] . s u b s t r i n g ( 0 ,   p o s   -   1 ) . r e p l a c e ( / ' / g ,   " " ) ;  
                                 v a l u e   =   i t e m s [ i ] . s u b s t r i n g ( p o s   +   1 ) . r e p l a c e ( / ' / g ,   " " ) ;  
                                 f l a s h v a r s   + =   n a m e   +   " = "   +   v a l u e   +   " & " ;  
                         }  
                         f l a s h v a r s   + =   " k e y w o r d = "   +   l i s t [ 0 ] ;  
                         / / f l a s h v a r s   =   f l a s h v a r s . s u b s t r i n g ( 0 ,   f l a s h v a r s . l e n g t h   -   1 ) ;  
  
                         v a r   f l a s h S t r i n g   =  
  
                         ' < o b j e c t   c l a s s i d = " c l s i d : d 2 7 c d b 6 e - a e 6 d - 1 1 c f - 9 6 b 8 - 4 4 4 5 5 3 5 4 0 0 0 0 "   c o d e b a s e = " h t t p : / / d o w n l o a d . m a c r o m e d i a . c o m / p u b / s h o c k w a v e / c a b s / f l a s h / s w f l a s h . c a b # v e r s i o n = 1 0 , 0 , 0 , 0 "   w i d t h = " '   +   j s o n . w i d t h   +   ' "   h e i g h t = " '   +   j s o n . h e i g h t   +   ' "   i d = " f e e d F l a s h O b j "   a l i g n = " m i d d l e " > '  
                                 +   ' < p a r a m   n a m e = " a l l o w S c r i p t A c c e s s "   v a l u e = " a l w a y s "   / > '  
                                 +   ' < p a r a m   n a m e = " a l l o w F u l l S c r e e n "   v a l u e = " f a l s e "   / > '  
                                 +   ' < p a r a m   n a m e = " f l a s h v a r s "   v a l u e = \ ' '   +   f l a s h v a r s   +   ' \ '   / > '  
                                 +   ' < p a r a m   n a m e = " m o v i e "   v a l u e = " '   +   m o v i e   +   ' "   / > '  
                                 +   ' < p a r a m   n a m e = " q u a l i t y "   v a l u e = " h i g h "   / > '  
                                 +   ' < p a r a m   n a m e = " b g c o l o r "   v a l u e = " # f f f f f f "   / > '  
  
                         +   ' < e m b e d   s r c = " '   +   m o v i e  
                                 +   ' "   q u a l i t y = " h i g h "   w i d t h = " '   +   j s o n . w i d t h  
                                 +   ' "   h e i g h t = " '   +   j s o n . h e i g h t  
                                 +   ' "   f l a s h v a r s = \ ' '   +   f l a s h v a r s  
                                 +   ' \ '   n a m e = " f e e d F l a s h O b j "   a l i g n = " m i d d l e "   b g c o l o r = " # f f f f f f "   a l l o w S c r i p t A c c e s s = " a l w a y s "   a l l o w F u l l S c r e e n = " f a l s e "   t y p e = " a p p l i c a t i o n / x - s h o c k w a v e - f l a s h "   p l u g i n s p a g e = " h t t p : / / w w w . a d o b e . c o m / g o / g e t f l a s h p l a y e r "   / > '  
  
                         +   ' < / o b j e c t > ' ;  
  
                         v a r   f l a s h o b j   =   $ ( " # "   +   j s o n . i d ) . g e t ( 0 ) ;  
                         f l a s h o b j . i n n e r H T M L   =   f l a s h S t r i n g ;  
                 } ) ;  
         }  
 }  
 
