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