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