ÿþ/ * 
   *   S h a d o w b o x . j s ,   v e r s i o n   3 . 0 . 2 
   *   h t t p : / / s h a d o w b o x - j s . c o m / 
   * 
   *   C o p y r i g h t   2 0 0 7 - 2 0 1 0 ,   M i c h a e l   J .   I .   J a c k s o n 
   *   D a t e :   2 0 1 0 - 0 2 - 2 5   1 1 : 4 3 : 1 6   + 0 0 0 0 
   * / 
 ( f u n c t i o n ( w i n d o w , u n d e f i n e d ) { v a r   S = { v e r s i o n : " 3 . 0 . 2 " } ; v a r   u a = n a v i g a t o r . u s e r A g e n t . t o L o w e r C a s e ( ) ; i f ( u a . i n d e x O f ( " w i n d o w s " ) > - 1 | | u a . i n d e x O f ( " w i n 3 2 " ) > - 1 ) { S . i s W i n d o w s = t r u e } e l s e { i f ( u a . i n d e x O f ( " m a c i n t o s h " ) > - 1 | | u a . i n d e x O f ( " m a c   o s   x " ) > - 1 ) { S . i s M a c = t r u e } e l s e { i f ( u a . i n d e x O f ( " l i n u x " ) > - 1 ) { S . i s L i n u x = t r u e } } } S . i s I E = u a . i n d e x O f ( " m s i e " ) > - 1 ; S . i s I E 6 = u a . i n d e x O f ( " m s i e   6 " ) > - 1 ; S . i s I E 7 = u a . i n d e x O f ( " m s i e   7 " ) > - 1 ; S . i s G e c k o = u a . i n d e x O f ( " g e c k o " ) > - 1 & & u a . i n d e x O f ( " s a f a r i " ) = = - 1 ; S . i s W e b K i t = u a . i n d e x O f ( " a p p l e w e b k i t / " ) > - 1 ; v a r   i n l i n e I d = / # ( . + ) $ / , g a l l e r y N a m e = / ^ ( l i g h t | s h a d o w ) b o x \ [ ( . * ? ) \ ] / i , i n l i n e P a r a m = / \ s * ( [ a - z _ ] * ? ) \ s * = \ s * ( . + ) \ s * / , f i l e E x t e n s i o n = / [ 0 - 9 a - z ] + $ / i , s c r i p t P a t h = / ( . + \ / ) s h a d o w b o x \ . j s / i ; v a r   o p e n = f a l s e , i n i t i a l i z e d = f a l s e , l a s t O p t i o n s = { } , s l i d e D e l a y = 0 , s l i d e S t a r t , s l i d e T i m e r ; S . c u r r e n t = - 1 ; S . d i m e n s i o n s = n u l l ; S . e a s e = f u n c t i o n ( s t a t e ) { r e t u r n   1 + M a t h . p o w ( s t a t e - 1 , 3 ) } ; S . e r r o r I n f o = { f l a : { n a m e : " F l a s h " , u r l : " h t t p : / / w w w . a d o b e . c o m / p r o d u c t s / f l a s h p l a y e r / " } , q t : { n a m e : " Q u i c k T i m e " , u r l : " h t t p : / / w w w . a p p l e . c o m / q u i c k t i m e / d o w n l o a d / " } , w m p : { n a m e : " W i n d o w s   M e d i a   P l a y e r " , u r l : " h t t p : / / w w w . m i c r o s o f t . c o m / w i n d o w s / w i n d o w s m e d i a / " } , f 4 m : { n a m e : " F l i p 4 M a c " , u r l : " h t t p : / / w w w . f l i p 4 m a c . c o m / w m v _ d o w n l o a d . h t m " } } ; S . g a l l e r y = [ ] ; S . o n R e a d y = n o o p ; S . p a t h = n u l l ; S . p l a y e r = n u l l ; S . p l a y e r I d = " s b - p l a y e r " ; S . o p t i o n s = { a n i m a t e : t r u e , a n i m a t e F a d e : t r u e , a u t o p l a y M o v i e s : t r u e , c o n t i n u o u s : f a l s e , e n a b l e K e y s : t r u e , f l a s h P a r a m s : { b g c o l o r : " # 0 0 0 0 0 0 " , a l l o w f u l l s c r e e n : t r u e } , f l a s h V a r s : { } , f l a s h V e r s i o n : " 9 . 0 . 1 1 5 " , h a n d l e O v e r s i z e : " r e s i z e " , h a n d l e U n s u p p o r t e d : " l i n k " , o n C h a n g e : n o o p , o n C l o s e : n o o p , o n F i n i s h : n o o p , o n O p e n : n o o p , s h o w M o v i e C o n t r o l s : t r u e , s k i p S e t u p : f a l s e , s l i d e s h o w D e l a y : 0 , v i e w p o r t P a d d i n g : 2 0 } ; S . g e t C u r r e n t = f u n c t i o n ( ) { r e t u r n   S . c u r r e n t > - 1 ? S . g a l l e r y [ S . c u r r e n t ] : n u l l } ; S . h a s N e x t = f u n c t i o n ( ) { r e t u r n   S . g a l l e r y . l e n g t h > 1 & & ( S . c u r r e n t ! = S . g a l l e r y . l e n g t h - 1 | | S . o p t i o n s . c o n t i n u o u s ) } ; S . i s O p e n = f u n c t i o n ( ) { r e t u r n   o p e n } ; S . i s P a u s e d = f u n c t i o n ( ) { r e t u r n   s l i d e T i m e r = = " p a u s e " } ; S . a p p l y O p t i o n s = f u n c t i o n ( o p t i o n s ) { l a s t O p t i o n s = a p p l y ( { } , S . o p t i o n s ) ; a p p l y ( S . o p t i o n s , o p t i o n s ) } ; S . r e v e r t O p t i o n s = f u n c t i o n ( ) { a p p l y ( S . o p t i o n s , l a s t O p t i o n s ) } ; S . i n i t = f u n c t i o n ( o p t i o n s , c a l l b a c k ) { i f ( i n i t i a l i z e d ) { r e t u r n } i n i t i a l i z e d = t r u e ; i f ( S . s k i n . o p t i o n s ) { a p p l y ( S . o p t i o n s , S . s k i n . o p t i o n s ) } i f ( o p t i o n s ) { a p p l y ( S . o p t i o n s , o p t i o n s ) } i f ( ! S . p a t h ) { v a r   p a t h , 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 ( v a r   i = 0 , l e n = s c r i p t s . l e n g t h ; i < l e n ; + + i ) { p a t h = s c r i p t P a t h . e x e c ( s c r i p t s [ i ] . s r c ) ; i f ( p a t h ) { S . p a t h = p a t h [ 1 ] ; b r e a k } } } i f ( c a l l b a c k ) { S . o n R e a d y = c a l l b a c k } b i n d L o a d ( ) } ; S . o p e n = f u n c t i o n ( o b j ) { i f ( o p e n ) { r e t u r n } v a r   g c = S . m a k e G a l l e r y ( o b j ) ; S . g a l l e r y = g c [ 0 ] ; S . c u r r e n t = g c [ 1 ] ; o b j = S . g e t C u r r e n t ( ) ; i f ( o b j = = n u l l ) { r e t u r n } S . a p p l y O p t i o n s ( o b j . o p t i o n s | | { } ) ; f i l t e r G a l l e r y ( ) ; i f ( S . g a l l e r y . l e n g t h ) { o b j = S . g e t C u r r e n t ( ) ; i f ( S . o p t i o n s . o n O p e n ( o b j ) = = = f a l s e ) { r e t u r n } o p e n = t r u e ; S . s k i n . o n O p e n ( o b j , l o a d ) } } ; S . c l o s e = f u n c t i o n ( ) { i f ( ! o p e n ) { r e t u r n } o p e n = f a l s e ; i f ( S . p l a y e r ) { S . p l a y e r . r e m o v e ( ) ; S . p l a y e r = n u l l } i f ( t y p e o f   s l i d e T i m e r = = " n u m b e r " ) { c l e a r T i m e o u t ( s l i d e T i m e r ) ; s l i d e T i m e r = n u l l } s l i d e D e l a y = 0 ; l i s t e n K e y s ( f a l s e ) ; S . o p t i o n s . o n C l o s e ( S . g e t C u r r e n t ( ) ) ; S . s k i n . o n C l o s e ( ) ; S . r e v e r t O p t i o n s ( ) } ; S . p l a y = f u n c t i o n ( ) { i f ( ! S . h a s N e x t ( ) ) { r e t u r n } i f ( ! s l i d e D e l a y ) { s l i d e D e l a y = S . o p t i o n s . s l i d e s h o w D e l a y * 1 0 0 0 } i f ( s l i d e D e l a y ) { s l i d e S t a r t = n o w ( ) ; s l i d e T i m e r = s e t T i m e o u t ( f u n c t i o n ( ) { s l i d e D e l a y = s l i d e S t a r t = 0 ; S . n e x t ( ) } , s l i d e D e l a y ) ; i f ( S . s k i n . o n P l a y ) { S . s k i n . o n P l a y ( ) } } } ; S . p a u s e = f u n c t i o n ( ) { i f ( t y p e o f   s l i d e T i m e r ! = " n u m b e r " ) { r e t u r n } s l i d e D e l a y = M a t h . m a x ( 0 , s l i d e D e l a y - ( n o w ( ) - s l i d e S t a r t ) ) ; i f ( s l i d e D e l a y ) { c l e a r T i m e o u t ( s l i d e T i m e r ) ; s l i d e T i m e r = " p a u s e " ; i f ( S . s k i n . o n P a u s e ) { S . s k i n . o n P a u s e ( ) } } } ; S . c h a n g e = f u n c t i o n ( i n d e x ) { i f ( ! ( i n d e x   i n   S . g a l l e r y ) ) { i f ( S . o p t i o n s . c o n t i n u o u s ) { i n d e x = ( i n d e x < 0 ? S . g a l l e r y . l e n g t h + i n d e x : 0 ) ; i f ( ! ( i n d e x   i n   S . g a l l e r y ) ) { r e t u r n } } e l s e { r e t u r n } } S . c u r r e n t = i n d e x ; i f ( t y p e o f   s l i d e T i m e r = = " n u m b e r " ) { c l e a r T i m e o u t ( s l i d e T i m e r ) ; s l i d e T i m e r = n u l l ; s l i d e D e l a y = s l i d e S t a r t = 0 } S . o p t i o n s . o n C h a n g e ( S . g e t C u r r e n t ( ) ) ; l o a d ( t r u e ) } ; S . n e x t = f u n c t i o n ( ) { S . c h a n g e ( S . c u r r e n t + 1 ) } ; S . p r e v i o u s = f u n c t i o n ( ) { S . c h a n g e ( S . c u r r e n t - 1 ) } ; S . s e t D i m e n s i o n s = f u n c t i o n ( h e i g h t , w i d t h , m a x H e i g h t , m a x W i d t h , t o p B o t t o m , l e f t R i g h t , p a d d i n g , p r e s e r v e A s p e c t ) { v a r   o r i g i n a l H e i g h t = h e i g h t , o r i g i n a l W i d t h = w i d t h ; v a r   e x t r a H e i g h t = 2 * p a d d i n g + t o p B o t t o m ; i f ( h e i g h t + e x t r a H e i g h t > m a x H e i g h t ) { h e i g h t = m a x H e i g h t - e x t r a H e i g h t } v a r   e x t r a W i d t h = 2 * p a d d i n g + l e f t R i g h t ; i f ( w i d t h + e x t r a W i d t h > m a x W i d t h ) { w i d t h = m a x W i d t h - e x t r a W i d t h } v a r   c h a n g e H e i g h t = ( o r i g i n a l H e i g h t - h e i g h t ) / o r i g i n a l H e i g h t , c h a n g e W i d t h = ( o r i g i n a l W i d t h - w i d t h ) / o r i g i n a l W i d t h , o v e r s i z e d = ( c h a n g e H e i g h t > 0 | | c h a n g e W i d t h > 0 ) ; i f ( p r e s e r v e A s p e c t & & o v e r s i z e d ) { i f ( c h a n g e H e i g h t > c h a n g e W i d t h ) { w i d t h = M a t h . r o u n d ( ( o r i g i n a l W i d t h / o r i g i n a l H e i g h t ) * h e i g h t ) } e l s e { i f ( c h a n g e W i d t h > c h a n g e H e i g h t ) { h e i g h t = M a t h . r o u n d ( ( o r i g i n a l H e i g h t / o r i g i n a l W i d t h ) * w i d t h ) } } } S . d i m e n s i o n s = { h e i g h t : h e i g h t + t o p B o t t o m , w i d t h : w i d t h + l e f t R i g h t , i n n e r H e i g h t : h e i g h t , i n n e r W i d t h : w i d t h , t o p : M a t h . f l o o r ( ( m a x H e i g h t - ( h e i g h t + e x t r a H e i g h t ) ) / 2 + p a d d i n g ) , l e f t : M a t h . f l o o r ( ( m a x W i d t h - ( w i d t h + e x t r a W i d t h ) ) / 2 + p a d d i n g ) , o v e r s i z e d : o v e r s i z e d } ; r e t u r n   S . d i m e n s i o n s } ; S . m a k e G a l l e r y = f u n c t i o n ( o b j ) { v a r   g a l l e r y = [ ] , c u r r e n t = - 1 ; i f ( t y p e o f   o b j = = " s t r i n g " ) { o b j = [ o b j ] } i f ( t y p e o f   o b j . l e n g t h = = " n u m b e r " ) { e a c h ( o b j , f u n c t i o n ( i , o ) { i f ( o . c o n t e n t ) { g a l l e r y [ i ] = o } e l s e { g a l l e r y [ i ] = { c o n t e n t : o } } } ) ; c u r r e n t = 0 } e l s e { i f ( o b j . t a g N a m e ) { v a r   c a c h e O b j = S . g e t C a c h e ( o b j ) ; o b j = c a c h e O b j ? c a c h e O b j : S . m a k e O b j e c t ( o b j ) } i f ( o b j . g a l l e r y ) { g a l l e r y = [ ] ; v a r   o ; f o r ( v a r   k e y   i n   S . c a c h e ) { o = S . c a c h e [ k e y ] ; i f ( o . g a l l e r y & & o . g a l l e r y = = o b j . g a l l e r y ) { i f ( c u r r e n t = = - 1 & & o . c o n t e n t = = o b j . c o n t e n t ) { c u r r e n t = g a l l e r y . l e n g t h } g a l l e r y . p u s h ( o ) } } i f ( c u r r e n t = = - 1 ) { g a l l e r y . u n s h i f t ( o b j ) ; c u r r e n t = 0 } } e l s e { g a l l e r y = [ o b j ] ; c u r r e n t = 0 } } e a c h ( g a l l e r y , f u n c t i o n ( i , o ) { g a l l e r y [ i ] = a p p l y ( { } , o ) } ) ; r e t u r n [ g a l l e r y , c u r r e n t ] } ; S . m a k e O b j e c t = f u n c t i o n ( l i n k , o p t i o n s ) { v a r   o b j = { c o n t e n t : l i n k . h r e f , t i t l e : l i n k . g e t A t t r i b u t e ( " t i t l e " ) | | " " , l i n k : l i n k } ; i f ( o p t i o n s ) { o p t i o n s = a p p l y ( { } , o p t i o n s ) ; e a c h ( [ " p l a y e r " , " t i t l e " , " h e i g h t " , " w i d t h " , " g a l l e r y " ] , f u n c t i o n ( i , o ) { i f ( t y p e o f   o p t i o n s [ o ] ! = " u n d e f i n e d " ) { o b j [ o ] = o p t i o n s [ o ] ; d e l e t e   o p t i o n s [ o ] } } ) ; o b j . o p t i o n s = o p t i o n s } e l s e { o b j . o p t i o n s = { } } i f ( ! o b j . p l a y e r ) { o b j . p l a y e r = S . g e t P l a y e r ( o b j . c o n t e n t ) } v a r   r e l = l i n k . g e t A t t r i b u t e ( " r e l " ) ; i f ( r e l ) { v a r   m a t c h = r e l . m a t c h ( g a l l e r y N a m e ) ; i f ( m a t c h ) { o b j . g a l l e r y = e s c a p e ( m a t c h [ 2 ] ) } e a c h ( r e l . s p l i t ( " ; " ) , f u n c t i o n ( i , p ) { m a t c h = p . m a t c h ( i n l i n e P a r a m ) ; i f ( m a t c h ) { o b j [ m a t c h [ 1 ] ] = m a t c h [ 2 ] } } ) } r e t u r n   o b j } ; S . g e t P l a y e r = f u n c t i o n ( c o n t e n t ) { i f ( c o n t e n t . i n d e x O f ( " # " ) > - 1 & & c o n t e n t . i n d e x O f ( d o c u m e n t . l o c a t i o n . h r e f ) = = 0 ) { r e t u r n " i n l i n e " } v a r   q = c o n t e n t . i n d e x O f ( " ? " ) ; i f ( q > - 1 ) { c o n t e n t = c o n t e n t . s u b s t r i n g ( 0 , q ) } v a r   e x t , m = c o n t e n t . m a t c h ( f i l e E x t e n s i o n ) ; i f ( m ) { e x t = m [ 0 ] . t o L o w e r C a s e ( ) } i f ( e x t ) { i f ( S . i m g & & S . i m g . e x t . i n d e x O f ( e x t ) > - 1 ) { r e t u r n " i m g " } i f ( S . s w f & & S . s w f . e x t . i n d e x O f ( e x t ) > - 1 ) { r e t u r n " s w f " } i f ( S . f l v & & S . f l v . e x t . i n d e x O f ( e x t ) > - 1 ) { r e t u r n " f l v " } i f ( S . q t & & S . q t . e x t . i n d e x O f ( e x t ) > - 1 ) { i f ( S . w m p & & S . w m p . e x t . i n d e x O f ( e x t ) > - 1 ) { r e t u r n " q t w m p " } e l s e { r e t u r n " q t " } } i f ( S . w m p & & S . w m p . e x t . i n d e x O f ( e x t ) > - 1 ) { r e t u r n " w m p " } } r e t u r n " i f r a m e " } ; f u n c t i o n   f i l t e r G a l l e r y ( ) { v a r   e r r = S . e r r o r I n f o , p l u g i n s = S . p l u g i n s , o b j , r e m o v e , n e e d e d , m , f o r m a t , r e p l a c e , i n l i n e E l , f l a s h V e r s i o n ; f o r ( v a r   i = 0 ; i < S . g a l l e r y . l e n g t h ; + + i ) { o b j = S . g a l l e r y [ i ] ; r e m o v e = f a l s e ; n e e d e d = n u l l ; s w i t c h ( o b j . p l a y e r ) { c a s e " f l v " : c a s e " s w f " : i f ( ! p l u g i n s . f l a ) { n e e d e d = " f l a " } b r e a k ; c a s e " q t " : i f ( ! p l u g i n s . q t ) { n e e d e d = " q t " } b r e a k ; c a s e " w m p " : i f ( S . i s M a c ) { i f ( p l u g i n s . q t & & p l u g i n s . f 4 m ) { o b j . p l a y e r = " q t " } e l s e { n e e d e d = " q t f 4 m " } } e l s e { i f ( ! p l u g i n s . w m p ) { n e e d e d = " w m p " } } b r e a k ; c a s e " q t w m p " : i f ( p l u g i n s . q t ) { o b j . p l a y e r = " q t " } e l s e { i f ( p l u g i n s . w m p ) { o b j . p l a y e r = " w m p " } e l s e { n e e d e d = " q t w m p " } } b r e a k } i f ( n e e d e d ) { i f ( S . o p t i o n s . h a n d l e U n s u p p o r t e d = = " l i n k " ) { s w i t c h ( n e e d e d ) { c a s e " q t f 4 m " : f o r m a t = " s h a r e d " ; r e p l a c e = [ e r r . q t . u r l , e r r . q t . n a m e , e r r . f 4 m . u r l , e r r . f 4 m . n a m e ] ; b r e a k ; c a s e " q t w m p " : f o r m a t = " e i t h e r " ; r e p l a c e = [ e r r . q t . u r l , e r r . q t . n a m e , e r r . w m p . u r l , e r r . w m p . n a m e ] ; b r e a k ; d e f a u l t : f o r m a t = " s i n g l e " ; r e p l a c e = [ e r r [ n e e d e d ] . u r l , e r r [ n e e d e d ] . n a m e ] } o b j . p l a y e r = " h t m l " ; o b j . c o n t e n t = ' < d i v   c l a s s = " s b - m e s s a g e " > ' + s p r i n t f ( S . l a n g . e r r o r s [ f o r m a t ] , r e p l a c e ) + " < / d i v > " } e l s e { r e m o v e = t r u e } } e l s e { i f ( o b j . p l a y e r = = " i n l i n e " ) { m = i n l i n e I d . e x e c ( o b j . c o n t e n t ) ; i f ( m ) { i n l i n e E l = g e t ( m [ 1 ] ) ; i f ( i n l i n e E l ) { o b j . c o n t e n t = i n l i n e E l . i n n e r H T M L } e l s e { r e m o v e = t r u e } } e l s e { r e m o v e = t r u e } } e l s e { i f ( o b j . p l a y e r = = " s w f " | | o b j . p l a y e r = = " f l v " ) { f l a s h V e r s i o n = ( o b j . o p t i o n s & & o b j . o p t i o n s . f l a s h V e r s i o n ) | | S . o p t i o n s . f l a s h V e r s i o n ; i f ( S . f l a s h & & ! S . f l a s h . h a s F l a s h P l a y e r V e r s i o n ( f l a s h V e r s i o n ) ) { o b j . w i d t h = 3 1 0 ; o b j . h e i g h t = 1 7 7 } } } } i f ( r e m o v e ) { S . g a l l e r y . s p l i c e ( i , 1 ) ; i f ( i < S . c u r r e n t ) { - - S . c u r r e n t } e l s e { i f ( i = = S . c u r r e n t ) { S . c u r r e n t = i > 0 ? i - 1 : i } } - - i } } } f u n c t i o n   l i s t e n K e y s ( o n ) { i f ( ! S . o p t i o n s . e n a b l e K e y s ) { r e t u r n } ( o n ? a d d E v e n t : r e m o v e E v e n t ) ( d o c u m e n t , " k e y d o w n " , h a n d l e K e y ) } f u n c t i o n   h a n d l e K e y ( e ) { i f ( e . m e t a K e y | | e . s h i f t K e y | | e . a l t K e y | | e . c t r l K e y ) { r e t u r n } v a r   c o d e = k e y C o d e ( e ) , h a n d l e r ; s w i t c h ( c o d e ) { c a s e   8 1 : c a s e   8 8 : c a s e   2 7 : h a n d l e r = S . c l o s e ; b r e a k ; c a s e   3 7 : h a n d l e r = S . p r e v i o u s ; b r e a k ; c a s e   3 9 : h a n d l e r = S . n e x t ; b r e a k ; c a s e   3 2 : h a n d l e r = t y p e o f   s l i d e T i m e r = = " n u m b e r " ? S . p a u s e : S . p l a y ; b r e a k } i f ( h a n d l e r ) { p r e v e n t D e f a u l t ( e ) ; h a n d l e r ( ) } } f u n c t i o n   l o a d ( c h a n g i n g ) { l i s t e n K e y s ( f a l s e ) ; v a r   o b j = S . g e t C u r r e n t ( ) ; v a r   p l a y e r = ( o b j . p l a y e r = = " i n l i n e " ? " h t m l " : o b j . p l a y e r ) ; i f ( t y p e o f   S [ p l a y e r ] ! = " f u n c t i o n " ) { t h r o w " u n k n o w n   p l a y e r   " + p l a y e r } i f ( c h a n g i n g ) { S . p l a y e r . r e m o v e ( ) ; S . r e v e r t O p t i o n s ( ) ; S . a p p l y O p t i o n s ( o b j . o p t i o n s | | { } ) } S . p l a y e r = n e w   S [ p l a y e r ] ( o b j , S . p l a y e r I d ) ; i f ( S . g a l l e r y . l e n g t h > 1 ) { v a r   n e x t = S . g a l l e r y [ S . c u r r e n t + 1 ] | | S . g a l l e r y [ 0 ] ; i f ( n e x t . p l a y e r = = " i m g " ) { v a r   a = n e w   I m a g e ( ) ; a . s r c = n e x t . c o n t e n t } v a r   p r e v = S . g a l l e r y [ S . c u r r e n t - 1 ] | | S . g a l l e r y [ S . g a l l e r y . l e n g t h - 1 ] ; i f ( p r e v . p l a y e r = = " i m g " ) { v a r   b = n e w   I m a g e ( ) ; b . s r c = p r e v . c o n t e n t } } S . s k i n . o n L o a d ( c h a n g i n g , w a i t R e a d y ) } f u n c t i o n   w a i t R e a d y ( ) { i f ( ! o p e n ) { r e t u r n } i f ( t y p e o f   S . p l a y e r . r e a d y ! = " u n d e f i n e d " ) { v a r   t i m e r = s e t I n t e r v a l ( f u n c t i o n ( ) { i f ( o p e n ) { i f ( S . p l a y e r . r e a d y ) { c l e a r I n t e r v a l ( t i m e r ) ; t i m e r = n u l l ; S . s k i n . o n R e a d y ( s h o w ) } } e l s e { c l e a r I n t e r v a l ( t i m e r ) ; t i m e r = n u l l } } , 1 0 ) } e l s e { S . s k i n . o n R e a d y ( s h o w ) } } f u n c t i o n   s h o w ( ) { i f ( ! o p e n ) { r e t u r n } S . p l a y e r . a p p e n d ( S . s k i n . b o d y , S . d i m e n s i o n s ) ; S . s k i n . o n S h o w ( f i n i s h ) } f u n c t i o n   f i n i s h ( ) { i f ( ! o p e n ) { r e t u r n } i f ( S . p l a y e r . o n L o a d ) { S . p l a y e r . o n L o a d ( ) } S . o p t i o n s . o n F i n i s h ( S . g e t C u r r e n t ( ) ) ; i f ( ! S . i s P a u s e d ( ) ) { S . p l a y ( ) } l i s t e n K e y s ( t r u e ) } i f ( ! A r r a y . p r o t o t y p e . i n d e x O f ) { A r r a y . p r o t o t y p e . i n d e x O f = f u n c t i o n ( o b j , f r o m ) { v a r   l e n = t h i s . l e n g t h > > > 0 ; f r o m = f r o m | | 0 ; i f ( f r o m < 0 ) { f r o m + = l e n } f o r ( ; f r o m < l e n ; + + f r o m ) { i f ( f r o m   i n   t h i s & & t h i s [ f r o m ] = = = o b j ) { r e t u r n   f r o m } } r e t u r n   - 1 } } f u n c t i o n   n o w ( ) { r e t u r n ( n e w   D a t e ) . g e t T i m e ( ) } f u n c t i o n   a p p l y ( o r i g i n a l , e x t e n s i o n ) { f o r ( v a r   p r o p e r t y   i n   e x t e n s i o n ) { o r i g i n a l [ p r o p e r t y ] = e x t e n s i o n [ p r o p e r t y ] } r e t u r n   o r i g i n a l } f u n c t i o n   e a c h ( o b j , c a l l b a c k ) { v a r   i = 0 , l e n = o b j . l e n g t h ; f o r ( v a r   v a l u e = o b j [ 0 ] ; i < l e n & & c a l l b a c k . c a l l ( v a l u e , i , v a l u e ) ! = = f a l s e ; v a l u e = o b j [ + + i ] ) { } } f u n c t i o n   s p r i n t f ( s t r , r e p l a c e ) { r e t u r n   s t r . r e p l a c e ( / \ { ( \ w + ? ) \ } / g , f u n c t i o n ( m a t c h , i ) { r e t u r n   r e p l a c e [ i ] } ) } f u n c t i o n   n o o p ( ) { } f u n c t i o n   g e t ( i d ) { r e t u r n   d o c u m e n t . g e t E l e m e n t B y I d ( i d ) } f u n c t i o n   r e m o v e ( e l ) { e l . p a r e n t N o d e . r e m o v e C h i l d ( e l ) } v a r   s u p p o r t s O p a c i t y = t r u e , s u p p o r t s F i x e d = t r u e ; f u n c t i o n   c h e c k S u p p o r t ( ) { v a r   b o d y = d o c u m e n t . b o d y , d i v = d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ; s u p p o r t s O p a c i t y = t y p e o f   d i v . s t y l e . o p a c i t y = = = " s t r i n g " ; d i v . s t y l e . p o s i t i o n = " f i x e d " ; d i v . s t y l e . m a r g i n = 0 ; d i v . s t y l e . t o p = " 2 0 p x " ; b o d y . a p p e n d C h i l d ( d i v , b o d y . f i r s t C h i l d ) ; s u p p o r t s F i x e d = d i v . o f f s e t T o p = = 2 0 ; b o d y . r e m o v e C h i l d ( d i v ) } S . g e t S t y l e = ( f u n c t i o n ( ) { v a r   o p a c i t y = / o p a c i t y = ( [ ^ ) ] * ) / , g e t C o m p u t e d S t y l e = d o c u m e n t . d e f a u l t V i e w & & d o c u m e n t . d e f a u l t V i e w . g e t C o m p u t e d S t y l e ; r e t u r n   f u n c t i o n ( e l , s t y l e ) { v a r   r e t ; i f ( ! s u p p o r t s O p a c i t y & & s t y l e = = " o p a c i t y " & & e l . c u r r e n t S t y l e ) { r e t = o p a c i t y . t e s t ( e l . c u r r e n t S t y l e . f i l t e r | | " " ) ? ( p a r s e F l o a t ( R e g E x p . $ 1 ) / 1 0 0 ) + " " : " " ; r e t u r n   r e t = = = " " ? " 1 " : r e t } i f ( g e t C o m p u t e d S t y l e ) { v a r   c o m p u t e d S t y l e = g e t C o m p u t e d S t y l e ( e l , n u l l ) ; i f ( c o m p u t e d S t y l e ) { r e t = c o m p u t e d S t y l e [ s t y l e ] } i f ( s t y l e = = " o p a c i t y " & & r e t = = " " ) { r e t = " 1 " } } e l s e { r e t = e l . c u r r e n t S t y l e [ s t y l e ] } r e t u r n   r e t } } ) ( ) ; S . a p p e n d H T M L = f u n c t i o n ( e l , h t m l ) { i f ( e l . i n s e r t A d j a c e n t H T M L ) { e l . i n s e r t A d j a c e n t H T M L ( " B e f o r e E n d " , h t m l ) } e l s e { i f ( e l . l a s t C h i l d ) { v a r   r a n g e = e l . o w n e r D o c u m e n t . c r e a t e R a n g e ( ) ; r a n g e . s e t S t a r t A f t e r ( e l . l a s t C h i l d ) ; v a r   f r a g = r a n g e . c r e a t e C o n t e x t u a l F r a g m e n t ( h t m l ) ; e l . a p p e n d C h i l d ( f r a g ) } e l s e { e l . i n n e r H T M L = h t m l } } } ; S . g e t W i n d o w S i z e = f u n c t i o n ( d i m e n s i o n ) { i f ( d o c u m e n t . c o m p a t M o d e = = = " C S S 1 C o m p a t " ) { r e t u r n   d o c u m e n t . d o c u m e n t E l e m e n t [ " c l i e n t " + d i m e n s i o n ] } r e t u r n   d o c u m e n t . b o d y [ " c l i e n t " + d i m e n s i o n ] } ; S . s e t O p a c i t y = f u n c t i o n ( e l , o p a c i t y ) { v a r   s t y l e = e l . s t y l e ; i f ( s u p p o r t s O p a c i t y ) { s t y l e . o p a c i t y = ( o p a c i t y = = 1 ? " " : o p a c i t y ) } e l s e { s t y l e . z o o m = 1 ; i f ( o p a c i t y = = 1 ) { i f ( t y p e o f   s t y l e . f i l t e r = = " s t r i n g " & & ( / a l p h a / i ) . t e s t ( s t y l e . f i l t e r ) ) { s t y l e . f i l t e r = s t y l e . f i l t e r . r e p l a c e ( / \ s * [ \ w \ . ] * a l p h a \ ( [ ^ \ ) ] * \ ) ; ? / g i , " " ) } } e l s e { s t y l e . f i l t e r = ( s t y l e . f i l t e r | | " " ) . r e p l a c e ( / \ s * [ \ w \ . ] * a l p h a \ ( [ ^ \ ) ] * \ ) / g i , " " ) + "   a l p h a ( o p a c i t y = " + ( o p a c i t y * 1 0 0 ) + " ) " } } } ; S . c l e a r O p a c i t y = f u n c t i o n ( e l ) { S . s e t O p a c i t y ( e l , 1 ) } ; f u n c t i o n   g e t T a r g e t ( e ) { v a r   t a r g e t = e . t a r g e t ? e . t a r g e t : e . s r c E l e m e n t ; r e t u r n   t a r g e t . n o d e T y p e = = 3 ? t a r g e t . p a r e n t N o d e : t a r g e t } f u n c t i o n   g e t P a g e X Y ( e ) { v a r   x = e . p a g e X | | ( e . c l i e n t X + ( d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l L e f t | | d o c u m e n t . b o d y . s c r o l l L e f t ) ) , y = e . p a g e Y | | ( e . c l i e n t Y + ( d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p | | d o c u m e n t . b o d y . s c r o l l T o p ) ) ; r e t u r n [ x , y ] } f u n c t i o n   p r e v e n t D e f a u l t ( e ) { e . p r e v e n t D e f a u l t ( ) } f u n c t i o n   k e y C o d e ( e ) { r e t u r n   e . w h i c h ? e . w h i c h : e . k e y C o d e } f u n c t i o n   a d d E v e n t ( e l , t y p e , h a n d l e r ) { i f ( e l . a d d E v e n t L i s t e n e r ) { e l . a d d E v e n t L i s t e n e r ( t y p e , h a n d l e r , f a l s e ) } e l s e { i f ( e l . n o d e T y p e = = = 3 | | e l . n o d e T y p e = = = 8 ) { r e t u r n } i f ( e l . s e t I n t e r v a l & & ( e l ! = = w i n d o w & & ! e l . f r a m e E l e m e n t ) ) { e l = w i n d o w } i f ( ! h a n d l e r . _ _ g u i d ) { h a n d l e r . _ _ g u i d = a d d E v e n t . g u i d + + } i f ( ! e l . e v e n t s ) { e l . e v e n t s = { } } v a r   h a n d l e r s = e l . e v e n t s [ t y p e ] ; i f ( ! h a n d l e r s ) { h a n d l e r s = e l . e v e n t s [ t y p e ] = { } ; i f ( e l [ " o n " + t y p e ] ) { h a n d l e r s [ 0 ] = e l [ " o n " + t y p e ] } } h a n d l e r s [ h a n d l e r . _ _ g u i d ] = h a n d l e r ; e l [ " o n " + t y p e ] = a d d E v e n t . h a n d l e E v e n t } } a d d E v e n t . g u i d = 1 ; a d d E v e n t . h a n d l e E v e n t = f u n c t i o n ( e v e n t ) { v a r   r e s u l t = t r u e ; e v e n t = e v e n t | | a d d E v e n t . f i x E v e n t ( ( ( t h i s . o w n e r D o c u m e n t | | t h i s . d o c u m e n t | | t h i s ) . p a r e n t W i n d o w | | w i n d o w ) . e v e n t ) ; v a r   h a n d l e r s = t h i s . e v e n t s [ e v e n t . t y p e ] ; f o r ( v a r   i   i n   h a n d l e r s ) { t h i s . _ _ h a n d l e E v e n t = h a n d l e r s [ i ] ; i f ( t h i s . _ _ h a n d l e E v e n t ( e v e n t ) = = = f a l s e ) { r e s u l t = f a l s e } } r e t u r n   r e s u l t } ; a d d E v e n t . p r e v e n t D e f a u l t = f u n c t i o n ( ) { t h i s . r e t u r n V a l u e = f a l s e } ; a d d E v e n t . s t o p P r o p a g a t i o n = f u n c t i o n ( ) { t h i s . c a n c e l B u b b l e = t r u e } ; a d d E v e n t . f i x E v e n t = f u n c t i o n ( e ) { e . p r e v e n t D e f a u l t = a d d E v e n t . p r e v e n t D e f a u l t ; e . s t o p P r o p a g a t i o n = a d d E v e n t . s t o p P r o p a g a t i o n ; r e t u r n   e } ; f u n c t i o n   r e m o v e E v e n t ( e l , t y p e , h a n d l e r ) { i f ( e l . r e m o v e E v e n t L i s t e n e r ) { e l . r e m o v e E v e n t L i s t e n e r ( t y p e , h a n d l e r , f a l s e ) } e l s e { i f ( e l . e v e n t s & & e l . e v e n t s [ t y p e ] ) { d e l e t e   e l . e v e n t s [ t y p e ] [ h a n d l e r . _ _ g u i d ] } } } v a r   l o a d e d = f a l s e , D O M C o n t e n t L o a d e d ; i f ( d o c u m e n t . a d d E v e n t L i s t e n e r ) { D O M C o n t e n t L o a d e d = f u n c t i o n ( ) { d o c u m e n t . r e m o v e E v e n t L i s t e n e r ( " D O M C o n t e n t L o a d e d " , D O M C o n t e n t L o a d e d , f a l s e ) ; S . l o a d ( ) } } e l s e { i f ( d o c u m e n t . a t t a c h E v e n t ) { D O M C o n t e n t L o a d e d = f u n c t i o n ( ) { i f ( d o c u m e n t . r e a d y S t a t e = = = " c o m p l e t e " ) { d o c u m e n t . d e t a c h E v e n t ( " o n r e a d y s t a t e c h a n g e " , D O M C o n t e n t L o a d e d ) ; S . l o a d ( ) } } } } f u n c t i o n   d o S c r o l l C h e c k ( ) { i f ( l o a d e d ) { r e t u r n } t r y { d o c u m e n t . d o c u m e n t E l e m e n t . d o S c r o l l ( " l e f t " ) } c a t c h ( e ) { s e t T i m e o u t ( d o S c r o l l C h e c k , 1 ) ; r e t u r n } S . l o a d ( ) } f u n c t i o n   b i n d L o a d ( ) { i f ( d o c u m e n t . r e a d y S t a t e = = = " c o m p l e t e " ) { r e t u r n   S . l o a d ( ) } i f ( d o c u m e n t . a d d E v e n t L i s t e n e r ) { d o c u m e n t . a d d E v e n t L i s t e n e r ( " D O M C o n t e n t L o a d e d " , D O M C o n t e n t L o a d e d , f a l s e ) ; 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 . l o a d , f a l s e ) } e l s e { i f ( d o c u m e n t . a t t a c h E v e n t ) { d o c u m e n t . a t t a c h E v e n t ( " o n r e a d y s t a t e c h a n g e " , D O M C o n t e n t L o a d e d ) ; w i n d o w . a t t a c h E v e n t ( " o n l o a d " , S . l o a d ) ; v a r   t o p L e v e l = f a l s e ; t r y { t o p L e v e l = w i n d o w . f r a m e E l e m e n t = = = n u l l } c a t c h ( e ) { } i f ( d o c u m e n t . d o c u m e n t E l e m e n t . d o S c r o l l & & t o p L e v e l ) { d o S c r o l l C h e c k ( ) } } } } S . l o a d = f u n c t i o n ( ) { i f ( l o a d e d ) { r e t u r n } i f ( ! d o c u m e n t . b o d y ) { r e t u r n   s e t T i m e o u t ( S . l o a d , 1 3 ) } l o a d e d = t r u e ; c h e c k S u p p o r t ( ) ; S . o n R e a d y ( ) ; i f ( ! S . o p t i o n s . s k i p S e t u p ) { S . s e t u p ( ) } S . s k i n . i n i t ( ) } ; S . p l u g i n s = { } ; i f ( n a v i g a t o r . p l u g i n s & & n a v i g a t o r . p l u g i n s . l e n g t h ) { v a r   n a m e s = [ ] ; e a c h ( n a v i g a t o r . p l u g i n s , f u n c t i o n ( i , p ) { n a m e s . p u s h ( p . n a m e ) } ) ; n a m e s = n a m e s . j o i n ( " , " ) ; v a r   f 4 m = n a m e s . i n d e x O f ( " F l i p 4 M a c " ) > - 1 ; S . p l u g i n s = { f l a : n a m e s . i n d e x O f ( " S h o c k w a v e   F l a s h " ) > - 1 , q t : n a m e s . i n d e x O f ( " Q u i c k T i m e " ) > - 1 , w m p : ! f 4 m & & n a m e s . i n d e x O f ( " W i n d o w s   M e d i a " ) > - 1 , f 4 m : f 4 m } } e l s e { v a r   d e t e c t P l u g i n = f u n c t i o n ( n a m e ) { v a r   a x o ; t r y { a x o = n e w   A c t i v e X O b j e c t ( n a m e ) } c a t c h ( e ) { } r e t u r n   ! ! a x o } ; S . p l u g i n s = { f l a : d e t e c t P l u g i n ( " S h o c k w a v e F l a s h . S h o c k w a v e F l a s h " ) , q t : d e t e c t P l u g i n ( " Q u i c k T i m e . Q u i c k T i m e " ) , w m p : d e t e c t P l u g i n ( " w m p l a y e r . o c x " ) , f 4 m : f a l s e } } v a r   r e l A t t r = / ^ ( l i g h t | s h a d o w ) b o x / i , e x p a n d o = " s h a d o w b o x C a c h e K e y " , c a c h e K e y = 1 ; S . c a c h e = { } ; S . s e l e c t = f u n c t i o n ( s e l e c t o r ) { v a r   l i n k s = [ ] ; i f ( ! s e l e c t o r ) { v a r   r e l ; e a c 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 ( " a " ) , f u n c t i o n ( i , e l ) { r e l = e l . g e t A t t r i b u t e ( " r e l " ) ; i f ( r e l & & r e l A t t r . t e s t ( r e l ) ) { l i n k s . p u s h ( e l ) } } ) } e l s e { v a r   l e n g t h = s e l e c t o r . l e n g t h ; i f ( l e n g t h ) { i f ( t y p e o f   s e l e c t o r = = " s t r i n g " ) { i f ( S . f i n d ) { l i n k s = S . f i n d ( s e l e c t o r ) } } e l s e { i f ( l e n g t h = = 2 & & t y p e o f   s e l e c t o r [ 0 ] = = " s t r i n g " & & s e l e c t o r [ 1 ] . n o d e T y p e ) { i f ( S . f i n d ) { l i n k s = S . f i n d ( s e l e c t o r [ 0 ] , s e l e c t o r [ 1 ] ) } } e l s e { f o r ( v a r   i = 0 ; i < l e n g t h ; + + i ) { l i n k s [ i ] = s e l e c t o r [ i ] } } } } e l s e { l i n k s . p u s h ( s e l e c t o r ) } } r e t u r n   l i n k s } ; S . s e t u p = f u n c t i o n ( s e l e c t o r , o p t i o n s ) { e a c h ( S . s e l e c t ( s e l e c t o r ) , f u n c t i o n ( i , l i n k ) { S . a d d C a c h e ( l i n k , o p t i o n s ) } ) } ; S . t e a r d o w n = f u n c t i o n ( s e l e c t o r ) { e a c h ( S . s e l e c t ( s e l e c t o r ) , f u n c t i o n ( i , l i n k ) { S . r e m o v e C a c h e ( l i n k ) } ) } ; S . a d d C a c h e = f u n c t i o n ( l i n k , o p t i o n s ) { v a r   k e y = l i n k [ e x p a n d o ] ; i f ( k e y = = u n d e f i n e d ) { k e y = c a c h e K e y + + ; l i n k [ e x p a n d o ] = k e y ; a d d E v e n t ( l i n k , " c l i c k " , h a n d l e C l i c k ) } S . c a c h e [ k e y ] = S . m a k e O b j e c t ( l i n k , o p t i o n s ) } ; S . r e m o v e C a c h e = f u n c t i o n ( l i n k ) { r e m o v e E v e n t ( l i n k , " c l i c k " , h a n d l e C l i c k ) ; d e l e t e   S . c a c h e [ l i n k [ e x p a n d o ] ] ; l i n k [ e x p a n d o ] = n u l l } ; S . g e t C a c h e = f u n c t i o n ( l i n k ) { v a r   k e y = l i n k [ e x p a n d o ] ; r e t u r n ( k e y   i n   S . c a c h e & & S . c a c h e [ k e y ] ) } ; S . c l e a r C a c h e = f u n c t i o n ( ) { f o r ( v a r   k e y   i n   S . c a c h e ) { S . r e m o v e C a c h e ( S . c a c h e [ k e y ] . l i n k ) } S . c a c h e = { } } ; f u n c t i o n   h a n d l e C l i c k ( e ) { S . o p e n ( t h i s ) ; i f ( S . g a l l e r y . l e n g t h ) { p r e v e n t D e f a u l t ( e ) } } 
 / * 
   *   S i z z l e   C S S   S e l e c t o r   E n g i n e   -   v 1 . 0 
   *     C o p y r i g h t   2 0 0 9 ,   T h e   D o j o   F o u n d a t i o n 
   *     R e l e a s e d   u n d e r   t h e   M I T ,   B S D ,   a n d   G P L   L i c e n s e s . 
   *     M o r e   i n f o r m a t i o n :   h t t p : / / s i z z l e j s . c o m / 
   * 
   *   M o d i f i e d   f o r   i n c l u s i o n   i n   S h a d o w b o x . j s 
   * / 
 S . f i n d = ( f u n c t i o n ( ) { v a r   c h u n k e r = / ( ( ? : \ ( ( ? : \ ( [ ^ ( ) ] + \ ) | [ ^ ( ) ] + ) + \ ) | \ [ ( ? : \ [ [ ^ [ \ ] ] * \ ] | [ ' " ] [ ^ ' " ] * [ ' " ] | [ ^ [ \ ] ' " ] + ) + \ ] | \ \ . | [ ^   > + ~ , ( \ [ \ \ ] + ) + | [ > + ~ ] ) ( \ s * , \ s * ) ? ( ( ? : . | \ r | \ n ) * ) / g , d o n e = 0 , t o S t r i n g = O b j e c t . p r o t o t y p e . t o S t r i n g , h a s D u p l i c a t e = f a l s e , b a s e H a s D u p l i c a t e = t r u e ; [ 0 , 0 ] . s o r t ( f u n c t i o n ( ) { b a s e H a s D u p l i c a t e = f a l s e ; r e t u r n   0 } ) ; v a r   S i z z l e = f u n c t i o n ( s e l e c t o r , c o n t e x t , r e s u l t s , s e e d ) { r e s u l t s = r e s u l t s | | [ ] ; v a r   o r i g C o n t e x t = c o n t e x t = c o n t e x t | | d o c u m e n t ; i f ( c o n t e x t . n o d e T y p e ! = = 1 & & c o n t e x t . n o d e T y p e ! = = 9 ) { r e t u r n [ ] } i f ( ! s e l e c t o r | | t y p e o f   s e l e c t o r ! = = " s t r i n g " ) { r e t u r n   r e s u l t s } v a r   p a r t s = [ ] , m , s e t , c h e c k S e t , e x t r a , p r u n e = t r u e , c o n t e x t X M L = i s X M L ( c o n t e x t ) , s o F a r = s e l e c t o r ; w h i l e ( ( c h u n k e r . e x e c ( " " ) , m = c h u n k e r . e x e c ( s o F a r ) ) ! = = n u l l ) { s o F a r = m [ 3 ] ; p a r t s . p u s h ( m [ 1 ] ) ; i f ( m [ 2 ] ) { e x t r a = m [ 3 ] ; b r e a k } } i f ( p a r t s . l e n g t h > 1 & & o r i g P O S . e x e c ( s e l e c t o r ) ) { i f ( p a r t s . l e n g t h = = = 2 & & E x p r . r e l a t i v e [ p a r t s [ 0 ] ] ) { s e t = p o s P r o c e s s ( p a r t s [ 0 ] + p a r t s [ 1 ] , c o n t e x t ) } e l s e { s e t = E x p r . r e l a t i v e [ p a r t s [ 0 ] ] ? [ c o n t e x t ] : S i z z l e ( p a r t s . s h i f t ( ) , c o n t e x t ) ; w h i l e ( p a r t s . l e n g t h ) { s e l e c t o r = p a r t s . s h i f t ( ) ; i f ( E x p r . r e l a t i v e [ s e l e c t o r ] ) { s e l e c t o r + = p a r t s . s h i f t ( ) } s e t = p o s P r o c e s s ( s e l e c t o r , s e t ) } } } e l s e { i f ( ! s e e d & & p a r t s . l e n g t h > 1 & & c o n t e x t . n o d e T y p e = = = 9 & & ! c o n t e x t X M L & & E x p r . m a t c h . I D . t e s t ( p a r t s [ 0 ] ) & & ! E x p r . m a t c h . I D . t e s t ( p a r t s [ p a r t s . l e n g t h - 1 ] ) ) { v a r   r e t = S i z z l e . f i n d ( p a r t s . s h i f t ( ) , c o n t e x t , c o n t e x t X M L ) ; c o n t e x t = r e t . e x p r ? S i z z l e . f i l t e r ( r e t . e x p r , r e t . s e t ) [ 0 ] : r e t . s e t [ 0 ] } i f ( c o n t e x t ) { v a r   r e t = s e e d ? { e x p r : p a r t s . p o p ( ) , s e t : m a k e A r r a y ( s e e d ) } : S i z z l e . f i n d ( p a r t s . p o p ( ) , p a r t s . l e n g t h = = = 1 & & ( p a r t s [ 0 ] = = = " ~ " | | p a r t s [ 0 ] = = = " + " ) & & c o n t e x t . p a r e n t N o d e ? c o n t e x t . p a r e n t N o d e : c o n t e x t , c o n t e x t X M L ) ; s e t = r e t . e x p r ? S i z z l e . f i l t e r ( r e t . e x p r , r e t . s e t ) : r e t . s e t ; i f ( p a r t s . l e n g t h > 0 ) { c h e c k S e t = m a k e A r r a y ( s e t ) } e l s e { p r u n e = f a l s e } w h i l e ( p a r t s . l e n g t h ) { v a r   c u r = p a r t s . p o p ( ) , p o p = c u r ; i f ( ! E x p r . r e l a t i v e [ c u r ] ) { c u r = " " } e l s e { p o p = p a r t s . p o p ( ) } i f ( p o p = = n u l l ) { p o p = c o n t e x t } E x p r . r e l a t i v e [ c u r ] ( c h e c k S e t , p o p , c o n t e x t X M L ) } } e l s e { c h e c k S e t = p a r t s = [ ] } } i f ( ! c h e c k S e t ) { c h e c k S e t = s e t } i f ( ! c h e c k S e t ) { t h r o w " S y n t a x   e r r o r ,   u n r e c o g n i z e d   e x p r e s s i o n :   " + ( c u r | | s e l e c t o r ) } i f ( t o S t r i n g . c a l l ( c h e c k S e t ) = = = " [ o b j e c t   A r r a y ] " ) { i f ( ! p r u n e ) { r e s u l t s . p u s h . a p p l y ( r e s u l t s , c h e c k S e t ) } e l s e { i f ( c o n t e x t & & c o n t e x t . n o d e T y p e = = = 1 ) { f o r ( v a r   i = 0 ; c h e c k S e t [ i ] ! = n u l l ; i + + ) { i f ( c h e c k S e t [ i ] & & ( c h e c k S e t [ i ] = = = t r u e | | c h e c k S e t [ i ] . n o d e T y p e = = = 1 & & c o n t a i n s ( c o n t e x t , c h e c k S e t [ i ] ) ) ) { r e s u l t s . p u s h ( s e t [ i ] ) } } } e l s e { f o r ( v a r   i = 0 ; c h e c k S e t [ i ] ! = n u l l ; i + + ) { i f ( c h e c k S e t [ i ] & & c h e c k S e t [ i ] . n o d e T y p e = = = 1 ) { r e s u l t s . p u s h ( s e t [ i ] ) } } } } } e l s e { m a k e A r r a y ( c h e c k S e t , r e s u l t s ) } i f ( e x t r a ) { S i z z l e ( e x t r a , o r i g C o n t e x t , r e s u l t s , s e e d ) ; S i z z l e . u n i q u e S o r t ( r e s u l t s ) } r e t u r n   r e s u l t s } ; S i z z l e . u n i q u e S o r t = f u n c t i o n ( r e s u l t s ) { i f ( s o r t O r d e r ) { h a s D u p l i c a t e = b a s e H a s D u p l i c a t e ; r e s u l t s . s o r t ( s o r t O r d e r ) ; i f ( h a s D u p l i c a t e ) { f o r ( v a r   i = 1 ; i < r e s u l t s . l e n g t h ; i + + ) { i f ( r e s u l t s [ i ] = = = r e s u l t s [ i - 1 ] ) { r e s u l t s . s p l i c e ( i - - , 1 ) } } } } r e t u r n   r e s u l t s } ; S i z z l e . m a t c h e s = f u n c t i o n ( e x p r , s e t ) { r e t u r n   S i z z l e ( e x p r , n u l l , n u l l , s e t ) } ; S i z z l e . f i n d = f u n c t i o n ( e x p r , c o n t e x t , i s X M L ) { v a r   s e t , m a t c h ; i f ( ! e x p r ) { r e t u r n [ ] } f o r ( v a r   i = 0 , l = E x p r . o r d e r . l e n g t h ; i < l ; i + + ) { v a r   t y p e = E x p r . o r d e r [ i ] , m a t c h ; i f ( ( m a t c h = E x p r . l e f t M a t c h [ t y p e ] . e x e c ( e x p r ) ) ) { v a r   l e f t = m a t c h [ 1 ] ; m a t c h . s p l i c e ( 1 , 1 ) ; i f ( l e f t . s u b s t r ( l e f t . l e n g t h - 1 ) ! = = " \ \ " ) { m a t c h [ 1 ] = ( m a t c h [ 1 ] | | " " ) . r e p l a c e ( / \ \ / g , " " ) ; s e t = E x p r . f i n d [ t y p e ] ( m a t c h , c o n t e x t , i s X M L ) ; i f ( s e t ! = n u l l ) { e x p r = e x p r . r e p l a c e ( E x p r . m a t c h [ t y p e ] , " " ) ; b r e a k } } } } i f ( ! s e t ) { s e t = c o n t e x t . g e t E l e m e n t s B y T a g N a m e ( " * " ) } r e t u r n { s e t : s e t , e x p r : e x p r } } ; S i z z l e . f i l t e r = f u n c t i o n ( e x p r , s e t , i n p l a c e , n o t ) { v a r   o l d = e x p r , r e s u l t = [ ] , c u r L o o p = s e t , m a t c h , a n y F o u n d , i s X M L F i l t e r = s e t & & s e t [ 0 ] & & i s X M L ( s e t [ 0 ] ) ; w h i l e ( e x p r & & s e t . l e n g t h ) { f o r ( v a r   t y p e   i n   E x p r . f i l t e r ) { i f ( ( m a t c h = E x p r . m a t c h [ t y p e ] . e x e c ( e x p r ) ) ! = n u l l ) { v a r   f i l t e r = E x p r . f i l t e r [ t y p e ] , f o u n d , i t e m ; a n y F o u n d = f a l s e ; i f ( c u r L o o p = = = r e s u l t ) { r e s u l t = [ ] } i f ( E x p r . p r e F i l t e r [ t y p e ] ) { m a t c h = E x p r . p r e F i l t e r [ t y p e ] ( m a t c h , c u r L o o p , i n p l a c e , r e s u l t , n o t , i s X M L F i l t e r ) ; i f ( ! m a t c h ) { a n y F o u n d = f o u n d = t r u e } e l s e { i f ( m a t c h = = = t r u e ) { c o n t i n u e } } } i f ( m a t c h ) { f o r ( v a r   i = 0 ; ( i t e m = c u r L o o p [ i ] ) ! = n u l l ; i + + ) { i f ( i t e m ) { f o u n d = f i l t e r ( i t e m , m a t c h , i , c u r L o o p ) ; v a r   p a s s = n o t ^ ! ! f o u n d ; i f ( i n p l a c e & & f o u n d ! = n u l l ) { i f ( p a s s ) { a n y F o u n d = t r u e } e l s e { c u r L o o p [ i ] = f a l s e } } e l s e { i f ( p a s s ) { r e s u l t . p u s h ( i t e m ) ; a n y F o u n d = t r u e } } } } } i f ( f o u n d ! = = u n d e f i n e d ) { i f ( ! i n p l a c e ) { c u r L o o p = r e s u l t } e x p r = e x p r . r e p l a c e ( E x p r . m a t c h [ t y p e ] , " " ) ; i f ( ! a n y F o u n d ) { r e t u r n [ ] } b r e a k } } } i f ( e x p r = = = o l d ) { i f ( a n y F o u n d = = n u l l ) { t h r o w " S y n t a x   e r r o r ,   u n r e c o g n i z e d   e x p r e s s i o n :   " + e x p r } e l s e { b r e a k } } o l d = e x p r } r e t u r n   c u r L o o p } ; v a r   E x p r = S i z z l e . s e l e c t o r s = { o r d e r : [ " I D " , " N A M E " , " T A G " ] , m a t c h : { I D : / # ( ( ? : [ \ w \ u 0 0 c 0 - \ u F F F F - ] | \ \ . ) + ) / , C L A S S : / \ . ( ( ? : [ \ w \ u 0 0 c 0 - \ u F F F F - ] | \ \ . ) + ) / , N A M E : / \ [ n a m e = [ ' " ] * ( ( ? : [ \ w \ u 0 0 c 0 - \ u F F F F - ] | \ \ . ) + ) [ ' " ] * \ ] / , A T T R : / \ [ \ s * ( ( ? : [ \ w \ u 0 0 c 0 - \ u F F F F - ] | \ \ . ) + ) \ s * ( ? : ( \ S ? = ) \ s * ( [ ' " ] * ) ( . * ? ) \ 3 | ) \ s * \ ] / , T A G : / ^ ( ( ? : [ \ w \ u 0 0 c 0 - \ u F F F F \ * - ] | \ \ . ) + ) / , C H I L D : / : ( o n l y | n t h | l a s t | f i r s t ) - c h i l d ( ? : \ ( ( e v e n | o d d | [ \ d n + - ] * ) \ ) ) ? / , P O S : / : ( n t h | e q | g t | l t | f i r s t | l a s t | e v e n | o d d ) ( ? : \ ( ( \ d * ) \ ) ) ? ( ? = [ ^ - ] | $ ) / , P S E U D O : / : ( ( ? : [ \ w \ u 0 0 c 0 - \ u F F F F - ] | \ \ . ) + ) ( ? : \ ( ( [ ' " ] * ) ( ( ? : \ ( [ ^ \ ) ] + \ ) | [ ^ \ 2 \ ( \ ) ] * ) + ) \ 2 \ ) ) ? / } , l e f t M a t c h : { } , a t t r M a p : { " c l a s s " : " c l a s s N a m e " , " f o r " : " h t m l F o r " } , a t t r H a n d l e : { h r e f : f u n c t i o n ( e l e m ) { r e t u r n   e l e m . g e t A t t r i b u t e ( " h r e f " ) } } , r e l a t i v e : { " + " : f u n c t i o n ( c h e c k S e t , p a r t ) { v a r   i s P a r t S t r = t y p e o f   p a r t = = = " s t r i n g " , i s T a g = i s P a r t S t r & & ! / \ W / . t e s t ( p a r t ) , i s P a r t S t r N o t T a g = i s P a r t S t r & & ! i s T a g ; i f ( i s T a g ) { p a r t = p a r t . t o L o w e r C a s e ( ) } f o r ( v a r   i = 0 , l = c h e c k S e t . l e n g t h , e l e m ; i < l ; i + + ) { i f ( ( e l e m = c h e c k S e t [ i ] ) ) { w h i l e ( ( e l e m = e l e m . p r e v i o u s S i b l i n g ) & & e l e m . n o d e T y p e ! = = 1 ) { } c h e c k S e t [ i ] = i s P a r t S t r N o t T a g | | e l e m & & e l e m . n o d e N a m e . t o L o w e r C a s e ( ) = = = p a r t ? e l e m | | f a l s e : e l e m = = = p a r t } } i f ( i s P a r t S t r N o t T a g ) { S i z z l e . f i l t e r ( p a r t , c h e c k S e t , t r u e ) } } , " > " : f u n c t i o n ( c h e c k S e t , p a r t ) { v a r   i s P a r t S t r = t y p e o f   p a r t = = = " s t r i n g " ; i f ( i s P a r t S t r & & ! / \ W / . t e s t ( p a r t ) ) { p a r t = p a r t . t o L o w e r C a s e ( ) ; f o r ( v a r   i = 0 , l = c h e c k S e t . l e n g t h ; i < l ; i + + ) { v a r   e l e m = c h e c k S e t [ i ] ; i f ( e l e m ) { v a r   p a r e n t = e l e m . p a r e n t N o d e ; c h e c k S e t [ i ] = p a r e n t . n o d e N a m e . t o L o w e r C a s e ( ) = = = p a r t ? p a r e n t : f a l s e } } } e l s e { f o r ( v a r   i = 0 , l = c h e c k S e t . l e n g t h ; i < l ; i + + ) { v a r   e l e m = c h e c k S e t [ i ] ; i f ( e l e m ) { c h e c k S e t [ i ] = i s P a r t S t r ? e l e m . p a r e n t N o d e : e l e m . p a r e n t N o d e = = = p a r t } } i f ( i s P a r t S t r ) { S i z z l e . f i l t e r ( p a r t , c h e c k S e t , t r u e ) } } } , " " : f u n c t i o n ( c h e c k S e t , p a r t , i s X M L ) { v a r   d o n e N a m e = d o n e + + , c h e c k F n = d i r C h e c k ; i f ( t y p e o f   p a r t = = = " s t r i n g " & & ! / \ W / . t e s t ( p a r t ) ) { v a r   n o d e C h e c k = p a r t = p a r t . t o L o w e r C a s e ( ) ; c h e c k F n = d i r N o d e C h e c k } c h e c k F n ( " p a r e n t N o d e " , p a r t , d o n e N a m e , c h e c k S e t , n o d e C h e c k , i s X M L ) } , " ~ " : f u n c t i o n ( c h e c k S e t , p a r t , i s X M L ) { v a r   d o n e N a m e = d o n e + + , c h e c k F n = d i r C h e c k ; i f ( t y p e o f   p a r t = = = " s t r i n g " & & ! / \ W / . t e s t ( p a r t ) ) { v a r   n o d e C h e c k = p a r t = p a r t . t o L o w e r C a s e ( ) ; c h e c k F n = d i r N o d e C h e c k } c h e c k F n ( " p r e v i o u s S i b l i n g " , p a r t , d o n e N a m e , c h e c k S e t , n o d e C h e c k , i s X M L ) } } , f i n d : { I D : f u n c t i o n ( m a t c h , c o n t e x t , i s X M L ) { i f ( t y p e o f   c o n t e x t . g e t E l e m e n t B y I d ! = = " u n d e f i n e d " & & ! i s X M L ) { v a r   m = c o n t e x t . g e t E l e m e n t B y I d ( m a t c h [ 1 ] ) ; r e t u r n   m ? [ m ] : [ ] } } , N A M E : f u n c t i o n ( m a t c h , c o n t e x t ) { i f ( t y p e o f   c o n t e x t . g e t E l e m e n t s B y N a m e ! = = " u n d e f i n e d " ) { v a r   r e t = [ ] , r e s u l t s = c o n t e x t . g e t E l e m e n t s B y N a m e ( m a t c h [ 1 ] ) ; f o r ( v a r   i = 0 , l = r e s u l t s . l e n g t h ; i < l ; i + + ) { i f ( r e s u l t s [ i ] . g e t A t t r i b u t e ( " n a m e " ) = = = m a t c h [ 1 ] ) { r e t . p u s h ( r e s u l t s [ i ] ) } } r e t u r n   r e t . l e n g t h = = = 0 ? n u l l : r e t } } , T A G : f u n c t i o n ( m a t c h , c o n t e x t ) { r e t u r n   c o n t e x t . g e t E l e m e n t s B y T a g N a m e ( m a t c h [ 1 ] ) } } , p r e F i l t e r : { C L A S S : f u n c t i o n ( m a t c h , c u r L o o p , i n p l a c e , r e s u l t , n o t , i s X M L ) { m a t c h = "   " + m a t c h [ 1 ] . r e p l a c e ( / \ \ / g , " " ) + "   " ; i f ( i s X M L ) { r e t u r n   m a t c h } f o r ( v a r   i = 0 , e l e m ; ( e l e m = c u r L o o p [ i ] ) ! = n u l l ; i + + ) { i f ( e l e m ) { i f ( n o t ^ ( e l e m . c l a s s N a m e & & ( "   " + e l e m . c l a s s N a m e + "   " ) . r e p l a c e ( / [ \ t \ n ] / g , "   " ) . i n d e x O f ( m a t c h ) > = 0 ) ) { i f ( ! i n p l a c e ) { r e s u l t . p u s h ( e l e m ) } } e l s e { i f ( i n p l a c e ) { c u r L o o p [ i ] = f a l s e } } } } r e t u r n   f a l s e } , I D : f u n c t i o n ( m a t c h ) { r e t u r n   m a t c h [ 1 ] . r e p l a c e ( / \ \ / g , " " ) } , T A G : f u n c t i o n ( m a t c h , c u r L o o p ) { r e t u r n   m a t c h [ 1 ] . t o L o w e r C a s e ( ) } , C H I L D : f u n c t i o n ( m a t c h ) { i f ( m a t c h [ 1 ] = = = " n t h " ) { v a r   t e s t = / ( - ? ) ( \ d * ) n ( ( ? : \ + | - ) ? \ d * ) / . e x e c ( m a t c h [ 2 ] = = = " e v e n " & & " 2 n " | | m a t c h [ 2 ] = = = " o d d " & & " 2 n + 1 " | | ! / \ D / . t e s t ( m a t c h [ 2 ] ) & & " 0 n + " + m a t c h [ 2 ] | | m a t c h [ 2 ] ) ; m a t c h [ 2 ] = ( t e s t [ 1 ] + ( t e s t [ 2 ] | | 1 ) ) - 0 ; m a t c h [ 3 ] = t e s t [ 3 ] - 0 } m a t c h [ 0 ] = d o n e + + ; r e t u r n   m a t c h } , A T T R : f u n c t i o n ( m a t c h , c u r L o o p , i n p l a c e , r e s u l t , n o t , i s X M L ) { v a r   n a m e = m a t c h [ 1 ] . r e p l a c e ( / \ \ / g , " " ) ; i f ( ! i s X M L & & E x p r . a t t r M a p [ n a m e ] ) { m a t c h [ 1 ] = E x p r . a t t r M a p [ n a m e ] } i f ( m a t c h [ 2 ] = = = " ~ = " ) { m a t c h [ 4 ] = "   " + m a t c h [ 4 ] + "   " } r e t u r n   m a t c h } , P S E U D O : f u n c t i o n ( m a t c h , c u r L o o p , i n p l a c e , r e s u l t , n o t ) { i f ( m a t c h [ 1 ] = = = " n o t " ) { i f ( ( c h u n k e r . e x e c ( m a t c h [ 3 ] ) | | " " ) . l e n g t h > 1 | | / ^ \ w / . t e s t ( m a t c h [ 3 ] ) ) { m a t c h [ 3 ] = S i z z l e ( m a t c h [ 3 ] , n u l l , n u l l , c u r L o o p ) } e l s e { v a r   r e t = S i z z l e . f i l t e r ( m a t c h [ 3 ] , c u r L o o p , i n p l a c e , t r u e ^ n o t ) ; i f ( ! i n p l a c e ) { r e s u l t . p u s h . a p p l y ( r e s u l t , r e t ) } r e t u r n   f a l s e } } e l s e { i f ( E x p r . m a t c h . P O S . t e s t ( m a t c h [ 0 ] ) | | E x p r . m a t c h . C H I L D . t e s t ( m a t c h [ 0 ] ) ) { r e t u r n   t r u e } } r e t u r n   m a t c h } , P O S : f u n c t i o n ( m a t c h ) { m a t c h . u n s h i f t ( t r u e ) ; r e t u r n   m a t c h } } , f i l t e r s : { e n a b l e d : f u n c t i o n ( e l e m ) { r e t u r n   e l e m . d i s a b l e d = = = f a l s e & & e l e m . t y p e ! = = " h i d d e n " } , d i s a b l e d : f u n c t i o n ( e l e m ) { r e t u r n   e l e m . d i s a b l e d = = = t r u e } , c h e c k e d : f u n c t i o n ( e l e m ) { r e t u r n   e l e m . c h e c k e d = = = t r u e } , s e l e c t e d : f u n c t i o n ( e l e m ) { e l e m . p a r e n t N o d e . s e l e c t e d I n d e x ; r e t u r n   e l e m . s e l e c t e d = = = t r u e } , p a r e n t : f u n c t i o n ( e l e m ) { r e t u r n   ! ! e l e m . f i r s t C h i l d } , e m p t y : f u n c t i o n ( e l e m ) { r e t u r n   ! e l e m . f i r s t C h i l d } , h a s : f u n c t i o n ( e l e m , i , m a t c h ) { r e t u r n   ! ! S i z z l e ( m a t c h [ 3 ] , e l e m ) . l e n g t h } , h e a d e r : f u n c t i o n ( e l e m ) { r e t u r n / h \ d / i . t e s t ( e l e m . n o d e N a m e ) } , t e x t : f u n c t i o n ( e l e m ) { r e t u r n " t e x t " = = = e l e m . t y p e } , r a d i o : f u n c t i o n ( e l e m ) { r e t u r n " r a d i o " = = = e l e m . t y p e } , c h e c k b o x : f u n c t i o n ( e l e m ) { r e t u r n " c h e c k b o x " = = = e l e m . t y p e } , f i l e : f u n c t i o n ( e l e m ) { r e t u r n " f i l e " = = = e l e m . t y p e } , p a s s w o r d : f u n c t i o n ( e l e m ) { r e t u r n " p a s s w o r d " = = = e l e m . t y p e } , s u b m i t : f u n c t i o n ( e l e m ) { r e t u r n " s u b m i t " = = = e l e m . t y p e } , i m a g e : f u n c t i o n ( e l e m ) { r e t u r n " i m a g e " = = = e l e m . t y p e } , r e s e t : f u n c t i o n ( e l e m ) { r e t u r n " r e s e t " = = = e l e m . t y p e } , b u t t o n : f u n c t i o n ( e l e m ) { r e t u r n " b u t t o n " = = = e l e m . t y p e | | e l e m . n o d e N a m e . t o L o w e r C a s e ( ) = = = " b u t t o n " } , i n p u t : f u n c t i o n ( e l e m ) { r e t u r n / i n p u t | s e l e c t | t e x t a r e a | b u t t o n / i . t e s t ( e l e m . n o d e N a m e ) } } , s e t F i l t e r s : { f i r s t : f u n c t i o n ( e l e m , i ) { r e t u r n   i = = = 0 } , l a s t : f u n c t i o n ( e l e m , i , m a t c h , a r r a y ) { r e t u r n   i = = = a r r a y . l e n g t h - 1 } , e v e n : f u n c t i o n ( e l e m , i ) { r e t u r n   i % 2 = = = 0 } , o d d : f u n c t i o n ( e l e m , i ) { r e t u r n   i % 2 = = = 1 } , l t : f u n c t i o n ( e l e m , i , m a t c h ) { r e t u r n   i < m a t c h [ 3 ] - 0 } , g t : f u n c t i o n ( e l e m , i , m a t c h ) { r e t u r n   i > m a t c h [ 3 ] - 0 } , n t h : f u n c t i o n ( e l e m , i , m a t c h ) { r e t u r n   m a t c h [ 3 ] - 0 = = = i } , e q : f u n c t i o n ( e l e m , i , m a t c h ) { r e t u r n   m a t c h [ 3 ] - 0 = = = i } } , f i l t e r : { P S E U D O : f u n c t i o n ( e l e m , m a t c h , i , a r r a y ) { v a r   n a m e = m a t c h [ 1 ] , f i l t e r = E x p r . f i l t e r s [ n a m e ] ; i f ( f i l t e r ) { r e t u r n   f i l t e r ( e l e m , i , m a t c h , a r r a y ) } e l s e { i f ( n a m e = = = " c o n t a i n s " ) { r e t u r n ( e l e m . t e x t C o n t e n t | | e l e m . i n n e r T e x t | | g e t T e x t ( [ e l e m ] ) | | " " ) . i n d e x O f ( m a t c h [ 3 ] ) > = 0 } e l s e { i f ( n a m e = = = " n o t " ) { v a r   n o t = m a t c h [ 3 ] ; f o r ( v a r   i = 0 , l = n o t . l e n g t h ; i < l ; i + + ) { i f ( n o t [ i ] = = = e l e m ) { r e t u r n   f a l s e } } r e t u r n   t r u e } e l s e { t h r o w " S y n t a x   e r r o r ,   u n r e c o g n i z e d   e x p r e s s i o n :   " + n a m e } } } } , C H I L D : f u n c t i o n ( e l e m , m a t c h ) { v a r   t y p e = m a t c h [ 1 ] , n o d e = e l e m ; s w i t c h ( t y p e ) { c a s e " o n l y " : c a s e " f i r s t " : w h i l e ( ( n o d e = n o d e . p r e v i o u s S i b l i n g ) ) { i f ( n o d e . n o d e T y p e = = = 1 ) { r e t u r n   f a l s e } } i f ( t y p e = = = " f i r s t " ) { r e t u r n   t r u e } n o d e = e l e m ; c a s e " l a s t " : w h i l e ( ( n o d e = n o d e . n e x t S i b l i n g ) ) { i f ( n o d e . n o d e T y p e = = = 1 ) { r e t u r n   f a l s e } } r e t u r n   t r u e ; c a s e " n t h " : v a r   f i r s t = m a t c h [ 2 ] , l a s t = m a t c h [ 3 ] ; i f ( f i r s t = = = 1 & & l a s t = = = 0 ) { r e t u r n   t r u e } v a r   d o n e N a m e = m a t c h [ 0 ] , p a r e n t = e l e m . p a r e n t N o d e ; i f ( p a r e n t & & ( p a r e n t . s i z c a c h e ! = = d o n e N a m e | | ! e l e m . n o d e I n d e x ) ) { v a r   c o u n t = 0 ; f o r ( n o d e = p a r e n t . f i r s t C h i l d ; n o d e ; n o d e = n o d e . n e x t S i b l i n g ) { i f ( n o d e . n o d e T y p e = = = 1 ) { n o d e . n o d e I n d e x = + + c o u n t } } p a r e n t . s i z c a c h e = d o n e N a m e } v a r   d i f f = e l e m . n o d e I n d e x - l a s t ; i f ( f i r s t = = = 0 ) { r e t u r n   d i f f = = = 0 } e l s e { r e t u r n ( d i f f % f i r s t = = = 0 & & d i f f / f i r s t > = 0 ) } } } , I D : f u n c t i o n ( e l e m , m a t c h ) { r e t u r n   e l e m . n o d e T y p e = = = 1 & & e l e m . g e t A t t r i b u t e ( " i d " ) = = = m a t c h } , T A G : f u n c t i o n ( e l e m , m a t c h ) { r e t u r n ( m a t c h = = = " * " & & e l e m . n o d e T y p e = = = 1 ) | | e l e m . n o d e N a m e . t o L o w e r C a s e ( ) = = = m a t c h } , C L A S S : f u n c t i o n ( e l e m , m a t c h ) { r e t u r n ( "   " + ( e l e m . c l a s s N a m e | | e l e m . g e t A t t r i b u t e ( " c l a s s " ) ) + "   " ) . i n d e x O f ( m a t c h ) > - 1 } , A T T R : f u n c t i o n ( e l e m , m a t c h ) { v a r   n a m e = m a t c h [ 1 ] , r e s u l t = E x p r . a t t r H a n d l e [ n a m e ] ? E x p r . a t t r H a n d l e [ n a m e ] ( e l e m ) : e l e m [ n a m e ] ! = n u l l ? e l e m [ n a m e ] : e l e m . g e t A t t r i b u t e ( n a m e ) , v a l u e = r e s u l t + " " , t y p e = m a t c h [ 2 ] , c h e c k = m a t c h [ 4 ] ; r e t u r n   r e s u l t = = n u l l ? t y p e = = = " ! = " : t y p e = = = " = " ? v a l u e = = = c h e c k : t y p e = = = " * = " ? v a l u e . i n d e x O f ( c h e c k ) > = 0 : t y p e = = = " ~ = " ? ( "   " + v a l u e + "   " ) . i n d e x O f ( c h e c k ) > = 0 : ! c h e c k ? v a l u e & & r e s u l t ! = = f a l s e : t y p e = = = " ! = " ? v a l u e ! = = c h e c k : t y p e = = = " ^ = " ? v a l u e . i n d e x O f ( c h e c k ) = = = 0 : t y p e = = = " $ = " ? v a l u e . s u b s t r ( v a l u e . l e n g t h - c h e c k . l e n g t h ) = = = c h e c k : t y p e = = = " | = " ? v a l u e = = = c h e c k | | v a l u e . s u b s t r ( 0 , c h e c k . l e n g t h + 1 ) = = = c h e c k + " - " : f a l s e } , P O S : f u n c t i o n ( e l e m , m a t c h , i , a r r a y ) { v a r   n a m e = m a t c h [ 2 ] , f i l t e r = E x p r . s e t F i l t e r s [ n a m e ] ; i f ( f i l t e r ) { r e t u r n   f i l t e r ( e l e m , i , m a t c h , a r r a y ) } } } } ; v a r   o r i g P O S = E x p r . m a t c h . P O S ; f o r ( v a r   t y p e   i n   E x p r . m a t c h ) { E x p r . m a t c h [ t y p e ] = n e w   R e g E x p ( E x p r . m a t c h [ t y p e ] . s o u r c e + / ( ? ! [ ^ \ [ ] * \ ] ) ( ? ! [ ^ \ ( ] * \ ) ) / . s o u r c e ) ; E x p r . l e f t M a t c h [ t y p e ] = n e w   R e g E x p ( / ( ^ ( ? : . | \ r | \ n ) * ? ) / . s o u r c e + E x p r . m a t c h [ t y p e ] . s o u r c e ) } v a r   m a k e A r r a y = f u n c t i o n ( a r r a y , r e s u l t s ) { a r r a y = A r r a y . p r o t o t y p e . s l i c e . c a l l ( a r r a y , 0 ) ; i f ( r e s u l t s ) { r e s u l t s . p u s h . a p p l y ( r e s u l t s , a r r a y ) ; r e t u r n   r e s u l t s } r e t u r n   a r r a y } ; t r y { A r r a y . p r o t o t y p e . s l i c e . c a l l ( d o c u m e n t . d o c u m e n t E l e m e n t . c h i l d N o d e s , 0 ) } c a t c h ( e ) { m a k e A r r a y = f u n c t i o n ( a r r a y , r e s u l t s ) { v a r   r e t = r e s u l t s | | [ ] ; i f ( t o S t r i n g . c a l l ( a r r a y ) = = = " [ o b j e c t   A r r a y ] " ) { A r r a y . p r o t o t y p e . p u s h . a p p l y ( r e t , a r r a y ) } e l s e { i f ( t y p e o f   a r r a y . l e n g t h = = = " n u m b e r " ) { f o r ( v a r   i = 0 , l = a r r a y . l e n g t h ; i < l ; i + + ) { r e t . p u s h ( a r r a y [ i ] ) } } e l s e { f o r ( v a r   i = 0 ; a r r a y [ i ] ; i + + ) { r e t . p u s h ( a r r a y [ i ] ) } } } r e t u r n   r e t } } v a r   s o r t O r d e r ; i f ( d o c u m e n t . d o c u m e n t E l e m e n t . c o m p a r e D o c u m e n t P o s i t i o n ) { s o r t O r d e r = f u n c t i o n ( a , b ) { i f ( ! a . c o m p a r e D o c u m e n t P o s i t i o n | | ! b . c o m p a r e D o c u m e n t P o s i t i o n ) { i f ( a = = b ) { h a s D u p l i c a t e = t r u e } r e t u r n   a . c o m p a r e D o c u m e n t P o s i t i o n ? - 1 : 1 } v a r   r e t = a . c o m p a r e D o c u m e n t P o s i t i o n ( b ) & 4 ? - 1 : a = = = b ? 0 : 1 ; i f ( r e t = = = 0 ) { h a s D u p l i c a t e = t r u e } r e t u r n   r e t } } e l s e { i f ( " s o u r c e I n d e x "   i n   d o c u m e n t . d o c u m e n t E l e m e n t ) { s o r t O r d e r = f u n c t i o n ( a , b ) { i f ( ! a . s o u r c e I n d e x | | ! b . s o u r c e I n d e x ) { i f ( a = = b ) { h a s D u p l i c a t e = t r u e } r e t u r n   a . s o u r c e I n d e x ? - 1 : 1 } v a r   r e t = a . s o u r c e I n d e x - b . s o u r c e I n d e x ; i f ( r e t = = = 0 ) { h a s D u p l i c a t e = t r u e } r e t u r n   r e t } } e l s e { i f ( d o c u m e n t . c r e a t e R a n g e ) { s o r t O r d e r = f u n c t i o n ( a , b ) { i f ( ! a . o w n e r D o c u m e n t | | ! b . o w n e r D o c u m e n t ) { i f ( a = = b ) { h a s D u p l i c a t e = t r u e } r e t u r n   a . o w n e r D o c u m e n t ? - 1 : 1 } v a r   a R a n g e = a . o w n e r D o c u m e n t . c r e a t e R a n g e ( ) , b R a n g e = b . o w n e r D o c u m e n t . c r e a t e R a n g e ( ) ; a R a n g e . s e t S t a r t ( a , 0 ) ; a R a n g e . s e t E n d ( a , 0 ) ; b R a n g e . s e t S t a r t ( b , 0 ) ; b R a n g e . s e t E n d ( b , 0 ) ; v a r   r e t = a R a n g e . c o m p a r e B o u n d a r y P o i n t s ( R a n g e . S T A R T _ T O _ E N D , b R a n g e ) ; i f ( r e t = = = 0 ) { h a s D u p l i c a t e = t r u e } r e t u r n   r e t } } } } f u n c t i o n   g e t T e x t ( e l e m s ) { v a r   r e t = " " , e l e m ; f o r ( v a r   i = 0 ; e l e m s [ i ] ; i + + ) { e l e m = e l e m s [ i ] ; i f ( e l e m . n o d e T y p e = = = 3 | | e l e m . n o d e T y p e = = = 4 ) { r e t + = e l e m . n o d e V a l u e } e l s e { i f ( e l e m . n o d e T y p e ! = = 8 ) { r e t + = g e t T e x t ( e l e m . c h i l d N o d e s ) } } } r e t u r n   r e t } ( f u n c t i o n ( ) { v a r   f o r m = d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) , i d = " s c r i p t " + ( n e w   D a t e ) . g e t T i m e ( ) ; f o r m . i n n e r H T M L = " < a   n a m e = ' " + i d + " ' / > " ; v a r   r o o t = d o c u m e n t . d o c u m e n t E l e m e n t ; r o o t . i n s e r t B e f o r e ( f o r m , r o o t . f i r s t C h i l d ) ; i f ( d o c u m e n t . g e t E l e m e n t B y I d ( i d ) ) { E x p r . f i n d . I D = f u n c t i o n ( m a t c h , c o n t e x t , i s X M L ) { i f ( t y p e o f   c o n t e x t . g e t E l e m e n t B y I d ! = = " u n d e f i n e d " & & ! i s X M L ) { v a r   m = c o n t e x t . g e t E l e m e n t B y I d ( m a t c h [ 1 ] ) ; r e t u r n   m ? m . i d = = = m a t c h [ 1 ] | | t y p e o f   m . g e t A t t r i b u t e N o d e ! = = " u n d e f i n e d " & & m . g e t A t t r i b u t e N o d e ( " i d " ) . n o d e V a l u e = = = m a t c h [ 1 ] ? [ m ] : u n d e f i n e d : [ ] } } ; E x p r . f i l t e r . I D = f u n c t i o n ( e l e m , m a t c h ) { v a r   n o d e = t y p e o f   e l e m . g e t A t t r i b u t e N o d e ! = = " u n d e f i n e d " & & e l e m . g e t A t t r i b u t e N o d e ( " i d " ) ; r e t u r n   e l e m . n o d e T y p e = = = 1 & & n o d e & & n o d e . n o d e V a l u e = = = m a t c h } } r o o t . r e m o v e C h i l d ( f o r m ) ; r o o t = f o r m = n u l l } ) ( ) ; ( f u n c t i o n ( ) { v a r   d i v = 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 i v . a p p e n d C h i l d ( d o c u m e n t . c r e a t e C o m m e n t ( " " ) ) ; i f ( d i v . g e t E l e m e n t s B y T a g N a m e ( " * " ) . l e n g t h > 0 ) { E x p r . f i n d . T A G = f u n c t i o n ( m a t c h , c o n t e x t ) { v a r   r e s u l t s = c o n t e x t . g e t E l e m e n t s B y T a g N a m e ( m a t c h [ 1 ] ) ; i f ( m a t c h [ 1 ] = = = " * " ) { v a r   t m p = [ ] ; f o r ( v a r   i = 0 ; r e s u l t s [ i ] ; i + + ) { i f ( r e s u l t s [ i ] . n o d e T y p e = = = 1 ) { t m p . p u s h ( r e s u l t s [ i ] ) } } r e s u l t s = t m p } r e t u r n   r e s u l t s } } d i v . i n n e r H T M L = " < a   h r e f = ' # ' > < / a > " ; i f ( d i v . f i r s t C h i l d & & t y p e o f   d i v . f i r s t C h i l d . g e t A t t r i b u t e ! = = " u n d e f i n e d " & & d i v . f i r s t C h i l d . g e t A t t r i b u t e ( " h r e f " ) ! = = " # " ) { E x p r . a t t r H a n d l e . h r e f = f u n c t i o n ( e l e m ) { r e t u r n   e l e m . g e t A t t r i b u t e ( " h r e f " , 2 ) } } d i v = n u l l } ) ( ) ; i f ( d o c u m e n t . q u e r y S e l e c t o r A l l ) { ( f u n c t i o n ( ) { v a r   o l d S i z z l e = S i z z l e , d i v = 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 i v . i n n e r H T M L = " < p   c l a s s = ' T E S T ' > < / p > " ; i f ( d i v . q u e r y S e l e c t o r A l l & & d i v . q u e r y S e l e c t o r A l l ( " . T E S T " ) . l e n g t h = = = 0 ) { r e t u r n } S i z z l e = f u n c t i o n ( q u e r y , c o n t e x t , e x t r a , s e e d ) { c o n t e x t = c o n t e x t | | d o c u m e n t ; i f ( ! s e e d & & c o n t e x t . n o d e T y p e = = = 9 & & ! i s X M L ( c o n t e x t ) ) { t r y { r e t u r n   m a k e A r r a y ( c o n t e x t . q u e r y S e l e c t o r A l l ( q u e r y ) , e x t r a ) } c a t c h ( e ) { } } r e t u r n   o l d S i z z l e ( q u e r y , c o n t e x t , e x t r a , s e e d ) } ; f o r ( v a r   p r o p   i n   o l d S i z z l e ) { S i z z l e [ p r o p ] = o l d S i z z l e [ p r o p ] } d i v = n u l l } ) ( ) } ( f u n c t i o n ( ) { v a r   d i v = 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 i v . i n n e r H T M L = " < d i v   c l a s s = ' t e s t   e ' > < / d i v > < d i v   c l a s s = ' t e s t ' > < / d i v > " ; i f ( ! d i v . g e t E l e m e n t s B y C l a s s N a m e | | d i v . g e t E l e m e n t s B y C l a s s N a m e ( " e " ) . l e n g t h = = = 0 ) { r e t u r n } d i v . l a s t C h i l d . c l a s s N a m e = " e " ; i f ( d i v . g e t E l e m e n t s B y C l a s s N a m e ( " e " ) . l e n g t h = = = 1 ) { r e t u r n } E x p r . o r d e r . s p l i c e ( 1 , 0 , " C L A S S " ) ; E x p r . f i n d . C L A S S = f u n c t i o n ( m a t c h , c o n t e x t , i s X M L ) { i f ( t y p e o f   c o n t e x t . g e t E l e m e n t s B y C l a s s N a m e ! = = " u n d e f i n e d " & & ! i s X M L ) { r e t u r n   c o n t e x t . g e t E l e m e n t s B y C l a s s N a m e ( m a t c h [ 1 ] ) } } ; d i v = n u l l } ) ( ) ; f u n c t i o n   d i r N o d e C h e c k ( d i r , c u r , d o n e N a m e , c h e c k S e t , n o d e C h e c k , i s X M L ) { f o r ( v a r   i = 0 , l = c h e c k S e t . l e n g t h ; i < l ; i + + ) { v a r   e l e m = c h e c k S e t [ i ] ; i f ( e l e m ) { e l e m = e l e m [ d i r ] ; v a r   m a t c h = f a l s e ; w h i l e ( e l e m ) { i f ( e l e m . s i z c a c h e = = = d o n e N a m e ) { m a t c h = c h e c k S e t [ e l e m . s i z s e t ] ; b r e a k } i f ( e l e m . n o d e T y p e = = = 1 & & ! i s X M L ) { e l e m . s i z c a c h e = d o n e N a m e ; e l e m . s i z s e t = i } i f ( e l e m . n o d e N a m e . t o L o w e r C a s e ( ) = = = c u r ) { m a t c h = e l e m ; b r e a k } e l e m = e l e m [ d i r ] } c h e c k S e t [ i ] = m a t c h } } } f u n c t i o n   d i r C h e c k ( d i r , c u r , d o n e N a m e , c h e c k S e t , n o d e C h e c k , i s X M L ) { f o r ( v a r   i = 0 , l = c h e c k S e t . l e n g t h ; i < l ; i + + ) { v a r   e l e m = c h e c k S e t [ i ] ; i f ( e l e m ) { e l e m = e l e m [ d i r ] ; v a r   m a t c h = f a l s e ; w h i l e ( e l e m ) { i f ( e l e m . s i z c a c h e = = = d o n e N a m e ) { m a t c h = c h e c k S e t [ e l e m . s i z s e t ] ; b r e a k } i f ( e l e m . n o d e T y p e = = = 1 ) { i f ( ! i s X M L ) { e l e m . s i z c a c h e = d o n e N a m e ; e l e m . s i z s e t = i } i f ( t y p e o f   c u r ! = = " s t r i n g " ) { i f ( e l e m = = = c u r ) { m a t c h = t r u e ; b r e a k } } e l s e { i f ( S i z z l e . f i l t e r ( c u r , [ e l e m ] ) . l e n g t h > 0 ) { m a t c h = e l e m ; b r e a k } } } e l e m = e l e m [ d i r ] } c h e c k S e t [ i ] = m a t c h } } } v a r   c o n t a i n s = d o c u m e n t . c o m p a r e D o c u m e n t P o s i t i o n ? f u n c t i o n ( a , b ) { r e t u r n   a . c o m p a r e D o c u m e n t P o s i t i o n ( b ) & 1 6 } : f u n c t i o n ( a , b ) { r e t u r n   a ! = = b & & ( a . c o n t a i n s ? a . c o n t a i n s ( b ) : t r u e ) } ; v a r   i s X M L = f u n c t i o n ( e l e m ) { v a r   d o c u m e n t E l e m e n t = ( e l e m ? e l e m . o w n e r D o c u m e n t | | e l e m : 0 ) . d o c u m e n t E l e m e n t ; r e t u r n   d o c u m e n t E l e m e n t ? d o c u m e n t E l e m e n t . n o d e N a m e ! = = " H T M L " : f a l s e } ; v a r   p o s P r o c e s s = f u n c t i o n ( s e l e c t o r , c o n t e x t ) { v a r   t m p S e t = [ ] , l a t e r = " " , m a t c h , r o o t = c o n t e x t . n o d e T y p e ? [ c o n t e x t ] : c o n t e x t ; w h i l e ( ( m a t c h = E x p r . m a t c h . P S E U D O . e x e c ( s e l e c t o r ) ) ) { l a t e r + = m a t c h [ 0 ] ; s e l e c t o r = s e l e c t o r . r e p l a c e ( E x p r . m a t c h . P S E U D O , " " ) } s e l e c t o r = E x p r . r e l a t i v e [ s e l e c t o r ] ? s e l e c t o r + " * " : s e l e c t o r ; f o r ( v a r   i = 0 , l = r o o t . l e n g t h ; i < l ; i + + ) { S i z z l e ( s e l e c t o r , r o o t [ i ] , t m p S e t ) } r e t u r n   S i z z l e . f i l t e r ( l a t e r , t m p S e t ) } ; r e t u r n   S i z z l e } ) ( ) ; 
 / * 
   *   S W F O b j e c t   v 2 . 1   < h t t p : / / c o d e . g o o g l e . c o m / p / s w f o b j e c t / > 
   *   C o p y r i g h t   ( c )   2 0 0 7 - 2 0 0 8   G e o f f   S t e a r n s ,   M i c h a e l   W i l l i a m s ,   a n d   B o b b y   v a n   d e r   S l u i s 
   *   T h i s   s o f t w a r e   i s   r e l e a s e d   u n d e r   t h e   M I T   L i c e n s e   < h t t p : / / w w w . o p e n s o u r c e . o r g / l i c e n s e s / m i t - l i c e n s e . p h p > 
   * 
   *   M o d i f i e d   f o r   i n c l u s i o n   i n   S h a d o w b o x . j s 
   * / 
 S . f l a s h = ( f u n c t i o n ( ) { v a r   s w f o b j e c t = f u n c t i o n ( ) { v a r   U N D E F = " u n d e f i n e d " , O B J E C T = " o b j e c t " , S H O C K W A V E _ F L A S H = " S h o c k w a v e   F l a s h " , S H O C K W A V E _ F L A S H _ A X = " S h o c k w a v e F l a s h . S h o c k w a v e F l a s h " , F L A S H _ M I M 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 " , E X P R E S S _ I N S T A L L _ I D = " S W F O b j e c t E x p r I n s t " , w i n = w i n d o w , d o c = d o c u m e n t , n a v = n a v i g a t o r , d o m L o a d F n A r r = [ ] , r e g O b j A r r = [ ] , o b j I d A r r = [ ] , l i s t e n e r s A r r = [ ] , s c r i p t , t i m e r = n u l l , s t o r e d A l t C o n t e n t = n u l l , s t o r e d A l t C o n t e n t I d = n u l l , i s D o m L o a d e d = f a l s e , i s E x p r e s s I n s t a l l A c t i v e = f a l s e ; v a r   u a = f u n c t i o n ( ) { v a r   w 3 c d o m = t y p e o f   d o c . g e t E l e m e n t B y I d ! = U N D E F & & t y p e o f   d o c . g e t E l e m e n t s B y T a g N a m e ! = U N D E F & & t y p e o f   d o c . c r e a t e E l e m e n t ! = U N D E F , p l a y e r V e r s i o n = [ 0 , 0 , 0 ] , d = n u l l ; i f ( t y p e o f   n a v . p l u g i n s ! = U N D E F & & t y p e o f   n a v . p l u g i n s [ S H O C K W A V E _ F L A S H ] = = O B J E C T ) { d = n a v . p l u g i n s [ S H O C K W A V E _ F L A S H ] . d e s c r i p t i o n ; i f ( d & & ! ( t y p e o f   n a v . m i m e T y p e s ! = U N D E F & & n a v . m i m e T y p e s [ F L A S H _ M I M E _ T Y P E ] & & ! n a v . m i m e T y p e s [ F L A S H _ M I M E _ T Y P E ] . e n a b l e d P l u g i n ) ) { d = d . r e p l a c e ( / ^ . * \ s + ( \ S + \ s + \ S + $ ) / , " $ 1 " ) ; p l a y e r V e r s i o n [ 0 ] = p a r s e I n t ( d . r e p l a c e ( / ^ ( . * ) \ . . * $ / , " $ 1 " ) , 1 0 ) ; p l a y e r V e r s i o n [ 1 ] = p a r s e I n t ( d . r e p l a c e ( / ^ . * \ . ( . * ) \ s . * $ / , " $ 1 " ) , 1 0 ) ; p l a y e r V e r s i o n [ 2 ] = / r / . t e s t ( d ) ? p a r s e I n t ( d . r e p l a c e ( / ^ . * r ( . * ) $ / , " $ 1 " ) , 1 0 ) : 0 } } e l s e { i f ( t y p e o f   w i n . A c t i v e X O b j e c t ! = U N D E F ) { v a r   a = n u l l , f p 6 C r a s h = f a l s e ; t r y { a = n e w   A c t i v e X O b j e c t ( S H O C K W A V E _ F L A S H _ A X + " . 7 " ) } c a t c h ( e ) { t r y { a = n e w   A c t i v e X O b j e c t ( S H O C K W A V E _ F L A S H _ A X + " . 6 " ) ; p l a y e r V e r s i o n = [ 6 , 0 , 2 1 ] ; a . A l l o w S c r i p t A c c e s s = " a l w a y s " } c a t c h ( e ) { i f ( p l a y e r V e r s i o n [ 0 ] = = 6 ) { f p 6 C r a s h = t r u e } } i f ( ! f p 6 C r a s h ) { t r y { a = n e w   A c t i v e X O b j e c t ( S H O C K W A V E _ F L A S H _ A X ) } c a t c h ( e ) { } } } i f ( ! f p 6 C r a s h & & a ) { t r y { d = a . G e t V a r i a b l e ( " $ v e r s i o n " ) ; i f ( d ) { d = d . s p l i t ( "   " ) [ 1 ] . s p l i t ( " , " ) ; p l a y e r V e r s i o n = [ p a r s e I n t ( d [ 0 ] , 1 0 ) , p a r s e I n t ( d [ 1 ] , 1 0 ) , p a r s e I n t ( d [ 2 ] , 1 0 ) ] } } c a t c h ( e ) { } } } } v a r   u = n a v . u s e r A g e n t . t o L o w e r C a s e ( ) , p = n a v . p l a t f o r m . t o L o w e r C a s e ( ) , w e b k i t = / w e b k i t / . t e s t ( u ) ? p a r s e F l o a t ( u . r e p l a c e ( / ^ . * w e b k i t \ / ( \ d + ( \ . \ d + ) ? ) . * $ / , " $ 1 " ) ) : f a l s e , i e = f a l s e , w i n d o w s = p ? / w i n / . t e s t ( p ) : / w i n / . t e s t ( u ) , m a c = p ? / m a c / . t e s t ( p ) : / m a c / . t e s t ( u ) ; 
 / * @ c c _ o n 
 	 	 	 i e   =   t r u e ; 
 	 	 	 @ i f   ( @ _ w i n 3 2 ) 
 	 	 	 	 w i n d o w s   =   t r u e ; 
 	 	 	 @ e l i f   ( @ _ m a c ) 
 	 	 	 	 m a c   =   t r u e ; 
 	 	 	 @ e n d 
 	 	 @ * / 
 r e t u r n { w 3 c d o m : w 3 c d o m , p v : p l a y e r V e r s i o n , w e b k i t : w e b k i t , i e : i e , w i n : w i n d o w s , m a c : m a c } } ( ) ; v a r   o n D o m L o a d = f u n c t i o n ( ) { i f ( ! u a . w 3 c d o m ) { r e t u r n } a d d D o m L o a d E v e n t ( m a i n ) ; i f ( u a . i e & & u a . w i n ) { t r y { d o c . w r i t e ( " < s c r i p t   i d = _ _ i e _ o n d o m l o a d   d e f e r = t r u e   s r c = / / : > < \ / s c r i p t > " ) ; s c r i p t = g e t E l e m e n t B y I d ( " _ _ i e _ o n d o m l o a d " ) ; i f ( s c r i p t ) { a d d L i s t e n e r ( s c r i p t , " o n r e a d y s t a t e c h a n g e " , c h e c k R e a d y S t a t e ) } } c a t c h ( e ) { } } i f ( u a . w e b k i t & & t y p e o f   d o c . r e a d y S t a t e ! = U N D E F ) { t i m e r = s e t I n t e r v a l ( f u n c t i o n ( ) { i f ( / l o a d e d | c o m p l e t e / . t e s t ( d o c . r e a d y S t a t e ) ) { c a l l D o m L o a d F u n c t i o n s ( ) } } , 1 0 ) } i f ( t y p e o f   d o c . a d d E v e n t L i s t e n e r ! = U N D E F ) { d o c . a d d E v e n t L i s t e n e r ( " D O M C o n t e n t L o a d e d " , c a l l D o m L o a d F u n c t i o n s , n u l l ) } a d d L o a d E v e n t ( c a l l D o m L o a d F u n c t i o n s ) } ( ) ; f u n c t i o n   c h e c k R e a d y S t a t e ( ) { i f ( 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 . p a r e n t N o d e . r e m o v e C h i l d ( s c r i p t ) ; c a l l D o m L o a d F u n c t i o n s ( ) } } f u n c t i o n   c a l l D o m L o a d F u n c t i o n s ( ) { i f ( i s D o m L o a d e d ) { r e t u r n } i f ( u a . i e & & u a . w i n ) { v a r   s = c r e a t e E l e m e n t ( " s p a n " ) ; t r y { v a r   t = d o c . g e t E l e m e n t s B y T a g N a m e ( " b o d y " ) [ 0 ] . a p p e n d C h i l d ( s ) ; t . p a r e n t N o d e . r e m o v e C h i l d ( t ) } c a t c h ( e ) { r e t u r n } } i s D o m L o a d e d = t r u e ; i f ( t i m e r ) { c l e a r I n t e r v a l ( t i m e r ) ; t i m e r = n u l l } v a r   d l = d o m L o a d F n A r r . l e n g t h ; f o r ( v a r   i = 0 ; i < d l ; i + + ) { d o m L o a d F n A r r [ i ] ( ) } } f u n c t i o n   a d d D o m L o a d E v e n t ( f n ) { i f ( i s D o m L o a d e d ) { f n ( ) } e l s e { d o m L o a d F n A r r [ d o m L o a d F n A r r . l e n g t h ] = f n } } f u n c t i o n   a d d L o a d E v e n t ( f n ) { i f ( t y p e o f   w i n . a d d E v e n t L i s t e n e r ! = U N D E F ) { w i n . a d d E v e n t L i s t e n e r ( " l o a d " , f n , f a l s e ) } e l s e { i f ( t y p e o f   d o c . a d d E v e n t L i s t e n e r ! = U N D E F ) { d o c . a d d E v e n t L i s t e n e r ( " l o a d " , f n , f a l s e ) } e l s e { i f ( t y p e o f   w i n . a t t a c h E v e n t ! = U N D E F ) { a d d L i s t e n e r ( w i n , " o n l o a d " , f n ) } e l s e { i f ( t y p e o f   w i n . o n l o a d = = " f u n c t i o n " ) { v a r   f n O l d = w i n . o n l o a d ; w i n . o n l o a d = f u n c t i o n ( ) { f n O l d ( ) ; f n ( ) } } e l s e { w i n . o n l o a d = f n } } } } } f u n c t i o n   m a i n ( ) { v a r   r l = r e g O b j A r r . l e n g t h ; f o r ( v a r   i = 0 ; i < r l ; i + + ) { v a r   i d = r e g O b j A r r [ i ] . i d ; i f ( u a . p v [ 0 ] > 0 ) { v a r   o b j = g e t E l e m e n t B y I d ( i d ) ; i f ( o b j ) { r e g O b j A r r [ i ] . w i d t h = o b j . g e t A t t r i b u t e ( " w i d t h " ) ? o b j . g e t A t t r i b u t e ( " w i d t h " ) : " 0 " ; r e g O b j A r r [ i ] . h e i g h t = o b j . g e t A t t r i b u t e ( " h e i g h t " ) ? o b j . g e t A t t r i b u t e ( " h e i g h t " ) : " 0 " ; i f ( h a s P l a y e r V e r s i o n ( r e g O b j A r r [ i ] . s w f V e r s i o n ) ) { i f ( u a . w e b k i t & & u a . w e b k i t < 3 1 2 ) { f i x P a r a m s ( o b j ) } s e t V i s i b i l i t y ( i d , t r u e ) } e l s e { i f ( r e g O b j A r r [ i ] . e x p r e s s I n s t a l l & & ! i s E x p r e s s I n s t a l l A c t i v e & & h a s P l a y e r V e r s i o n ( " 6 . 0 . 6 5 " ) & & ( u a . w i n | | u a . m a c ) ) { s h o w E x p r e s s I n s t a l l ( r e g O b j A r r [ i ] ) } e l s e { d i s p l a y A l t C o n t e n t ( o b j ) } } } } e l s e { s e t V i s i b i l i t y ( i d , t r u e ) } } } f u n c t i o n   f i x P a r a m s ( o b j ) { v a r   n e s t e d O b j = o b j . g e t E l e m e n t s B y T a g N a m e ( O B J E C T ) [ 0 ] ; i f ( n e s t e d O b j ) { v a r   e = c r e a t e E l e m e n t ( " e m b e d " ) , a = n e s t e d O b j . a t t r i b u t e s ; i f ( a ) { v a r   a l = a . l e n g t h ; f o r ( v a r   i = 0 ; i < a l ; i + + ) { i f ( a [ i ] . n o d e N a m e = = " D A T A " ) { e . s e t A t t r i b u t e ( " s r c " , a [ i ] . n o d e V a l u e ) } e l s e { e . s e t A t t r i b u t e ( a [ i ] . n o d e N a m e , a [ i ] . n o d e V a l u e ) } } } v a r   c = n e s t e d O b j . c h i l d N o d e s ; i f ( c ) { v a r   c l = c . l e n g t h ; f o r ( v a r   j = 0 ; j < c l ; j + + ) { i f ( c [ j ] . n o d e T y p e = = 1 & & c [ j ] . n o d e N a m e = = " P A R A M " ) { e . s e t A t t r i b u t e ( c [ j ] . g e t A t t r i b u t e ( " n a m e " ) , c [ j ] . g e t A t t r i b u t e ( " v a l u e " ) ) } } } o b j . p a r e n t N o d e . r e p l a c e C h i l d ( e , o b j ) } } f u n c t i o n   s h o w E x p r e s s I n s t a l l ( r e g O b j ) { i s E x p r e s s I n s t a l l A c t i v e = t r u e ; v a r   o b j = g e t E l e m e n t B y I d ( r e g O b j . i d ) ; i f ( o b j ) { i f ( r e g O b j . a l t C o n t e n t I d ) { v a r   a c = g e t E l e m e n t B y I d ( r e g O b j . a l t C o n t e n t I d ) ; i f ( a c ) { s t o r e d A l t C o n t e n t = a c ; s t o r e d A l t C o n t e n t I d = r e g O b j . a l t C o n t e n t I d } } e l s e { s t o r e d A l t C o n t e n t = a b s t r a c t A l t C o n t e n t ( o b j ) } i f ( ! ( / % $ / . t e s t ( r e g O b j . w i d t h ) ) & & p a r s e I n t ( r e g O b j . w i d t h , 1 0 ) < 3 1 0 ) { r e g O b j . w i d t h = " 3 1 0 " } i f ( ! ( / % $ / . t e s t ( r e g O b j . h e i g h t ) ) & & p a r s e I n t ( r e g O b j . h e i g h t , 1 0 ) < 1 3 7 ) { r e g O b j . h e i g h t = " 1 3 7 " } d o c . t i t l e = d o c . t i t l e . s l i c e ( 0 , 4 7 ) + "   -   F l a s h   P l a y e r   I n s t a l l a t i o n " ; v a r   p t = u a . i e & & u a . w i n ? " A c t i v e X " : " P l u g I n " , d t = d o c . t i t l e , f v = " M M r e d i r e c t U R L = " + w i n . l o c a t i o n + " & M M p l a y e r T y p e = " + p t + " & M M d o c t i t l e = " + d t , r e p l a c e I d = r e g O b j . i d ; i f ( u a . i e & & u a . w i n & & o b j . r e a d y S t a t e ! = 4 ) { v a r   n e w O b j = c r e a t e E l e m e n t ( " d i v " ) ; r e p l a c e I d + = " S W F O b j e c t N e w " ; n e w O b j . s e t A t t r i b u t e ( " i d " , r e p l a c e I d ) ; o b j . p a r e n t N o d e . i n s e r t B e f o r e ( n e w O b j , o b j ) ; o b j . s t y l e . d i s p l a y = " n o n e " ; v a r   f n = f u n c t i o n ( ) { o b j . p a r e n t N o d e . r e m o v e C h i l d ( o b j ) } ; a d d L i s t e n e r ( w i n , " o n l o a d " , f n ) } c r e a t e S W F ( { d a t a : r e g O b j . e x p r e s s I n s t a l l , i d : E X P R E S S _ I N S T A L L _ I D , w i d t h : r e g O b j . w i d t h , h e i g h t : r e g O b j . h e i g h t } , { f l a s h v a r s : f v } , r e p l a c e I d ) } } f u n c t i o n   d i s p l a y A l t C o n t e n t ( o b j ) { i f ( u a . i e & & u a . w i n & & o b j . r e a d y S t a t e ! = 4 ) { v a r   e l = c r e a t e E l e m e n t ( " d i v " ) ; o b j . p a r e n t N o d e . i n s e r t B e f o r e ( e l , o b j ) ; e l . p a r e n t N o d e . r e p l a c e C h i l d ( a b s t r a c t A l t C o n t e n t ( o b j ) , e l ) ; o b j . s t y l e . d i s p l a y = " n o n e " ; v a r   f n = f u n c t i o n ( ) { o b j . p a r e n t N o d e . r e m o v e C h i l d ( o b j ) } ; a d d L i s t e n e r ( w i n , " o n l o a d " , f n ) } e l s e { o b j . p a r e n t N o d e . r e p l a c e C h i l d ( a b s t r a c t A l t C o n t e n t ( o b j ) , o b j ) } } f u n c t i o n   a b s t r a c t A l t C o n t e n t ( o b j ) { v a r   a c = c r e a t e E l e m e n t ( " d i v " ) ; i f ( u a . w i n & & u a . i e ) { a c . i n n e r H T M L = o b j . i n n e r H T M L } e l s e { v a r   n e s t e d O b j = o b j . g e t E l e m e n t s B y T a g N a m e ( O B J E C T ) [ 0 ] ; i f ( n e s t e d O b j ) { v a r   c = n e s t e d O b j . c h i l d N o d e s ; i f ( c ) { v a r   c l = c . l e n g t h ; f o r ( v a r   i = 0 ; i < c l ; i + + ) { i f ( ! ( c [ i ] . n o d e T y p e = = 1 & & c [ i ] . n o d e N a m e = = " P A R A M " ) & & ! ( c [ i ] . n o d e T y p e = = 8 ) ) { a c . a p p e n d C h i l d ( c [ i ] . c l o n e N o d e ( t r u e ) ) } } } } } r e t u r n   a c } f u n c t i o n   c r e a t e S W F ( a t t O b j , p a r O b j , i d ) { v a r   r , e l = g e t E l e m e n t B y I d ( i d ) ; i f ( e l ) { i f ( t y p e o f   a t t O b j . i d = = U N D E F ) { a t t O b j . i d = i d } i f ( u a . i e & & u a . w i n ) { v a r   a t t = " " ; f o r ( v a r   i   i n   a t t O b j ) { i f ( a t t O b j [ i ] ! = O b j e c t . p r o t o t y p e [ i ] ) { i f ( i . t o L o w e r C a s e ( ) = = " d a t a " ) { p a r O b j . m o v i e = a t t O b j [ i ] } e l s e { i f ( i . t o L o w e r C a s e ( ) = = " s t y l e c l a s s " ) { a t t + = '   c l a s s = " ' + a t t O b j [ i ] + ' " ' } e l s e { i f ( i . t o L o w e r C a s e ( ) ! = " c l a s s i d " ) { a t t + = "   " + i + ' = " ' + a t t O b j [ i ] + ' " ' } } } } } v a r   p a r = " " ; f o r ( v a r   j   i n   p a r O b j ) { i f ( p a r O b j [ j ] ! = O b j e c t . p r o t o t y p e [ j ] ) { p a r + = ' < p a r a m   n a m e = " ' + j + ' "   v a l u e = " ' + p a r O b j [ j ] + ' "   / > ' } } e l . o u t e r H T M L = ' < 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 " ' + a t t + " > " + p a r + " < / o b j e c t > " ; o b j I d A r r [ o b j I d A r r . l e n g t h ] = a t t O b j . i d ; r = g e t E l e m e n t B y I d ( a t t O b j . i d ) } e l s e { i f ( u a . w e b k i t & & u a . w e b k i t < 3 1 2 ) { v a r   e = c r e a t e E l e m e n t ( " e m b e d " ) ; e . s e t A t t r i b u t e ( " t y p e " , F L A S H _ M I M E _ T Y P E ) ; f o r ( v a r   k   i n   a t t O b j ) { i f ( a t t O b j [ k ] ! = O b j e c t . p r o t o t y p e [ k ] ) { i f ( k . t o L o w e r C a s e ( ) = = " d a t a " ) { e . s e t A t t r i b u t e ( " s r c " , a t t O b j [ k ] ) } e l s e { i f ( k . t o L o w e r C a s e ( ) = = " s t y l e c l a s s " ) { e . s e t A t t r i b u t e ( " c l a s s " , a t t O b j [ k ] ) } e l s e { i f ( k . t o L o w e r C a s e ( ) ! = " c l a s s i d " ) { e . s e t A t t r i b u t e ( k , a t t O b j [ k ] ) } } } } } f o r ( v a r   l   i n   p a r O b j ) { i f ( p a r O b j [ l ] ! = O b j e c t . p r o t o t y p e [ l ] ) { i f ( l . t o L o w e r C a s e ( ) ! = " m o v i e " ) { e . s e t A t t r i b u t e ( l , p a r O b j [ l ] ) } } } e l . p a r e n t N o d e . r e p l a c e C h i l d ( e , e l ) ; r = e } e l s e { v a r   o = c r e a t e E l e m e n t ( O B J E C T ) ; o . s e t A t t r i b u t e ( " t y p e " , F L A S H _ M I M E _ T Y P E ) ; f o r ( v a r   m   i n   a t t O b j ) { i f ( a t t O b j [ m ] ! = O b j e c t . p r o t o t y p e [ m ] ) { i f ( m . t o L o w e r C a s e ( ) = = " s t y l e c l a s s " ) { o . s e t A t t r i b u t e ( " c l a s s " , a t t O b j [ m ] ) } e l s e { i f ( m . t o L o w e r C a s e ( ) ! = " c l a s s i d " ) { o . s e t A t t r i b u t e ( m , a t t O b j [ m ] ) } } } } f o r ( v a r   n   i n   p a r O b j ) { i f ( p a r O b j [ n ] ! = O b j e c t . p r o t o t y p e [ n ] & & n . t o L o w e r C a s e ( ) ! = " m o v i e " ) { c r e a t e O b j P a r a m ( o , n , p a r O b j [ n ] ) } } e l . p a r e n t N o d e . r e p l a c e C h i l d ( o , e l ) ; r = o } } } r e t u r n   r } f u n c t i o n   c r e a t e O b j P a r a m ( e l , p N a m e , p V a l u e ) { v a r   p = c r e a t e E l e m e n t ( " p a r a m " ) ; p . s e t A t t r i b u t e ( " n a m e " , p N a m e ) ; p . s e t A t t r i b u t e ( " v a l u e " , p V a l u e ) ; e l . a p p e n d C h i l d ( p ) } f u n c t i o n   r e m o v e S W F ( i d ) { v a r   o b j = g e t E l e m e n t B y I d ( i d ) ; i f ( o b j & & ( o b j . n o d e N a m e = = " O B J E C T " | | o b j . n o d e N a m e = = " E M B E D " ) ) { i f ( u a . i e & & u a . w i n ) { i f ( o b j . r e a d y S t a t e = = 4 ) { r e m o v e O b j e c t I n I E ( i d ) } e l s e { w i n . a t t a c h E v e n t ( " o n l o a d " , f u n c t i o n ( ) { r e m o v e O b j e c t I n I E ( i d ) } ) } } e l s e { o b j . p a r e n t N o d e . r e m o v e C h i l d ( o b j ) } } } f u n c t i o n   r e m o v e O b j e c t I n I E ( i d ) { v a r   o b j = g e t E l e m e n t B y I d ( i d ) ; i f ( o b j ) { f o r ( v a r   i   i n   o b j ) { i f ( t y p e o f   o b j [ i ] = = " f u n c t i o n " ) { o b j [ i ] = n u l l } } o b j . p a r e n t N o d e . r e m o v e C h i l d ( o b j ) } } f u n c t i o n   g e t E l e m e n t B y I d ( i d ) { v a r   e l = n u l l ; t r y { e l = d o c . g e t E l e m e n t B y I d ( i d ) } c a t c h ( e ) { } r e t u r n   e l } f u n c t i o n   c r e a t e E l e m e n t ( e l ) { r e t u r n   d o c . c r e a t e E l e m e n t ( e l ) } f u n c t i o n   a d d L i s t e n e r ( t a r g e t , e v e n t T y p e , f n ) { t a r g e t . a t t a c h E v e n t ( e v e n t T y p e , f n ) ; l i s t e n e r s A r r [ l i s t e n e r s A r r . l e n g t h ] = [ t a r g e t , e v e n t T y p e , f n ] } f u n c t i o n   h a s P l a y e r V e r s i o n ( r v ) { v a r   p v = u a . p v , v = r v . s p l i t ( " . " ) ; v [ 0 ] = p a r s e I n t ( v [ 0 ] , 1 0 ) ; v [ 1 ] = p a r s e I n t ( v [ 1 ] , 1 0 ) | | 0 ; v [ 2 ] = p a r s e I n t ( v [ 2 ] , 1 0 ) | | 0 ; r e t u r n ( p v [ 0 ] > v [ 0 ] | | ( p v [ 0 ] = = v [ 0 ] & & p v [ 1 ] > v [ 1 ] ) | | ( p v [ 0 ] = = v [ 0 ] & & p v [ 1 ] = = v [ 1 ] & & p v [ 2 ] > = v [ 2 ] ) ) ? t r u e : f a l s e } f u n c t i o n   c r e a t e C S S ( s e l , d e c l ) { i f ( u a . i e & & u a . m a c ) { r e t u r n } v a r   h = d o c . 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 ] , s = c r e a t e E l e m e n t ( " s t y l e " ) ; s . s e t A t t r i b u t e ( " t y p e " , " t e x t / c s s " ) ; s . s e t A t t r i b u t e ( " m e d i a " , " s c r e e n " ) ; i f ( ! ( u a . i e & & u a . w i n ) & & t y p e o f   d o c . c r e a t e T e x t N o d e ! = U N D E F ) { s . a p p e n d C h i l d ( d o c . c r e a t e T e x t N o d e ( s e l + "   { " + d e c l + " } " ) ) } h . a p p e n d C h i l d ( s ) ; i f ( u a . i e & & u a . w i n & & t y p e o f   d o c . s t y l e S h e e t s ! = U N D E F & & d o c . s t y l e S h e e t s . l e n g t h > 0 ) { v a r   l s = d o c . s t y l e S h e e t s [ d o c . s t y l e S h e e t s . l e n g t h - 1 ] ; i f ( t y p e o f   l s . a d d R u l e = = O B J E C T ) { l s . a d d R u l e ( s e l , d e c l ) } } } f u n c t i o n   s e t V i s i b i l i t y ( i d , i s V i s i b l e ) { v a r   v = i s V i s i b l e ? " v i s i b l e " : " h i d d e n " ; i f ( i s D o m L o a d e d & & g e t E l e m e n t B y I d ( i d ) ) { g e t E l e m e n t B y I d ( i d ) . s t y l e . v i s i b i l i t y = v } e l s e { c r e a t e C S S ( " # " + i d , " v i s i b i l i t y : " + v ) } } f u n c t i o n   u r l E n c o d e I f N e c e s s a r y ( s ) { v a r   r e g e x = / [ \ \ \ " < > \ . ; ] / ; v a r   h a s B a d C h a r s = r e g e x . e x e c ( s ) ! = n u l l ; r e t u r n   h a s B a d C h a r s ? e n c o d e U R I C o m p o n e n t ( s ) : s } v a r   c l e a n u p = f u n c t i o n ( ) { i f ( u a . i e & & u a . w i n ) { 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 " , f u n c t i o n ( ) { v a r   l l = l i s t e n e r s A r r . l e n g t h ; f o r ( v a r   i = 0 ; i < l l ; i + + ) { l i s t e n e r s A r r [ i ] [ 0 ] . d e t a c h E v e n t ( l i s t e n e r s A r r [ i ] [ 1 ] , l i s t e n e r s A r r [ i ] [ 2 ] ) } v a r   i l = o b j I d A r r . l e n g t h ; f o r ( v a r   j = 0 ; j < i l ; j + + ) { r e m o v e S W F ( o b j I d A r r [ j ] ) } f o r ( v a r   k   i n   u a ) { u a [ k ] = n u l l } u a = n u l l ; f o r ( v a r   l   i n   s w f o b j e c t ) { s w f o b j e c t [ l ] = n u l l } s w f o b j e c t = n u l l } ) } } ( ) ; r e t u r n { r e g i s t e r O b j e c t : f u n c t i o n ( o b j e c t I d S t r , s w f V e r s i o n S t r , x i S w f U r l S t r ) { i f ( ! u a . w 3 c d o m | | ! o b j e c t I d S t r | | ! s w f V e r s i o n S t r ) { r e t u r n } v a r   r e g O b j = { } ; r e g O b j . i d = o b j e c t I d S t r ; r e g O b j . s w f V e r s i o n = s w f V e r s i o n S t r ; r e g O b j . e x p r e s s I n s t a l l = x i S w f U r l S t r ? x i S w f U r l S t r : f a l s e ; r e g O b j A r r [ r e g O b j A r r . l e n g t h ] = r e g O b j ; s e t V i s i b i l i t y ( o b j e c t I d S t r , f a l s e ) } , g e t O b j e c t B y I d : f u n c t i o n ( o b j e c t I d S t r ) { v a r   r = n u l l ; i f ( u a . w 3 c d o m ) { v a r   o = g e t E l e m e n t B y I d ( o b j e c t I d S t r ) ; i f ( o ) { v a r   n = o . g e t E l e m e n t s B y T a g N a m e ( O B J E C T ) [ 0 ] ; i f ( ! n | | ( n & & t y p e o f   o . S e t V a r i a b l e ! = U N D E F ) ) { r = o } e l s e { i f ( t y p e o f   n . S e t V a r i a b l e ! = U N D E F ) { r = n } } } } r e t u r n   r } , e m b e d S W F : f u n c t i o n ( s w f U r l S t r , r e p l a c e E l e m I d S t r , w i d t h S t r , h e i g h t S t r , s w f V e r s i o n S t r , x i S w f U r l S t r , f l a s h v a r s O b j , p a r O b j , a t t O b j ) { i f ( ! u a . w 3 c d o m | | ! s w f U r l S t r | | ! r e p l a c e E l e m I d S t r | | ! w i d t h S t r | | ! h e i g h t S t r | | ! s w f V e r s i o n S t r ) { r e t u r n } w i d t h S t r + = " " ; h e i g h t S t r + = " " ; i f ( h a s P l a y e r V e r s i o n ( s w f V e r s i o n S t r ) ) { s e t V i s i b i l i t y ( r e p l a c e E l e m I d S t r , f a l s e ) ; v a r   a t t = { } ; i f ( a t t O b j & & t y p e o f   a t t O b j = = = O B J E C T ) { f o r ( v a r   i   i n   a t t O b j ) { i f ( a t t O b j [ i ] ! = O b j e c t . p r o t o t y p e [ i ] ) { a t t [ i ] = a t t O b j [ i ] } } } a t t . d a t a = s w f U r l S t r ; a t t . w i d t h = w i d t h S t r ; a t t . h e i g h t = h e i g h t S t r ; v a r   p a r = { } ; i f ( p a r O b j & & t y p e o f   p a r O b j = = = O B J E C T ) { f o r ( v a r   j   i n   p a r O b j ) { i f ( p a r O b j [ j ] ! = O b j e c t . p r o t o t y p e [ j ] ) { p a r [ j ] = p a r O b j [ j ] } } } i f ( f l a s h v a r s O b j & & t y p e o f   f l a s h v a r s O b j = = = O B J E C T ) { f o r ( v a r   k   i n   f l a s h v a r s O b j ) { i f ( f l a s h v a r s O b j [ k ] ! = O b j e c t . p r o t o t y p e [ k ] ) { i f ( t y p e o f   p a r . f l a s h v a r s ! = U N D E F ) { p a r . f l a s h v a r s + = " & " + k + " = " + f l a s h v a r s O b j [ k ] } e l s e { p a r . f l a s h v a r s = k + " = " + f l a s h v a r s O b j [ k ] } } } } a d d D o m L o a d E v e n t ( f u n c t i o n ( ) { c r e a t e S W F ( a t t , p a r , r e p l a c e E l e m I d S t r ) ; i f ( a t t . i d = = r e p l a c e E l e m I d S t r ) { s e t V i s i b i l i t y ( r e p l a c e E l e m I d S t r , t r u e ) } } ) } e l s e { i f ( x i S w f U r l S t r & & ! i s E x p r e s s I n s t a l l A c t i v e & & h a s P l a y e r V e r s i o n ( " 6 . 0 . 6 5 " ) & & ( u a . w i n | | u a . m a c ) ) { i s E x p r e s s I n s t a l l A c t i v e = t r u e ; s e t V i s i b i l i t y ( r e p l a c e E l e m I d S t r , f a l s e ) ; a d d D o m L o a d E v e n t ( f u n c t i o n ( ) { v a r   r e g O b j = { } ; r e g O b j . i d = r e g O b j . a l t C o n t e n t I d = r e p l a c e E l e m I d S t r ; r e g O b j . w i d t h = w i d t h S t r ; r e g O b j . h e i g h t = h e i g h t S t r ; r e g O b j . e x p r e s s I n s t a l l = x i S w f U r l S t r ; s h o w E x p r e s s I n s t a l l ( r e g O b j ) } ) } } } , g e t F l a s h P l a y e r V e r s i o n : f u n c t i o n ( ) { r e t u r n { m a j o r : u a . p v [ 0 ] , m i n o r : u a . p v [ 1 ] , r e l e a s e : u a . p v [ 2 ] } } , h a s F l a s h P l a y e r V e r s i o n : h a s P l a y e r V e r s i o n , c r e a t e S W F : f u n c t i o n ( a t t O b j , p a r O b j , r e p l a c e E l e m I d S t r ) { i f ( u a . w 3 c d o m ) { r e t u r n   c r e a t e S W F ( a t t O b j , p a r O b j , r e p l a c e E l e m I d S t r ) } e l s e { r e t u r n   u n d e f i n e d } } , r e m o v e S W F : f u n c t i o n ( o b j E l e m I d S t r ) { i f ( u a . w 3 c d o m ) { r e m o v e S W F ( o b j E l e m I d S t r ) } } , c r e a t e C S S : f u n c t i o n ( s e l , d e c l ) { i f ( u a . w 3 c d o m ) { c r e a t e C S S ( s e l , d e c l ) } } , a d d D o m L o a d E v e n t : a d d D o m L o a d E v e n t , a d d L o a d E v e n t : a d d L o a d E v e n t , g e t Q u e r y P a r a m V a l u e : f u n c t i o n ( p a r a m ) { v a r   q = d o c . l o c a t i o n . s e a r c h | | d o c . l o c a t i o n . h a s h ; i f ( p a r a m = = n u l l ) { r e t u r n   u r l E n c o d e I f N e c e s s a r y ( q ) } i f ( q ) { v a r   p a i r s = q . s u b s t r i n g ( 1 ) . s p l i t ( " & " ) ; f o r ( v a r   i = 0 ; i < p a i r s . l e n g t h ; i + + ) { i f ( p a i r s [ i ] . s u b s t r i n g ( 0 , p a i r s [ i ] . i n d e x O f ( " = " ) ) = = p a r a m ) { r e t u r n   u r l E n c o d e I f N e c e s s a r y ( p a i r s [ i ] . s u b s t r i n g ( ( p a i r s [ i ] . i n d e x O f ( " = " ) + 1 ) ) ) } } } r e t u r n " " } , e x p r e s s I n s t a l l C a l l b a c k : f u n c t i o n ( ) { i f ( i s E x p r e s s I n s t a l l A c t i v e & & s t o r e d A l t C o n t e n t ) { v a r   o b j = g e t E l e m e n t B y I d ( E X P R E S S _ I N S T A L L _ I D ) ; i f ( o b j ) { o b j . p a r e n t N o d e . r e p l a c e C h i l d ( s t o r e d A l t C o n t e n t , o b j ) ; i f ( s t o r e d A l t C o n t e n t I d ) { s e t V i s i b i l i t y ( s t o r e d A l t C o n t e n t I d , t r u e ) ; i f ( u a . i e & & u a . w i n ) { s t o r e d A l t C o n t e n t . s t y l e . d i s p l a y = " b l o c k " } } s t o r e d A l t C o n t e n t = n u l l ; s t o r e d A l t C o n t e n t I d = n u l l ; i s E x p r e s s I n s t a l l A c t i v e = f a l s e } } } } } ( ) ; r e t u r n   s w f o b j e c t } ) ( ) ; S . l a n g = { c o d e : " h u " , o f : " / " , l o a d i n g : " B e t ö l t é s . . . " , c a n c e l : " M é g s e " , n e x t : " K ö v e t k e z Q" , p r e v i o u s : " E l Qz Q" , p l a y : " L e j á t s z á s " , p a u s e : " S z ü n e t " , c l o s e : " B e z á r á s " , e r r o r s : { s i n g l e : ' A   t a r t a l o m   m e g j e l e n í t é s é h e z   a   k ö v e t k e z Q  b Qv í t m é n y   s z ü k s é g e s :   < a   h r e f = " { 0 } " > { 1 } < / a > . ' , s h a r e d : ' A   t a r t a l o m   m e g j e l e n í t é s é h e z   a   k ö v e t k e z Q  k é t   b Qv í t m é n y   s z ü k s é g e s :   < a   h r e f = " { 0 } " > { 1 } < / a > ,   < a   h r e f = " { 2 } " > { 3 } < / a > . ' , e i t h e r : ' A   t a r t a l o m   m e g j e l e n í t é s é h e z   a   k ö v e t k e z Q  b Qv í t m é n y e k   v a l a m e l y i k é t   t e l e p í t e n i e   k e l l :   < a   h r e f = " { 0 } " > { 1 } < / a >   v a g y   < a   h r e f = " { 2 } " > { 3 } < / a > . ' } } ; v a r   p r e , p r o x y I d = " s b - d r a g - p r o x y " , d r a g D a t a , d r a g P r o x y , d r a g T a r g e t ; f u n c t i o n   r e s e t D r a g ( ) { d r a g D a t a = { x : 0 , y : 0 , s t a r t X : n u l l , s t a r t Y : n u l l } } f u n c t i o n   u p d a t e P r o x y ( ) { v a r   d i m s = S . d i m e n s i o n s ; a p p l y ( d r a g P r o x y . s t y l e , { h e i g h t : d i m s . i n n e r H e i g h t + " p x " , w i d t h : d i m s . i n n e r W i d t h + " p x " } ) } f u n c t i o n   e n a b l e D r a g ( ) { r e s e t D r a g ( ) ; v a r   s t y l e = [ " p o s i t i o n : a b s o l u t e " , " c u r s o r : " + ( S . i s G e c k o ? " - m o z - g r a b " : " m o v e " ) , " b a c k g r o u n d - c o l o r : " + ( S . i s I E ? " # f f f ; f i l t e r : a l p h a ( o p a c i t y = 0 ) " : " t r a n s p a r e n t " ) ] . j o i n ( " ; " ) ; S . a p p e n d H T M L ( S . s k i n . b o d y , ' < d i v   i d = " ' + p r o x y I d + ' "   s t y l e = " ' + s t y l e + ' " > < / d i v > ' ) ; d r a g P r o x y = g e t ( p r o x y I d ) ; u p d a t e P r o x y ( ) ; a d d E v e n t ( d r a g P r o x y , " m o u s e d o w n " , s t a r t D r a g ) } f u n c t i o n   d i s a b l e D r a g ( ) { i f ( d r a g P r o x y ) { r e m o v e E v e n t ( d r a g P r o x y , " m o u s e d o w n " , s t a r t D r a g ) ; r e m o v e ( d r a g P r o x y ) ; d r a g P r o x y = n u l l } d r a g T a r g e t = n u l l } f u n c t i o n   s t a r t D r a g ( e ) { p r e v e n t D e f a u l t ( e ) ; v a r   x y = g e t P a g e X Y ( e ) ; d r a g D a t a . s t a r t X = x y [ 0 ] ; d r a g D a t a . s t a r t Y = x y [ 1 ] ; d r a g T a r g e t = g e t ( S . p l a y e r . i d ) ; a d d E v e n t ( d o c u m e n t , " m o u s e m o v e " , p o s i t i o n D r a g ) ; a d d E v e n t ( d o c u m e n t , " m o u s e u p " , e n d D r a g ) ; i f ( S . i s G e c k o ) { d r a g P r o x y . s t y l e . c u r s o r = " - m o z - g r a b b i n g " } } f u n c t i o n   p o s i t i o n D r a g ( e ) { v a r   p l a y e r = S . p l a y e r , d i m s = S . d i m e n s i o n s , x y = g e t P a g e X Y ( e ) ; v a r   m o v e X = x y [ 0 ] - d r a g D a t a . s t a r t X ; d r a g D a t a . s t a r t X + = m o v e X ; d r a g D a t a . x = M a t h . m a x ( M a t h . m i n ( 0 , d r a g D a t a . x + m o v e X ) , d i m s . i n n e r W i d t h - p l a y e r . w i d t h ) ; v a r   m o v e Y = x y [ 1 ] - d r a g D a t a . s t a r t Y ; d r a g D a t a . s t a r t Y + = m o v e Y ; d r a g D a t a . y = M a t h . m a x ( M a t h . m i n ( 0 , d r a g D a t a . y + m o v e Y ) , d i m s . i n n e r H e i g h t - p l a y e r . h e i g h t ) ; a p p l y ( d r a g T a r g e t . s t y l e , { l e f t : d r a g D a t a . x + " p x " , t o p : d r a g D a t a . y + " p x " } ) } f u n c t i o n   e n d D r a g ( ) { r e m o v e E v e n t ( d o c u m e n t , " m o u s e m o v e " , p o s i t i o n D r a g ) ; r e m o v e E v e n t ( d o c u m e n t , " m o u s e u p " , e n d D r a g ) ; i f ( S . i s G e c k o ) { d r a g P r o x y . s t y l e . c u r s o r = " - m o z - g r a b " } } S . i m g = f u n c t i o n ( o b j , i d ) { t h i s . o b j = o b j ; t h i s . i d = i d ; t h i s . r e a d y = f a l s e ; v a r   s e l f = t h i s ; p r e = n e w   I m a g e ( ) ; p r e . o n l o a d = f u n c t i o n ( ) { s e l f . h e i g h t = o b j . h e i g h t ? p a r s e I n t ( o b j . h e i g h t , 1 0 ) : p r e . h e i g h t ; s e l f . w i d t h = o b j . w i d t h ? p a r s e I n t ( o b j . w i d t h , 1 0 ) : p r e . w i d t h ; s e l f . r e a d y = t r u e ; p r e . o n l o a d = n u l l ; p r e = n u l l } ; p r e . s r c = o b j . c o n t e n t } ; S . i m g . e x t = [ " b m p " , " g i f " , " j p g " , " j p e g " , " p n g " ] ; S . i m g . p r o t o t y p e = { a p p e n d : f u n c t i o n ( b o d y , d i m s ) { v a r   i m g = d o c u m e n t . c r e a t e E l e m e n t ( " i m g " ) ; i m g . i d = t h i s . i d ; i m g . s r c = t h i s . o b j . c o n t e n t ; i m g . s t y l e . p o s i t i o n = " a b s o l u t e " ; v a r   h e i g h t , w i d t h ; i f ( d i m s . o v e r s i z e d & & S . o p t i o n s . h a n d l e O v e r s i z e = = " r e s i z e " ) { h e i g h t = d i m s . i n n e r H e i g h t ; w i d t h = d i m s . i n n e r W i d t h } e l s e { h e i g h t = t h i s . h e i g h t ; w i d t h = t h i s . w i d t h } i m g . s e t A t t r i b u t e ( " h e i g h t " , h e i g h t ) ; i m g . s e t A t t r i b u t e ( " w i d t h " , w i d t h ) ; b o d y . a p p e n d C h i l d ( i m g ) } , r e m o v e : f u n c t i o n ( ) { v a r   e l = g e t ( t h i s . i d ) ; i f ( e l ) { r e m o v e ( e l ) } d i s a b l e D r a g ( ) ; i f ( p r e ) { p r e . o n l o a d = n u l l ; p r e = n u l l } } , o n L o a d : f u n c t i o n ( ) { v a r   d i m s = S . d i m e n s i o n s ; i f ( d i m s . o v e r s i z e d & & S . o p t i o n s . h a n d l e O v e r s i z e = = " d r a g " ) { e n a b l e D r a g ( ) } } , o n W i n d o w R e s i z e : f u n c t i o n ( ) { v a r   d i m s = S . d i m e n s i o n s ; s w i t c h ( S . o p t i o n s . h a n d l e O v e r s i z e ) { c a s e " r e s i z e " : v a r   e l = g e t ( t h i s . i d ) ; e l . h e i g h t = d i m s . i n n e r H e i g h t ; e l . w i d t h = d i m s . i n n e r W i d t h ; b r e a k ; c a s e " d r a g " : i f ( d r a g T a r g e t ) { v a r   t o p = p a r s e I n t ( S . g e t S t y l e ( d r a g T a r g e t , " t o p " ) ) , l e f t = p a r s e I n t ( S . g e t S t y l e ( d r a g T a r g e t , " l e f t " ) ) ; i f ( t o p + t h i s . h e i g h t < d i m s . i n n e r H e i g h t ) { d r a g T a r g e t . s t y l e . t o p = d i m s . i n n e r H e i g h t - t h i s . h e i g h t + " p x " } i f ( l e f t + t h i s . w i d t h < d i m s . i n n e r W i d t h ) { d r a g T a r g e t . s t y l e . l e f t = d i m s . i n n e r W i d t h - t h i s . w i d t h + " p x " } u p d a t e P r o x y ( ) } b r e a k } } } ; S . i f r a m e = f u n c t i o n ( o b j , i d ) { t h i s . o b j = o b j ; t h i s . i d = i d ; v a r   o v e r l a y = g e t ( " s b - o v e r l a y " ) ; t h i s . h e i g h t = o b j . h e i g h t ? p a r s e I n t ( o b j . h e i g h t , 1 0 ) : o v e r l a y . o f f s e t H e i g h t ; t h i s . w i d t h = o b j . w i d t h ? p a r s e I n t ( o b j . w i d t h , 1 0 ) : o v e r l a y . o f f s e t W i d t h } ; S . i f r a m e . p r o t o t y p e = { a p p e n d : f u n c t i o n ( b o d y , d i m s ) { v a r   h t m l = ' < i f r a m e   i d = " ' + t h i s . i d + ' "   n a m e = " ' + t h i s . i d + ' "   h e i g h t = " 1 0 0 % "   w i d t h = " 1 0 0 % "   f r a m e b o r d e r = " 0 "   m a r g i n w i d t h = " 0 "   m a r g i n h e i g h t = " 0 "   s t y l e = " v i s i b i l i t y : h i d d e n "   o n l o a d = " t h i s . s t y l e . v i s i b i l i t y = \ ' v i s i b l e \ ' "   s c r o l l i n g = " a u t o " ' ; i f ( S . i s I E ) { h t m l + = '   a l l o w t r a n s p a r e n c y = " t r u e " ' ; i f ( S . i s I E 6 ) { h t m l + = "   s r c = \ " j a v a s c r i p t : f a l s e ; d o c u m e n t . w r i t e ( ' ' ) ; \ " " } } h t m l + = " > < / i f r a m e > " ; b o d y . i n n e r H T M L = h t m l } , r e m o v e : f u n c t i o n ( ) { v a r   e l = g e t ( t h i s . i d ) ; i f ( e l ) { r e m o v e ( e l ) ; i f ( S . i s G e c k o ) { d e l e t e   w i n d o w . f r a m e s [ t h i s . i d ] } } } , o n L o a d : f u n c t i o n ( ) { v a r   w i n = S . i s I E ? g e t ( t h i s . i d ) . c o n t e n t W i n d o w : w i n d o w . f r a m e s [ t h i s . i d ] ; w i n . l o c a t i o n . h r e f = t h i s . o b j . c o n t e n t } } ; S . s w f = f u n c t i o n ( o b j , i d ) { t h i s . o b j = o b j ; t h i s . i d = i d ; t h i s . h e i g h t = o b j . h e i g h t ? p a r s e I n t ( o b j . h e i g h t , 1 0 ) : 3 0 0 ; t h i s . w i d t h = o b j . w i d t h ? p a r s e I n t ( o b j . w i d t h , 1 0 ) : 3 0 0 } ; S . s w f . e x t = [ " s w f " ] ; S . s w f . p r o t o t y p e = { a p p e n d : f u n c t i o n ( b o d y , d i m s ) { v a r   t m p = d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ; t m p . i d = t h i s . i d ; b o d y . a p p e n d C h i l d ( t m p ) ; v a r   h e i g h t = d i m s . i n n e r H e i g h t , w i d t h = d i m s . i n n e r W i d t h , s w f = t h i s . o b j . c o n t e n t , v e r s i o n = S . o p t i o n s . f l a s h V e r s i o n , e x p r e s s = S . p a t h + " e x p r e s s I n s t a l l . s w f " , f l a s h v a r s = S . o p t i o n s . f l a s h V a r s , p a r a m s = S . o p t i o n s . f l a s h P a r a m s ; S . f l a s h . e m b e d S W F ( s w f , t h i s . i d , w i d t h , h e i g h t , v e r s i o n , e x p r e s s , f l a s h v a r s , p a r a m s ) } , r e m o v e : f u n c t i o n ( ) { S . f l a s h . e x p r e s s I n s t a l l C a l l b a c k ( ) ; S . f l a s h . r e m o v e S W F ( t h i s . i d ) } , o n W i n d o w R e s i z e : f u n c t i o n ( ) { v a r   d i m s = S . d i m e n s i o n s , e l = g e t ( t h i s . i d ) ; e l . h e i g h t = d i m s . i n n e r H e i g h t ; e l . w i d t h = d i m s . i n n e r W i d t h } } ; v a r   j w C o n t r o l l e r H e i g h t = 2 0 ; S . f l v = f u n c t i o n ( o b j , i d ) { t h i s . o b j = o b j ; t h i s . i d = i d ; t h i s . h e i g h t = o b j . h e i g h t ? p a r s e I n t ( o b j . h e i g h t , 1 0 ) : 3 0 0 ; i f ( S . o p t i o n s . s h o w M o v i e C o n t r o l s ) { t h i s . h e i g h t + = j w C o n t r o l l e r H e i g h t } t h i s . w i d t h = o b j . w i d t h ? p a r s e I n t ( o b j . w i d t h , 1 0 ) : 3 0 0 } ; S . f l v . e x t = [ " f l v " , " m 4 v " ] ; S . f l v . p r o t o t y p e = { a p p e n d : f u n c t i o n ( b o d y , d i m s ) { v a r   t m p = d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ; t m p . i d = t h i s . i d ; b o d y . a p p e n d C h i l d ( t m p ) ; v a r   h e i g h t = d i m s . i n n e r H e i g h t , w i d t h = d i m s . i n n e r W i d t h , s w f = S . p a t h + " p l a y e r . s w f " , v e r s i o n = S . o p t i o n s . f l a s h V e r s i o n , e x p r e s s = S . p a t h + " e x p r e s s I n s t a l l . s w f " , f l a s h v a r s = a p p l y ( { f i l e : t h i s . o b j . c o n t e n t , h e i g h t : h e i g h t , w i d t h : w i d t h , a u t o s t a r t : ( S . o p t i o n s . a u t o p l a y M o v i e s ? " t r u e " : " f a l s e " ) , c o n t r o l b a r : ( S . o p t i o n s . s h o w M o v i e C o n t r o l s ? " b o t t o m " : " n o n e " ) , b a c k c o l o r : " 0 x 0 0 0 0 0 0 " , f r o n t c o l o r : " 0 x C C C C C C " , l i g h t c o l o r : " 0 x 5 5 7 7 2 2 " } , S . o p t i o n s . f l a s h V a r s ) , p a r a m s = S . o p t i o n s . f l a s h P a r a m s ; S . f l a s h . e m b e d S W F ( s w f , t h i s . i d , w i d t h , h e i g h t , v e r s i o n , e x p r e s s , f l a s h v a r s , p a r a m s ) } , r e m o v e : f u n c t i o n ( ) { S . f l a s h . e x p r e s s I n s t a l l C a l l b a c k ( ) ; S . f l a s h . r e m o v e S W F ( t h i s . i d ) } , o n W i n d o w R e s i z e : f u n c t i o n ( ) { v a r   d i m s = S . d i m e n s i o n s , e l = g e t ( t h i s . i d ) ; e l . h e i g h t = d i m s . i n n e r H e i g h t ; e l . w i d t h = d i m s . i n n e r W i d t h } } ; v a r   o v e r l a y O n = f a l s e , v i s i b i l i t y C a c h e = [ ] , p n g I d s = [ " s b - n a v - c l o s e " , " s b - n a v - n e x t " , " s b - n a v - p l a y " , " s b - n a v - p a u s e " , " s b - n a v - p r e v i o u s " ] , c o n t a i n e r , o v e r l a y , w r a p p e r , d o W i n d o w R e s i z e = t r u e ; f u n c t i o n   a n i m a t e ( e l , p r o p e r t y , t o , d u r a t i o n , c a l l b a c k ) { v a r   i s O p a c i t y = ( p r o p e r t y = = " o p a c i t y " ) , a n i m = i s O p a c i t y ? S . s e t O p a c i t y : f u n c t i o n ( e l , v a l u e ) { e l . s t y l e [ p r o p e r t y ] = " " + v a l u e + " p x " } ; i f ( d u r a t i o n = = 0 | | ( ! i s O p a c i t y & & ! S . o p t i o n s . a n i m a t e ) | | ( i s O p a c i t y & & ! S . o p t i o n s . a n i m a t e F a d e ) ) { a n i m ( e l , t o ) ; i f ( c a l l b a c k ) { c a l l b a c k ( ) } r e t u r n } v a r   f r o m = p a r s e F l o a t ( S . g e t S t y l e ( e l , p r o p e r t y ) ) | | 0 ; v a r   d e l t a = t o - f r o m ; i f ( d e l t a = = 0 ) { i f ( c a l l b a c k ) { c a l l b a c k ( ) } r e t u r n } d u r a t i o n * = 1 0 0 0 ; v a r   b e g i n = n o w ( ) , e a s e = S . e a s e , e n d = b e g i n + d u r a t i o n , t i m e ; v a r   i n t e r v a l = s e t I n t e r v a l ( f u n c t i o n ( ) { t i m e = n o w ( ) ; i f ( t i m e > = e n d ) { c l e a r I n t e r v a l ( i n t e r v a l ) ; i n t e r v a l = n u l l ; a n i m ( e l , t o ) ; i f ( c a l l b a c k ) { c a l l b a c k ( ) } } e l s e { a n i m ( e l , f r o m + e a s e ( ( t i m e - b e g i n ) / d u r a t i o n ) * d e l t a ) } } , 1 0 ) } f u n c t i o n   s e t S i z e ( ) { c o n t a i n e r . s t y l e . h e i g h t = S . g e t W i n d o w S i z e ( " H e i g h t " ) + " p x " ; c o n t a i n e r . s t y l e . w i d t h = S . g e t W i n d o w S i z e ( " W i d t h " ) + " p x " } f u n c t i o n   s e t P o s i t i o n ( ) { c o n t a i n e r . s t y l e . t o p = d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p + " p x " ; c o n t a i n e r . s t y l e . l e f t = d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l L e f t + " p x " } f u n c t i o n   t o g g l e T r o u b l e E l e m e n t s ( o n ) { i f ( o n ) { e a c h ( v i s i b i l i t y C a c h e , f u n c t i o n ( i , e l ) { e l [ 0 ] . s t y l e . v i s i b i l i t y = e l [ 1 ] | | " " } ) } e l s e { v i s i b i l i t y C a c h e = [ ] ; e a c h ( S . o p t i o n s . t r o u b l e E l e m e n t s , f u n c t i o n ( t a g ) { e a c 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 ( t a g ) , f u n c t i o n ( e l ) { v i s i b i l i t y C a c h e . p u s h ( [ e l , e l . s t y l e . v i s i b i l i t y ] ) ; e l . s t y l e . v i s i b i l i t y = " h i d d e n " } ) } ) } } f u n c t i o n   t o g g l e N a v ( i d , o n ) { v a r   e l = g e t ( " s b - n a v - " + i d ) ; i f ( e l ) { e l . s t y l e . d i s p l a y = o n ? " " : " n o n e " } } f u n c t i o n   t o g g l e L o a d i n g ( o n , c a l l b a c k ) { v a r   l o a d i n g = g e t ( " s b - l o a d i n g " ) , p l a y e r N a m e = S . g e t C u r r e n t ( ) . p l a y e r , a n i m = ( p l a y e r N a m e = = " i m g " | | p l a y e r N a m e = = " h t m l " ) ; i f ( o n ) { S . s e t O p a c i t y ( l o a d i n g , 0 ) ; l o a d i n g . s t y l e . d i s p l a y = " b l o c k " ; v a r   w r a p p e d = f u n c t i o n ( ) { S . c l e a r O p a c i t y ( l o a d i n g ) ; i f ( c a l l b a c k ) { c a l l b a c k ( ) } } ; i f ( a n i m ) { a n i m a t e ( l o a d i n g , " o p a c i t y " , 1 , S . o p t i o n s . f a d e D u r a t i o n , w r a p p e d ) } e l s e { w r a p p e d ( ) } } e l s e { v a r   w r a p p e d = f u n c t i o n ( ) { l o a d i n g . s t y l e . d i s p l a y = " n o n e " ; S . c l e a r O p a c i t y ( l o a d i n g ) ; i f ( c a l l b a c k ) { c a l l b a c k ( ) } } ; i f ( a n i m ) { a n i m a t e ( l o a d i n g , " o p a c i t y " , 0 , S . o p t i o n s . f a d e D u r a t i o n , w r a p p e d ) } e l s e { w r a p p e d ( ) } } } f u n c t i o n   b u i l d B a r s ( c a l l b a c k ) { v a r   o b j = S . g e t C u r r e n t ( ) ; g e t ( " s b - t i t l e - i n n e r " ) . i n n e r H T M L = o b j . t i t l e | | " " ; v a r   c l o s e , n e x t , p l a y , p a u s e , p r e v i o u s ; i f ( S . o p t i o n s . d i s p l a y N a v ) { c l o s e = t r u e ; v a r   l e n = S . g a l l e r y . l e n g t h ; i f ( l e n > 1 ) { i f ( S . o p t i o n s . c o n t i n u o u s ) { n e x t = p r e v i o u s = t r u e } e l s e { n e x t = ( l e n - 1 ) > S . c u r r e n t ; p r e v i o u s = S . c u r r e n t > 0 } } i f ( S . o p t i o n s . s l i d e s h o w D e l a y > 0 & & S . h a s N e x t ( ) ) { p a u s e = ! S . i s P a u s e d ( ) ; p l a y = ! p a u s e } } e l s e { c l o s e = n e x t = p l a y = p a u s e = p r e v i o u s = f a l s e } t o g g l e N a v ( " c l o s e " , c l o s e ) ; t o g g l e N a v ( " n e x t " , n e x t ) ; t o g g l e N a v ( " p l a y " , p l a y ) ; t o g g l e N a v ( " p a u s e " , p a u s e ) ; t o g g l e N a v ( " p r e v i o u s " , p r e v i o u s ) ; v a r   c o u n t e r = " " ; i f ( S . o p t i o n s . d i s p l a y C o u n t e r & & S . g a l l e r y . l e n g t h > 1 ) { v a r   l e n = S . g a l l e r y . l e n g t h ; i f ( S . o p t i o n s . c o u n t e r T y p e = = " s k i p " ) { v a r   i = 0 , e n d = l e n , l i m i t = p a r s e I n t ( S . o p t i o n s . c o u n t e r L i m i t ) | | 0 ; i f ( l i m i t < l e n & & l i m i t > 2 ) { v a r   h = M a t h . f l o o r ( l i m i t / 2 ) ; i = S . c u r r e n t - h ; i f ( i < 0 ) { i + = l e n } e n d = S . c u r r e n t + ( l i m i t - h ) ; i f ( e n d > l e n ) { e n d - = l e n } } w h i l e ( i ! = e n d ) { i f ( i = = l e n ) { i = 0 } c o u n t e r + = ' < a   o n c l i c k = " S h a d o w b o x . c h a n g e ( ' + i + ' ) ; " ' ; i f ( i = = S . c u r r e n t ) { c o u n t e r + = '   c l a s s = " s b - c o u n t e r - c u r r e n t " ' } c o u n t e r + = " > " + ( + + i ) + " < / a > " } } e l s e { c o u n t e r = [ S . c u r r e n t + 1 , S . l a n g . o f , l e n ] . j o i n ( "   " ) } } g e t ( " s b - c o u n t e r " ) . i n n e r H T M L = c o u n t e r ; c a l l b a c k ( ) } f u n c t i o n   s h o w B a r s ( c a l l b a c k ) { v a r   t i t l e I n n e r = g e t ( " s b - t i t l e - i n n e r " ) , i n f o I n n e r = g e t ( " s b - i n f o - i n n e r " ) , d u r a t i o n = 0 . 3 5 ; t i t l e I n n e r . s t y l e . v i s i b i l i t y = i n f o I n n e r . s t y l e . v i s i b i l i t y = " " ; i f ( t i t l e I n n e r . i n n e r H T M L ! = " " ) { a n i m a t e ( t i t l e I n n e r , " m a r g i n T o p " , 0 , d u r a t i o n ) } a n i m a t e ( i n f o I n n e r , " m a r g i n T o p " , 0 , d u r a t i o n , c a l l b a c k ) } f u n c t i o n   h i d e B a r s ( a n i m , c a l l b a c k ) { v a r   t i t l e = g e t ( " s b - t i t l e " ) , i n f o = g e t ( " s b - i n f o " ) , t i t l e H e i g h t = t i t l e . o f f s e t H e i g h t , i n f o H e i g h t = i n f o . o f f s e t H e i g h t , t i t l e I n n e r = g e t ( " s b - t i t l e - i n n e r " ) , i n f o I n n e r = g e t ( " s b - i n f o - i n n e r " ) , d u r a t i o n = ( a n i m ? 0 . 3 5 : 0 ) ; a n i m a t e ( t i t l e I n n e r , " m a r g i n T o p " , t i t l e H e i g h t , d u r a t i o n ) ; a n i m a t e ( i n f o I n n e r , " m a r g i n T o p " , i n f o H e i g h t * - 1 , d u r a t i o n , f u n c t i o n ( ) { t i t l e I n n e r . s t y l e . v i s i b i l i t y = i n f o I n n e r . s t y l e . v i s i b i l i t y = " h i d d e n " ; c a l l b a c k ( ) } ) } f u n c t i o n   a d j u s t H e i g h t ( h e i g h t , t o p , a n i m , c a l l b a c k ) { v a r   w r a p p e r I n n e r = g e t ( " s b - w r a p p e r - i n n e r " ) , d u r a t i o n = ( a n i m ? S . o p t i o n s . r e s i z e D u r a t i o n : 0 ) ; a n i m a t e ( w r a p p e r , " t o p " , t o p , d u r a t i o n ) ; a n i m a t e ( w r a p p e r I n n e r , " h e i g h t " , h e i g h t , d u r a t i o n , c a l l b a c k ) } f u n c t i o n   a d j u s t W i d t h ( w i d t h , l e f t , a n i m , c a l l b a c k ) { v a r   d u r a t i o n = ( a n i m ? S . o p t i o n s . r e s i z e D u r a t i o n : 0 ) ; a n i m a t e ( w r a p p e r , " l e f t " , l e f t , d u r a t i o n ) ; a n i m a t e ( w r a p p e r , " w i d t h " , w i d t h , d u r a t i o n , c a l l b a c k ) } f u n c t i o n   s e t D i m e n s i o n s ( h e i g h t , w i d t h ) { v a r   b o d y I n n e r = g e t ( " s b - b o d y - i n n e r " ) , h e i g h t = p a r s e I n t ( h e i g h t ) , w i d t h = p a r s e I n t ( w i d t h ) , t o p B o t t o m = w r a p p e r . o f f s e t H e i g h t - b o d y I n n e r . o f f s e t H e i g h t , l e f t R i g h t = w r a p p e r . o f f s e t W i d t h - b o d y I n n e r . o f f s e t W i d t h , m a x H e i g h t = o v e r l a y . o f f s e t H e i g h t , m a x W i d t h = o v e r l a y . o f f s e t W i d t h , p a d d i n g = p a r s e I n t ( S . o p t i o n s . v i e w p o r t P a d d i n g ) | | 2 0 , p r e s e r v e A s p e c t = ( S . p l a y e r & & S . o p t i o n s . h a n d l e O v e r s i z e ! = " d r a g " ) ; r e t u r n   S . s e t D i m e n s i o n s ( h e i g h t , w i d t h , m a x H e i g h t , m a x W i d t h , t o p B o t t o m , l e f t R i g h t , p a d d i n g , p r e s e r v e A s p e c t ) } v a r   K = { } ; K . m a r k u p = ' < d i v   i d = " s b - c o n t a i n e r " > < d i v   i d = " s b - o v e r l a y " > < / d i v > < d i v   i d = " s b - w r a p p e r " > < d i v   i d = " s b - t i t l e " > < d i v   i d = " s b - t i t l e - i n n e r " > < / d i v > < / d i v > < d i v   i d = " s b - w r a p p e r - i n n e r " > < d i v   i d = " s b - b o d y " > < d i v   i d = " s b - b o d y - i n n e r " > < / d i v > < d i v   i d = " s b - l o a d i n g " > < d i v   i d = " s b - l o a d i n g - i n n e r " > < s p a n > { l o a d i n g } < / s p a n > < / d i v > < / d i v > < / d i v > < / d i v > < d i v   i d = " s b - i n f o " > < d i v   i d = " s b - i n f o - i n n e r " > < d i v   i d = " s b - c o u n t e r " > < / d i v > < d i v   i d = " s b - n a v " > < a   i d = " s b - n a v - c l o s e "   t i t l e = " B e z á r "   o n c l i c k = " S h a d o w b o x . c l o s e ( ) " > < / a > < a   i d = " s b - n a v - n e x t "   t i t l e = " { n e x t } "   o n c l i c k = " S h a d o w b o x . n e x t ( ) " > < / a > < a   i d = " s b - n a v - p l a y "   t i t l e = " { p l a y } "   o n c l i c k = " S h a d o w b o x . p l a y ( ) " > < / a > < a   i d = " s b - n a v - p a u s e "   t i t l e = " { p a u s e } "   o n c l i c k = " S h a d o w b o x . p a u s e ( ) " > < / a > < a   i d = " s b - n a v - p r e v i o u s "   t i t l e = " { p r e v i o u s } "   o n c l i c k = " S h a d o w b o x . p r e v i o u s ( ) " > < / a > < / d i v > < / d i v > < / d i v > < / d i v > < / d i v > ' ; K . o p t i o n s = { a n i m S e q u e n c e : " s y n c " , c o u n t e r L i m i t : 1 0 , c o u n t e r T y p e : " d e f a u l t " , d i s p l a y C o u n t e r : t r u e , d i s p l a y N a v : t r u e , f a d e D u r a t i o n : 0 . 3 5 , i n i t i a l H e i g h t : 1 6 0 , i n i t i a l W i d t h : 3 2 0 , m o d a l : f a l s e , o v e r l a y C o l o r : " # 0 0 0 " , o v e r l a y O p a c i t y : 0 . 9 , r e s i z e D u r a t i o n : 0 . 3 5 , s h o w O v e r l a y : t r u e , t r o u b l e E l e m e n t s : [ " s e l e c t " , " o b j e c t " , " e m b e d " , " c a n v a s " ] } ; K . i n i t = f u n c t i o n ( ) { S . a p p e n d H T M L ( d o c u m e n t . b o d y , s p r i n t f ( K . m a r k u p , S . l a n g ) ) ; K . b o d y = g e t ( " s b - b o d y - i n n e r " ) ; c o n t a i n e r = g e t ( " s b - c o n t a i n e r " ) ; o v e r l a y = g e t ( " s b - o v e r l a y " ) ; w r a p p e r = g e t ( " s b - w r a p p e r " ) ; i f ( ! s u p p o r t s F i x e d ) { c o n t a i n e r . s t y l e . p o s i t i o n = " a b s o l u t e " } i f ( ! s u p p o r t s O p a c i t y ) { v a r   e l , m , r e = / u r l \ ( " ( . * \ . p n g ) " \ ) / ; e a c h ( p n g I d s , f u n c t i o n ( i , i d ) { e l = g e t ( i d ) ; i f ( e l ) { m = S . g e t S t y l e ( e l , " b a c k g r o u n d I m a g e " ) . m a t c h ( r e ) ; i f ( m ) { e l . s t y l e . b a c k g r o u n d I m a g e = " n o n e " ; e l . s t y l e . f i l t e r = " p r o g i d : D X I m a g e T r a n s f o r m . M i c r o s o f t . A l p h a I m a g e L o a d e r ( e n a b l e d = t r u e , s r c = " + m [ 1 ] + " , s i z i n g M e t h o d = s c a l e ) ; " } } } ) } v a r   t i m e r ; a d d E v e n t ( w i n d o w , " r e s i z e " , f u n c t i o n ( ) { i f ( t i m e r ) { c l e a r T i m e o u t ( t i m e r ) ; t i m e r = n u l l } i f ( o p e n ) { t i m e r = s e t T i m e o u t ( K . o n W i n d o w R e s i z e , 1 0 ) } } ) } ; K . o n O p e n = f u n c t i o n ( o b j , c a l l b a c k ) { d o W i n d o w R e s i z e = f a l s e ; c o n t a i n e r . s t y l e . d i s p l a y = " b l o c k " ; s e t S i z e ( ) ; v a r   d i m s = s e t D i m e n s i o n s ( S . o p t i o n s . i n i t i a l H e i g h t , S . o p t i o n s . i n i t i a l W i d t h ) ; a d j u s t H e i g h t ( d i m s . i n n e r H e i g h t , d i m s . t o p ) ; a d j u s t W i d t h ( d i m s . w i d t h , d i m s . l e f t ) ; i f ( S . o p t i o n s . s h o w O v e r l a y ) { o v e r l a y . s t y l e . b a c k g r o u n d C o l o r = S . o p t i o n s . o v e r l a y C o l o r ; S . s e t O p a c i t y ( o v e r l a y , 0 ) ; i f ( ! S . o p t i o n s . m o d a l ) { a d d E v e n t ( o v e r l a y , " c l i c k " , S . c l o s e ) } o v e r l a y O n = t r u e } i f ( ! s u p p o r t s F i x e d ) { s e t P o s i t i o n ( ) ; a d d E v e n t ( w i n d o w , " s c r o l l " , s e t P o s i t i o n ) } t o g g l e T r o u b l e E l e m e n t s ( ) ; c o n t a i n e r . s t y l e . v i s i b i l i t y = " v i s i b l e " ; i f ( o v e r l a y O n ) { a n i m a t e ( o v e r l a y , " o p a c i t y " , S . o p t i o n s . o v e r l a y O p a c i t y , S . o p t i o n s . f a d e D u r a t i o n , c a l l b a c k ) } e l s e { c a l l b a c k ( ) } } ; K . o n L o a d = f u n c t i o n ( c h a n g i n g , c a l l b a c k ) { t o g g l e L o a d i n g ( t r u e ) ; w h i l e ( K . b o d y . f i r s t C h i l d ) { r e m o v e ( K . b o d y . f i r s t C h i l d ) } h i d e B a r s ( c h a n g i n g , f u n c t i o n ( ) { i f ( ! o p e n ) { r e t u r n } i f ( ! c h a n g i n g ) { w r a p p e r . s t y l e . v i s i b i l i t y = " v i s i b l e " } b u i l d B a r s ( c a l l b a c k ) } ) } ; K . o n R e a d y = f u n c t i o n ( c a l l b a c k ) { i f ( ! o p e n ) { r e t u r n } v a r   p l a y e r = S . p l a y e r , d i m s = s e t D i m e n s i o n s ( p l a y e r . h e i g h t , p l a y e r . w i d t h ) ; v a r   w r a p p e d = f u n c t i o n ( ) { s h o w B a r s ( c a l l b a c k ) } ; s w i t c h ( S . o p t i o n s . a n i m S e q u e n c e ) { c a s e " h w " : a d j u s t H e i g h t ( d i m s . i n n e r H e i g h t , d i m s . t o p , t r u e , f u n c t i o n ( ) { a d j u s t W i d t h ( d i m s . w i d t h , d i m s . l e f t , t r u e , w r a p p e d ) } ) ; b r e a k ; c a s e " w h " : a d j u s t W i d t h ( d i m s . w i d t h , d i m s . l e f t , t r u e , f u n c t i o n ( ) { a d j u s t H e i g h t ( d i m s . i n n e r H e i g h t , d i m s . t o p , t r u e , w r a p p e d ) } ) ; b r e a k ; d e f a u l t : a d j u s t W i d t h ( d i m s . w i d t h , d i m s . l e f t , t r u e ) ; a d j u s t H e i g h t ( d i m s . i n n e r H e i g h t , d i m s . t o p , t r u e , w r a p p e d ) } } ; K . o n S h o w = f u n c t i o n ( c a l l b a c k ) { t o g g l e L o a d i n g ( f a l s e , c a l l b a c k ) ; d o W i n d o w R e s i z e = t r u e } ; K . o n C l o s e = f u n c t i o n ( ) { i f ( ! s u p p o r t s F i x e d ) { r e m o v e E v e n t ( w i n d o w , " s c r o l l " , s e t P o s i t i o n ) } r e m o v e E v e n t ( o v e r l a y , " c l i c k " , S . c l o s e ) ; w r a p p e r . s t y l e . v i s i b i l i t y = " h i d d e n " ; v a r   c a l l b a c k = f u n c t i o n ( ) { c o n t a i n e r . s t y l e . v i s i b i l i t y = " h i d d e n " ; c o n t a i n e r . s t y l e . d i s p l a y = " n o n e " ; t o g g l e T r o u b l e E l e m e n t s ( t r u e ) } ; i f ( o v e r l a y O n ) { a n i m a t e ( o v e r l a y , " o p a c i t y " , 0 , S . o p t i o n s . f a d e D u r a t i o n , c a l l b a c k ) } e l s e { c a l l b a c k ( ) } } ; K . o n P l a y = f u n c t i o n ( ) { t o g g l e N a v ( " p l a y " , f a l s e ) ; t o g g l e N a v ( " p a u s e " , t r u e ) } ; K . o n P a u s e = f u n c t i o n ( ) { t o g g l e N a v ( " p a u s e " , f a l s e ) ; t o g g l e N a v ( " p l a y " , t r u e ) } ; K . o n W i n d o w R e s i z e = f u n c t i o n ( ) { i f ( ! d o W i n d o w R e s i z e ) { r e t u r n } s e t S i z e ( ) ; v a r   p l a y e r = S . p l a y e r , d i m s = s e t D i m e n s i o n s ( p l a y e r . h e i g h t , p l a y e r . w i d t h ) ; a d j u s t W i d t h ( d i m s . w i d t h , d i m s . l e f t ) ; a d j u s t H e i g h t ( d i m s . i n n e r H e i g h t , d i m s . t o p ) ; i f ( p l a y e r . o n W i n d o w R e s i z e ) { p l a y e r . o n W i n d o w R e s i z e ( ) } } ; S . s k i n = K ; w i n d o w . S h a d o w b o x = S } ) ( w i n d o w ) ; 
