ÿþ/ * 
 *   j Q u e r y   J a v a S c r i p t   L i b r a r y   v 1 . 3 . 2 
 *   h t t p : / / j q u e r y . c o m / 
 * 
 *   C o p y r i g h t   ( c )   2 0 0 9   J o h n   R e s i g 
 *   D u a l   l i c e n s e d   u n d e r   t h e   M I T   a n d   G P L   l i c e n s e s . 
 *   h t t p : / / d o c s . j q u e r y . c o m / L i c e n s e 
 * 
 *   D a t e :   2 0 0 9 - 0 2 - 1 9   1 7 : 3 4 : 2 1   - 0 5 0 0   ( T h u ,   1 9   F e b   2 0 0 9 ) 
 *   R e v i s i o n :   6 2 4 6 
 * /  
 ( f u n c t i o n ( )   {  
         v a r   l   =   t h i s ,   g ,   y   =   l . j Q u e r y ,   p   =   l . $ ,   o   =   l . j Q u e r y   =   l . $   =   f u n c t i o n ( E ,   F )   {   r e t u r n   n e w   o . f n . i n i t ( E ,   F )   } ,   D   =   / ^ [ ^ < ] * ( < ( . | \ s ) + > ) [ ^ > ] * $ | ^ # ( [ \ w - ] + ) $ / ,   f   =   / ^ . [ ^ : # \ [ \ . , ] * $ / ;   o . f n   =   o . p r o t o t y p e   =   {   i n i t :   f u n c t i o n ( E ,   H )   {   E   =   E   | |   d o c u m e n t ;   i f   ( E . n o d e T y p e )   {   t h i s [ 0 ]   =   E ;   t h i s . l e n g t h   =   1 ;   t h i s . c o n t e x t   =   E ;   r e t u r n   t h i s   }   i f   ( t y p e o f   E   = = =   " s t r i n g " )   {   v a r   G   =   D . e x e c ( E ) ;   i f   ( G   & &   ( G [ 1 ]   | |   ! H ) )   {   i f   ( G [ 1 ] )   {   E   =   o . c l e a n ( [ G [ 1 ] ] ,   H )   }   e l s e   {   v a r   I   =   d o c u m e n t . g e t E l e m e n t B y I d ( G [ 3 ] ) ;   i f   ( I   & &   I . i d   ! =   G [ 3 ] )   {   r e t u r n   o ( ) . f i n d ( E )   }   v a r   F   =   o ( I   | |   [ ] ) ;   F . c o n t e x t   =   d o c u m e n t ;   F . s e l e c t o r   =   E ;   r e t u r n   F   }   }   e l s e   {   r e t u r n   o ( H ) . f i n d ( E )   }   }   e l s e   {   i f   ( o . i s F u n c t i o n ( E ) )   {   r e t u r n   o ( d o c u m e n t ) . r e a d y ( E )   }   }   i f   ( E . s e l e c t o r   & &   E . c o n t e x t )   {   t h i s . s e l e c t o r   =   E . s e l e c t o r ;   t h i s . c o n t e x t   =   E . c o n t e x t   }   r e t u r n   t h i s . s e t A r r a y ( o . i s A r r a y ( E )   ?   E   :   o . m a k e A r r a y ( E ) )   } ,   s e l e c t o r :   " " ,   j q u e r y :   " 1 . 3 . 2 " ,   s i z e :   f u n c t i o n ( )   {   r e t u r n   t h i s . l e n g t h   } ,   g e t :   f u n c t i o n ( E )   {   r e t u r n   E   = = =   g   ?   A r r a y . p r o t o t y p e . s l i c e . c a l l ( t h i s )   :   t h i s [ E ]   } ,   p u s h S t a c k :   f u n c t i o n ( F ,   H ,   E )   {   v a r   G   =   o ( F ) ;   G . p r e v O b j e c t   =   t h i s ;   G . c o n t e x t   =   t h i s . c o n t e x t ;   i f   ( H   = = =   " f i n d " )   {   G . s e l e c t o r   =   t h i s . s e l e c t o r   +   ( t h i s . s e l e c t o r   ?   "   "   :   " " )   +   E   }   e l s e   {   i f   ( H )   {   G . s e l e c t o r   =   t h i s . s e l e c t o r   +   " . "   +   H   +   " ( "   +   E   +   " ) "   }   }   r e t u r n   G   } ,   s e t A r r a y :   f u n c t i o n ( E )   {   t h i s . l e n g t h   =   0 ;   A r r a y . p r o t o t y p e . p u s h . a p p l y ( t h i s ,   E ) ;   r e t u r n   t h i s   } ,   e a c h :   f u n c t i o n ( F ,   E )   {   r e t u r n   o . e a c h ( t h i s ,   F ,   E )   } ,   i n d e x :   f u n c t i o n ( E )   {   r e t u r n   o . i n A r r a y ( E   & &   E . j q u e r y   ?   E [ 0 ]   :   E ,   t h i s )   } ,   a t t r :   f u n c t i o n ( F ,   H ,   G )   {   v a r   E   =   F ;   i f   ( t y p e o f   F   = = =   " s t r i n g " )   {   i f   ( H   = = =   g )   {   r e t u r n   t h i s [ 0 ]   & &   o [ G   | |   " a t t r " ] ( t h i s [ 0 ] ,   F )   }   e l s e   {   E   =   { } ;   E [ F ]   =   H   }   }   r e t u r n   t h i s . e a c h ( f u n c t i o n ( I )   {   f o r   ( F   i n   E )   {   o . a t t r ( G   ?   t h i s . s t y l e   :   t h i s ,   F ,   o . p r o p ( t h i s ,   E [ F ] ,   G ,   I ,   F ) )   }   } )   } ,   c s s :   f u n c t i o n ( E ,   F )   {   i f   ( ( E   = =   " w i d t h "   | |   E   = =   " h e i g h t " )   & &   p a r s e F l o a t ( F )   <   0 )   {   F   =   g   }   r e t u r n   t h i s . a t t r ( E ,   F ,   " c u r C S S " )   } ,   t e x t :   f u n c t i o n ( F )   {   i f   ( t y p e o f   F   ! = =   " o b j e c t "   & &   F   ! =   n u l l )   {   r e t u r n   t h i s . e m p t y ( ) . a p p e n d ( ( t h i s [ 0 ]   & &   t h i s [ 0 ] . o w n e r D o c u m e n t   | |   d o c u m e n t ) . c r e a t e T e x t N o d e ( F ) )   }   v a r   E   =   " " ;   o . e a c h ( F   | |   t h i s ,   f u n c t i o n ( )   {   o . e a c h ( t h i s . c h i l d N o d e s ,   f u n c t i o n ( )   {   i f   ( t h i s . n o d e T y p e   ! =   8 )   {   E   + =   t h i s . n o d e T y p e   ! =   1   ?   t h i s . n o d e V a l u e   :   o . f n . t e x t ( [ t h i s ] )   }   } )   } ) ;   r e t u r n   E   } ,   w r a p A l l :   f u n c t i o n ( E )   {   i f   ( t h i s [ 0 ] )   {   v a r   F   =   o ( E ,   t h i s [ 0 ] . o w n e r D o c u m e n t ) . c l o n e ( ) ;   i f   ( t h i s [ 0 ] . p a r e n t N o d e )   {   F . i n s e r t B e f o r e ( t h i s [ 0 ] )   }   F . m a p ( f u n c t i o n ( )   {   v a r   G   =   t h i s ;   w h i l e   ( G . f i r s t C h i l d )   {   G   =   G . f i r s t C h i l d   }   r e t u r n   G   } ) . a p p e n d ( t h i s )   }   r e t u r n   t h i s   } ,   w r a p I n n e r :   f u n c t i o n ( E )   {   r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {   o ( t h i s ) . c o n t e n t s ( ) . w r a p A l l ( E )   } )   } ,   w r a p :   f u n c t i o n ( E )   {   r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {   o ( t h i s ) . w r a p A l l ( E )   } )   } ,   a p p e n d :   f u n c t i o n ( )   {   r e t u r n   t h i s . d o m M a n i p ( a r g u m e n t s ,   t r u e ,   f u n c t i o n ( E )   {   i f   ( t h i s . n o d e T y p e   = =   1 )   {   t h i s . a p p e n d C h i l d ( E )   }   } )   } ,   p r e p e n d :   f u n c t i o n ( )   {   r e t u r n   t h i s . d o m M a n i p ( a r g u m e n t s ,   t r u e ,   f u n c t i o n ( E )   {   i f   ( t h i s . n o d e T y p e   = =   1 )   {   t h i s . i n s e r t B e f o r e ( E ,   t h i s . f i r s t C h i l d )   }   } )   } ,   b e f o r e :   f u n c t i o n ( )   {   r e t u r n   t h i s . d o m M a n i p ( a r g u m e n t s ,   f a l s e ,   f u n c t i o n ( E )   {   t h i s . p a r e n t N o d e . i n s e r t B e f o r e ( E ,   t h i s )   } )   } ,   a f t e r :   f u n c t i o n ( )   {   r e t u r n   t h i s . d o m M a n i p ( a r g u m e n t s ,   f a l s e ,   f u n c t i o n ( E )   {   t h i s . p a r e n t N o d e . i n s e r t B e f o r e ( E ,   t h i s . n e x t S i b l i n g )   } )   } ,   e n d :   f u n c t i o n ( )   {   r e t u r n   t h i s . p r e v O b j e c t   | |   o ( [ ] )   } ,   p u s h :   [ ] . p u s h ,   s o r t :   [ ] . s o r t ,   s p l i c e :   [ ] . s p l i c e ,   f i n d :   f u n c t i o n ( E )   {   i f   ( t h i s . l e n g t h   = = =   1 )   {   v a r   F   =   t h i s . p u s h S t a c k ( [ ] ,   " f i n d " ,   E ) ;   F . l e n g t h   =   0 ;   o . f i n d ( E ,   t h i s [ 0 ] ,   F ) ;   r e t u r n   F   }   e l s e   {   r e t u r n   t h i s . p u s h S t a c k ( o . u n i q u e ( o . m a p ( t h i s ,   f u n c t i o n ( G )   {   r e t u r n   o . f i n d ( E ,   G )   } ) ) ,   " f i n d " ,   E )   }   } ,   c l o n e :   f u n c t i o n ( G )   {   v a r   E   =   t h i s . m a p ( f u n c t i o n ( )   {   i f   ( ! o . s u p p o r t . n o C l o n e E v e n t   & &   ! o . i s X M L D o c ( t h i s ) )   {   v a r   I   =   t h i s . o u t e r H T M L ;   i f   ( ! I )   {   v a r   J   =   t h i s . o w n e r D o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ;   J . a p p e n d C h i l d ( t h i s . c l o n e N o d e ( t r u e ) ) ;   I   =   J . i n n e r H T M L   }   r e t u r n   o . c l e a n ( [ I . r e p l a c e ( /   j Q u e r y \ d + = " ( ? : \ d + | n u l l ) " / g ,   " " ) . r e p l a c e ( / ^ \ s * / ,   " " ) ] ) [ 0 ]   }   e l s e   {   r e t u r n   t h i s . c l o n e N o d e ( t r u e )   }   } ) ;   i f   ( G   = = =   t r u e )   {   v a r   H   =   t h i s . f i n d ( " * " ) . a n d S e l f ( ) ,   F   =   0 ;   E . f i n d ( " * " ) . a n d S e l f ( ) . e a c h ( f u n c t i o n ( )   {   i f   ( t h i s . n o d e N a m e   ! = =   H [ F ] . n o d e N a m e )   {   r e t u r n   }   v a r   I   =   o . d a t a ( H [ F ] ,   " e v e n t s " ) ;   f o r   ( v a r   K   i n   I )   {   f o r   ( v a r   J   i n   I [ K ] )   {   o . e v e n t . a d d ( t h i s ,   K ,   I [ K ] [ J ] ,   I [ K ] [ J ] . d a t a )   }   }   F + +   } )   }   r e t u r n   E   } ,   f i l t e r :   f u n c t i o n ( E )   {   r e t u r n   t h i s . p u s h S t a c k ( o . i s F u n c t i o n ( E )   & &   o . g r e p ( t h i s ,   f u n c t i o n ( G ,   F )   {   r e t u r n   E . c a l l ( G ,   F )   } )   | |   o . m u l t i F i l t e r ( E ,   o . g r e p ( t h i s ,   f u n c t i o n ( F )   {   r e t u r n   F . n o d e T y p e   = = =   1   } ) ) ,   " f i l t e r " ,   E )   } ,   c l o s e s t :   f u n c t i o n ( E )   {   v a r   G   =   o . e x p r . m a t c h . P O S . t e s t ( E )   ?   o ( E )   :   n u l l ,   F   =   0 ;   r e t u r n   t h i s . m a p ( f u n c t i o n ( )   {   v a r   H   =   t h i s ;   w h i l e   ( H   & &   H . o w n e r D o c u m e n t )   {   i f   ( G   ?   G . i n d e x ( H )   >   - 1   :   o ( H ) . i s ( E ) )   {   o . d a t a ( H ,   " c l o s e s t " ,   F ) ;   r e t u r n   H   }   H   =   H . p a r e n t N o d e ;   F + +   }   } )   } ,   n o t :   f u n c t i o n ( E )   {   i f   ( t y p e o f   E   = = =   " s t r i n g " )   {   i f   ( f . t e s t ( E ) )   {   r e t u r n   t h i s . p u s h S t a c k ( o . m u l t i F i l t e r ( E ,   t h i s ,   t r u e ) ,   " n o t " ,   E )   }   e l s e   {   E   =   o . m u l t i F i l t e r ( E ,   t h i s )   }   }   v a r   F   =   E . l e n g t h   & &   E [ E . l e n g t h   -   1 ]   ! = =   g   & &   ! E . n o d e T y p e ;   r e t u r n   t h i s . f i l t e r ( f u n c t i o n ( )   {   r e t u r n   F   ?   o . i n A r r a y ( t h i s ,   E )   <   0   :   t h i s   ! =   E   } )   } ,   a d d :   f u n c t i o n ( E )   {   r e t u r n   t h i s . p u s h S t a c k ( o . u n i q u e ( o . m e r g e ( t h i s . g e t ( ) ,   t y p e o f   E   = = =   " s t r i n g "   ?   o ( E )   :   o . m a k e A r r a y ( E ) ) ) )   } ,   i s :   f u n c t i o n ( E )   {   r e t u r n   ! ! E   & &   o . m u l t i F i l t e r ( E ,   t h i s ) . l e n g t h   >   0   } ,   h a s C l a s s :   f u n c t i o n ( E )   {   r e t u r n   ! ! E   & &   t h i s . i s ( " . "   +   E )   } ,   v a l :   f u n c t i o n ( K )   {   i f   ( K   = = =   g )   {   v a r   E   =   t h i s [ 0 ] ;   i f   ( E )   {   i f   ( o . n o d e N a m e ( E ,   " o p t i o n " ) )   {   r e t u r n   ( E . a t t r i b u t e s . v a l u e   | |   { } ) . s p e c i f i e d   ?   E . v a l u e   :   E . t e x t   }   i f   ( o . n o d e N a m e ( E ,   " s e l e c t " ) )   {   v a r   I   =   E . s e l e c t e d I n d e x ,   L   =   [ ] ,   M   =   E . o p t i o n s ,   H   =   E . t y p e   = =   " s e l e c t - o n e " ;   i f   ( I   <   0 )   {   r e t u r n   n u l l   }   f o r   ( v a r   F   =   H   ?   I   :   0 ,   J   =   H   ?   I   +   1   :   M . l e n g t h ;   F   <   J ;   F + + )   {   v a r   G   =   M [ F ] ;   i f   ( G . s e l e c t e d )   {   K   =   o ( G ) . v a l ( ) ;   i f   ( H )   {   r e t u r n   K   }   L . p u s h ( K )   }   }   r e t u r n   L   }   r e t u r n   ( E . v a l u e   | |   " " ) . r e p l a c e ( / \ r / g ,   " " )   }   r e t u r n   g   }   i f   ( t y p e o f   K   = = =   " n u m b e r " )   {   K   + =   " "   }   r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {   i f   ( t h i s . n o d e T y p e   ! =   1 )   {   r e t u r n   }   i f   ( o . i s A r r a y ( K )   & &   / r a d i o | c h e c k b o x / . t e s t ( t h i s . t y p e ) )   {   t h i s . c h e c k e d   =   ( o . i n A r r a y ( t h i s . v a l u e ,   K )   > =   0   | |   o . i n A r r a y ( t h i s . n a m e ,   K )   > =   0 )   }   e l s e   {   i f   ( o . n o d e N a m e ( t h i s ,   " s e l e c t " ) )   {   v a r   N   =   o . m a k e A r r a y ( K ) ;   o ( " o p t i o n " ,   t h i s ) . e a c h ( f u n c t i o n ( )   {   t h i s . s e l e c t e d   =   ( o . i n A r r a y ( t h i s . v a l u e ,   N )   > =   0   | |   o . i n A r r a y ( t h i s . t e x t ,   N )   > =   0 )   } ) ;   i f   ( ! N . l e n g t h )   {   t h i s . s e l e c t e d I n d e x   =   - 1   }   }   e l s e   {   t h i s . v a l u e   =   K   }   }   } )   } ,   h t m l :   f u n c t i o n ( E )   {   r e t u r n   E   = = =   g   ?   ( t h i s [ 0 ]   ?   t h i s [ 0 ] . i n n e r H T M L . r e p l a c e ( /   j Q u e r y \ d + = " ( ? : \ d + | n u l l ) " / g ,   " " )   :   n u l l )   :   t h i s . e m p t y ( ) . a p p e n d ( E )   } ,   r e p l a c e W i t h :   f u n c t i o n ( E )   {   r e t u r n   t h i s . a f t e r ( E ) . r e m o v e ( )   } ,   e q :   f u n c t i o n ( E )   {   r e t u r n   t h i s . s l i c e ( E ,   + E   +   1 )   } ,   s l i c e :   f u n c t i o n ( )   {   r e t u r n   t h i s . p u s h S t a c k ( A r r a y . p r o t o t y p e . s l i c e . a p p l y ( t h i s ,   a r g u m e n t s ) ,   " s l i c e " ,   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 ) . j o i n ( " , " ) )   } ,   m a p :   f u n c t i o n ( E )   {   r e t u r n   t h i s . p u s h S t a c k ( o . m a p ( t h i s ,   f u n c t i o n ( G ,   F )   {   r e t u r n   E . c a l l ( G ,   F ,   G )   } ) )   } ,   a n d S e l f :   f u n c t i o n ( )   {   r e t u r n   t h i s . a d d ( t h i s . p r e v O b j e c t )   } ,   d o m M a n i p :   f u n c t i o n ( J ,   M ,   L )   {   i f   ( t h i s [ 0 ] )   {   v a r   I   =   ( t h i s [ 0 ] . o w n e r D o c u m e n t   | |   t h i s [ 0 ] ) . c r e a t e D o c u m e n t F r a g m e n t ( ) ,   F   =   o . c l e a n ( J ,   ( t h i s [ 0 ] . o w n e r D o c u m e n t   | |   t h i s [ 0 ] ) ,   I ) ,   H   =   I . f i r s t C h i l d ;   i f   ( H )   {   f o r   ( v a r   G   =   0 ,   E   =   t h i s . l e n g t h ;   G   <   E ;   G + + )   {   L . c a l l ( K ( t h i s [ G ] ,   H ) ,   t h i s . l e n g t h   >   1   | |   G   >   0   ?   I . c l o n e N o d e ( t r u e )   :   I )   }   }   i f   ( F )   {   o . e a c h ( F ,   z )   }   }   r e t u r n   t h i s ;   f u n c t i o n   K ( N ,   O )   {   r e t u r n   M   & &   o . n o d e N a m e ( N ,   " t a b l e " )   & &   o . n o d e N a m e ( O ,   " t r " )   ?   ( N . g e t E l e m e n t s B y T a g N a m e ( " t b o d y " ) [ 0 ]   | |   N . a p p e n d C h i l d ( N . o w n e r D o c u m e n t . c r e a t e E l e m e n t ( " t b o d y " ) ) )   :   N   }   }   } ;   o . f n . i n i t . p r o t o t y p e   =   o . f n ;   f u n c t i o n   z ( E ,   F )   {   i f   ( F . s r c )   {   o . a j a x ( {   u r l :   F . s r c ,   a s y n c :   f a l s e ,   d a t a T y p e :   " s c r i p t "   } )   }   e l s e   {   o . g l o b a l E v a l ( F . t e x t   | |   F . t e x t C o n t e n t   | |   F . i n n e r H T M L   | |   " " )   }   i f   ( F . p a r e n t N o d e )   {   F . p a r e n t N o d e . r e m o v e C h i l d ( F )   }   }   f u n c t i o n   e ( )   {   r e t u r n   + n e w   D a t e   }   o . e x t e n d   =   o . f n . e x t e n d   =   f u n c t i o n ( )   {   v a r   J   =   a r g u m e n t s [ 0 ]   | |   { } ,   H   =   1 ,   I   =   a r g u m e n t s . l e n g t h ,   E   =   f a l s e ,   G ;   i f   ( t y p e o f   J   = = =   " b o o l e a n " )   {   E   =   J ;   J   =   a r g u m e n t s [ 1 ]   | |   { } ;   H   =   2   }   i f   ( t y p e o f   J   ! = =   " o b j e c t "   & &   ! o . i s F u n c t i o n ( J ) )   {   J   =   { }   }   i f   ( I   = =   H )   {   J   =   t h i s ;   - - H   }   f o r   ( ;   H   <   I ;   H + + )   {   i f   ( ( G   =   a r g u m e n t s [ H ] )   ! =   n u l l )   {   f o r   ( v a r   F   i n   G )   {   v a r   K   =   J [ F ] ,   L   =   G [ F ] ;   i f   ( J   = = =   L )   {   c o n t i n u e   }   i f   ( E   & &   L   & &   t y p e o f   L   = = =   " o b j e c t "   & &   ! L . n o d e T y p e )   {   J [ F ]   =   o . e x t e n d ( E ,   K   | |   ( L . l e n g t h   ! =   n u l l   ?   [ ]   :   { } ) ,   L )   }   e l s e   {   i f   ( L   ! = =   g )   {   J [ F ]   =   L   }   }   }   }   }   r e t u r n   J   } ;   v a r   b   =   / z - ? i n d e x | f o n t - ? w e i g h t | o p a c i t y | z o o m | l i n e - ? h e i g h t / i ,   q   =   d o c u m e n t . d e f a u l t V i e w   | |   { } ,   s   =   O b j e c t . p r o t o t y p e . t o S t r i n g ;   o . e x t e n d ( {   n o C o n f l i c t :   f u n c t i o n ( E )   {   l . $   =   p ;   i f   ( E )   {   l . j Q u e r y   =   y   }   r e t u r n   o   } ,   i s F u n c t i o n :   f u n c t i o n ( E )   {   r e t u r n   s . c a l l ( E )   = = =   " [ o b j e c t   F u n c t i o n ] "   } ,   i s A r r a y :   f u n c t i o n ( E )   {   r e t u r n   s . c a l l ( E )   = = =   " [ o b j e c t   A r r a y ] "   } ,   i s X M L D o c :   f u n c t i o n ( E )   {   r e t u r n   E . n o d e T y p e   = = =   9   & &   E . 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 "   | |   ! ! E . o w n e r D o c u m e n t   & &   o . i s X M L D o c ( E . o w n e r D o c u m e n t )   } ,   g l o b a l E v a l :   f u n c t i o n ( G )   {   i f   ( G   & &   / \ S / . t e s t ( G ) )   {   v a r   F   =   d o c u m e n t . g e t E l e m e n t s B y T a g N a m e ( " h e a d " ) [ 0 ]   | |   d o c u m e n t . d o c u m e n t E l e m e n t ,   E   =   d o c u m e n t . c r e a t e E l e m e n t ( " s c r i p t " ) ;   E . t y p e   =   " t e x t / j a v a s c r i p t " ;   i f   ( o . s u p p o r t . s c r i p t E v a l )   {   E . 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 T e x t N o d e ( G ) )   }   e l s e   {   E . t e x t   =   G   }   F . i n s e r t B e f o r e ( E ,   F . f i r s t C h i l d ) ;   F . r e m o v e C h i l d ( E )   }   } ,   n o d e N a m e :   f u n c t i o n ( F ,   E )   {   r e t u r n   F . n o d e N a m e   & &   F . n o d e N a m e . t o U p p e r C a s e ( )   = =   E . t o U p p e r C a s e ( )   } ,   e a c h :   f u n c t i o n ( G ,   K ,   F )   {   v a r   E ,   H   =   0 ,   I   =   G . l e n g t h ;   i f   ( F )   {   i f   ( I   = = =   g )   {   f o r   ( E   i n   G )   {   i f   ( K . a p p l y ( G [ E ] ,   F )   = = =   f a l s e )   {   b r e a k   }   }   }   e l s e   {   f o r   ( ;   H   <   I ;   )   {   i f   ( K . a p p l y ( G [ H + + ] ,   F )   = = =   f a l s e )   {   b r e a k   }   }   }   }   e l s e   {   i f   ( I   = = =   g )   {   f o r   ( E   i n   G )   {   i f   ( K . c a l l ( G [ E ] ,   E ,   G [ E ] )   = = =   f a l s e )   {   b r e a k   }   }   }   e l s e   {   f o r   ( v a r   J   =   G [ 0 ] ;   H   <   I   & &   K . c a l l ( J ,   H ,   J )   ! = =   f a l s e ;   J   =   G [ + + H ] )   {   }   }   }   r e t u r n   G   } ,   p r o p :   f u n c t i o n ( H ,   I ,   G ,   F ,   E )   {   i f   ( o . i s F u n c t i o n ( I ) )   {   I   =   I . c a l l ( H ,   F )   }   r e t u r n   t y p e o f   I   = = =   " n u m b e r "   & &   G   = =   " c u r C S S "   & &   ! b . t e s t ( E )   ?   I   +   " p x "   :   I   } ,   c l a s s N a m e :   {   a d d :   f u n c t i o n ( E ,   F )   {   o . e a c h ( ( F   | |   " " ) . s p l i t ( / \ s + / ) ,   f u n c t i o n ( G ,   H )   {   i f   ( E . n o d e T y p e   = =   1   & &   ! o . c l a s s N a m e . h a s ( E . c l a s s N a m e ,   H ) )   {   E . c l a s s N a m e   + =   ( E . c l a s s N a m e   ?   "   "   :   " " )   +   H   }   } )   } ,   r e m o v e :   f u n c t i o n ( E ,   F )   {   i f   ( E . n o d e T y p e   = =   1 )   {   E . c l a s s N a m e   =   F   ! = =   g   ?   o . g r e p ( E . c l a s s N a m e . s p l i t ( / \ s + / ) ,   f u n c t i o n ( G )   {   r e t u r n   ! o . c l a s s N a m e . h a s ( F ,   G )   } ) . j o i n ( "   " )   :   " "   }   } ,   h a s :   f u n c t i o n ( F ,   E )   {   r e t u r n   F   & &   o . i n A r r a y ( E ,   ( F . c l a s s N a m e   | |   F ) . t o S t r i n g ( ) . s p l i t ( / \ s + / ) )   >   - 1   }   } ,   s w a p :   f u n c t i o n ( H ,   G ,   I )   {   v a r   E   =   { } ;   f o r   ( v a r   F   i n   G )   {   E [ F ]   =   H . s t y l e [ F ] ;   H . s t y l e [ F ]   =   G [ F ]   }   I . c a l l ( H ) ;   f o r   ( v a r   F   i n   G )   {   H . s t y l e [ F ]   =   E [ F ]   }   } ,   c s s :   f u n c t i o n ( H ,   F ,   J ,   E )   {   i f   ( F   = =   " w i d t h "   | |   F   = =   " h e i g h t " )   {   v a r   L ,   G   =   {   p o s i t i o n :   " a b s o l u t e " ,   v i s i b i l i t y :   " h i d d e n " ,   d i s p l a y :   " b l o c k "   } ,   K   =   F   = =   " w i d t h "   ?   [ " L e f t " ,   " R i g h t " ]   :   [ " T o p " ,   " B o t t o m " ] ;   f u n c t i o n   I ( )   {   L   =   F   = =   " w i d t h "   ?   H . o f f s e t W i d t h   :   H . o f f s e t H e i g h t ;   i f   ( E   = = =   " b o r d e r " )   {   r e t u r n   }   o . e a c h ( K ,   f u n c t i o n ( )   {   i f   ( ! E )   {   L   - =   p a r s e F l o a t ( o . c u r C S S ( H ,   " p a d d i n g "   +   t h i s ,   t r u e ) )   | |   0   }   i f   ( E   = = =   " m a r g i n " )   {   L   + =   p a r s e F l o a t ( o . c u r C S S ( H ,   " m a r g i n "   +   t h i s ,   t r u e ) )   | |   0   }   e l s e   {   L   - =   p a r s e F l o a t ( o . c u r C S S ( H ,   " b o r d e r "   +   t h i s   +   " W i d t h " ,   t r u e ) )   | |   0   }   } )   }   i f   ( H . o f f s e t W i d t h   ! = =   0 )   {   I ( )   }   e l s e   {   o . s w a p ( H ,   G ,   I )   }   r e t u r n   M a t h . m a x ( 0 ,   M a t h . r o u n d ( L ) )   }   r e t u r n   o . c u r C S S ( H ,   F ,   J )   } ,   c u r C S S :   f u n c t i o n ( I ,   F ,   G )   {   v a r   L ,   E   =   I . s t y l e ;   i f   ( F   = =   " o p a c i t y "   & &   ! o . s u p p o r t . o p a c i t y )   {   L   =   o . a t t r ( E ,   " o p a c i t y " ) ;   r e t u r n   L   = =   " "   ?   " 1 "   :   L   }   i f   ( F . m a t c h ( / f l o a t / i ) )   {   F   =   w   }   i f   ( ! G   & &   E   & &   E [ F ] )   {   L   =   E [ F ]   }   e l s e   {   i f   ( q . g e t C o m p u t e d S t y l e )   {   i f   ( F . m a t c h ( / f l o a t / i ) )   {   F   =   " f l o a t "   }   F   =   F . r e p l a c e ( / ( [ A - Z ] ) / g ,   " - $ 1 " ) . t o L o w e r C a s e ( ) ;   v a r   M   =   q . g e t C o m p u t e d S t y l e ( I ,   n u l l ) ;   i f   ( M )   {   L   =   M . g e t P r o p e r t y V a l u e ( F )   }   i f   ( F   = =   " o p a c i t y "   & &   L   = =   " " )   {   L   =   " 1 "   }   }   e l s e   {   i f   ( I . c u r r e n t S t y l e )   {   v a r   J   =   F . r e p l a c e ( / \ - ( \ w ) / g ,   f u n c t i o n ( N ,   O )   {   r e t u r n   O . t o U p p e r C a s e ( )   } ) ;   L   =   I . c u r r e n t S t y l e [ F ]   | |   I . c u r r e n t S t y l e [ J ] ;   i f   ( ! / ^ \ d + ( p x ) ? $ / i . t e s t ( L )   & &   / ^ \ d / . t e s t ( L ) )   {   v a r   H   =   E . l e f t ,   K   =   I . r u n t i m e S t y l e . l e f t ;   I . r u n t i m e S t y l e . l e f t   =   I . c u r r e n t S t y l e . l e f t ;   E . l e f t   =   L   | |   0 ;   L   =   E . p i x e l L e f t   +   " p x " ;   E . l e f t   =   H ;   I . r u n t i m e S t y l e . l e f t   =   K   }   }   }   }   r e t u r n   L   } ,   c l e a n :   f u n c t i o n ( F ,   K ,   I )   {   K   =   K   | |   d o c u m e n t ;   i f   ( t y p e o f   K . c r e a t e E l e m e n t   = = =   " u n d e f i n e d " )   {   K   =   K . o w n e r D o c u m e n t   | |   K [ 0 ]   & &   K [ 0 ] . o w n e r D o c u m e n t   | |   d o c u m e n t   }   i f   ( ! I   & &   F . l e n g t h   = = =   1   & &   t y p e o f   F [ 0 ]   = = =   " s t r i n g " )   {   v a r   H   =   / ^ < ( \ w + ) \ s * \ / ? > $ / . e x e c ( F [ 0 ] ) ;   i f   ( H )   {   r e t u r n   [ K . c r e a t e E l e m e n t ( H [ 1 ] ) ]   }   }   v a r   G   =   [ ] ,   E   =   [ ] ,   L   =   K . c r e a t e E l e m e n t ( " d i v " ) ;   o . e a c h ( F ,   f u n c t i o n ( P ,   S )   {   i f   ( t y p e o f   S   = = =   " n u m b e r " )   {   S   + =   " "   }   i f   ( ! S )   {   r e t u r n   }   i f   ( t y p e o f   S   = = =   " s t r i n g " )   {   S   =   S . r e p l a c e ( / ( < ( \ w + ) [ ^ > ] * ? ) \ / > / g ,   f u n c t i o n ( U ,   V ,   T )   {   r e t u r n   T . m a t c h ( / ^ ( a b b r | b r | c o l | i m g | i n p u t | l i n k | m e t a | p a r a m | h r | a r e a | e m b e d ) $ / i )   ?   U   :   V   +   " > < / "   +   T   +   " > "   } ) ;   v a r   O   =   S . r e p l a c e ( / ^ \ s + / ,   " " ) . s u b s t r i n g ( 0 ,   1 0 ) . t o L o w e r C a s e ( ) ;   v a r   Q   =   ! O . i n d e x O f ( " < o p t " )   & &   [ 1 ,   " < s e l e c t   m u l t i p l e = ' m u l t i p l e ' > " ,   " < / s e l e c t > " ]   | |   ! O . i n d e x O f ( " < l e g " )   & &   [ 1 ,   " < f i e l d s e t > " ,   " < / f i e l d s e t > " ]   | |   O . m a t c h ( / ^ < ( t h e a d | t b o d y | t f o o t | c o l g | c a p ) / )   & &   [ 1 ,   " < t a b l e > " ,   " < / t a b l e > " ]   | |   ! O . i n d e x O f ( " < t r " )   & &   [ 2 ,   " < t a b l e > < t b o d y > " ,   " < / t b o d y > < / t a b l e > " ]   | |   ( ! O . i n d e x O f ( " < t d " )   | |   ! O . i n d e x O f ( " < t h " ) )   & &   [ 3 ,   " < t a b l e > < t b o d y > < t r > " ,   " < / t r > < / t b o d y > < / t a b l e > " ]   | |   ! O . i n d e x O f ( " < c o l " )   & &   [ 2 ,   " < t a b l e > < t b o d y > < / t b o d y > < c o l g r o u p > " ,   " < / c o l g r o u p > < / t a b l e > " ]   | |   ! o . s u p p o r t . h t m l S e r i a l i z e   & &   [ 1 ,   " d i v < d i v > " ,   " < / d i v > " ]   | |   [ 0 ,   " " ,   " " ] ;   L . i n n e r H T M L   =   Q [ 1 ]   +   S   +   Q [ 2 ] ;   w h i l e   ( Q [ 0 ] - - )   {   L   =   L . l a s t C h i l d   }   i f   ( ! o . s u p p o r t . t b o d y )   {   v a r   R   =   / < t b o d y / i . t e s t ( S ) ,   N   =   ! O . i n d e x O f ( " < t a b l e " )   & &   ! R   ?   L . f i r s t C h i l d   & &   L . f i r s t C h i l d . c h i l d N o d e s   :   Q [ 1 ]   = =   " < t a b l e > "   & &   ! R   ?   L . c h i l d N o d e s   :   [ ] ;   f o r   ( v a r   M   =   N . l e n g t h   -   1 ;   M   > =   0 ;   - - M )   {   i f   ( o . n o d e N a m e ( N [ M ] ,   " t b o d y " )   & &   ! N [ M ] . c h i l d N o d e s . l e n g t h )   {   N [ M ] . p a r e n t N o d e . r e m o v e C h i l d ( N [ M ] )   }   }   }   i f   ( ! o . s u p p o r t . l e a d i n g W h i t e s p a c e   & &   / ^ \ s / . t e s t ( S ) )   {   L . i n s e r t B e f o r e ( K . c r e a t e T e x t N o d e ( S . m a t c h ( / ^ \ s * / ) [ 0 ] ) ,   L . f i r s t C h i l d )   }   S   =   o . m a k e A r r a y ( L . c h i l d N o d e s )   }   i f   ( S . n o d e T y p e )   {   G . p u s h ( S )   }   e l s e   {   G   =   o . m e r g e ( G ,   S )   }   } ) ;   i f   ( I )   {   f o r   ( v a r   J   =   0 ;   G [ J ] ;   J + + )   {   i f   ( o . n o d e N a m e ( G [ J ] ,   " s c r i p t " )   & &   ( ! G [ J ] . t y p e   | |   G [ J ] . t y p e . t o L o w e r C a s e ( )   = = =   " t e x t / j a v a s c r i p t " ) )   {   E . p u s h ( G [ J ] . p a r e n t N o d e   ?   G [ J ] . p a r e n t N o d e . r e m o v e C h i l d ( G [ J ] )   :   G [ J ] )   }   e l s e   {   i f   ( G [ J ] . n o d e T y p e   = = =   1 )   {   G . s p l i c e . a p p l y ( G ,   [ J   +   1 ,   0 ] . c o n c a t ( o . m a k e A r r a y ( G [ J ] . 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 " ) ) ) )   }   I . a p p e n d C h i l d ( G [ J ] )   }   }   r e t u r n   E   }   r e t u r n   G   } ,   a t t r :   f u n c t i o n ( J ,   G ,   K )   {   i f   ( ! J   | |   J . n o d e T y p e   = =   3   | |   J . n o d e T y p e   = =   8 )   {   r e t u r n   g   }   v a r   H   =   ! o . i s X M L D o c ( J ) ,   L   =   K   ! = =   g ;   G   =   H   & &   o . p r o p s [ G ]   | |   G ;   i f   ( J . t a g N a m e )   {   v a r   F   =   / h r e f | s r c | s t y l e / . t e s t ( G ) ;   i f   ( G   = =   " s e l e c t e d "   & &   J . p a r e n t N o d e )   {   J . p a r e n t N o d e . s e l e c t e d I n d e x   }   i f   ( G   i n   J   & &   H   & &   ! F )   {   i f   ( L )   {   i f   ( G   = =   " t y p e "   & &   o . n o d e N a m e ( J ,   " i n p u t " )   & &   J . p a r e n t N o d e )   {   t h r o w   " t y p e   p r o p e r t y   c a n ' t   b e   c h a n g e d "   }   J [ G ]   =   K   }   i f   ( o . n o d e N a m e ( J ,   " f o r m " )   & &   J . g e t A t t r i b u t e N o d e ( G ) )   {   r e t u r n   J . g e t A t t r i b u t e N o d e ( G ) . n o d e V a l u e   }   i f   ( G   = =   " t a b I n d e x " )   {   v a r   I   =   J . g e t A t t r i b u t e N o d e ( " t a b I n d e x " ) ;   r e t u r n   I   & &   I . s p e c i f i e d   ?   I . v a l u e   :   J . n o d e N a m e . m a t c h ( / ( b u t t o n | i n p u t | o b j e c t | s e l e c t | t e x t a r e a ) / i )   ?   0   :   J . n o d e N a m e . m a t c h ( / ^ ( a | a r e a ) $ / i )   & &   J . h r e f   ?   0   :   g   }   r e t u r n   J [ G ]   }   i f   ( ! o . s u p p o r t . s t y l e   & &   H   & &   G   = =   " s t y l e " )   {   r e t u r n   o . a t t r ( J . s t y l e ,   " c s s T e x t " ,   K )   }   i f   ( L )   {   J . s e t A t t r i b u t e ( G ,   " "   +   K )   }   v a r   E   =   ! o . s u p p o r t . h r e f N o r m a l i z e d   & &   H   & &   F   ?   J . g e t A t t r i b u t e ( G ,   2 )   :   J . g e t A t t r i b u t e ( G ) ;   r e t u r n   E   = = =   n u l l   ?   g   :   E   }   i f   ( ! o . s u p p o r t . o p a c i t y   & &   G   = =   " o p a c i t y " )   {   i f   ( L )   {   J . z o o m   =   1 ;   J . f i l t e r   =   ( J . f i l t e r   | |   " " ) . r e p l a c e ( / a l p h a \ ( [ ^ ) ] * \ ) / ,   " " )   +   ( p a r s e I n t ( K )   +   " "   = =   " N a N "   ?   " "   :   " a l p h a ( o p a c i t y = "   +   K   *   1 0 0   +   " ) " )   }   r e t u r n   J . f i l t e r   & &   J . f i l t e r . i n d e x O f ( " o p a c i t y = " )   > =   0   ?   ( p a r s e F l o a t ( J . f i l t e r . m a t c h ( / o p a c i t y = ( [ ^ ) ] * ) / ) [ 1 ] )   /   1 0 0 )   +   " "   :   " "   }   G   =   G . r e p l a c e ( / - ( [ a - z ] ) / i g ,   f u n c t i o n ( M ,   N )   {   r e t u r n   N . t o U p p e r C a s e ( )   } ) ;   i f   ( L )   {   J [ G ]   =   K   }   r e t u r n   J [ G ]   } ,   t r i m :   f u n c t i o n ( E )   {   r e t u r n   ( E   | |   " " ) . r e p l a c e ( / ^ \ s + | \ s + $ / g ,   " " )   } ,   m a k e A r r a y :   f u n c t i o n ( G )   {   v a r   E   =   [ ] ;   i f   ( G   ! =   n u l l )   {   v a r   F   =   G . l e n g t h ;   i f   ( F   = =   n u l l   | |   t y p e o f   G   = = =   " s t r i n g "   | |   o . i s F u n c t i o n ( G )   | |   G . s e t I n t e r v a l )   {   E [ 0 ]   =   G   }   e l s e   {   w h i l e   ( F )   {   E [ - - F ]   =   G [ F ]   }   }   }   r e t u r n   E   } ,   i n A r r a y :   f u n c t i o n ( G ,   H )   {   f o r   ( v a r   E   =   0 ,   F   =   H . l e n g t h ;   E   <   F ;   E + + )   {   i f   ( H [ E ]   = = =   G )   {   r e t u r n   E   }   }   r e t u r n   - 1   } ,   m e r g e :   f u n c t i o n ( H ,   E )   {   v a r   F   =   0 ,   G ,   I   =   H . l e n g t h ;   i f   ( ! o . s u p p o r t . g e t A l l )   {   w h i l e   ( ( G   =   E [ F + + ] )   ! =   n u l l )   {   i f   ( G . n o d e T y p e   ! =   8 )   {   H [ I + + ]   =   G   }   }   }   e l s e   {   w h i l e   ( ( G   =   E [ F + + ] )   ! =   n u l l )   {   H [ I + + ]   =   G   }   }   r e t u r n   H   } ,   u n i q u e :   f u n c t i o n ( K )   {   v a r   F   =   [ ] ,   E   =   { } ;   t r y   {   f o r   ( v a r   G   =   0 ,   H   =   K . l e n g t h ;   G   <   H ;   G + + )   {   v a r   J   =   o . d a t a ( K [ G ] ) ;   i f   ( ! E [ J ] )   {   E [ J ]   =   t r u e ;   F . p u s h ( K [ G ] )   }   }   }   c a t c h   ( I )   {   F   =   K   }   r e t u r n   F   } ,   g r e p :   f u n c t i o n ( F ,   J ,   E )   {   v a r   G   =   [ ] ;   f o r   ( v a r   H   =   0 ,   I   =   F . l e n g t h ;   H   <   I ;   H + + )   {   i f   ( ! E   ! =   ! J ( F [ H ] ,   H ) )   {   G . p u s h ( F [ H ] )   }   }   r e t u r n   G   } ,   m a p :   f u n c t i o n ( E ,   J )   {   v a r   F   =   [ ] ;   f o r   ( v a r   G   =   0 ,   H   =   E . l e n g t h ;   G   <   H ;   G + + )   {   v a r   I   =   J ( E [ G ] ,   G ) ;   i f   ( I   ! =   n u l l )   {   F [ F . l e n g t h ]   =   I   }   }   r e t u r n   F . c o n c a t . a p p l y ( [ ] ,   F )   }   } ) ;   v a r   C   =   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 ( ) ;   o . b r o w s e r   =   {   v e r s i o n :   ( C . m a t c h ( / . + ( ? : r v | i t | r a | i e ) [ \ / :   ] ( [ \ d . ] + ) / )   | |   [ 0 ,   " 0 " ] ) [ 1 ] ,   s a f a r i :   / w e b k i t / . t e s t ( C ) ,   o p e r a :   / o p e r a / . t e s t ( C ) ,   m s i e :   / m s i e / . t e s t ( C )   & &   ! / o p e r a / . t e s t ( C ) ,   m o z i l l a :   / m o z i l l a / . t e s t ( C )   & &   ! / ( c o m p a t i b l e | w e b k i t ) / . t e s t ( C )   } ;   o . e a c h ( {   p a r e n t :   f u n c t i o n ( E )   {   r e t u r n   E . p a r e n t N o d e   } ,   p a r e n t s :   f u n c t i o n ( E )   {   r e t u r n   o . d i r ( E ,   " p a r e n t N o d e " )   } ,   n e x t :   f u n c t i o n ( E )   {   r e t u r n   o . n t h ( E ,   2 ,   " n e x t S i b l i n g " )   } ,   p r e v :   f u n c t i o n ( E )   {   r e t u r n   o . n t h ( E ,   2 ,   " p r e v i o u s S i b l i n g " )   } ,   n e x t A l l :   f u n c t i o n ( E )   {   r e t u r n   o . d i r ( E ,   " n e x t S i b l i n g " )   } ,   p r e v A l l :   f u n c t i o n ( E )   {   r e t u r n   o . d i r ( E ,   " p r e v i o u s S i b l i n g " )   } ,   s i b l i n g s :   f u n c t i o n ( E )   {   r e t u r n   o . s i b l i n g ( E . p a r e n t N o d e . f i r s t C h i l d ,   E )   } ,   c h i l d r e n :   f u n c t i o n ( E )   {   r e t u r n   o . s i b l i n g ( E . f i r s t C h i l d )   } ,   c o n t e n t s :   f u n c t i o n ( E )   {   r e t u r n   o . n o d e N a m e ( E ,   " i f r a m e " )   ?   E . c o n t e n t D o c u m e n t   | |   E . c o n t e n t W i n d o w . d o c u m e n t   :   o . m a k e A r r a y ( E . c h i l d N o d e s )   }   } ,   f u n c t i o n ( E ,   F )   {   o . f n [ E ]   =   f u n c t i o n ( G )   {   v a r   H   =   o . m a p ( t h i s ,   F ) ;   i f   ( G   & &   t y p e o f   G   = =   " s t r i n g " )   {   H   =   o . m u l t i F i l t e r ( G ,   H )   }   r e t u r n   t h i s . p u s h S t a c k ( o . u n i q u e ( H ) ,   E ,   G )   }   } ) ;   o . e a c h ( {   a p p e n d T o :   " a p p e n d " ,   p r e p e n d T o :   " p r e p e n d " ,   i n s e r t B e f o r e :   " b e f o r e " ,   i n s e r t A f t e r :   " a f t e r " ,   r e p l a c e A l l :   " r e p l a c e W i t h "   } ,   f u n c t i o n ( E ,   F )   {   o . f n [ E ]   =   f u n c t i o n ( G )   {   v a r   J   =   [ ] ,   L   =   o ( G ) ;   f o r   ( v a r   K   =   0 ,   H   =   L . l e n g t h ;   K   <   H ;   K + + )   {   v a r   I   =   ( K   >   0   ?   t h i s . c l o n e ( t r u e )   :   t h i s ) . g e t ( ) ;   o . f n [ F ] . a p p l y ( o ( L [ K ] ) ,   I ) ;   J   =   J . c o n c a t ( I )   }   r e t u r n   t h i s . p u s h S t a c k ( J ,   E ,   G )   }   } ) ;   o . e a c h ( {   r e m o v e A t t r :   f u n c t i o n ( E )   {   o . a t t r ( t h i s ,   E ,   " " ) ;   i f   ( t h i s . n o d e T y p e   = =   1 )   {   t h i s . r e m o v e A t t r i b u t e ( E )   }   } ,   a d d C l a s s :   f u n c t i o n ( E )   {   o . c l a s s N a m e . a d d ( t h i s ,   E )   } ,   r e m o v e C l a s s :   f u n c t i o n ( E )   {   o . c l a s s N a m e . r e m o v e ( t h i s ,   E )   } ,   t o g g l e C l a s s :   f u n c t i o n ( F ,   E )   {   i f   ( t y p e o f   E   ! = =   " b o o l e a n " )   {   E   =   ! o . c l a s s N a m e . h a s ( t h i s ,   F )   }   o . c l a s s N a m e [ E   ?   " a d d "   :   " r e m o v e " ] ( t h i s ,   F )   } ,   r e m o v e :   f u n c t i o n ( E )   {   i f   ( ! E   | |   o . f i l t e r ( E ,   [ t h i s ] ) . l e n g t h )   {   o ( " * " ,   t h i s ) . a d d ( [ t h i s ] ) . e a c h ( f u n c t i o n ( )   {   o . e v e n t . r e m o v e ( t h i s ) ;   o . r e m o v e D a t a ( t h i s )   } ) ;   i f   ( t h i s . p a r e n t N o d e )   {   t h i s . p a r e n t N o d e . r e m o v e C h i l d ( t h i s )   }   }   } ,   e m p t y :   f u n c t i o n ( )   {   o ( t h i s ) . c h i l d r e n ( ) . r e m o v e ( ) ;   w h i l e   ( t h i s . f i r s t C h i l d )   {   t h i s . r e m o v e C h i l d ( t h i s . f i r s t C h i l d )   }   }   } ,   f u n c t i o n ( E ,   F )   {   o . f n [ E ]   =   f u n c t i o n ( )   {   r e t u r n   t h i s . e a c h ( F ,   a r g u m e n t s )   }   } ) ;   f u n c t i o n   j ( E ,   F )   {   r e t u r n   E [ 0 ]   & &   p a r s e I n t ( o . c u r C S S ( E [ 0 ] ,   F ,   t r u e ) ,   1 0 )   | |   0   }   v a r   h   =   " j Q u e r y "   +   e ( ) ,   v   =   0 ,   A   =   { } ;   o . e x t e n d ( {   c a c h e :   { } ,   d a t a :   f u n c t i o n ( F ,   E ,   G )   {   F   =   F   = =   l   ?   A   :   F ;   v a r   H   =   F [ h ] ;   i f   ( ! H )   {   H   =   F [ h ]   =   + + v   }   i f   ( E   & &   ! o . c a c h e [ H ] )   {   o . c a c h e [ H ]   =   { }   }   i f   ( G   ! = =   g )   {   o . c a c h e [ H ] [ E ]   =   G   }   r e t u r n   E   ?   o . c a c h e [ H ] [ E ]   :   H   } ,   r e m o v e D a t a :   f u n c t i o n ( F ,   E )   {   F   =   F   = =   l   ?   A   :   F ;   v a r   H   =   F [ h ] ;   i f   ( E )   {   i f   ( o . c a c h e [ H ] )   {   d e l e t e   o . c a c h e [ H ] [ E ] ;   E   =   " " ;   f o r   ( E   i n   o . c a c h e [ H ] )   {   b r e a k   }   i f   ( ! E )   {   o . r e m o v e D a t a ( F )   }   }   }   e l s e   {   t r y   {   d e l e t e   F [ h ]   }   c a t c h   ( G )   {   i f   ( F . r e m o v e A t t r i b u t e )   {   F . r e m o v e A t t r i b u t e ( h )   }   }   d e l e t e   o . c a c h e [ H ]   }   } ,   q u e u e :   f u n c t i o n ( F ,   E ,   H )   {   i f   ( F )   {   E   =   ( E   | |   " f x " )   +   " q u e u e " ;   v a r   G   =   o . d a t a ( F ,   E ) ;   i f   ( ! G   | |   o . i s A r r a y ( H ) )   {   G   =   o . d a t a ( F ,   E ,   o . m a k e A r r a y ( H ) )   }   e l s e   {   i f   ( H )   {   G . p u s h ( H )   }   }   }   r e t u r n   G   } ,   d e q u e u e :   f u n c t i o n ( H ,   G )   {   v a r   E   =   o . q u e u e ( H ,   G ) ,   F   =   E . s h i f t ( ) ;   i f   ( ! G   | |   G   = = =   " f x " )   {   F   =   E [ 0 ]   }   i f   ( F   ! = =   g )   {   F . c a l l ( H )   }   }   } ) ;   o . f n . e x t e n d ( {   d a t a :   f u n c t i o n ( E ,   G )   {   v a r   H   =   E . s p l i t ( " . " ) ;   H [ 1 ]   =   H [ 1 ]   ?   " . "   +   H [ 1 ]   :   " " ;   i f   ( G   = = =   g )   {   v a r   F   =   t h i s . t r i g g e r H a n d l e r ( " g e t D a t a "   +   H [ 1 ]   +   " ! " ,   [ H [ 0 ] ] ) ;   i f   ( F   = = =   g   & &   t h i s . l e n g t h )   {   F   =   o . d a t a ( t h i s [ 0 ] ,   E )   }   r e t u r n   F   = = =   g   & &   H [ 1 ]   ?   t h i s . d a t a ( H [ 0 ] )   :   F   }   e l s e   {   r e t u r n   t h i s . t r i g g e r ( " s e t D a t a "   +   H [ 1 ]   +   " ! " ,   [ H [ 0 ] ,   G ] ) . e a c h ( f u n c t i o n ( )   {   o . d a t a ( t h i s ,   E ,   G )   } )   }   } ,   r e m o v e D a t a :   f u n c t i o n ( E )   {   r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {   o . r e m o v e D a t a ( t h i s ,   E )   } )   } ,   q u e u e :   f u n c t i o n ( E ,   F )   {   i f   ( t y p e o f   E   ! = =   " s t r i n g " )   {   F   =   E ;   E   =   " f x "   }   i f   ( F   = = =   g )   {   r e t u r n   o . q u e u e ( t h i s [ 0 ] ,   E )   }   r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {   v a r   G   =   o . q u e u e ( t h i s ,   E ,   F ) ;   i f   ( E   = =   " f x "   & &   G . l e n g t h   = =   1 )   {   G [ 0 ] . c a l l ( t h i s )   }   } )   } ,   d e q u e u e :   f u n c t i o n ( E )   {   r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {   o . d e q u e u e ( t h i s ,   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 0 . 9 . 3 
         *     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 / 
         * /  
         ( f u n c t i o n ( )   {   v a r   R   =   / ( ( ? : \ ( ( ? : \ ( [ ^ ( ) ] + \ ) | [ ^ ( ) ] + ) + \ ) | \ [ ( ? : \ [ [ ^ [ \ ] ] * \ ] | [ ' " ] [ ^ ' " ] * [ ' " ] | [ ^ [ \ ] ' " ] + ) + \ ] | \ \ . | [ ^   > + ~ , ( \ [ \ \ ] + ) + | [ > + ~ ] ) ( \ s * , \ s * ) ? / g ,   L   =   0 ,   H   =   O b j e c t . p r o t o t y p e . t o S t r i n g ;   v a r   F   =   f u n c t i o n ( Y ,   U ,   a b ,   a c )   {   a b   =   a b   | |   [ ] ;   U   =   U   | |   d o c u m e n t ;   i f   ( U . n o d e T y p e   ! = =   1   & &   U . n o d e T y p e   ! = =   9 )   {   r e t u r n   [ ]   }   i f   ( ! Y   | |   t y p e o f   Y   ! = =   " s t r i n g " )   {   r e t u r n   a b   }   v a r   Z   =   [ ] ,   W ,   a f ,   a i ,   T ,   a d ,   V ,   X   =   t r u e ;   R . l a s t I n d e x   =   0 ;   w h i l e   ( ( W   =   R . e x e c ( Y ) )   ! = =   n u l l )   {   Z . p u s h ( W [ 1 ] ) ;   i f   ( W [ 2 ] )   {   V   =   R e g E x p . r i g h t C o n t e x t ;   b r e a k   }   }   i f   ( Z . l e n g t h   >   1   & &   M . e x e c ( Y ) )   {   i f   ( Z . l e n g t h   = = =   2   & &   I . r e l a t i v e [ Z [ 0 ] ] )   {   a f   =   J ( Z [ 0 ]   +   Z [ 1 ] ,   U )   }   e l s e   {   a f   =   I . r e l a t i v e [ Z [ 0 ] ]   ?   [ U ]   :   F ( Z . s h i f t ( ) ,   U ) ;   w h i l e   ( Z . l e n g t h )   {   Y   =   Z . s h i f t ( ) ;   i f   ( I . r e l a t i v e [ Y ] )   {   Y   + =   Z . s h i f t ( )   }   a f   =   J ( Y ,   a f )   }   }   }   e l s e   {   v a r   a e   =   a c   ?   {   e x p r :   Z . p o p ( ) ,   s e t :   E ( a c ) }   :   F . f i n d ( Z . p o p ( ) ,   Z . l e n g t h   = = =   1   & &   U . p a r e n t N o d e   ?   U . p a r e n t N o d e   :   U ,   Q ( U ) ) ;   a f   =   F . f i l t e r ( a e . e x p r ,   a e . s e t ) ;   i f   ( Z . l e n g t h   >   0 )   {   a i   =   E ( a f )   }   e l s e   {   X   =   f a l s e   }   w h i l e   ( Z . l e n g t h )   {   v a r   a h   =   Z . p o p ( ) ,   a g   =   a h ;   i f   ( ! I . r e l a t i v e [ a h ] )   {   a h   =   " "   }   e l s e   {   a g   =   Z . p o p ( )   }   i f   ( a g   = =   n u l l )   {   a g   =   U   }   I . r e l a t i v e [ a h ] ( a i ,   a g ,   Q ( U ) )   }   }   i f   ( ! a i )   {   a i   =   a f   }   i f   ( ! a i )   {   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 :   "   +   ( a h   | |   Y )   }   i f   ( H . c a l l ( a i )   = = =   " [ o b j e c t   A r r a y ] " )   {   i f   ( ! X )   {   a b . p u s h . a p p l y ( a b ,   a i )   }   e l s e   {   i f   ( U . n o d e T y p e   = = =   1 )   {   f o r   ( v a r   a a   =   0 ;   a i [ a a ]   ! =   n u l l ;   a a + + )   {   i f   ( a i [ a a ]   & &   ( a i [ a a ]   = = =   t r u e   | |   a i [ a a ] . n o d e T y p e   = = =   1   & &   K ( U ,   a i [ a a ] ) ) )   {   a b . p u s h ( a f [ a a ] )   }   }   }   e l s e   {   f o r   ( v a r   a a   =   0 ;   a i [ a a ]   ! =   n u l l ;   a a + + )   {   i f   ( a i [ a a ]   & &   a i [ a a ] . n o d e T y p e   = = =   1 )   {   a b . p u s h ( a f [ a a ] )   }   }   }   }   }   e l s e   {   E ( a i ,   a b )   }   i f   ( V )   {   F ( V ,   U ,   a b ,   a c ) ;   i f   ( G )   {   h a s D u p l i c a t e   =   f a l s e ;   a b . s o r t ( G ) ;   i f   ( h a s D u p l i c a t e )   {   f o r   ( v a r   a a   =   1 ;   a a   <   a b . l e n g t h ;   a a + + )   {   i f   ( a b [ a a ]   = = =   a b [ a a   -   1 ] )   {   a b . s p l i c e ( a a - - ,   1 )   }   }   }   }   }   r e t u r n   a b   } ;   F . m a t c h e s   =   f u n c t i o n ( T ,   U )   {   r e t u r n   F ( T ,   n u l l ,   n u l l ,   U )   } ;   F . f i n d   =   f u n c t i o n ( a a ,   T ,   a b )   {   v a r   Z ,   X ;   i f   ( ! a a )   {   r e t u r n   [ ]   }   f o r   ( v a r   W   =   0 ,   V   =   I . o r d e r . l e n g t h ;   W   <   V ;   W + + )   {   v a r   Y   =   I . o r d e r [ W ] ,   X ;   i f   ( ( X   =   I . m a t c h [ Y ] . e x e c ( a a ) ) )   {   v a r   U   =   R e g E x p . l e f t C o n t e x t ;   i f   ( U . s u b s t r ( U . l e n g t h   -   1 )   ! = =   " \ \ " )   {   X [ 1 ]   =   ( X [ 1 ]   | |   " " ) . r e p l a c e ( / \ \ / g ,   " " ) ;   Z   =   I . f i n d [ Y ] ( X ,   T ,   a b ) ;   i f   ( Z   ! =   n u l l )   {   a a   =   a a . r e p l a c e ( I . m a t c h [ Y ] ,   " " ) ;   b r e a k   }   }   }   }   i f   ( ! Z )   {   Z   =   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 :   Z ,   e x p r :   a a }   } ;   F . f i l t e r   =   f u n c t i o n ( a d ,   a c ,   a g ,   W )   {   v a r   V   =   a d ,   a i   =   [ ] ,   a a   =   a c ,   Y ,   T ,   Z   =   a c   & &   a c [ 0 ]   & &   Q ( a c [ 0 ] ) ;   w h i l e   ( a d   & &   a c . l e n g t h )   {   f o r   ( v a r   a b   i n   I . f i l t e r )   {   i f   ( ( Y   =   I . m a t c h [ a b ] . e x e c ( a d ) )   ! =   n u l l )   {   v a r   U   =   I . f i l t e r [ a b ] ,   a h ,   a f ;   T   =   f a l s e ;   i f   ( a a   = =   a i )   {   a i   =   [ ]   }   i f   ( I . p r e F i l t e r [ a b ] )   {   Y   =   I . p r e F i l t e r [ a b ] ( Y ,   a a ,   a g ,   a i ,   W ,   Z ) ;   i f   ( ! Y )   {   T   =   a h   =   t r u e   }   e l s e   {   i f   ( Y   = = =   t r u e )   {   c o n t i n u e   }   }   }   i f   ( Y )   {   f o r   ( v a r   X   =   0 ;   ( a f   =   a a [ X ] )   ! =   n u l l ;   X + + )   {   i f   ( a f )   {   a h   =   U ( a f ,   Y ,   X ,   a a ) ;   v a r   a e   =   W   ^   ! ! a h ;   i f   ( a g   & &   a h   ! =   n u l l )   {   i f   ( a e )   {   T   =   t r u e   }   e l s e   {   a a [ X ]   =   f a l s e   }   }   e l s e   {   i f   ( a e )   {   a i . p u s h ( a f ) ;   T   =   t r u e   }   }   }   }   }   i f   ( a h   ! = =   g )   {   i f   ( ! a g )   {   a a   =   a i   }   a d   =   a d . r e p l a c e ( I . m a t c h [ a b ] ,   " " ) ;   i f   ( ! T )   {   r e t u r n   [ ]   }   b r e a k   }   }   }   i f   ( a d   = =   V )   {   i f   ( T   = =   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 :   "   +   a d   }   e l s e   {   b r e a k   }   }   V   =   a d   }   r e t u r n   a a   } ;   v a r   I   =   F . 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 \ ) ) ? /   } ,   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 ( T )   {   r e t u r n   T . 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 ( a a ,   T ,   Z )   {   v a r   X   =   t y p e o f   T   = = =   " s t r i n g " ,   a b   =   X   & &   ! / \ W / . t e s t ( T ) ,   Y   =   X   & &   ! a b ;   i f   ( a b   & &   ! Z )   {   T   =   T . t o U p p e r C a s e ( )   }   f o r   ( v a r   W   =   0 ,   V   =   a a . l e n g t h ,   U ;   W   <   V ;   W + + )   {   i f   ( ( U   =   a a [ W ] ) )   {   w h i l e   ( ( U   =   U . p r e v i o u s S i b l i n g )   & &   U . n o d e T y p e   ! = =   1 )   {   }   a a [ W ]   =   Y   | |   U   & &   U . n o d e N a m e   = = =   T   ?   U   | |   f a l s e   :   U   = = =   T   }   }   i f   ( Y )   {   F . f i l t e r ( T ,   a a ,   t r u e )   }   } ,   " > " :   f u n c t i o n ( Z ,   U ,   a a )   {   v a r   X   =   t y p e o f   U   = = =   " s t r i n g " ;   i f   ( X   & &   ! / \ W / . t e s t ( U ) )   {   U   =   a a   ?   U   :   U . t o U p p e r C a s e ( ) ;   f o r   ( v a r   V   =   0 ,   T   =   Z . l e n g t h ;   V   <   T ;   V + + )   {   v a r   Y   =   Z [ V ] ;   i f   ( Y )   {   v a r   W   =   Y . p a r e n t N o d e ;   Z [ V ]   =   W . n o d e N a m e   = = =   U   ?   W   :   f a l s e   }   }   }   e l s e   {   f o r   ( v a r   V   =   0 ,   T   =   Z . l e n g t h ;   V   <   T ;   V + + )   {   v a r   Y   =   Z [ V ] ;   i f   ( Y )   {   Z [ V ]   =   X   ?   Y . p a r e n t N o d e   :   Y . p a r e n t N o d e   = = =   U   }   }   i f   ( X )   {   F . f i l t e r ( U ,   Z ,   t r u e )   }   }   } ,   " " :   f u n c t i o n ( W ,   U ,   Y )   {   v a r   V   =   L + + ,   T   =   S ;   i f   ( ! U . m a t c h ( / \ W / ) )   {   v a r   X   =   U   =   Y   ?   U   :   U . t o U p p e r C a s e ( ) ;   T   =   P   }   T ( " p a r e n t N o d e " ,   U ,   V ,   W ,   X ,   Y )   } ,   " ~ " :   f u n c t i o n ( W ,   U ,   Y )   {   v a r   V   =   L + + ,   T   =   S ;   i f   ( t y p e o f   U   = = =   " s t r i n g "   & &   ! U . m a t c h ( / \ W / ) )   {   v a r   X   =   U   =   Y   ?   U   :   U . t o U p p e r C a s e ( ) ;   T   =   P   }   T ( " p r e v i o u s S i b l i n g " ,   U ,   V ,   W ,   X ,   Y )   }   } ,   f i n d :   {   I D :   f u n c t i o n ( U ,   V ,   W )   {   i f   ( t y p e o f   V . g e t E l e m e n t B y I d   ! = =   " u n d e f i n e d "   & &   ! W )   {   v a r   T   =   V . g e t E l e m e n t B y I d ( U [ 1 ] ) ;   r e t u r n   T   ?   [ T ]   :   [ ]   }   } ,   N A M E :   f u n c t i o n ( V ,   Y ,   Z )   {   i f   ( t y p e o f   Y . 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   U   =   [ ] ,   X   =   Y . g e t E l e m e n t s B y N a m e ( V [ 1 ] ) ;   f o r   ( v a r   W   =   0 ,   T   =   X . l e n g t h ;   W   <   T ;   W + + )   {   i f   ( X [ W ] . g e t A t t r i b u t e ( " n a m e " )   = = =   V [ 1 ] )   {   U . p u s h ( X [ W ] )   }   }   r e t u r n   U . l e n g t h   = = =   0   ?   n u l l   :   U   }   } ,   T A G :   f u n c t i o n ( T ,   U )   {   r e t u r n   U . g e t E l e m e n t s B y T a g N a m e ( T [ 1 ] )   }   } ,   p r e F i l t e r :   {   C L A S S :   f u n c t i o n ( W ,   U ,   V ,   T ,   Z ,   a a )   {   W   =   "   "   +   W [ 1 ] . r e p l a c e ( / \ \ / g ,   " " )   +   "   " ;   i f   ( a a )   {   r e t u r n   W   }   f o r   ( v a r   X   =   0 ,   Y ;   ( Y   =   U [ X ] )   ! =   n u l l ;   X + + )   {   i f   ( Y )   {   i f   ( Z   ^   ( Y . c l a s s N a m e   & &   ( "   "   +   Y . c l a s s N a m e   +   "   " ) . i n d e x O f ( W )   > =   0 ) )   {   i f   ( ! V )   {   T . p u s h ( Y )   }   }   e l s e   {   i f   ( V )   {   U [ X ]   =   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 ( T )   {   r e t u r n   T [ 1 ] . r e p l a c e ( / \ \ / g ,   " " )   } ,   T A G :   f u n c t i o n ( U ,   T )   {   f o r   ( v a r   V   =   0 ;   T [ V ]   = = =   f a l s e ;   V + + )   {   }   r e t u r n   T [ V ]   & &   Q ( T [ V ] )   ?   U [ 1 ]   :   U [ 1 ] . t o U p p e r C a s e ( )   } ,   C H I L D :   f u n c t i o n ( T )   {   i f   ( T [ 1 ]   = =   " n t h " )   {   v a r   U   =   / ( - ? ) ( \ d * ) n ( ( ? : \ + | - ) ? \ d * ) / . e x e c ( T [ 2 ]   = =   " e v e n "   & &   " 2 n "   | |   T [ 2 ]   = =   " o d d "   & &   " 2 n + 1 "   | |   ! / \ D / . t e s t ( T [ 2 ] )   & &   " 0 n + "   +   T [ 2 ]   | |   T [ 2 ] ) ;   T [ 2 ]   =   ( U [ 1 ]   +   ( U [ 2 ]   | |   1 ) )   -   0 ;   T [ 3 ]   =   U [ 3 ]   -   0   }   T [ 0 ]   =   L + + ;   r e t u r n   T   } ,   A T T R :   f u n c t i o n ( X ,   U ,   V ,   T ,   Y ,   Z )   {   v a r   W   =   X [ 1 ] . r e p l a c e ( / \ \ / g ,   " " ) ;   i f   ( ! Z   & &   I . a t t r M a p [ W ] )   {   X [ 1 ]   =   I . a t t r M a p [ W ]   }   i f   ( X [ 2 ]   = = =   " ~ = " )   {   X [ 4 ]   =   "   "   +   X [ 4 ]   +   "   "   }   r e t u r n   X   } ,   P S E U D O :   f u n c t i o n ( X ,   U ,   V ,   T ,   Y )   {   i f   ( X [ 1 ]   = = =   " n o t " )   {   i f   ( X [ 3 ] . m a t c h ( R ) . l e n g t h   >   1   | |   / ^ \ w / . t e s t ( X [ 3 ] ) )   {   X [ 3 ]   =   F ( X [ 3 ] ,   n u l l ,   n u l l ,   U )   }   e l s e   {   v a r   W   =   F . f i l t e r ( X [ 3 ] ,   U ,   V ,   t r u e   ^   Y ) ;   i f   ( ! V )   {   T . p u s h . a p p l y ( T ,   W )   }   r e t u r n   f a l s e   }   }   e l s e   {   i f   ( I . m a t c h . P O S . t e s t ( X [ 0 ] )   | |   I . m a t c h . C H I L D . t e s t ( X [ 0 ] ) )   {   r e t u r n   t r u e   }   }   r e t u r n   X   } ,   P O S :   f u n c t i o n ( T )   {   T . u n s h i f t ( t r u e ) ;   r e t u r n   T   }   } ,   f i l t e r s :   {   e n a b l e d :   f u n c t i o n ( T )   {   r e t u r n   T . d i s a b l e d   = = =   f a l s e   & &   T . 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 ( T )   {   r e t u r n   T . 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 ( T )   {   r e t u r n   T . 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 ( T )   {   T . 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   T . 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 ( T )   {   r e t u r n   ! ! T . f i r s t C h i l d   } ,   e m p t y :   f u n c t i o n ( T )   {   r e t u r n   ! T . f i r s t C h i l d   } ,   h a s :   f u n c t i o n ( V ,   U ,   T )   {   r e t u r n   ! ! F ( T [ 3 ] ,   V ) . l e n g t h   } ,   h e a d e r :   f u n c t i o n ( T )   {   r e t u r n   / h \ d / i . t e s t ( T . n o d e N a m e )   } ,   t e x t :   f u n c t i o n ( T )   {   r e t u r n   " t e x t "   = = =   T . t y p e   } ,   r a d i o :   f u n c t i o n ( T )   {   r e t u r n   " r a d i o "   = = =   T . t y p e   } ,   c h e c k b o x :   f u n c t i o n ( T )   {   r e t u r n   " c h e c k b o x "   = = =   T . t y p e   } ,   f i l e :   f u n c t i o n ( T )   {   r e t u r n   " f i l e "   = = =   T . t y p e   } ,   p a s s w o r d :   f u n c t i o n ( T )   {   r e t u r n   " p a s s w o r d "   = = =   T . t y p e   } ,   s u b m i t :   f u n c t i o n ( T )   {   r e t u r n   " s u b m i t "   = = =   T . t y p e   } ,   i m a g e :   f u n c t i o n ( T )   {   r e t u r n   " i m a g e "   = = =   T . t y p e   } ,   r e s e t :   f u n c t i o n ( T )   {   r e t u r n   " r e s e t "   = = =   T . t y p e   } ,   b u t t o n :   f u n c t i o n ( T )   {   r e t u r n   " b u t t o n "   = = =   T . t y p e   | |   T . n o d e N a m e . t o U p p 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 ( T )   {   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 ( T . 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 ( U ,   T )   {   r e t u r n   T   = = =   0   } ,   l a s t :   f u n c t i o n ( V ,   U ,   T ,   W )   {   r e t u r n   U   = = =   W . l e n g t h   -   1   } ,   e v e n :   f u n c t i o n ( U ,   T )   {   r e t u r n   T   %   2   = = =   0   } ,   o d d :   f u n c t i o n ( U ,   T )   {   r e t u r n   T   %   2   = = =   1   } ,   l t :   f u n c t i o n ( V ,   U ,   T )   {   r e t u r n   U   <   T [ 3 ]   -   0   } ,   g t :   f u n c t i o n ( V ,   U ,   T )   {   r e t u r n   U   >   T [ 3 ]   -   0   } ,   n t h :   f u n c t i o n ( V ,   U ,   T )   {   r e t u r n   T [ 3 ]   -   0   = =   U   } ,   e q :   f u n c t i o n ( V ,   U ,   T )   {   r e t u r n   T [ 3 ]   -   0   = =   U   }   } ,   f i l t e r :   {   P S E U D O :   f u n c t i o n ( Z ,   V ,   W ,   a a )   {   v a r   U   =   V [ 1 ] ,   X   =   I . f i l t e r s [ U ] ;   i f   ( X )   {   r e t u r n   X ( Z ,   W ,   V ,   a a )   }   e l s e   {   i f   ( U   = = =   " c o n t a i n s " )   {   r e t u r n   ( Z . t e x t C o n t e n t   | |   Z . i n n e r T e x t   | |   " " ) . i n d e x O f ( V [ 3 ] )   > =   0   }   e l s e   {   i f   ( U   = = =   " n o t " )   {   v a r   Y   =   V [ 3 ] ;   f o r   ( v a r   W   =   0 ,   T   =   Y . l e n g t h ;   W   <   T ;   W + + )   {   i f   ( Y [ W ]   = = =   Z )   {   r e t u r n   f a l s e   }   }   r e t u r n   t r u e   }   }   }   } ,   C H I L D :   f u n c t i o n ( T ,   W )   {   v a r   Z   =   W [ 1 ] ,   U   =   T ;   s w i t c h   ( Z )   {   c a s e   " o n l y " :   c a s e   " f i r s t " :   w h i l e   ( U   =   U . p r e v i o u s S i b l i n g )   {   i f   ( U . n o d e T y p e   = = =   1 )   {   r e t u r n   f a l s e   }   }   i f   ( Z   = =   " f i r s t " )   {   r e t u r n   t r u e   }   U   =   T ;   c a s e   " l a s t " :   w h i l e   ( U   =   U . n e x t S i b l i n g )   {   i f   ( U . 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   V   =   W [ 2 ] ,   a c   =   W [ 3 ] ;   i f   ( V   = =   1   & &   a c   = =   0 )   {   r e t u r n   t r u e   }   v a r   Y   =   W [ 0 ] ,   a b   =   T . p a r e n t N o d e ;   i f   ( a b   & &   ( a b . s i z c a c h e   ! = =   Y   | |   ! T . n o d e I n d e x ) )   {   v a r   X   =   0 ;   f o r   ( U   =   a b . f i r s t C h i l d ;   U ;   U   =   U . n e x t S i b l i n g )   {   i f   ( U . n o d e T y p e   = = =   1 )   {   U . n o d e I n d e x   =   + + X   }   }   a b . s i z c a c h e   =   Y   }   v a r   a a   =   T . n o d e I n d e x   -   a c ;   i f   ( V   = =   0 )   {   r e t u r n   a a   = =   0   }   e l s e   {   r e t u r n   ( a a   %   V   = =   0   & &   a a   /   V   > =   0 )   }   }   } ,   I D :   f u n c t i o n ( U ,   T )   {   r e t u r n   U . n o d e T y p e   = = =   1   & &   U . g e t A t t r i b u t e ( " i d " )   = = =   T   } ,   T A G :   f u n c t i o n ( U ,   T )   {   r e t u r n   ( T   = = =   " * "   & &   U . n o d e T y p e   = = =   1 )   | |   U . n o d e N a m e   = = =   T   } ,   C L A S S :   f u n c t i o n ( U ,   T )   {   r e t u r n   ( "   "   +   ( U . c l a s s N a m e   | |   U . g e t A t t r i b u t e ( " c l a s s " ) )   +   "   " ) . i n d e x O f ( T )   >   - 1   } ,   A T T R :   f u n c t i o n ( Y ,   W )   {   v a r   V   =   W [ 1 ] ,   T   =   I . a t t r H a n d l e [ V ]   ?   I . a t t r H a n d l e [ V ] ( Y )   :   Y [ V ]   ! =   n u l l   ?   Y [ V ]   :   Y . g e t A t t r i b u t e ( V ) ,   Z   =   T   +   " " ,   X   =   W [ 2 ] ,   U   =   W [ 4 ] ;   r e t u r n   T   = =   n u l l   ?   X   = = =   " ! = "   :   X   = = =   " = "   ?   Z   = = =   U   :   X   = = =   " * = "   ?   Z . i n d e x O f ( U )   > =   0   :   X   = = =   " ~ = "   ?   ( "   "   +   Z   +   "   " ) . i n d e x O f ( U )   > =   0   :   ! U   ?   Z   & &   T   ! = =   f a l s e   :   X   = = =   " ! = "   ?   Z   ! =   U   :   X   = = =   " ^ = "   ?   Z . i n d e x O f ( U )   = = =   0   :   X   = = =   " $ = "   ?   Z . s u b s t r ( Z . l e n g t h   -   U . l e n g t h )   = = =   U   :   X   = = =   " | = "   ?   Z   = = =   U   | |   Z . s u b s t r ( 0 ,   U . l e n g t h   +   1 )   = = =   U   +   " - "   :   f a l s e   } ,   P O S :   f u n c t i o n ( X ,   U ,   V ,   Y )   {   v a r   T   =   U [ 2 ] ,   W   =   I . s e t F i l t e r s [ T ] ;   i f   ( W )   {   r e t u r n   W ( X ,   V ,   U ,   Y )   }   }   }   } ;   v a r   M   =   I . m a t c h . P O S ;   f o r   ( v a r   O   i n   I . m a t c h )   {   I . m a t c h [ O ]   =   R e g E x p ( I . m a t c h [ O ] . s o u r c e   +   / ( ? ! [ ^ \ [ ] * \ ] ) ( ? ! [ ^ \ ( ] * \ ) ) / . s o u r c e )   }   v a r   E   =   f u n c t i o n ( U ,   T )   {   U   =   A r r a y . p r o t o t y p e . s l i c e . c a l l ( U ) ;   i f   ( T )   {   T . p u s h . a p p l y ( T ,   U ) ;   r e t u r n   T   }   r e t u r n   U   } ;   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 )   }   c a t c h   ( N )   {   E   =   f u n c t i o n ( X ,   W )   {   v a r   U   =   W   | |   [ ] ;   i f   ( H . c a l l ( X )   = = =   " [ 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 ( U ,   X )   }   e l s e   {   i f   ( t y p e o f   X . l e n g t h   = = =   " n u m b e r " )   {   f o r   ( v a r   V   =   0 ,   T   =   X . l e n g t h ;   V   <   T ;   V + + )   {   U . p u s h ( X [ V ] )   }   }   e l s e   {   f o r   ( v a r   V   =   0 ;   X [ V ] ;   V + + )   {   U . p u s h ( X [ V ] )   }   }   }   r e t u r n   U   }   }   v a r   G ;   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 )   {   G   =   f u n c t i o n ( U ,   T )   {   v a r   V   =   U . c o m p a r e D o c u m e n t P o s i t i o n ( T )   &   4   ?   - 1   :   U   = = =   T   ?   0   :   1 ;   i f   ( V   = = =   0 )   {   h a s D u p l i c a t e   =   t r u e   }   r e t u r n   V   }   }   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 )   {   G   =   f u n c t i o n ( U ,   T )   {   v a r   V   =   U . s o u r c e I n d e x   -   T . s o u r c e I n d e x ;   i f   ( V   = = =   0 )   {   h a s D u p l i c a t e   =   t r u e   }   r e t u r n   V   }   }   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 )   {   G   =   f u n c t i o n ( W ,   U )   {   v a r   V   =   W . o w n e r D o c u m e n t . c r e a t e R a n g e ( ) ,   T   =   U . o w n e r D o c u m e n t . c r e a t e R a n g e ( ) ;   V . s e l e c t N o d e ( W ) ;   V . c o l l a p s e ( t r u e ) ;   T . s e l e c t N o d e ( U ) ;   T . c o l l a p s e ( t r u e ) ;   v a r   X   =   V . 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 ,   T ) ;   i f   ( X   = = =   0 )   {   h a s D u p l i c a t e   =   t r u e   }   r e t u r n   X   }   }   }   }   ( f u n c t i o n ( )   {   v a r   U   =   d o c u m e n t . c r e a t e E l e m e n t ( " f o r m " ) ,   V   =   " s c r i p t "   +   ( n e w   D a t e ) . g e t T i m e ( ) ;   U . i n n e r H T M L   =   " < i n p u t   n a m e = ' "   +   V   +   " ' / > " ;   v a r   T   =   d o c u m e n t . d o c u m e n t E l e m e n t ;   T . i n s e r t B e f o r e ( U ,   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 ( V ) )   {   I . f i n d . I D   =   f u n c t i o n ( X ,   Y ,   Z )   {   i f   ( t y p e o f   Y . g e t E l e m e n t B y I d   ! = =   " u n d e f i n e d "   & &   ! Z )   {   v a r   W   =   Y . g e t E l e m e n t B y I d ( X [ 1 ] ) ;   r e t u r n   W   ?   W . i d   = = =   X [ 1 ]   | |   t y p e o f   W . 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 "   & &   W . 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   = = =   X [ 1 ]   ?   [ W ]   :   g   :   [ ]   }   } ;   I . f i l t e r . I D   =   f u n c t i o n ( Y ,   W )   {   v a r   X   =   t y p e o f   Y . 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 "   & &   Y . g e t A t t r i b u t e N o d e ( " i d " ) ;   r e t u r n   Y . n o d e T y p e   = = =   1   & &   X   & &   X . n o d e V a l u e   = = =   W   }   }   T . r e m o v e C h i l d ( U )   } ) ( ) ;   ( f u n c t i o n ( )   {   v a r   T   =   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 . 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   ( T . 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 )   {   I . f i n d . T A G   =   f u n c t i o n ( U ,   Y )   {   v a r   X   =   Y . g e t E l e m e n t s B y T a g N a m e ( U [ 1 ] ) ;   i f   ( U [ 1 ]   = = =   " * " )   {   v a r   W   =   [ ] ;   f o r   ( v a r   V   =   0 ;   X [ V ] ;   V + + )   {   i f   ( X [ V ] . n o d e T y p e   = = =   1 )   {   W . p u s h ( X [ V ] )   }   }   X   =   W   }   r e t u r n   X   }   }   T . i n n e r H T M L   =   " < a   h r e f = ' # ' > < / a > " ;   i f   ( T . f i r s t C h i l d   & &   t y p e o f   T . 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 "   & &   T . 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 " )   ! = =   " # " )   {   I . a t t r H a n d l e . h r e f   =   f u n c t i o n ( U )   {   r e t u r n   U . g e t A t t r i b u t e ( " h r e f " ,   2 )   }   }   } ) ( ) ;   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   T   =   F ,   U   =   d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ;   U . i n n e r H T M L   =   " < p   c l a s s = ' T E S T ' > < / p > " ;   i f   ( U . q u e r y S e l e c t o r A l l   & &   U . 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   }   F   =   f u n c t i o n ( Y ,   X ,   V ,   W )   {   X   =   X   | |   d o c u m e n t ;   i f   ( ! W   & &   X . n o d e T y p e   = = =   9   & &   ! Q ( X ) )   {   t r y   {   r e t u r n   E ( X . q u e r y S e l e c t o r A l l ( Y ) ,   V )   }   c a t c h   ( Z )   {   }   }   r e t u r n   T ( Y ,   X ,   V ,   W )   } ;   F . f i n d   =   T . f i n d ;   F . f i l t e r   =   T . f i l t e r ;   F . s e l e c t o r s   =   T . s e l e c t o r s ;   F . m a t c h e s   =   T . m a t c h e s   } ) ( )   }   i f   ( d o c u m e n t . g e t E l e m e n t s B y C l a s s N a m e   & &   d o c u m e n t . d o c u m e n t E l e m e n t . g e t E l e m e n t s B y C l a s s N a m e )   {   ( f u n c t i o n ( )   {   v a r   T   =   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 . 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   ( T . 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   }   T . l a s t C h i l d . c l a s s N a m e   =   " e " ;   i f   ( T . 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   }   I . o r d e r . s p l i c e ( 1 ,   0 ,   " C L A S S " ) ;   I . f i n d . C L A S S   =   f u n c t i o n ( U ,   V ,   W )   {   i f   ( t y p e o f   V . 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 "   & &   ! W )   {   r e t u r n   V . g e t E l e m e n t s B y C l a s s N a m e ( U [ 1 ] )   }   }   } ) ( )   }   f u n c t i o n   P ( U ,   Z ,   Y ,   a d ,   a a ,   a c )   {   v a r   a b   =   U   = =   " p r e v i o u s S i b l i n g "   & &   ! a c ;   f o r   ( v a r   W   =   0 ,   V   =   a d . l e n g t h ;   W   <   V ;   W + + )   {   v a r   T   =   a d [ W ] ;   i f   ( T )   {   i f   ( a b   & &   T . n o d e T y p e   = = =   1 )   {   T . s i z c a c h e   =   Y ;   T . s i z s e t   =   W   }   T   =   T [ U ] ;   v a r   X   =   f a l s e ;   w h i l e   ( T )   {   i f   ( T . s i z c a c h e   = = =   Y )   {   X   =   a d [ T . s i z s e t ] ;   b r e a k   }   i f   ( T . n o d e T y p e   = = =   1   & &   ! a c )   {   T . s i z c a c h e   =   Y ;   T . s i z s e t   =   W   }   i f   ( T . n o d e N a m e   = = =   Z )   {   X   =   T ;   b r e a k   }   T   =   T [ U ]   }   a d [ W ]   =   X   }   }   }   f u n c t i o n   S ( U ,   Z ,   Y ,   a d ,   a a ,   a c )   {   v a r   a b   =   U   = =   " p r e v i o u s S i b l i n g "   & &   ! a c ;   f o r   ( v a r   W   =   0 ,   V   =   a d . l e n g t h ;   W   <   V ;   W + + )   {   v a r   T   =   a d [ W ] ;   i f   ( T )   {   i f   ( a b   & &   T . n o d e T y p e   = = =   1 )   {   T . s i z c a c h e   =   Y ;   T . s i z s e t   =   W   }   T   =   T [ U ] ;   v a r   X   =   f a l s e ;   w h i l e   ( T )   {   i f   ( T . s i z c a c h e   = = =   Y )   {   X   =   a d [ T . s i z s e t ] ;   b r e a k   }   i f   ( T . n o d e T y p e   = = =   1 )   {   i f   ( ! a c )   {   T . s i z c a c h e   =   Y ;   T . s i z s e t   =   W   }   i f   ( t y p e o f   Z   ! = =   " s t r i n g " )   {   i f   ( T   = = =   Z )   {   X   =   t r u e ;   b r e a k   }   }   e l s e   {   i f   ( F . f i l t e r ( Z ,   [ T ] ) . l e n g t h   >   0 )   {   X   =   T ;   b r e a k   }   }   }   T   =   T [ U ]   }   a d [ W ]   =   X   }   }   }   v a r   K   =   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 ( U ,   T )   {   r e t u r n   U . c o m p a r e D o c u m e n t P o s i t i o n ( T )   &   1 6   }   :   f u n c t i o n ( U ,   T )   {   r e t u r n   U   ! = =   T   & &   ( U . c o n t a i n s   ?   U . c o n t a i n s ( T )   :   t r u e )   } ;   v a r   Q   =   f u n c t i o n ( T )   {   r e t u r n   T . n o d e T y p e   = = =   9   & &   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 "   | |   ! ! T . o w n e r D o c u m e n t   & &   Q ( T . o w n e r D o c u m e n t )   } ;   v a r   J   =   f u n c t i o n ( T ,   a a )   {   v a r   W   =   [ ] ,   X   =   " " ,   Y ,   V   =   a a . n o d e T y p e   ?   [ a a ]   :   a a ;   w h i l e   ( ( Y   =   I . m a t c h . P S E U D O . e x e c ( T ) ) )   {   X   + =   Y [ 0 ] ;   T   =   T . r e p l a c e ( I . m a t c h . P S E U D O ,   " " )   }   T   =   I . r e l a t i v e [ T ]   ?   T   +   " * "   :   T ;   f o r   ( v a r   Z   =   0 ,   U   =   V . l e n g t h ;   Z   <   U ;   Z + + )   {   F ( T ,   V [ Z ] ,   W )   }   r e t u r n   F . f i l t e r ( X ,   W )   } ;   o . f i n d   =   F ;   o . f i l t e r   =   F . f i l t e r ;   o . e x p r   =   F . s e l e c t o r s ;   o . e x p r [ " : " ]   =   o . e x p r . f i l t e r s ;   F . s e l e c t o r s . f i l t e r s . h i d d e n   =   f u n c t i o n ( T )   {   r e t u r n   T . o f f s e t W i d t h   = = =   0   | |   T . o f f s e t H e i g h t   = = =   0   } ;   F . s e l e c t o r s . f i l t e r s . v i s i b l e   =   f u n c t i o n ( T )   {   r e t u r n   T . o f f s e t W i d t h   >   0   | |   T . o f f s e t H e i g h t   >   0   } ;   F . s e l e c t o r s . f i l t e r s . a n i m a t e d   =   f u n c t i o n ( T )   {   r e t u r n   o . g r e p ( o . t i m e r s ,   f u n c t i o n ( U )   {   r e t u r n   T   = = =   U . e l e m   } ) . l e n g t h   } ;   o . m u l t i F i l t e r   =   f u n c t i o n ( V ,   T ,   U )   {   i f   ( U )   {   V   =   " : n o t ( "   +   V   +   " ) "   }   r e t u r n   F . m a t c h e s ( V ,   T )   } ;   o . d i r   =   f u n c t i o n ( V ,   U )   {   v a r   T   =   [ ] ,   W   =   V [ U ] ;   w h i l e   ( W   & &   W   ! =   d o c u m e n t )   {   i f   ( W . n o d e T y p e   = =   1 )   {   T . p u s h ( W )   }   W   =   W [ U ]   }   r e t u r n   T   } ;   o . n t h   =   f u n c t i o n ( X ,   T ,   V ,   W )   {   T   =   T   | |   1 ;   v a r   U   =   0 ;   f o r   ( ;   X ;   X   =   X [ V ] )   {   i f   ( X . n o d e T y p e   = =   1   & &   + + U   = =   T )   {   b r e a k   }   }   r e t u r n   X   } ;   o . s i b l i n g   =   f u n c t i o n ( V ,   U )   {   v a r   T   =   [ ] ;   f o r   ( ;   V ;   V   =   V . n e x t S i b l i n g )   {   i f   ( V . n o d e T y p e   = =   1   & &   V   ! =   U )   {   T . p u s h ( V )   }   }   r e t u r n   T   } ;   r e t u r n ;   l . S i z z l e   =   F   } ) ( ) ;   o . e v e n t   =   {   a d d :   f u n c t i o n ( I ,   F ,   H ,   K )   {   i f   ( I . n o d e T y p e   = =   3   | |   I . n o d e T y p e   = =   8 )   {   r e t u r n   }   i f   ( I . s e t I n t e r v a l   & &   I   ! =   l )   {   I   =   l   }   i f   ( ! H . g u i d )   {   H . g u i d   =   t h i s . g u i d + +   }   i f   ( K   ! = =   g )   {   v a r   G   =   H ;   H   =   t h i s . p r o x y ( G ) ;   H . d a t a   =   K   }   v a r   E   =   o . d a t a ( I ,   " e v e n t s " )   | |   o . d a t a ( I ,   " e v e n t s " ,   { } ) ,   J   =   o . d a t a ( I ,   " h a n d l e " )   | |   o . d a t a ( I ,   " h a n d l e " ,   f u n c t i o n ( )   {   r e t u r n   t y p e o f   o   ! = =   " u n d e f i n e d "   & &   ! o . e v e n t . t r i g g e r e d   ?   o . e v e n t . h a n d l e . a p p l y ( a r g u m e n t s . c a l l e e . e l e m ,   a r g u m e n t s )   :   g   } ) ;   J . e l e m   =   I ;   o . e a c h ( F . s p l i t ( / \ s + / ) ,   f u n c t i o n ( M ,   N )   {   v a r   O   =   N . s p l i t ( " . " ) ;   N   =   O . s h i f t ( ) ;   H . t y p e   =   O . s l i c e ( ) . s o r t ( ) . j o i n ( " . " ) ;   v a r   L   =   E [ N ] ;   i f   ( o . e v e n t . s p e c i a l A l l [ N ] )   {   o . e v e n t . s p e c i a l A l l [ N ] . s e t u p . c a l l ( I ,   K ,   O )   }   i f   ( ! L )   {   L   =   E [ N ]   =   { } ;   i f   ( ! o . e v e n t . s p e c i a l [ N ]   | |   o . e v e n t . s p e c i a l [ N ] . s e t u p . c a l l ( I ,   K ,   O )   = = =   f a l s e )   {   i f   ( I . a d d E v e n t L i s t e n e r )   {   I . a d d E v e n t L i s t e n e r ( N ,   J ,   f a l s e )   }   e l s e   {   i f   ( I . a t t a c h E v e n t )   {   I . a t t a c h E v e n t ( " o n "   +   N ,   J )   }   }   }   }   L [ H . g u i d ]   =   H ;   o . e v e n t . g l o b a l [ N ]   =   t r u e   } ) ;   I   =   n u l l   } ,   g u i d :   1 ,   g l o b a l :   { } ,   r e m o v e :   f u n c t i o n ( K ,   H ,   J )   {   i f   ( K . n o d e T y p e   = =   3   | |   K . n o d e T y p e   = =   8 )   {   r e t u r n   }   v a r   G   =   o . d a t a ( K ,   " e v e n t s " ) ,   F ,   E ;   i f   ( G )   {   i f   ( H   = = =   g   | |   ( t y p e o f   H   = = =   " s t r i n g "   & &   H . c h a r A t ( 0 )   = =   " . " ) )   {   f o r   ( v a r   I   i n   G )   {   t h i s . r e m o v e ( K ,   I   +   ( H   | |   " " ) )   }   }   e l s e   {   i f   ( H . t y p e )   {   J   =   H . h a n d l e r ;   H   =   H . t y p e   }   o . e a c h ( H . s p l i t ( / \ s + / ) ,   f u n c t i o n ( M ,   O )   {   v a r   Q   =   O . s p l i t ( " . " ) ;   O   =   Q . s h i f t ( ) ;   v a r   N   =   R e g E x p ( " ( ^ | \ \ . ) "   +   Q . s l i c e ( ) . s o r t ( ) . j o i n ( " . * \ \ . " )   +   " ( \ \ . | $ ) " ) ;   i f   ( G [ O ] )   {   i f   ( J )   {   d e l e t e   G [ O ] [ J . g u i d ]   }   e l s e   {   f o r   ( v a r   P   i n   G [ O ] )   {   i f   ( N . t e s t ( G [ O ] [ P ] . t y p e ) )   {   d e l e t e   G [ O ] [ P ]   }   }   }   i f   ( o . e v e n t . s p e c i a l A l l [ O ] )   {   o . e v e n t . s p e c i a l A l l [ O ] . t e a r d o w n . c a l l ( K ,   Q )   }   f o r   ( F   i n   G [ O ] )   {   b r e a k   }   i f   ( ! F )   {   i f   ( ! o . e v e n t . s p e c i a l [ O ]   | |   o . e v e n t . s p e c i a l [ O ] . t e a r d o w n . c a l l ( K ,   Q )   = = =   f a l s e )   {   i f   ( K . r e m o v e E v e n t L i s t e n e r )   {   K . r e m o v e E v e n t L i s t e n e r ( O ,   o . d a t a ( K ,   " h a n d l e " ) ,   f a l s e )   }   e l s e   {   i f   ( K . d e t a c h E v e n t )   {   K . d e t a c h E v e n t ( " o n "   +   O ,   o . d a t a ( K ,   " h a n d l e " ) )   }   }   }   F   =   n u l l ;   d e l e t e   G [ O ]   }   }   } )   }   f o r   ( F   i n   G )   {   b r e a k   }   i f   ( ! F )   {   v a r   L   =   o . d a t a ( K ,   " h a n d l e " ) ;   i f   ( L )   {   L . e l e m   =   n u l l   }   o . r e m o v e D a t a ( K ,   " e v e n t s " ) ;   o . r e m o v e D a t a ( K ,   " h a n d l e " )   }   }   } ,   t r i g g e r :   f u n c t i o n ( I ,   K ,   H ,   E )   {   v a r   G   =   I . t y p e   | |   I ;   i f   ( ! E )   {   I   =   t y p e o f   I   = = =   " o b j e c t "   ?   I [ h ]   ?   I   :   o . e x t e n d ( o . E v e n t ( G ) ,   I )   :   o . E v e n t ( G ) ;   i f   ( G . i n d e x O f ( " ! " )   > =   0 )   {   I . t y p e   =   G   =   G . s l i c e ( 0 ,   - 1 ) ;   I . e x c l u s i v e   =   t r u e   }   i f   ( ! H )   {   I . s t o p P r o p a g a t i o n ( ) ;   i f   ( t h i s . g l o b a l [ G ] )   {   o . e a c h ( o . c a c h e ,   f u n c t i o n ( )   {   i f   ( t h i s . e v e n t s   & &   t h i s . e v e n t s [ G ] )   {   o . e v e n t . t r i g g e r ( I ,   K ,   t h i s . h a n d l e . e l e m )   }   } )   }   }   i f   ( ! H   | |   H . n o d e T y p e   = =   3   | |   H . n o d e T y p e   = =   8 )   {   r e t u r n   g   }   I . r e s u l t   =   g ;   I . t a r g e t   =   H ;   K   =   o . m a k e A r r a y ( K ) ;   K . u n s h i f t ( I )   }   I . c u r r e n t T a r g e t   =   H ;   v a r   J   =   o . d a t a ( H ,   " h a n d l e " ) ;   i f   ( J )   {   J . a p p l y ( H ,   K )   }   i f   ( ( ! H [ G ]   | |   ( o . n o d e N a m e ( H ,   " a " )   & &   G   = =   " c l i c k " ) )   & &   H [ " o n "   +   G ]   & &   H [ " o n "   +   G ] . a p p l y ( H ,   K )   = = =   f a l s e )   {   I . r e s u l t   =   f a l s e   }   i f   ( ! E   & &   H [ G ]   & &   ! I . i s D e f a u l t P r e v e n t e d ( )   & &   ! ( o . n o d e N a m e ( H ,   " a " )   & &   G   = =   " c l i c k " ) )   {   t h i s . t r i g g e r e d   =   t r u e ;   t r y   {   H [ G ] ( )   }   c a t c h   ( L )   {   }   }   t h i s . t r i g g e r e d   =   f a l s e ;   i f   ( ! I . i s P r o p a g a t i o n S t o p p e d ( ) )   {   v a r   F   =   H . p a r e n t N o d e   | |   H . o w n e r D o c u m e n t ;   i f   ( F )   {   o . e v e n t . t r i g g e r ( I ,   K ,   F ,   t r u e )   }   }   } ,   h a n d l e :   f u n c t i o n ( K )   {   v a r   J ,   E ;   K   =   a r g u m e n t s [ 0 ]   =   o . e v e n t . f i x ( K   | |   l . e v e n t ) ;   K . c u r r e n t T a r g e t   =   t h i s ;   v a r   L   =   K . t y p e . s p l i t ( " . " ) ;   K . t y p e   =   L . s h i f t ( ) ;   J   =   ! L . l e n g t h   & &   ! K . e x c l u s i v e ;   v a r   I   =   R e g E x p ( " ( ^ | \ \ . ) "   +   L . s l i c e ( ) . s o r t ( ) . j o i n ( " . * \ \ . " )   +   " ( \ \ . | $ ) " ) ;   E   =   ( o . d a t a ( t h i s ,   " e v e n t s " )   | |   { } ) [ K . t y p e ] ;   f o r   ( v a r   G   i n   E )   {   v a r   H   =   E [ G ] ;   i f   ( J   | |   I . t e s t ( H . t y p e ) )   {   K . h a n d l e r   =   H ;   K . d a t a   =   H . d a t a ;   v a r   F   =   H . a p p l y ( t h i s ,   a r g u m e n t s ) ;   i f   ( F   ! = =   g )   {   K . r e s u l t   =   F ;   i f   ( F   = = =   f a l s e )   {   K . p r e v e n t D e f a u l t ( ) ;   K . s t o p P r o p a g a t i o n ( )   }   }   i f   ( K . i s I m m e d i a t e P r o p a g a t i o n S t o p p e d ( ) )   {   b r e a k   }   }   }   } ,   p r o p s :   " a l t K e y   a t t r C h a n g e   a t t r N a m e   b u b b l e s   b u t t o n   c a n c e l a b l e   c h a r C o d e   c l i e n t X   c l i e n t Y   c t r l K e y   c u r r e n t T a r g e t   d a t a   d e t a i l   e v e n t P h a s e   f r o m E l e m e n t   h a n d l e r   k e y C o d e   m e t a K e y   n e w V a l u e   o r i g i n a l T a r g e t   p a g e X   p a g e Y   p r e v V a l u e   r e l a t e d N o d e   r e l a t e d T a r g e t   s c r e e n X   s c r e e n Y   s h i f t K e y   s r c E l e m e n t   t a r g e t   t o E l e m e n t   v i e w   w h e e l D e l t a   w h i c h " . s p l i t ( "   " ) ,   f i x :   f u n c t i o n ( H )   {   i f   ( H [ h ] )   {   r e t u r n   H   }   v a r   F   =   H ;   H   =   o . E v e n t ( F ) ;   f o r   ( v a r   G   =   t h i s . p r o p s . l e n g t h ,   J ;   G ;   )   {   J   =   t h i s . p r o p s [ - - G ] ;   H [ J ]   =   F [ J ]   }   i f   ( ! H . t a r g e t )   {   H . t a r g e t   =   H . s r c E l e m e n t   | |   d o c u m e n t   }   i f   ( H . t a r g e t . n o d e T y p e   = =   3 )   {   H . t a r g e t   =   H . t a r g e t . p a r e n t N o d e   }   i f   ( ! H . r e l a t e d T a r g e t   & &   H . f r o m E l e m e n t )   {   H . r e l a t e d T a r g e t   =   H . f r o m E l e m e n t   = =   H . t a r g e t   ?   H . t o E l e m e n t   :   H . f r o m E l e m e n t   }   i f   ( H . p a g e X   = =   n u l l   & &   H . c l i e n t X   ! =   n u l l )   {   v a r   I   =   d o c u m e n t . d o c u m e n t E l e m e n t ,   E   =   d o c u m e n t . b o d y ;   H . p a g e X   =   H . c l i e n t X   +   ( I   & &   I . s c r o l l L e f t   | |   E   & &   E . s c r o l l L e f t   | |   0 )   -   ( I . c l i e n t L e f t   | |   0 ) ;   H . p a g e Y   =   H . c l i e n t Y   +   ( I   & &   I . s c r o l l T o p   | |   E   & &   E . s c r o l l T o p   | |   0 )   -   ( I . c l i e n t T o p   | |   0 )   }   i f   ( ! H . w h i c h   & &   ( ( H . c h a r C o d e   | |   H . c h a r C o d e   = = =   0 )   ?   H . c h a r C o d e   :   H . k e y C o d e ) )   {   H . w h i c h   =   H . c h a r C o d e   | |   H . k e y C o d e   }   i f   ( ! H . m e t a K e y   & &   H . c t r l K e y )   {   H . m e t a K e y   =   H . c t r l K e y   }   i f   ( ! H . w h i c h   & &   H . b u t t o n )   {   H . w h i c h   =   ( H . b u t t o n   &   1   ?   1   :   ( H . b u t t o n   &   2   ?   3   :   ( H . b u t t o n   &   4   ?   2   :   0 ) ) )   }   r e t u r n   H   } ,   p r o x y :   f u n c t i o n ( F ,   E )   {   E   =   E   | |   f u n c t i o n ( )   {   r e t u r n   F . a p p l y ( t h i s ,   a r g u m e n t s )   } ;   E . g u i d   =   F . g u i d   =   F . g u i d   | |   E . g u i d   | |   t h i s . g u i d + + ;   r e t u r n   E   } ,   s p e c i a l :   {   r e a d y :   {   s e t u p :   B ,   t e a r d o w n :   f u n c t i o n ( )   {   }   }   } ,   s p e c i a l A l l :   {   l i v e :   {   s e t u p :   f u n c t i o n ( E ,   F )   {   o . e v e n t . a d d ( t h i s ,   F [ 0 ] ,   c )   } ,   t e a r d o w n :   f u n c t i o n ( G )   {   i f   ( G . l e n g t h )   {   v a r   E   =   0 ,   F   =   R e g E x p ( " ( ^ | \ \ . ) "   +   G [ 0 ]   +   " ( \ \ . | $ ) " ) ;   o . e a c h ( ( o . d a t a ( t h i s ,   " e v e n t s " ) . l i v e   | |   { } ) ,   f u n c t i o n ( )   {   i f   ( F . t e s t ( t h i s . t y p e ) )   {   E + +   }   } ) ;   i f   ( E   <   1 )   {   o . e v e n t . r e m o v e ( t h i s ,   G [ 0 ] ,   c )   }   }   }   } }   } ;   o . E v e n t   =   f u n c t i o n ( E )   {   i f   ( ! t h i s . p r e v e n t D e f a u l t )   {   r e t u r n   n e w   o . E v e n t ( E )   }   i f   ( E   & &   E . t y p e )   {   t h i s . o r i g i n a l E v e n t   =   E ;   t h i s . t y p e   =   E . t y p e   }   e l s e   {   t h i s . t y p e   =   E   }   t h i s . t i m e S t a m p   =   e ( ) ;   t h i s [ h ]   =   t r u e   } ;   f u n c t i o n   k ( )   {   r e t u r n   f a l s e   }   f u n c t i o n   u ( )   {   r e t u r n   t r u e   }   o . E v e n t . p r o t o t y p e   =   {   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 . i s D e f a u l t P r e v e n t e d   =   u ;   v a r   E   =   t h i s . o r i g i n a l E v e n t ;   i f   ( ! E )   {   r e t u r n   }   i f   ( E . p r e v e n t D e f a u l t )   {   E . p r e v e n t D e f a u l t ( )   }   E . r e t u r n V a l u e   =   f a l s e   } ,   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 . i s P r o p a g a t i o n S t o p p e d   =   u ;   v a r   E   =   t h i s . o r i g i n a l E v e n t ;   i f   ( ! E )   {   r e t u r n   }   i f   ( E . s t o p P r o p a g a t i o n )   {   E . s t o p P r o p a g a t i o n ( )   }   E . c a n c e l B u b b l e   =   t r u e   } ,   s t o p I m m e d i a t e P r o p a g a t i o n :   f u n c t i o n ( )   {   t h i s . i s I m m e d i a t e P r o p a g a t i o n S t o p p e d   =   u ;   t h i s . s t o p P r o p a g a t i o n ( )   } ,   i s D e f a u l t P r e v e n t e d :   k ,   i s P r o p a g a t i o n S t o p p e d :   k ,   i s I m m e d i a t e P r o p a g a t i o n S t o p p e d :   k   } ;   v a r   a   =   f u n c t i o n ( F )   {   v a r   E   =   F . r e l a t e d T a r g e t ;   w h i l e   ( E   & &   E   ! =   t h i s )   {   t r y   {   E   =   E . p a r e n t N o d e   }   c a t c h   ( G )   {   E   =   t h i s   }   }   i f   ( E   ! =   t h i s )   {   F . t y p e   =   F . d a t a ;   o . e v e n t . h a n d l e . a p p l y ( t h i s ,   a r g u m e n t s )   }   } ;   o . e a c h ( {   m o u s e o v e r :   " m o u s e e n t e r " ,   m o u s e o u t :   " m o u s e l e a v e "   } ,   f u n c t i o n ( F ,   E )   {   o . e v e n t . s p e c i a l [ E ]   =   {   s e t u p :   f u n c t i o n ( )   {   o . e v e n t . a d d ( t h i s ,   F ,   a ,   E )   } ,   t e a r d o w n :   f u n c t i o n ( )   {   o . e v e n t . r e m o v e ( t h i s ,   F ,   a )   }   }   } ) ;   o . f n . e x t e n d ( {   b i n d :   f u n c t i o n ( F ,   G ,   E )   {   r e t u r n   F   = =   " u n l o a d "   ?   t h i s . o n e ( F ,   G ,   E )   :   t h i s . e a c h ( f u n c t i o n ( )   {   o . e v e n t . a d d ( t h i s ,   F ,   E   | |   G ,   E   & &   G )   } )   } ,   o n e :   f u n c t i o n ( G ,   H ,   F )   {   v a r   E   =   o . e v e n t . p r o x y ( F   | |   H ,   f u n c t i o n ( I )   {   o ( t h i s ) . u n b i n d ( I ,   E ) ;   r e t u r n   ( F   | |   H ) . a p p l y ( t h i s ,   a r g u m e n t s )   } ) ;   r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {   o . e v e n t . a d d ( t h i s ,   G ,   E ,   F   & &   H )   } )   } ,   u n b i n d :   f u n c t i o n ( F ,   E )   {   r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {   o . e v e n t . r e m o v e ( t h i s ,   F ,   E )   } )   } ,   t r i g g e r :   f u n c t i o n ( E ,   F )   {   r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {   o . e v e n t . t r i g g e r ( E ,   F ,   t h i s )   } )   } ,   t r i g g e r H a n d l e r :   f u n c t i o n ( E ,   G )   {   i f   ( t h i s [ 0 ] )   {   v a r   F   =   o . E v e n t ( E ) ;   F . p r e v e n t D e f a u l t ( ) ;   F . s t o p P r o p a g a t i o n ( ) ;   o . e v e n t . t r i g g e r ( F ,   G ,   t h i s [ 0 ] ) ;   r e t u r n   F . r e s u l t   }   } ,   t o g g l e :   f u n c t i o n ( G )   {   v a r   E   =   a r g u m e n t s ,   F   =   1 ;   w h i l e   ( F   <   E . l e n g t h )   {   o . e v e n t . p r o x y ( G ,   E [ F + + ] )   }   r e t u r n   t h i s . c l i c k ( o . e v e n t . p r o x y ( G ,   f u n c t i o n ( H )   {   t h i s . l a s t T o g g l e   =   ( t h i s . l a s t T o g g l e   | |   0 )   %   F ;   H . p r e v e n t D e f a u l t ( ) ;   r e t u r n   E [ t h i s . l a s t T o g g l e + + ] . a p p l y ( t h i s ,   a r g u m e n t s )   | |   f a l s e   } ) )   } ,   h o v e r :   f u n c t i o n ( E ,   F )   {   r e t u r n   t h i s . m o u s e e n t e r ( E ) . m o u s e l e a v e ( F )   } ,   r e a d y :   f u n c t i o n ( E )   {   B ( ) ;   i f   ( o . i s R e a d y )   {   E . c a l l ( d o c u m e n t ,   o )   }   e l s e   {   o . r e a d y L i s t . p u s h ( E )   }   r e t u r n   t h i s   } ,   l i v e :   f u n c t i o n ( G ,   F )   {   v a r   E   =   o . e v e n t . p r o x y ( F ) ;   E . g u i d   + =   t h i s . s e l e c t o r   +   G ;   o ( d o c u m e n t ) . b i n d ( i ( G ,   t h i s . s e l e c t o r ) ,   t h i s . s e l e c t o r ,   E ) ;   r e t u r n   t h i s   } ,   d i e :   f u n c t i o n ( F ,   E )   {   o ( d o c u m e n t ) . u n b i n d ( i ( F ,   t h i s . s e l e c t o r ) ,   E   ?   {   g u i d :   E . g u i d   +   t h i s . s e l e c t o r   +   F }   :   n u l l ) ;   r e t u r n   t h i s   }   } ) ;   f u n c t i o n   c ( H )   {   v a r   E   =   R e g E x p ( " ( ^ | \ \ . ) "   +   H . t y p e   +   " ( \ \ . | $ ) " ) ,   G   =   t r u e ,   F   =   [ ] ;   o . e a c h ( o . d a t a ( t h i s ,   " e v e n t s " ) . l i v e   | |   [ ] ,   f u n c t i o n ( I ,   J )   {   i f   ( E . t e s t ( J . t y p e ) )   {   v a r   K   =   o ( H . t a r g e t ) . c l o s e s t ( J . d a t a ) [ 0 ] ;   i f   ( K )   {   F . p u s h ( {   e l e m :   K ,   f n :   J   } )   }   }   } ) ;   F . s o r t ( f u n c t i o n ( J ,   I )   {   r e t u r n   o . d a t a ( J . e l e m ,   " c l o s e s t " )   -   o . d a t a ( I . e l e m ,   " c l o s e s t " )   } ) ;   o . e a c h ( F ,   f u n c t i o n ( )   {   i f   ( t h i s . f n . c a l l ( t h i s . e l e m ,   H ,   t h i s . f n . d a t a )   = = =   f a l s e )   {   r e t u r n   ( G   =   f a l s e )   }   } ) ;   r e t u r n   G   }   f u n c t i o n   i ( F ,   E )   {   r e t u r n   [ " l i v e " ,   F ,   E . r e p l a c e ( / \ . / g ,   " ` " ) . r e p l a c e ( /   / g ,   " | " ) ] . j o i n ( " . " )   }   o . e x t e n d ( {   i s R e a d y :   f a l s e ,   r e a d y L i s t :   [ ] ,   r e a d y :   f u n c t i o n ( )   {   i f   ( ! o . i s R e a d y )   {   o . i s R e a d y   =   t r u e ;   i f   ( o . r e a d y L i s t )   {   o . e a c h ( o . r e a d y L i s t ,   f u n c t i o n ( )   {   t h i s . c a l l ( d o c u m e n t ,   o )   } ) ;   o . r e a d y L i s t   =   n u l l   }   o ( d o c u m e n t ) . t r i g g e r H a n d l e r ( " r e a d y " )   }   }   } ) ;   v a r   x   =   f a l s e ;   f u n c t i o n   B ( )   {   i f   ( x )   {   r e t u r n   }   x   =   t r u e ;   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 " ,   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 " ,   a r g u m e n t s . c a l l e e ,   f a l s e ) ;   o . r e a d y ( )   } ,   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 " ,   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 " ,   a r g u m e n t s . c a l l e e ) ;   o . r e a d y ( )   }   } ) ;   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   & &   l   = =   l . t o p )   {   ( f u n c t i o n ( )   {   i f   ( o . i s R e a d y )   {   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 ( a r g u m e n t s . c a l l e e ,   0 ) ;   r e t u r n   }   o . r e a d y ( )   } ) ( )   }   }   }   o . e v e n t . a d d ( l ,   " l o a d " ,   o . r e a d y )   }   o . e a c h ( ( " b l u r , f o c u s , l o a d , r e s i z e , s c r o l l , u n l o a d , c l i c k , d b l c l i c k , m o u s e d o w n , m o u s e u p , m o u s e m o v e , m o u s e o v e r , m o u s e o u t , m o u s e e n t e r , m o u s e l e a v e , c h a n g e , s e l e c t , s u b m i t , k e y d o w n , k e y p r e s s , k e y u p , e r r o r " ) . s p l i t ( " , " ) ,   f u n c t i o n ( F ,   E )   {   o . f n [ E ]   =   f u n c t i o n ( G )   {   r e t u r n   G   ?   t h i s . b i n d ( E ,   G )   :   t h i s . t r i g g e r ( E )   }   } ) ;   o ( l ) . b i n d ( " u n l o a d " ,   f u n c t i o n ( )   {   f o r   ( v a r   E   i n   o . c a c h e )   {   i f   ( E   ! =   1   & &   o . c a c h e [ E ] . h a n d l e )   {   o . e v e n t . r e m o v e ( o . c a c h e [ E ] . h a n d l e . e l e m )   }   }   } ) ;   ( f u n c t i o n ( )   {   o . s u p p o r t   =   { } ;   v a r   F   =   d o c u m e n t . d o c u m e n t E l e m e n t ,   G   =   d o c u m e n t . c r e a t e E l e m e n t ( " s c r i p t " ) ,   K   =   d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ,   J   =   " s c r i p t "   +   ( n e w   D a t e ) . g e t T i m e ( ) ;   K . s t y l e . d i s p l a y   =   " n o n e " ;   K . i n n e r H T M L   =   '       < l i n k / > < t a b l e > < / t a b l e > < a   h r e f = " / a "   s t y l e = " c o l o r : r e d ; f l o a t : l e f t ; o p a c i t y : . 5 ; " > a < / a > < s e l e c t > < o p t i o n > t e x t < / o p t i o n > < / s e l e c t > < o b j e c t > < p a r a m / > < / o b j e c t > ' ;   v a r   H   =   K . g e t E l e m e n t s B y T a g N a m e ( " * " ) ,   E   =   K . g e t E l e m e n t s B y T a g N a m e ( " a " ) [ 0 ] ;   i f   ( ! H   | |   ! H . l e n g t h   | |   ! E )   {   r e t u r n   }   o . s u p p o r t   =   {   l e a d i n g W h i t e s p a c e :   K . f i r s t C h i l d . n o d e T y p e   = =   3 ,   t b o d y :   ! K . g e t E l e m e n t s B y T a g N a m e ( " t b o d y " ) . l e n g t h ,   o b j e c t A l l :   ! ! K . 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 ] . 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 ,   h t m l S e r i a l i z e :   ! ! K . g e t E l e m e n t s B y T a g N a m e ( " l i n k " ) . l e n g t h ,   s t y l e :   / r e d / . t e s t ( E . g e t A t t r i b u t e ( " s t y l e " ) ) ,   h r e f N o r m a l i z e d :   E . g e t A t t r i b u t e ( " h r e f " )   = = =   " / a " ,   o p a c i t y :   E . s t y l e . o p a c i t y   = = =   " 0 . 5 " ,   c s s F l o a t :   ! ! E . s t y l e . c s s F l o a t ,   s c r i p t E v a l :   f a l s e ,   n o C l o n e E v e n t :   t r u e ,   b o x M o d e l :   n u l l   } ;   G . t y p e   =   " t e x t / j a v a s c r i p t " ;   t r y   {   G . 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 T e x t N o d e ( " w i n d o w . "   +   J   +   " = 1 ; " ) )   }   c a t c h   ( I )   {   }   F . i n s e r t B e f o r e ( G ,   F . f i r s t C h i l d ) ;   i f   ( l [ J ] )   {   o . s u p p o r t . s c r i p t E v a l   =   t r u e ;   d e l e t e   l [ J ]   }   F . r e m o v e C h i l d ( G ) ;   i f   ( K . a t t a c h E v e n t   & &   K . f i r e E v e n t )   {   K . a t t a c h E v e n t ( " o n c l i c k " ,   f u n c t i o n ( )   {   o . s u p p o r t . n o C l o n e E v e n t   =   f a l s e ;   K . d e t a c h E v e n t ( " o n c l i c k " ,   a r g u m e n t s . c a l l e e )   } ) ;   K . c l o n e N o d e ( t r u e ) . f i r e E v e n t ( " o n c l i c k " )   }   o ( f u n c t i o n ( )   {   v a r   L   =   d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ;   L . s t y l e . w i d t h   =   L . s t y l e . p a d d i n g L e f t   =   " 1 p x " ;   d o c u m e n t . b o d y . a p p e n d C h i l d ( L ) ;   o . b o x M o d e l   =   o . s u p p o r t . b o x M o d e l   =   L . o f f s e t W i d t h   = = =   2 ;   d o c u m e n t . b o d y . r e m o v e C h i l d ( L ) . s t y l e . d i s p l a y   =   " n o n e "   } )   } ) ( ) ;   v a r   w   =   o . s u p p o r t . c s s F l o a t   ?   " c s s F l o a t "   :   " s t y l e F l o a t " ;   o . p r o p s   =   {   " f o r " :   " h t m l F o r " ,   " c l a s s " :   " c l a s s N a m e " ,   " f l o a t " :   w ,   c s s F l o a t :   w ,   s t y l e F l o a t :   w ,   r e a d o n l y :   " r e a d O n l y " ,   m a x l e n g t h :   " m a x L e n g t h " ,   c e l l s p a c i n g :   " c e l l S p a c i n g " ,   r o w s p a n :   " r o w S p a n " ,   t a b i n d e x :   " t a b I n d e x "   } ;   o . f n . e x t e n d ( {   _ l o a d :   o . f n . l o a d ,   l o a d :   f u n c t i o n ( G ,   J ,   K )   {   i f   ( t y p e o f   G   ! = =   " s t r i n g " )   {   r e t u r n   t h i s . _ l o a d ( G )   }   v a r   I   =   G . i n d e x O f ( "   " ) ;   i f   ( I   > =   0 )   {   v a r   E   =   G . s l i c e ( I ,   G . l e n g t h ) ;   G   =   G . s l i c e ( 0 ,   I )   }   v a r   H   =   " G E T " ;   i f   ( J )   {   i f   ( o . i s F u n c t i o n ( J ) )   {   K   =   J ;   J   =   n u l l   }   e l s e   {   i f   ( t y p e o f   J   = = =   " o b j e c t " )   {   J   =   o . p a r a m ( J ) ;   H   =   " P O S T "   }   }   }   v a r   F   =   t h i s ;   o . a j a x ( {   u r l :   G ,   t y p e :   H ,   d a t a T y p e :   " h t m l " ,   d a t a :   J ,   c o m p l e t e :   f u n c t i o n ( M ,   L )   {   i f   ( L   = =   " s u c c e s s "   | |   L   = =   " n o t m o d i f i e d " )   {   F . h t m l ( E   ?   o ( " < d i v / > " ) . a p p e n d ( M . r e s p o n s e T e x t . r e p l a c e ( / < s c r i p t ( . | \ s ) * ? \ / s c r i p t > / g ,   " " ) ) . f i n d ( E )   :   M . r e s p o n s e T e x t )   }   i f   ( K )   {   F . e a c h ( K ,   [ M . r e s p o n s e T e x t ,   L ,   M ] )   }   }   } ) ;   r e t u r n   t h i s   } ,   s e r i a l i z e :   f u n c t i o n ( )   {   r e t u r n   o . p a r a m ( t h i s . s e r i a l i z e A r r a y ( ) )   } ,   s e r i a l i z e A r r a y :   f u n c t i o n ( )   {   r e t u r n   t h i s . m a p ( f u n c t i o n ( )   {   r e t u r n   t h i s . e l e m e n t s   ?   o . m a k e A r r a y ( t h i s . e l e m e n t s )   :   t h i s   } ) . f i l t e r ( f u n c t i o n ( )   {   r e t u r n   t h i s . n a m e   & &   ! t h i s . d i s a b l e d   & &   ( t h i s . c h e c k e d   | |   / s e l e c t | t e x t a r e a / i . t e s t ( t h i s . n o d e N a m e )   | |   / t e x t | h i d d e n | p a s s w o r d | s e a r c h / i . t e s t ( t h i s . t y p e ) )   } ) . m a p ( f u n c t i o n ( E ,   F )   {   v a r   G   =   o ( t h i s ) . v a l ( ) ;   r e t u r n   G   = =   n u l l   ?   n u l l   :   o . i s A r r a y ( G )   ?   o . m a p ( G ,   f u n c t i o n ( I ,   H )   {   r e t u r n   {   n a m e :   F . n a m e ,   v a l u e :   I }   } )   :   {   n a m e :   F . n a m e ,   v a l u e :   G }   } ) . g e t ( )   }   } ) ;   o . e a c h ( " a j a x S t a r t , a j a x S t o p , a j a x C o m p l e t e , a j a x E r r o r , a j a x S u c c e s s , a j a x S e n d " . s p l i t ( " , " ) ,   f u n c t i o n ( E ,   F )   {   o . f n [ F ]   =   f u n c t i o n ( G )   {   r e t u r n   t h i s . b i n d ( F ,   G )   }   } ) ;   v a r   r   =   e ( ) ;   o . e x t e n d ( {   g e t :   f u n c t i o n ( E ,   G ,   H ,   F )   {   i f   ( o . i s F u n c t i o n ( G ) )   {   H   =   G ;   G   =   n u l l   }   r e t u r n   o . a j a x ( {   t y p e :   " G E T " ,   u r l :   E ,   d a t a :   G ,   s u c c e s s :   H ,   d a t a T y p e :   F   } )   } ,   g e t S c r i p t :   f u n c t i o n ( E ,   F )   {   r e t u r n   o . g e t ( E ,   n u l l ,   F ,   " s c r i p t " )   } ,   g e t J S O N :   f u n c t i o n ( E ,   F ,   G )   {   r e t u r n   o . g e t ( E ,   F ,   G ,   " j s o n " )   } ,   p o s t :   f u n c t i o n ( E ,   G ,   H ,   F )   {   i f   ( o . i s F u n c t i o n ( G ) )   {   H   =   G ;   G   =   { }   }   r e t u r n   o . a j a x ( {   t y p e :   " P O S T " ,   u r l :   E ,   d a t a :   G ,   s u c c e s s :   H ,   d a t a T y p e :   F   } )   } ,   a j a x S e t u p :   f u n c t i o n ( E )   {   o . e x t e n d ( o . a j a x S e t t i n g s ,   E )   } ,   a j a x S e t t i n g s :   {   u r l :   l o c a t i o n . h r e f ,   g l o b a l :   t r u e ,   t y p e :   " G E T " ,   c o n t e n t T y p e :   " a p p l i c a t i o n / x - w w w - f o r m - u r l e n c o d e d " ,   p r o c e s s D a t a :   t r u e ,   a s y n c :   t r u e ,   x h r :   f u n c t i o n ( )   {   r e t u r n   l . A c t i v e X O b j e c t   ?   n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " )   :   n e w   X M L H t t p R e q u e s t ( )   } ,   a c c e p t s :   {   x m l :   " a p p l i c a t i o n / x m l ,   t e x t / x m l " ,   h t m l :   " t e x t / h t m l " ,   s c r i p t :   " t e x t / j a v a s c r i p t ,   a p p l i c a t i o n / j a v a s c r i p t " ,   j s o n :   " a p p l i c a t i o n / j s o n ,   t e x t / j a v a s c r i p t " ,   t e x t :   " t e x t / p l a i n " ,   _ d e f a u l t :   " * / * " }   } ,   l a s t M o d i f i e d :   { } ,   a j a x :   f u n c t i o n ( M )   {   M   =   o . e x t e n d ( t r u e ,   M ,   o . e x t e n d ( t r u e ,   { } ,   o . a j a x S e t t i n g s ,   M ) ) ;   v a r   W ,   F   =   / = \ ? ( & | $ ) / g ,   R ,   V ,   G   =   M . t y p e . t o U p p e r C a s e ( ) ;   i f   ( M . d a t a   & &   M . p r o c e s s D a t a   & &   t y p e o f   M . d a t a   ! = =   " s t r i n g " )   {   M . d a t a   =   o . p a r a m ( M . d a t a )   }   i f   ( M . d a t a T y p e   = =   " j s o n p " )   {   i f   ( G   = =   " G E T " )   {   i f   ( ! M . u r l . m a t c h ( F ) )   {   M . u r l   + =   ( M . u r l . m a t c h ( / \ ? / )   ?   " & "   :   " ? " )   +   ( M . j s o n p   | |   " c a l l b a c k " )   +   " = ? "   }   }   e l s e   {   i f   ( ! M . d a t a   | |   ! M . d a t a . m a t c h ( F ) )   {   M . d a t a   =   ( M . d a t a   ?   M . d a t a   +   " & "   :   " " )   +   ( M . j s o n p   | |   " c a l l b a c k " )   +   " = ? "   }   }   M . d a t a T y p e   =   " j s o n "   }   i f   ( M . d a t a T y p e   = =   " j s o n "   & &   ( M . d a t a   & &   M . d a t a . m a t c h ( F )   | |   M . u r l . m a t c h ( F ) ) )   {   W   =   " j s o n p "   +   r + + ;   i f   ( M . d a t a )   {   M . d a t a   =   ( M . d a t a   +   " " ) . r e p l a c e ( F ,   " = "   +   W   +   " $ 1 " )   }   M . u r l   =   M . u r l . r e p l a c e ( F ,   " = "   +   W   +   " $ 1 " ) ;   M . d a t a T y p e   =   " s c r i p t " ;   l [ W ]   =   f u n c t i o n ( X )   {   V   =   X ;   I ( ) ;   L ( ) ;   l [ W ]   =   g ;   t r y   {   d e l e t e   l [ W ]   }   c a t c h   ( Y )   {   }   i f   ( H )   {   H . r e m o v e C h i l d ( T )   }   }   }   i f   ( M . d a t a T y p e   = =   " s c r i p t "   & &   M . c a c h e   = =   n u l l )   {   M . c a c h e   =   f a l s e   }   i f   ( M . c a c h e   = = =   f a l s e   & &   G   = =   " G E T " )   {   v a r   E   =   e ( ) ;   v a r   U   =   M . u r l . r e p l a c e ( / ( \ ? | & ) _ = . * ? ( & | $ ) / ,   " $ 1 _ = "   +   E   +   " $ 2 " ) ;   M . u r l   =   U   +   ( ( U   = =   M . u r l )   ?   ( M . u r l . m a t c h ( / \ ? / )   ?   " & "   :   " ? " )   +   " _ = "   +   E   :   " " )   }   i f   ( M . d a t a   & &   G   = =   " G E T " )   {   M . u r l   + =   ( M . u r l . m a t c h ( / \ ? / )   ?   " & "   :   " ? " )   +   M . d a t a ;   M . d a t a   =   n u l l   }   i f   ( M . g l o b a l   & &   ! o . a c t i v e + + )   {   o . e v e n t . t r i g g e r ( " a j a x S t a r t " )   }   v a r   Q   =   / ^ ( \ w + : ) ? \ / \ / ( [ ^ \ / ? # ] + ) / . e x e c ( M . u r l ) ;   i f   ( M . d a t a T y p e   = =   " s c r i p t "   & &   G   = =   " G E T "   & &   Q   & &   ( Q [ 1 ]   & &   Q [ 1 ]   ! =   l o c a t i o n . p r o t o c o l   | |   Q [ 2 ]   ! =   l o c a t i o n . h o s t ) )   {   v a r   H   =   d o c u m e n t . g e t E l e m e n t s B y T a g N a m e ( " h e a d " ) [ 0 ] ;   v a r   T   =   d o c u m e n t . c r e a t e E l e m e n t ( " s c r i p t " ) ;   T . s r c   =   M . u r l ;   i f   ( M . s c r i p t C h a r s e t )   {   T . c h a r s e t   =   M . s c r i p t C h a r s e t   }   i f   ( ! W )   {   v a r   O   =   f a l s e ;   T . o n l o a d   =   T . o n r e a d y s t a t e c h a n g e   =   f u n c t i o n ( )   {   i f   ( ! O   & &   ( ! t h i s . r e a d y S t a t e   | |   t h i s . r e a d y S t a t e   = =   " l o a d e d "   | |   t h i s . r e a d y S t a t e   = =   " c o m p l e t e " ) )   {   O   =   t r u e ;   I ( ) ;   L ( ) ;   T . o n l o a d   =   T . o n r e a d y s t a t e c h a n g e   =   n u l l ;   H . r e m o v e C h i l d ( T )   }   }   }   H . a p p e n d C h i l d ( T ) ;   r e t u r n   g   }   v a r   K   =   f a l s e ;   v a r   J   =   M . x h r ( ) ;   i f   ( M . u s e r n a m e )   {   J . o p e n ( G ,   M . u r l ,   M . a s y n c ,   M . u s e r n a m e ,   M . p a s s w o r d )   }   e l s e   {   J . o p e n ( G ,   M . u r l ,   M . a s y n c )   }   t r y   {   i f   ( M . d a t a )   {   J . s e t R e q u e s t H e a d e r ( " C o n t e n t - T y p e " ,   M . c o n t e n t T y p e )   }   i f   ( M . i f M o d i f i e d )   {   J . s e t R e q u e s t H e a d e r ( " I f - M o d i f i e d - S i n c e " ,   o . l a s t M o d i f i e d [ M . u r l ]   | |   " T h u ,   0 1   J a n   1 9 7 0   0 0 : 0 0 : 0 0   G M T " )   }   J . s e t R e q u e s t H e a d e r ( " X - R e q u e s t e d - W i t h " ,   " X M L H t t p R e q u e s t " ) ;   J . s e t R e q u e s t H e a d e r ( " A c c e p t " ,   M . d a t a T y p e   & &   M . a c c e p t s [ M . d a t a T y p e ]   ?   M . a c c e p t s [ M . d a t a T y p e ]   +   " ,   * / * "   :   M . a c c e p t s . _ d e f a u l t )   }   c a t c h   ( S )   {   }   i f   ( M . b e f o r e S e n d   & &   M . b e f o r e S e n d ( J ,   M )   = = =   f a l s e )   {   i f   ( M . g l o b a l   & &   !   - - o . a c t i v e )   {   o . e v e n t . t r i g g e r ( " a j a x S t o p " )   }   J . a b o r t ( ) ;   r e t u r n   f a l s e   }   i f   ( M . g l o b a l )   {   o . e v e n t . t r i g g e r ( " a j a x S e n d " ,   [ J ,   M ] )   }   v a r   N   =   f u n c t i o n ( X )   {   i f   ( J . r e a d y S t a t e   = =   0 )   {   i f   ( P )   {   c l e a r I n t e r v a l ( P ) ;   P   =   n u l l ;   i f   ( M . g l o b a l   & &   !   - - o . a c t i v e )   {   o . e v e n t . t r i g g e r ( " a j a x S t o p " )   }   }   }   e l s e   {   i f   ( ! K   & &   J   & &   ( J . r e a d y S t a t e   = =   4   | |   X   = =   " t i m e o u t " ) )   {   K   =   t r u e ;   i f   ( P )   {   c l e a r I n t e r v a l ( P ) ;   P   =   n u l l   }   R   =   X   = =   " t i m e o u t "   ?   " t i m e o u t "   :   ! o . h t t p S u c c e s s ( J )   ?   " e r r o r "   :   M . i f M o d i f i e d   & &   o . h t t p N o t M o d i f i e d ( J ,   M . u r l )   ?   " n o t m o d i f i e d "   :   " s u c c e s s " ;   i f   ( R   = =   " s u c c e s s " )   {   t r y   {   V   =   o . h t t p D a t a ( J ,   M . d a t a T y p e ,   M )   }   c a t c h   ( Z )   {   R   =   " p a r s e r e r r o r "   }   }   i f   ( R   = =   " s u c c e s s " )   {   v a r   Y ;   t r y   {   Y   =   J . g e t R e s p o n s e H e a d e r ( " L a s t - M o d i f i e d " )   }   c a t c h   ( Z )   {   }   i f   ( M . i f M o d i f i e d   & &   Y )   {   o . l a s t M o d i f i e d [ M . u r l ]   =   Y   }   i f   ( ! W )   {   I ( )   }   }   e l s e   {   o . h a n d l e E r r o r ( M ,   J ,   R )   }   L ( ) ;   i f   ( X )   {   J . a b o r t ( )   }   i f   ( M . a s y n c )   {   J   =   n u l l   }   }   }   } ;   i f   ( M . a s y n c )   {   v a r   P   =   s e t I n t e r v a l ( N ,   1 3 ) ;   i f   ( M . t i m e o u t   >   0 )   {   s e t T i m e o u t ( f u n c t i o n ( )   {   i f   ( J   & &   ! K )   {   N ( " t i m e o u t " )   }   } ,   M . t i m e o u t )   }   }   t r y   {   J . s e n d ( M . d a t a )   }   c a t c h   ( S )   {   o . h a n d l e E r r o r ( M ,   J ,   n u l l ,   S )   }   i f   ( ! M . a s y n c )   {   N ( )   }   f u n c t i o n   I ( )   {   i f   ( M . s u c c e s s )   {   M . s u c c e s s ( V ,   R )   }   i f   ( M . g l o b a l )   {   o . e v e n t . t r i g g e r ( " a j a x S u c c e s s " ,   [ J ,   M ] )   }   }   f u n c t i o n   L ( )   {   i f   ( M . c o m p l e t e )   {   M . c o m p l e t e ( J ,   R )   }   i f   ( M . g l o b a l )   {   o . e v e n t . t r i g g e r ( " a j a x C o m p l e t e " ,   [ J ,   M ] )   }   i f   ( M . g l o b a l   & &   !   - - o . a c t i v e )   {   o . e v e n t . t r i g g e r ( " a j a x S t o p " )   }   }   r e t u r n   J   } ,   h a n d l e E r r o r :   f u n c t i o n ( F ,   H ,   E ,   G )   {   i f   ( F . e r r o r )   {   F . e r r o r ( H ,   E ,   G )   }   i f   ( F . g l o b a l )   {   o . e v e n t . t r i g g e r ( " a j a x E r r o r " ,   [ H ,   F ,   G ] )   }   } ,   a c t i v e :   0 ,   h t t p S u c c e s s :   f u n c t i o n ( F )   {   t r y   {   r e t u r n   ! F . s t a t u s   & &   l o c a t i o n . p r o t o c o l   = =   " f i l e : "   | |   ( F . s t a t u s   > =   2 0 0   & &   F . s t a t u s   <   3 0 0 )   | |   F . s t a t u s   = =   3 0 4   | |   F . s t a t u s   = =   1 2 2 3   }   c a t c h   ( E )   {   }   r e t u r n   f a l s e   } ,   h t t p N o t M o d i f i e d :   f u n c t i o n ( G ,   E )   {   t r y   {   v a r   H   =   G . g e t R e s p o n s e H e a d e r ( " L a s t - M o d i f i e d " ) ;   r e t u r n   G . s t a t u s   = =   3 0 4   | |   H   = =   o . l a s t M o d i f i e d [ E ]   }   c a t c h   ( F )   {   }   r e t u r n   f a l s e   } ,   h t t p D a t a :   f u n c t i o n ( J ,   H ,   G )   {   v a r   F   =   J . g e t R e s p o n s e H e a d e r ( " c o n t e n t - t y p e " ) ,   E   =   H   = =   " x m l "   | |   ! H   & &   F   & &   F . i n d e x O f ( " x m l " )   > =   0 ,   I   =   E   ?   J . r e s p o n s e X M L   :   J . r e s p o n s e T e x t ;   i f   ( E   & &   I . d o c u m e n t E l e m e n t . t a g N a m e   = =   " p a r s e r e r r o r " )   {   t h r o w   " p a r s e r e r r o r "   }   i f   ( G   & &   G . d a t a F i l t e r )   {   I   =   G . d a t a F i l t e r ( I ,   H )   }   i f   ( t y p e o f   I   = = =   " s t r i n g " )   {   i f   ( H   = =   " s c r i p t " )   {   o . g l o b a l E v a l ( I )   }   i f   ( H   = =   " j s o n " )   {   I   =   l [ " e v a l " ] ( " ( "   +   I   +   " ) " )   }   }   r e t u r n   I   } ,   p a r a m :   f u n c t i o n ( E )   {   v a r   G   =   [ ] ;   f u n c t i o n   H ( I ,   J )   {   G [ G . l e n g t h ]   =   e n c o d e U R I C o m p o n e n t ( I )   +   " = "   +   e n c o d e U R I C o m p o n e n t ( J )   }   i f   ( o . i s A r r a y ( E )   | |   E . j q u e r y )   {   o . e a c h ( E ,   f u n c t i o n ( )   {   H ( t h i s . n a m e ,   t h i s . v a l u e )   } )   }   e l s e   {   f o r   ( v a r   F   i n   E )   {   i f   ( o . i s A r r a y ( E [ F ] ) )   {   o . e a c h ( E [ F ] ,   f u n c t i o n ( )   {   H ( F ,   t h i s )   } )   }   e l s e   {   H ( F ,   o . i s F u n c t i o n ( E [ F ] )   ?   E [ F ] ( )   :   E [ F ] )   }   }   }   r e t u r n   G . j o i n ( " & " ) . r e p l a c e ( / % 2 0 / g ,   " + " )   }   } ) ;   v a r   m   =   { } ,   n ,   d   =   [ [ " h e i g h t " ,   " m a r g i n T o p " ,   " m a r g i n B o t t o m " ,   " p a d d i n g T o p " ,   " p a d d i n g B o t t o m " ] ,   [ " w i d t h " ,   " m a r g i n L e f t " ,   " m a r g i n R i g h t " ,   " p a d d i n g L e f t " ,   " p a d d i n g R i g h t " ] ,   [ " o p a c i t y " ] ] ;   f u n c t i o n   t ( F ,   E )   {   v a r   G   =   { } ;   o . e a c h ( d . c o n c a t . a p p l y ( [ ] ,   d . s l i c e ( 0 ,   E ) ) ,   f u n c t i o n ( )   {   G [ t h i s ]   =   F   } ) ;   r e t u r n   G   }   o . f n . e x t e n d ( {   s h o w :   f u n c t i o n ( J ,   L )   {   i f   ( J )   {   r e t u r n   t h i s . a n i m a t e ( t ( " s h o w " ,   3 ) ,   J ,   L )   }   e l s e   {   f o r   ( v a r   H   =   0 ,   F   =   t h i s . l e n g t h ;   H   <   F ;   H + + )   {   v a r   E   =   o . d a t a ( t h i s [ H ] ,   " o l d d i s p l a y " ) ;   t h i s [ H ] . s t y l e . d i s p l a y   =   E   | |   " " ;   i f   ( o . c s s ( t h i s [ H ] ,   " d i s p l a y " )   = = =   " n o n e " )   {   v a r   G   =   t h i s [ H ] . t a g N a m e ,   K ;   i f   ( m [ G ] )   {   K   =   m [ G ]   }   e l s e   {   v a r   I   =   o ( " < "   +   G   +   "   / > " ) . a p p e n d T o ( " b o d y " ) ;   K   =   I . c s s ( " d i s p l a y " ) ;   i f   ( K   = = =   " n o n e " )   {   K   =   " b l o c k "   }   I . r e m o v e ( ) ;   m [ G ]   =   K   }   o . d a t a ( t h i s [ H ] ,   " o l d d i s p l a y " ,   K )   }   }   f o r   ( v a r   H   =   0 ,   F   =   t h i s . l e n g t h ;   H   <   F ;   H + + )   {   t h i s [ H ] . s t y l e . d i s p l a y   =   o . d a t a ( t h i s [ H ] ,   " o l d d i s p l a y " )   | |   " "   }   r e t u r n   t h i s   }   } ,   h i d e :   f u n c t i o n ( H ,   I )   {   i f   ( H )   {   r e t u r n   t h i s . a n i m a t e ( t ( " h i d e " ,   3 ) ,   H ,   I )   }   e l s e   {   f o r   ( v a r   G   =   0 ,   F   =   t h i s . l e n g t h ;   G   <   F ;   G + + )   {   v a r   E   =   o . d a t a ( t h i s [ G ] ,   " o l d d i s p l a y " ) ;   i f   ( ! E   & &   E   ! = =   " n o n e " )   {   o . d a t a ( t h i s [ G ] ,   " o l d d i s p l a y " ,   o . c s s ( t h i s [ G ] ,   " d i s p l a y " ) )   }   }   f o r   ( v a r   G   =   0 ,   F   =   t h i s . l e n g t h ;   G   <   F ;   G + + )   {   t h i s [ G ] . s t y l e . d i s p l a y   =   " n o n e "   }   r e t u r n   t h i s   }   } ,   _ t o g g l e :   o . f n . t o g g l e ,   t o g g l e :   f u n c t i o n ( G ,   F )   {   v a r   E   =   t y p e o f   G   = = =   " b o o l e a n " ;   r e t u r n   o . i s F u n c t i o n ( G )   & &   o . i s F u n c t i o n ( F )   ?   t h i s . _ t o g g l e . a p p l y ( t h i s ,   a r g u m e n t s )   :   G   = =   n u l l   | |   E   ?   t h i s . e a c h ( f u n c t i o n ( )   {   v a r   H   =   E   ?   G   :   o ( t h i s ) . i s ( " : h i d d e n " ) ;   o ( t h i s ) [ H   ?   " s h o w "   :   " h i d e " ] ( )   } )   :   t h i s . a n i m a t e ( t ( " t o g g l e " ,   3 ) ,   G ,   F )   } ,   f a d e T o :   f u n c t i o n ( E ,   G ,   F )   {   r e t u r n   t h i s . a n i m a t e ( {   o p a c i t y :   G   } ,   E ,   F )   } ,   a n i m a t e :   f u n c t i o n ( I ,   F ,   H ,   G )   {   v a r   E   =   o . s p e e d ( F ,   H ,   G ) ;   r e t u r n   t h i s [ E . q u e u e   = = =   f a l s e   ?   " e a c h "   :   " q u e u e " ] ( f u n c t i o n ( )   {   v a r   K   =   o . e x t e n d ( { } ,   E ) ,   M ,   L   =   t h i s . n o d e T y p e   = =   1   & &   o ( t h i s ) . i s ( " : h i d d e n " ) ,   J   =   t h i s ;   f o r   ( M   i n   I )   {   i f   ( I [ M ]   = =   " h i d e "   & &   L   | |   I [ M ]   = =   " s h o w "   & &   ! L )   {   r e t u r n   K . c o m p l e t e . c a l l ( t h i s )   }   i f   ( ( M   = =   " h e i g h t "   | |   M   = =   " w i d t h " )   & &   t h i s . s t y l e )   {   K . d i s p l a y   =   o . c s s ( t h i s ,   " d i s p l a y " ) ;   K . o v e r f l o w   =   t h i s . s t y l e . o v e r f l o w   }   }   i f   ( K . o v e r f l o w   ! =   n u l l )   {   t h i s . s t y l e . o v e r f l o w   =   " h i d d e n "   }   K . c u r A n i m   =   o . e x t e n d ( { } ,   I ) ;   o . e a c h ( I ,   f u n c t i o n ( O ,   S )   {   v a r   R   =   n e w   o . f x ( J ,   K ,   O ) ;   i f   ( / t o g g l e | s h o w | h i d e / . t e s t ( S ) )   {   R [ S   = =   " t o g g l e "   ?   L   ?   " s h o w "   :   " h i d e "   :   S ] ( I )   }   e l s e   {   v a r   Q   =   S . t o S t r i n g ( ) . m a t c h ( / ^ ( [ + - ] = ) ? ( [ \ d + - . ] + ) ( . * ) $ / ) ,   T   =   R . c u r ( t r u e )   | |   0 ;   i f   ( Q )   {   v a r   N   =   p a r s e F l o a t ( Q [ 2 ] ) ,   P   =   Q [ 3 ]   | |   " p x " ;   i f   ( P   ! =   " p x " )   {   J . s t y l e [ O ]   =   ( N   | |   1 )   +   P ;   T   =   ( ( N   | |   1 )   /   R . c u r ( t r u e ) )   *   T ;   J . s t y l e [ O ]   =   T   +   P   }   i f   ( Q [ 1 ] )   {   N   =   ( ( Q [ 1 ]   = =   " - = "   ?   - 1   :   1 )   *   N )   +   T   }   R . c u s t o m ( T ,   N ,   P )   }   e l s e   {   R . c u s t o m ( T ,   S ,   " " )   }   }   } ) ;   r e t u r n   t r u e   } )   } ,   s t o p :   f u n c t i o n ( F ,   E )   {   v a r   G   =   o . t i m e r s ;   i f   ( F )   {   t h i s . q u e u e ( [ ] )   }   t h i s . e a c h ( f u n c t i o n ( )   {   f o r   ( v a r   H   =   G . l e n g t h   -   1 ;   H   > =   0 ;   H - - )   {   i f   ( G [ H ] . e l e m   = =   t h i s )   {   i f   ( E )   {   G [ H ] ( t r u e )   }   G . s p l i c e ( H ,   1 )   }   }   } ) ;   i f   ( ! E )   {   t h i s . d e q u e u e ( )   }   r e t u r n   t h i s   }   } ) ;   o . e a c h ( {   s l i d e D o w n :   t ( " s h o w " ,   1 ) ,   s l i d e U p :   t ( " h i d e " ,   1 ) ,   s l i d e T o g g l e :   t ( " t o g g l e " ,   1 ) ,   f a d e I n :   {   o p a c i t y :   " s h o w "   } ,   f a d e O u t :   {   o p a c i t y :   " h i d e " }   } ,   f u n c t i o n ( E ,   F )   {   o . f n [ E ]   =   f u n c t i o n ( G ,   H )   {   r e t u r n   t h i s . a n i m a t e ( F ,   G ,   H )   }   } ) ;   o . e x t e n d ( {   s p e e d :   f u n c t i o n ( G ,   H ,   F )   {   v a r   E   =   t y p e o f   G   = = =   " o b j e c t "   ?   G   :   {   c o m p l e t e :   F   | |   ! F   & &   H   | |   o . i s F u n c t i o n ( G )   & &   G ,   d u r a t i o n :   G ,   e a s i n g :   F   & &   H   | |   H   & &   ! o . i s F u n c t i o n ( H )   & &   H   } ;   E . d u r a t i o n   =   o . f x . o f f   ?   0   :   t y p e o f   E . d u r a t i o n   = = =   " n u m b e r "   ?   E . d u r a t i o n   :   o . f x . s p e e d s [ E . d u r a t i o n ]   | |   o . f x . s p e e d s . _ d e f a u l t ;   E . o l d   =   E . c o m p l e t e ;   E . c o m p l e t e   =   f u n c t i o n ( )   {   i f   ( E . q u e u e   ! = =   f a l s e )   {   o ( t h i s ) . d e q u e u e ( )   }   i f   ( o . i s F u n c t i o n ( E . o l d ) )   {   E . o l d . c a l l ( t h i s )   }   } ;   r e t u r n   E   } ,   e a s i n g :   {   l i n e a r :   f u n c t i o n ( G ,   H ,   E ,   F )   {   r e t u r n   E   +   F   *   G   } ,   s w i n g :   f u n c t i o n ( G ,   H ,   E ,   F )   {   r e t u r n   ( ( - M a t h . c o s ( G   *   M a t h . P I )   /   2 )   +   0 . 5 )   *   F   +   E   }   } ,   t i m e r s :   [ ] ,   f x :   f u n c t i o n ( F ,   E ,   G )   {   t h i s . o p t i o n s   =   E ;   t h i s . e l e m   =   F ;   t h i s . p r o p   =   G ;   i f   ( ! E . o r i g )   {   E . o r i g   =   { }   }   }   } ) ;   o . f x . p r o t o t y p e   =   {   u p d a t e :   f u n c t i o n ( )   {   i f   ( t h i s . o p t i o n s . s t e p )   {   t h i s . o p t i o n s . s t e p . c a l l ( t h i s . e l e m ,   t h i s . n o w ,   t h i s )   }   ( o . f x . s t e p [ t h i s . p r o p ]   | |   o . f x . s t e p . _ d e f a u l t ) ( t h i s ) ;   i f   ( ( t h i s . p r o p   = =   " h e i g h t "   | |   t h i s . p r o p   = =   " w i d t h " )   & &   t h i s . e l e m . s t y l e )   {   t h i s . e l e m . s t y l e . d i s p l a y   =   " b l o c k "   }   } ,   c u r :   f u n c t i o n ( F )   {   i f   ( t h i s . e l e m [ t h i s . p r o p ]   ! =   n u l l   & &   ( ! t h i s . e l e m . s t y l e   | |   t h i s . e l e m . s t y l e [ t h i s . p r o p ]   = =   n u l l ) )   {   r e t u r n   t h i s . e l e m [ t h i s . p r o p ]   }   v a r   E   =   p a r s e F l o a t ( o . c s s ( t h i s . e l e m ,   t h i s . p r o p ,   F ) ) ;   r e t u r n   E   & &   E   >   - 1 0 0 0 0   ?   E   :   p a r s e F l o a t ( o . c u r C S S ( t h i s . e l e m ,   t h i s . p r o p ) )   | |   0   } ,   c u s t o m :   f u n c t i o n ( I ,   H ,   G )   {   t h i s . s t a r t T i m e   =   e ( ) ;   t h i s . s t a r t   =   I ;   t h i s . e n d   =   H ;   t h i s . u n i t   =   G   | |   t h i s . u n i t   | |   " p x " ;   t h i s . n o w   =   t h i s . s t a r t ;   t h i s . p o s   =   t h i s . s t a t e   =   0 ;   v a r   E   =   t h i s ;   f u n c t i o n   F ( J )   {   r e t u r n   E . s t e p ( J )   }   F . e l e m   =   t h i s . e l e m ;   i f   ( F ( )   & &   o . t i m e r s . p u s h ( F )   & &   ! n )   {   n   =   s e t I n t e r v a l ( f u n c t i o n ( )   {   v a r   K   =   o . t i m e r s ;   f o r   ( v a r   J   =   0 ;   J   <   K . l e n g t h ;   J + + )   {   i f   ( ! K [ J ] ( ) )   {   K . s p l i c e ( J - - ,   1 )   }   }   i f   ( ! K . l e n g t h )   {   c l e a r I n t e r v a l ( n ) ;   n   =   g   }   } ,   1 3 )   }   } ,   s h o w :   f u n c t i o n ( )   {   t h i s . o p t i o n s . o r i g [ t h i s . p r o p ]   =   o . a t t r ( t h i s . e l e m . s t y l e ,   t h i s . p r o p ) ;   t h i s . o p t i o n s . s h o w   =   t r u e ;   t h i s . c u s t o m ( t h i s . p r o p   = =   " w i d t h "   | |   t h i s . p r o p   = =   " h e i g h t "   ?   1   :   0 ,   t h i s . c u r ( ) ) ;   o ( t h i s . e l e m ) . s h o w ( )   } ,   h i d e :   f u n c t i o n ( )   {   t h i s . o p t i o n s . o r i g [ t h i s . p r o p ]   =   o . a t t r ( t h i s . e l e m . s t y l e ,   t h i s . p r o p ) ;   t h i s . o p t i o n s . h i d e   =   t r u e ;   t h i s . c u s t o m ( t h i s . c u r ( ) ,   0 )   } ,   s t e p :   f u n c t i o n ( H )   {   v a r   G   =   e ( ) ;   i f   ( H   | |   G   > =   t h i s . o p t i o n s . d u r a t i o n   +   t h i s . s t a r t T i m e )   {   t h i s . n o w   =   t h i s . e n d ;   t h i s . p o s   =   t h i s . s t a t e   =   1 ;   t h i s . u p d a t e ( ) ;   t h i s . o p t i o n s . c u r A n i m [ t h i s . p r o p ]   =   t r u e ;   v a r   E   =   t r u e ;   f o r   ( v a r   F   i n   t h i s . o p t i o n s . c u r A n i m )   {   i f   ( t h i s . o p t i o n s . c u r A n i m [ F ]   ! = =   t r u e )   {   E   =   f a l s e   }   }   i f   ( E )   {   i f   ( t h i s . o p t i o n s . d i s p l a y   ! =   n u l l )   {   t h i s . e l e m . s t y l e . o v e r f l o w   =   t h i s . o p t i o n s . o v e r f l o w ;   t h i s . e l e m . s t y l e . d i s p l a y   =   t h i s . o p t i o n s . d i s p l a y ;   i f   ( o . c s s ( t h i s . e l e m ,   " d i s p l a y " )   = =   " n o n e " )   {   t h i s . e l e m . s t y l e . d i s p l a y   =   " b l o c k "   }   }   i f   ( t h i s . o p t i o n s . h i d e )   {   o ( t h i s . e l e m ) . h i d e ( )   }   i f   ( t h i s . o p t i o n s . h i d e   | |   t h i s . o p t i o n s . s h o w )   {   f o r   ( v a r   I   i n   t h i s . o p t i o n s . c u r A n i m )   {   o . a t t r ( t h i s . e l e m . s t y l e ,   I ,   t h i s . o p t i o n s . o r i g [ I ] )   }   }   t h i s . o p t i o n s . c o m p l e t e . c a l l ( t h i s . e l e m )   }   r e t u r n   f a l s e   }   e l s e   {   v a r   J   =   G   -   t h i s . s t a r t T i m e ;   t h i s . s t a t e   =   J   /   t h i s . o p t i o n s . d u r a t i o n ;   t h i s . p o s   =   o . e a s i n g [ t h i s . o p t i o n s . e a s i n g   | |   ( o . e a s i n g . s w i n g   ?   " s w i n g "   :   " l i n e a r " ) ] ( t h i s . s t a t e ,   J ,   0 ,   1 ,   t h i s . o p t i o n s . d u r a t i o n ) ;   t h i s . n o w   =   t h i s . s t a r t   +   ( ( t h i s . e n d   -   t h i s . s t a r t )   *   t h i s . p o s ) ;   t h i s . u p d a t e ( )   }   r e t u r n   t r u e   }   } ;   o . e x t e n d ( o . f x ,   {   s p e e d s :   {   s l o w :   6 0 0 ,   f a s t :   2 0 0 ,   _ d e f a u l t :   4 0 0   } ,   s t e p :   {   o p a c i t y :   f u n c t i o n ( E )   {   o . a t t r ( E . e l e m . s t y l e ,   " o p a c i t y " ,   E . n o w )   } ,   _ d e f a u l t :   f u n c t i o n ( E )   {   i f   ( E . e l e m . s t y l e   & &   E . e l e m . s t y l e [ E . p r o p ]   ! =   n u l l )   {   E . e l e m . s t y l e [ E . p r o p ]   =   E . n o w   +   E . u n i t   }   e l s e   {   E . e l e m [ E . p r o p ]   =   E . n o w   }   }   }   } ) ;   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 . g e t B o u n d i n g C l i e n t R e c t )   {   o . f n . o f f s e t   =   f u n c t i o n ( )   {   i f   ( ! t h i s [ 0 ] )   {   r e t u r n   {   t o p :   0 ,   l e f t :   0 }   }   i f   ( t h i s [ 0 ]   = = =   t h i s [ 0 ] . o w n e r D o c u m e n t . b o d y )   {   r e t u r n   o . o f f s e t . b o d y O f f s e t ( t h i s [ 0 ] )   }   v a r   G   =   t h i s [ 0 ] . g e t B o u n d i n g C l i e n t R e c t ( ) ,   J   =   t h i s [ 0 ] . o w n e r D o c u m e n t ,   F   =   J . b o d y ,   E   =   J . d o c u m e n t E l e m e n t ,   L   =   E . c l i e n t T o p   | |   F . c l i e n t T o p   | |   0 ,   K   =   E . c l i e n t L e f t   | |   F . c l i e n t L e f t   | |   0 ,   I   =   G . t o p   +   ( s e l f . p a g e Y O f f s e t   | |   o . b o x M o d e l   & &   E . s c r o l l T o p   | |   F . s c r o l l T o p )   -   L ,   H   =   G . l e f t   +   ( s e l f . p a g e X O f f s e t   | |   o . b o x M o d e l   & &   E . s c r o l l L e f t   | |   F . s c r o l l L e f t )   -   K ;   r e t u r n   {   t o p :   I ,   l e f t :   H }   }   }   e l s e   {   o . f n . o f f s e t   =   f u n c t i o n ( )   {   i f   ( ! t h i s [ 0 ] )   {   r e t u r n   {   t o p :   0 ,   l e f t :   0 }   }   i f   ( t h i s [ 0 ]   = = =   t h i s [ 0 ] . o w n e r D o c u m e n t . b o d y )   {   r e t u r n   o . o f f s e t . b o d y O f f s e t ( t h i s [ 0 ] )   }   o . o f f s e t . i n i t i a l i z e d   | |   o . o f f s e t . i n i t i a l i z e ( ) ;   v a r   J   =   t h i s [ 0 ] ,   G   =   J . o f f s e t P a r e n t ,   F   =   J ,   O   =   J . o w n e r D o c u m e n t ,   M ,   H   =   O . d o c u m e n t E l e m e n t ,   K   =   O . b o d y ,   L   =   O . d e f a u l t V i e w ,   E   =   L . g e t C o m p u t e d S t y l e ( J ,   n u l l ) ,   N   =   J . o f f s e t T o p ,   I   =   J . o f f s e t L e f t ;   w h i l e   ( ( J   =   J . p a r e n t N o d e )   & &   J   ! = =   K   & &   J   ! = =   H )   {   M   =   L . g e t C o m p u t e d S t y l e ( J ,   n u l l ) ;   N   - =   J . s c r o l l T o p ,   I   - =   J . s c r o l l L e f t ;   i f   ( J   = = =   G )   {   N   + =   J . o f f s e t T o p ,   I   + =   J . o f f s e t L e f t ;   i f   ( o . o f f s e t . d o e s N o t A d d B o r d e r   & &   ! ( o . o f f s e t . d o e s A d d B o r d e r F o r T a b l e A n d C e l l s   & &   / ^ t ( a b l e | d | h ) $ / i . t e s t ( J . t a g N a m e ) ) )   {   N   + =   p a r s e I n t ( M . b o r d e r T o p W i d t h ,   1 0 )   | |   0 ,   I   + =   p a r s e I n t ( M . b o r d e r L e f t W i d t h ,   1 0 )   | |   0   }   F   =   G ,   G   =   J . o f f s e t P a r e n t   }   i f   ( o . o f f s e t . s u b t r a c t s B o r d e r F o r O v e r f l o w N o t V i s i b l e   & &   M . o v e r f l o w   ! = =   " v i s i b l e " )   {   N   + =   p a r s e I n t ( M . b o r d e r T o p W i d t h ,   1 0 )   | |   0 ,   I   + =   p a r s e I n t ( M . b o r d e r L e f t W i d t h ,   1 0 )   | |   0   }   E   =   M   }   i f   ( E . p o s i t i o n   = = =   " r e l a t i v e "   | |   E . p o s i t i o n   = = =   " s t a t i c " )   {   N   + =   K . o f f s e t T o p ,   I   + =   K . o f f s e t L e f t   }   i f   ( E . p o s i t i o n   = = =   " f i x e d " )   {   N   + =   M a t h . m a x ( H . s c r o l l T o p ,   K . s c r o l l T o p ) ,   I   + =   M a t h . m a x ( H . s c r o l l L e f t ,   K . s c r o l l L e f t )   }   r e t u r n   {   t o p :   N ,   l e f t :   I }   }   }   o . o f f s e t   =   {   i n i t i a l i z e :   f u n c t i o n ( )   {   i f   ( t h i s . i n i t i a l i z e d )   {   r e t u r n   }   v a r   L   =   d o c u m e n t . b o d y ,   F   =   d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ,   H ,   G ,   N ,   I ,   M ,   E ,   J   =   L . s t y l e . m a r g i n T o p ,   K   =   ' < d i v   s t y l e = " p o s i t i o n : a b s o l u t e ; t o p : 0 ; l e f t : 0 ; m a r g i n : 0 ; b o r d e r : 5 p x   s o l i d   # 0 0 0 ; p a d d i n g : 0 ; w i d t h : 1 p x ; h e i g h t : 1 p x ; " > < d i v > < / d i v > < / d i v > < t a b l e   s t y l e = " p o s i t i o n : a b s o l u t e ; t o p : 0 ; l e f t : 0 ; m a r g i n : 0 ; b o r d e r : 5 p x   s o l i d   # 0 0 0 ; p a d d i n g : 0 ; w i d t h : 1 p x ; h e i g h t : 1 p x ; "   c e l l p a d d i n g = " 0 "   c e l l s p a c i n g = " 0 " > < t r > < t d > < / t d > < / t r > < / t a b l e > ' ;   M   =   {   p o s i t i o n :   " a b s o l u t e " ,   t o p :   0 ,   l e f t :   0 ,   m a r g i n :   0 ,   b o r d e r :   0 ,   w i d t h :   " 1 p x " ,   h e i g h t :   " 1 p x " ,   v i s i b i l i t y :   " h i d d e n "   } ;   f o r   ( E   i n   M )   {   F . s t y l e [ E ]   =   M [ E ]   }   F . i n n e r H T M L   =   K ;   L . i n s e r t B e f o r e ( F ,   L . f i r s t C h i l d ) ;   H   =   F . f i r s t C h i l d ,   G   =   H . f i r s t C h i l d ,   I   =   H . n e x t S i b l i n g . f i r s t C h i l d . f i r s t C h i l d ;   t h i s . d o e s N o t A d d B o r d e r   =   ( G . o f f s e t T o p   ! = =   5 ) ;   t h i s . d o e s A d d B o r d e r F o r T a b l e A n d C e l l s   =   ( I . o f f s e t T o p   = = =   5 ) ;   H . s t y l e . o v e r f l o w   =   " h i d d e n " ,   H . s t y l e . p o s i t i o n   =   " r e l a t i v e " ;   t h i s . s u b t r a c t s B o r d e r F o r O v e r f l o w N o t V i s i b l e   =   ( G . o f f s e t T o p   = = =   - 5 ) ;   L . s t y l e . m a r g i n T o p   =   " 1 p x " ;   t h i s . d o e s N o t I n c l u d e M a r g i n I n B o d y O f f s e t   =   ( L . o f f s e t T o p   = = =   0 ) ;   L . s t y l e . m a r g i n T o p   =   J ;   L . r e m o v e C h i l d ( F ) ;   t h i s . i n i t i a l i z e d   =   t r u e   } ,   b o d y O f f s e t :   f u n c t i o n ( E )   {   o . o f f s e t . i n i t i a l i z e d   | |   o . o f f s e t . i n i t i a l i z e ( ) ;   v a r   G   =   E . o f f s e t T o p ,   F   =   E . o f f s e t L e f t ;   i f   ( o . o f f s e t . d o e s N o t I n c l u d e M a r g i n I n B o d y O f f s e t )   {   G   + =   p a r s e I n t ( o . c u r C S S ( E ,   " m a r g i n T o p " ,   t r u e ) ,   1 0 )   | |   0 ,   F   + =   p a r s e I n t ( o . c u r C S S ( E ,   " m a r g i n L e f t " ,   t r u e ) ,   1 0 )   | |   0   }   r e t u r n   {   t o p :   G ,   l e f t :   F }   }   } ;   o . f n . e x t e n d ( {   p o s i t i o n :   f u n c t i o n ( )   {   v a r   I   =   0 ,   H   =   0 ,   F ;   i f   ( t h i s [ 0 ] )   {   v a r   G   =   t h i s . o f f s e t P a r e n t ( ) ,   J   =   t h i s . o f f s e t ( ) ,   E   =   / ^ b o d y | h t m l $ / i . t e s t ( G [ 0 ] . t a g N a m e )   ?   {   t o p :   0 ,   l e f t :   0 }   :   G . o f f s e t ( ) ;   J . t o p   - =   j ( t h i s ,   " m a r g i n T o p " ) ;   J . l e f t   - =   j ( t h i s ,   " m a r g i n L e f t " ) ;   E . t o p   + =   j ( G ,   " b o r d e r T o p W i d t h " ) ;   E . l e f t   + =   j ( G ,   " b o r d e r L e f t W i d t h " ) ;   F   =   {   t o p :   J . t o p   -   E . t o p ,   l e f t :   J . l e f t   -   E . l e f t }   }   r e t u r n   F   } ,   o f f s e t P a r e n t :   f u n c t i o n ( )   {   v a r   E   =   t h i s [ 0 ] . o f f s e t P a r e n t   | |   d o c u m e n t . b o d y ;   w h i l e   ( E   & &   ( ! / ^ b o d y | h t m l $ / i . t e s t ( E . t a g N a m e )   & &   o . c s s ( E ,   " p o s i t i o n " )   = =   " s t a t i c " ) )   {   E   =   E . o f f s e t P a r e n t   }   r e t u r n   o ( E )   }   } ) ;   o . e a c h ( [ " L e f t " ,   " T o p " ] ,   f u n c t i o n ( F ,   E )   {   v a r   G   =   " s c r o l l "   +   E ;   o . f n [ G ]   =   f u n c t i o n ( H )   {   i f   ( ! t h i s [ 0 ] )   {   r e t u r n   n u l l   }   r e t u r n   H   ! = =   g   ?   t h i s . e a c h ( f u n c t i o n ( )   {   t h i s   = =   l   | |   t h i s   = =   d o c u m e n t   ?   l . s c r o l l T o ( ! F   ?   H   :   o ( l ) . s c r o l l L e f t ( ) ,   F   ?   H   :   o ( l ) . s c r o l l T o p ( ) )   :   t h i s [ G ]   =   H   } )   :   t h i s [ 0 ]   = =   l   | |   t h i s [ 0 ]   = =   d o c u m e n t   ?   s e l f [ F   ?   " p a g e Y O f f s e t "   :   " p a g e X O f f s e t " ]   | |   o . b o x M o d e l   & &   d o c u m e n t . d o c u m e n t E l e m e n t [ G ]   | |   d o c u m e n t . b o d y [ G ]   :   t h i s [ 0 ] [ G ]   }   } ) ;   o . e a c h ( [ " H e i g h t " ,   " W i d t h " ] ,   f u n c t i o n ( I ,   G )   {   v a r   E   =   I   ?   " L e f t "   :   " T o p " ,   H   =   I   ?   " R i g h t "   :   " B o t t o m " ,   F   =   G . t o L o w e r C a s e ( ) ;   o . f n [ " i n n e r "   +   G ]   =   f u n c t i o n ( )   {   r e t u r n   t h i s [ 0 ]   ?   o . c s s ( t h i s [ 0 ] ,   F ,   f a l s e ,   " p a d d i n g " )   :   n u l l   } ;   o . f n [ " o u t e r "   +   G ]   =   f u n c t i o n ( K )   {   r e t u r n   t h i s [ 0 ]   ?   o . c s s ( t h i s [ 0 ] ,   F ,   f a l s e ,   K   ?   " m a r g i n "   :   " b o r d e r " )   :   n u l l   } ;   v a r   J   =   G . t o L o w e r C a s e ( ) ;   o . f n [ J ]   =   f u n c t i o n ( K )   {   r e t u r n   t h i s [ 0 ]   = =   l   ?   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 "   & &   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 "   +   G ]   | |   d o c u m e n t . b o d y [ " c l i e n t "   +   G ]   :   t h i s [ 0 ]   = =   d o c u m e n t   ?   M a t h . m a x ( 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 "   +   G ] ,   d o c u m e n t . b o d y [ " s c r o l l "   +   G ] ,   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 "   +   G ] ,   d o c u m e n t . b o d y [ " o f f s e t "   +   G ] ,   d o c u m e n t . d o c u m e n t E l e m e n t [ " o f f s e t "   +   G ] )   :   K   = = =   g   ?   ( t h i s . l e n g t h   ?   o . c s s ( t h i s [ 0 ] ,   J )   :   n u l l )   :   t h i s . c s s ( J ,   t y p e o f   K   = = =   " s t r i n g "   ?   K   :   K   +   " p x " )   }   } )  
 } ) ( ) ;  
  
  
  
  
 / / m e n u   A c c o r d i o n  
 / / a u t h o r :   M a r g h o o b   S u l e m a n  
 / / D a t e :   0 5 t h   A u g ,   2 0 0 9  
 / / V e r s i o n :   1 . 0  
 / / w e b :   w w w . g i f t l e l o . c o m   |   w w w . m a r g h o o b s u l e m a n . c o m  
 ; ( f u n c t i o n ( $ ) {  
 	 $ . f n . m s A c c o r d i o n   =   f u n c t i o n ( o p t i o n s )   {  
 	 	 o p t i o n s   =   $ . e x t e n d ( {  
 	 	 	 	 	 c u r r e n t D i v : ' 1 ' ,  
 	 	 	 	 	 p r e v i o u s D i v : ' ' ,  
 	 	 	 	 	 v e r t i c a l :   f a l s e ,  
 	 	 	 	 	 d e f a u l t i d : 0 ,  
 	 	 	 	 	 c u r r e n t c o u n t e r : 0 ,  
 	 	 	 	 	 i n t e r v a l i d : 0 ,  
 	 	 	 	 	 a u t o d e l a y : 0 ,  
 	 	 	 	 	 e v e n t : " c l i c k " ,  
 	 	 	 	 	 a l l d i v s _ a r r a y : n e w   A r r a y ( )  
 	 	 	 } ,   o p t i o n s ) ;  
 	 	 $ ( t h i s ) . a d d C l a s s ( " a c c o r d i o n W r a p p e r " ) ;  
 	 	 $ ( t h i s ) . c s s ( { o v e r f l o w : " h i d d e n " } ) ;  
 	 	 / / a l e r t ( t h i s ) ;  
 	 	 v a r   e l e m e n t i d   =   $ ( t h i s ) . a t t r ( " i d " ) ;  
 	 	 v a r   a l l D i v s   =   t h i s . c h i l d r e n ( ) ;  
 	 	 i f ( o p t i o n s . a u t o d e l a y > 0 )     {  
 	 	 	 $ ( " # " +   e l e m e n t i d   + "   >   d i v " ) . b i n d ( " m o u s e e n t e r " ,   f u n c t i o n ( ) {  
 	 	 	 	 	 	 	 	 	 	 	 	 	 	       p a u s e ( ) ;  
 	 	 	 	 	 	 	 	 	 	 	 	 	 	       } ) ;  
 	 	 	 $ ( " # " +   e l e m e n t i d   + "   >   d i v " ) . b i n d ( " m o u s e l e a v e " ,   f u n c t i o n ( ) {  
 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	     s t a r t P l a y ( ) ;  
 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	     } ) ;  
 	 	 }  
 	 	 / / s e t   i d s  
 	 	 a l l D i v s . e a c h ( f u n c t i o n ( c u r r e n t )   {  
 	 	 	 	 	 	 	 	   v a r   i C u r r e n t   =   c u r r e n t ;  
 	 	 	 	 	 	 	 	   v a r   s T i t l e I D   =   e l e m e n t i d + " _ m s T i t l e _ " + ( i C u r r e n t ) ;  
 	 	 	 	 	 	 	 	   v a r   s C o n t e n t I D   =   s T i t l e I D + " _ m s C o n t e n t _ " + ( i C u r r e n t ) ;  
 	 	 	 	 	 	 	 	   v a r   c u r r e n t D i v   =   a l l D i v s [ i C u r r e n t ] ;  
 	 	 	 	 	 	 	 	   v a r   t o t a l C h i l d   =   c u r r e n t D i v . c h i l d N o d e s . l e n g t h ;  
 	 	 	 	 	 	 	 	   v a r   t i t l e D i v   =   $ ( c u r r e n t D i v ) . f i n d ( " d i v . t i t l e " ) ;  
 	 	 	 	 	 	 	 	   t i t l e D i v . a t t r ( " i d " ,   s T i t l e I D ) ;  
 	 	 	 	 	 	 	 	   v a r   c o n t e n t D i v   =   $ ( c u r r e n t D i v ) . f i n d ( " d i v . c o n t e n t " ) ;  
 	 	 	 	 	 	 	 	   c o n t e n t D i v . a t t r ( " i d " ,   s C o n t e n t I D ) ;  
 	 	 	 	 	 	 	 	   o p t i o n s . a l l d i v s _ a r r a y . p u s h ( s T i t l e I D ) ;  
 	 	 	 	 	 	 	 	   / / $ ( " # " + s T i t l e I D ) . c l i c k ( f u n c t i o n ( ) { o p e n M e ( s T i t l e I D ) ; } ) ;  
 	 	 	 	 	 	 	 	   $ ( " # " + s T i t l e I D ) . b i n d ( o p t i o n s . e v e n t ,   f u n c t i o n ( ) { p a u s e ( ) ; o p e n M e ( s T i t l e I D ) ; } ) ;  
 	 	 	 	 	 	 	 	   } ) ;  
 	 	  
 	 	 / / m a k e   v e r t i c a l  
 	 	 i f ( o p t i o n s . v e r t i c a l )   { m a k e V e r t i c a l ( ) ; } ;  
 	 	 / / o p e n   d e f a u l t  
 	 	 o p e n M e ( e l e m e n t i d + " _ m s T i t l e _ " + o p t i o n s . d e f a u l t i d ) ;  
 	 	 i f ( o p t i o n s . a u t o d e l a y > 0 )   { s t a r t P l a y ( ) ; } ;  
 	 	 / / a l e r t ( a l l D i v s . l e n g t h ) ;  
 	 	 f u n c t i o n   o p e n M e ( i d )   {  
 	 	 	 v a r   s T i t l e I D   =   i d ;  
 	 	 	 v a r   i C u r r e n t   =   s T i t l e I D . s p l i t ( " _ " ) [ s T i t l e I D . s p l i t ( " _ " ) . l e n g t h - 1 ] ;  
 	 	 	 o p t i o n s . c u r r e n t c o u n t e r   =   i C u r r e n t ;  
 	 	 	 v a r   s C o n t e n t I D   =   i d + " _ m s C o n t e n t _ " + i C u r r e n t ;  
 	 	 	 i f ( $ ( " # " + s C o n t e n t I D ) . c s s ( " d i s p l a y " ) = = " n o n e " )   {  
 	 	 	 	 i f ( o p t i o n s . p r e v i o u s D i v ! = " " )   {  
 	 	 	 	 	 c l o s e M e ( o p t i o n s . p r e v i o u s D i v ) ;  
 	 	 	 	 } ;  
 	 	 	 	 i f ( o p t i o n s . v e r t i c a l )   {  
 	 	 	 	 	 $ ( " # " + s C o n t e n t I D ) . s l i d e D o w n ( " s l o w " ) ;  
 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 $ ( " # " + s C o n t e n t I D ) . s h o w ( " s l o w " ) ;  
 	 	 	 	 }  
 	 	 	 	 o p t i o n s . c u r r e n t D i v   =   s C o n t e n t I D ;  
 	 	 	 	 o p t i o n s . p r e v i o u s D i v   =   o p t i o n s . c u r r e n t D i v ;  
 	 	 	 } ;  
 	 	 } ;  
 	 	 f u n c t i o n   c l o s e M e ( d i v )   {  
 	 	 	 i f ( o p t i o n s . v e r t i c a l )   {  
 	 	 	 	 $ ( " # " + d i v ) . s l i d e U p ( " s l o w " ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 $ ( " # " + d i v ) . h i d e ( " s l o w " ) ;  
 	 	 	 } ;  
 	 	 } ; 	  
 	 	 f u n c t i o n   m a k e V e r t i c a l ( )   {  
 	 	 	 $ ( " # " + e l e m e n t i d   + "   >   d i v " ) . c s s ( { d i s p l a y : " b l o c k " ,   f l o a t : " n o n e " ,   c l e a r : " b o t h " } ) ;  
 	 	 	 $ ( " # " + e l e m e n t i d   + "   >   d i v   >   d i v . t i t l e " ) . c s s ( { d i s p l a y : " b l o c k " ,   f l o a t : " n o n e " ,   c l e a r : " b o t h " } ) ;  
 	 	 	 $ ( " # " + e l e m e n t i d   + "   >   d i v   >   d i v . c o n t e n t " ) . c s s ( { c l e a r : " b o t h " } ) ;  
 	 	 } ;  
 	 	 f u n c t i o n   s t a r t P l a y ( )   {  
 	 	 	 o p t i o n s . i n t e r v a l i d   =   w i n d o w . s e t I n t e r v a l ( p l a y ,   o p t i o n s . a u t o d e l a y * 1 0 0 0 ) ;  
 	 	 } ;  
 	 	 f u n c t i o n   p l a y ( )   {  
 	 	 	 v a r   s T i t l e I d   =   o p t i o n s . a l l d i v s _ a r r a y [ o p t i o n s . c u r r e n t c o u n t e r ] ;  
 	 	 	 o p e n M e ( s T i t l e I d ) ;  
 	 	 	 o p t i o n s . c u r r e n t c o u n t e r + + ;  
 	 	 	 i f ( o p t i o n s . c u r r e n t c o u n t e r = = o p t i o n s . a l l d i v s _ a r r a y . l e n g t h )   o p t i o n s . c u r r e n t c o u n t e r   =   0 ;  
 	 	 } ;  
 	 	 f u n c t i o n   p a u s e ( )   {  
 	 	 	 w i n d o w . c l e a r I n t e r v a l ( o p t i o n s . i n t e r v a l i d ) ;  
 	 	 } ;  
 	 	 }  
 } ) ( j Q u e r y ) ;  
  
  
 / * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -    
   *   j Q u e r y   p l u g i n :   c u s t o m I n p u t ( )  
   *   b y   M a g g i e   W a c h s   a n d   S c o t t   J e h l ,   h t t p : / / w w w . f i l a m e n t g r o u p . c o m  
   *   C o p y r i g h t   ( c )   2 0 0 9   F i l a m e n t   G r o u p  
   *   D u a l   l i c e n s e d   u n d e r   t h e   M I T   ( f i l a m e n t g r o u p . c o m / e x a m p l e s / m i t - l i c e n s e . t x t )   a n d   G P L   ( f i l a m e n t g r o u p . c o m / e x a m p l e s / g p l - l i c e n s e . t x t )   l i c e n s e s .  
   *   A r t i c l e :   h t t p : / / w w w . f i l a m e n t g r o u p . c o m / l a b / a c c e s s i b l e _ c u s t o m _ d e s i g n e d _ c h e c k b o x _ r a d i o _ b u t t o n _ i n p u t s _ s t y l e d _ c s s _ j q u e r y /      
   *   U s a g e   e x a m p l e   b e l o w   ( s e e   c o m m e n t   " R u n   t h e   s c r i p t . . . " ) .  
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * /  
  
  
 ( f u n c t i o n ( $ ) {  
 $ . f n . c u s t o m I n p u t   =   f u n c t i o n ( ) {  
 	 $ ( t h i s ) . e a c h ( f u n c t i o n ( i ) { 	  
 	 	 i f ( $ ( t h i s ) . i s ( ' [ t y p e = c h e c k b o x ] , [ t y p e = r a d i o ] ' ) ) {  
 	 	 	 v a r   i n p u t   =   $ ( t h i s ) ;  
 	 	 	  
 	 	 	 / /   g e t   t h e   a s s o c i a t e d   l a b e l   u s i n g   t h e   i n p u t ' s   i d  
 	 	 	 v a r   l a b e l   =   $ ( ' l a b e l [ f o r = ' + i n p u t . a t t r ( ' i d ' ) + ' ] ' ) ;  
 	 	 	  
 	 	 	 / / g e t   t y p e ,   f o r   c l a s s n a m e   s u f f i x    
 	 	 	 v a r   i n p u t T y p e   =   ( i n p u t . i s ( ' [ t y p e = c h e c k b o x ] ' ) )   ?   ' c h e c k b o x '   :   ' r a d i o ' ;  
 	 	 	  
 	 	 	 / /   w r a p   t h e   i n p u t   +   l a b e l   i n   a   d i v    
 	 	 	 $ ( ' < d i v   c l a s s = " c u s t o m - ' +   i n p u t T y p e   + ' " > < / d i v > ' ) . i n s e r t B e f o r e ( i n p u t ) . a p p e n d ( i n p u t ,   l a b e l ) ;  
 	 	 	  
 	 	 	 / /   f i n d   a l l   i n p u t s   i n   t h i s   s e t   u s i n g   t h e   s h a r e d   n a m e   a t t r i b u t e  
 	 	 	 v a r   a l l I n p u t s   =   $ ( ' i n p u t [ n a m e = ' + i n p u t . a t t r ( ' n a m e ' ) + ' ] ' ) ;  
 	 	 	  
 	 	 	 / /   n e c e s s a r y   f o r   b r o w s e r s   t h a t   d o n ' t   s u p p o r t   t h e   : h o v e r   p s e u d o   c l a s s   o n   l a b e l s  
 	 	 	 l a b e l . h o v e r (  
 	 	 	 	 f u n c t i o n ( ) {    
 	 	 	 	 	 $ ( t h i s ) . a d d C l a s s ( ' h o v e r ' ) ;    
 	 	 	 	 	 i f ( i n p u t T y p e   = =   ' c h e c k b o x '   & &   i n p u t . i s ( ' : c h e c k e d ' ) ) {    
 	 	 	 	 	 	 $ ( t h i s ) . a d d C l a s s ( ' c h e c k e d H o v e r ' ) ;    
 	 	 	 	 	 }    
 	 	 	 	 } ,  
 	 	 	 	 f u n c t i o n ( ) {   $ ( t h i s ) . r e m o v e C l a s s ( ' h o v e r   c h e c k e d H o v e r ' ) ;   }  
 	 	 	 ) ;  
 	 	 	  
 	 	 	 / / b i n d   c u s t o m   e v e n t ,   t r i g g e r   i t ,   b i n d   c l i c k , f o c u s , b l u r   e v e n t s 	 	 	 	 	  
 	 	 	 i n p u t . b i n d ( ' u p d a t e S t a t e ' ,   f u n c t i o n ( ) { 	  
 	 	 	 	 i f   ( i n p u t . i s ( ' : c h e c k e d ' ) )   {  
 	 	 	 	 	 i f   ( i n p u t . i s ( ' : r a d i o ' ) )   { 	 	 	 	  
 	 	 	 	 	 	 a l l I n p u t s . e a c h ( f u n c t i o n ( ) {  
 	 	 	 	 	 	 	 $ ( ' l a b e l [ f o r = ' + $ ( t h i s ) . a t t r ( ' i d ' ) + ' ] ' ) . r e m o v e C l a s s ( ' c h e c k e d ' ) ;  
 	 	 	 	 	 	 } ) ; 	 	  
 	 	 	 	 	 } ;  
 	 	 	 	 	 l a b e l . a d d C l a s s ( ' c h e c k e d ' ) ;  
 	 	 	 	 }  
 	 	 	 	 e l s e   {   l a b e l . r e m o v e C l a s s ( ' c h e c k e d   c h e c k e d H o v e r   c h e c k e d F o c u s ' ) ;   }  
 	 	 	 	 	 	 	 	 	 	  
 	 	 	 } )  
 	 	 	 . t r i g g e r ( ' u p d a t e S t a t e ' )  
 	 	 	 . c l i c k ( f u n c t i o n ( ) {    
 	 	 	 	 $ ( t h i s ) . t r i g g e r ( ' u p d a t e S t a t e ' ) ;    
 	 	 	 } )  
 	 	 	 . f o c u s ( f u n c t i o n ( ) {    
 	 	 	 	 l a b e l . a d d C l a s s ( ' f o c u s ' ) ;    
 	 	 	 	 i f ( i n p u t T y p e   = =   ' c h e c k b o x '   & &   i n p u t . i s ( ' : c h e c k e d ' ) ) {    
 	 	 	 	 	 $ ( t h i s ) . a d d C l a s s ( ' c h e c k e d F o c u s ' ) ;    
 	 	 	 	 }    
 	 	 	 } )  
 	 	 	 . b l u r ( f u n c t i o n ( ) {   l a b e l . r e m o v e C l a s s ( ' f o c u s   c h e c k e d F o c u s ' ) ;   } ) ;  
 	 	 }  
 	 } ) ;  
 }  
 } ) ( j Q u e r y ) ;  
  
  
 / *  
   *   j Q u e r y   E a s i n g   v 1 . 3   -   h t t p : / / g s g d . c o . u k / s a n d b o x / j q u e r y / e a s i n g /  
   *  
   *   U s e s   t h e   b u i l t   i n   e a s i n g   c a p a b i l i t i e s   a d d e d   I n   j Q u e r y   1 . 1  
   *   t o   o f f e r   m u l t i p l e   e a s i n g   o p t i o n s  
   *  
    
 * /  
  
 / /   t :   c u r r e n t   t i m e ,   b :   b e g I n n I n g   v a l u e ,   c :   c h a n g e   I n   v a l u e ,   d :   d u r a t i o n  
 j Q u e r y . e a s i n g [ ' j s w i n g ' ]   =   j Q u e r y . e a s i n g [ ' s w i n g ' ] ;  
  
 j Q u e r y . e x t e n d (   j Q u e r y . e a s i n g ,  
 {  
 	 d e f :   ' e a s e O u t Q u a d ' ,  
 	 s w i n g :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 / / a l e r t ( j Q u e r y . e a s i n g . d e f a u l t ) ;  
 	 	 r e t u r n   j Q u e r y . e a s i n g [ j Q u e r y . e a s i n g . d e f ] ( x ,   t ,   b ,   c ,   d ) ;  
 	 } ,  
 	 e a s e I n Q u a d :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   c * ( t / = d ) * t   +   b ;  
 	 } ,  
 	 e a s e O u t Q u a d :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   - c   * ( t / = d ) * ( t - 2 )   +   b ;  
 	 } ,  
 	 e a s e I n O u t Q u a d :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 i f   ( ( t / = d / 2 )   <   1 )   r e t u r n   c / 2 * t * t   +   b ;  
 	 	 r e t u r n   - c / 2   *   ( ( - - t ) * ( t - 2 )   -   1 )   +   b ;  
 	 } ,  
 	 e a s e I n C u b i c :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   c * ( t / = d ) * t * t   +   b ;  
 	 } ,  
 	 e a s e O u t C u b i c :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   c * ( ( t = t / d - 1 ) * t * t   +   1 )   +   b ;  
 	 } ,  
 	 e a s e I n O u t C u b i c :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 i f   ( ( t / = d / 2 )   <   1 )   r e t u r n   c / 2 * t * t * t   +   b ;  
 	 	 r e t u r n   c / 2 * ( ( t - = 2 ) * t * t   +   2 )   +   b ;  
 	 } ,  
 	 e a s e I n Q u a r t :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   c * ( t / = d ) * t * t * t   +   b ;  
 	 } ,  
 	 e a s e O u t Q u a r t :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   - c   *   ( ( t = t / d - 1 ) * t * t * t   -   1 )   +   b ;  
 	 } ,  
 	 e a s e I n O u t Q u a r t :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 i f   ( ( t / = d / 2 )   <   1 )   r e t u r n   c / 2 * t * t * t * t   +   b ;  
 	 	 r e t u r n   - c / 2   *   ( ( t - = 2 ) * t * t * t   -   2 )   +   b ;  
 	 } ,  
 	 e a s e I n Q u i n t :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   c * ( t / = d ) * t * t * t * t   +   b ;  
 	 } ,  
 	 e a s e O u t Q u i n t :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   c * ( ( t = t / d - 1 ) * t * t * t * t   +   1 )   +   b ;  
 	 } ,  
 	 e a s e I n O u t Q u i n t :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 i f   ( ( t / = d / 2 )   <   1 )   r e t u r n   c / 2 * t * t * t * t * t   +   b ;  
 	 	 r e t u r n   c / 2 * ( ( t - = 2 ) * t * t * t * t   +   2 )   +   b ;  
 	 } ,  
 	 e a s e I n S i n e :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   - c   *   M a t h . c o s ( t / d   *   ( M a t h . P I / 2 ) )   +   c   +   b ;  
 	 } ,  
 	 e a s e O u t S i n e :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   c   *   M a t h . s i n ( t / d   *   ( M a t h . P I / 2 ) )   +   b ;  
 	 } ,  
 	 e a s e I n O u t S i n e :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   - c / 2   *   ( M a t h . c o s ( M a t h . P I * t / d )   -   1 )   +   b ;  
 	 } ,  
 	 e a s e I n E x p o :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   ( t = = 0 )   ?   b   :   c   *   M a t h . p o w ( 2 ,   1 0   *   ( t / d   -   1 ) )   +   b ;  
 	 } ,  
 	 e a s e O u t E x p o :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   ( t = = d )   ?   b + c   :   c   *   ( - M a t h . p o w ( 2 ,   - 1 0   *   t / d )   +   1 )   +   b ;  
 	 } ,  
 	 e a s e I n O u t E x p o :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 i f   ( t = = 0 )   r e t u r n   b ;  
 	 	 i f   ( t = = d )   r e t u r n   b + c ;  
 	 	 i f   ( ( t / = d / 2 )   <   1 )   r e t u r n   c / 2   *   M a t h . p o w ( 2 ,   1 0   *   ( t   -   1 ) )   +   b ;  
 	 	 r e t u r n   c / 2   *   ( - M a t h . p o w ( 2 ,   - 1 0   *   - - t )   +   2 )   +   b ;  
 	 } ,  
 	 e a s e I n C i r c :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   - c   *   ( M a t h . s q r t ( 1   -   ( t / = d ) * t )   -   1 )   +   b ;  
 	 } ,  
 	 e a s e O u t C i r c :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   c   *   M a t h . s q r t ( 1   -   ( t = t / d - 1 ) * t )   +   b ;  
 	 } ,  
 	 e a s e I n O u t C i r c :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 i f   ( ( t / = d / 2 )   <   1 )   r e t u r n   - c / 2   *   ( M a t h . s q r t ( 1   -   t * t )   -   1 )   +   b ;  
 	 	 r e t u r n   c / 2   *   ( M a t h . s q r t ( 1   -   ( t - = 2 ) * t )   +   1 )   +   b ;  
 	 } ,  
 	 e a s e I n E l a s t i c :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 v a r   s = 1 . 7 0 1 5 8 ; v a r   p = 0 ; v a r   a = c ;  
 	 	 i f   ( t = = 0 )   r e t u r n   b ;     i f   ( ( t / = d ) = = 1 )   r e t u r n   b + c ;     i f   ( ! p )   p = d * . 3 ;  
 	 	 i f   ( a   <   M a t h . a b s ( c ) )   {   a = c ;   v a r   s = p / 4 ;   }  
 	 	 e l s e   v a r   s   =   p / ( 2 * M a t h . P I )   *   M a t h . a s i n   ( c / a ) ;  
 	 	 r e t u r n   - ( a * M a t h . p o w ( 2 , 1 0 * ( t - = 1 ) )   *   M a t h . s i n (   ( t * d - s ) * ( 2 * M a t h . P I ) / p   ) )   +   b ;  
 	 } ,  
 	 e a s e O u t E l a s t i c :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 v a r   s = 1 . 7 0 1 5 8 ; v a r   p = 0 ; v a r   a = c ;  
 	 	 i f   ( t = = 0 )   r e t u r n   b ;     i f   ( ( t / = d ) = = 1 )   r e t u r n   b + c ;     i f   ( ! p )   p = d * . 3 ;  
 	 	 i f   ( a   <   M a t h . a b s ( c ) )   {   a = c ;   v a r   s = p / 4 ;   }  
 	 	 e l s e   v a r   s   =   p / ( 2 * M a t h . P I )   *   M a t h . a s i n   ( c / a ) ;  
 	 	 r e t u r n   a * M a t h . p o w ( 2 , - 1 0 * t )   *   M a t h . s i n (   ( t * d - s ) * ( 2 * M a t h . P I ) / p   )   +   c   +   b ;  
 	 } ,  
 	 e a s e I n O u t E l a s t i c :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 v a r   s = 1 . 7 0 1 5 8 ; v a r   p = 0 ; v a r   a = c ;  
 	 	 i f   ( t = = 0 )   r e t u r n   b ;     i f   ( ( t / = d / 2 ) = = 2 )   r e t u r n   b + c ;     i f   ( ! p )   p = d * ( . 3 * 1 . 5 ) ;  
 	 	 i f   ( a   <   M a t h . a b s ( c ) )   {   a = c ;   v a r   s = p / 4 ;   }  
 	 	 e l s e   v a r   s   =   p / ( 2 * M a t h . P I )   *   M a t h . a s i n   ( c / a ) ;  
 	 	 i f   ( t   <   1 )   r e t u r n   - . 5 * ( a * M a t h . p o w ( 2 , 1 0 * ( t - = 1 ) )   *   M a t h . s i n (   ( t * d - s ) * ( 2 * M a t h . P I ) / p   ) )   +   b ;  
 	 	 r e t u r n   a * M a t h . p o w ( 2 , - 1 0 * ( t - = 1 ) )   *   M a t h . s i n (   ( t * d - s ) * ( 2 * M a t h . P I ) / p   ) * . 5   +   c   +   b ;  
 	 } ,  
 	 e a s e I n B a c k :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d ,   s )   {  
 	 	 i f   ( s   = =   u n d e f i n e d )   s   =   1 . 7 0 1 5 8 ;  
 	 	 r e t u r n   c * ( t / = d ) * t * ( ( s + 1 ) * t   -   s )   +   b ;  
 	 } ,  
 	 e a s e O u t B a c k :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d ,   s )   {  
 	 	 i f   ( s   = =   u n d e f i n e d )   s   =   1 . 7 0 1 5 8 ;  
 	 	 r e t u r n   c * ( ( t = t / d - 1 ) * t * ( ( s + 1 ) * t   +   s )   +   1 )   +   b ;  
 	 } ,  
 	 e a s e I n O u t B a c k :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d ,   s )   {  
 	 	 i f   ( s   = =   u n d e f i n e d )   s   =   1 . 7 0 1 5 8 ;    
 	 	 i f   ( ( t / = d / 2 )   <   1 )   r e t u r n   c / 2 * ( t * t * ( ( ( s * = ( 1 . 5 2 5 ) ) + 1 ) * t   -   s ) )   +   b ;  
 	 	 r e t u r n   c / 2 * ( ( t - = 2 ) * t * ( ( ( s * = ( 1 . 5 2 5 ) ) + 1 ) * t   +   s )   +   2 )   +   b ;  
 	 } ,  
 	 e a s e I n B o u n c e :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 r e t u r n   c   -   j Q u e r y . e a s i n g . e a s e O u t B o u n c e   ( x ,   d - t ,   0 ,   c ,   d )   +   b ;  
 	 } ,  
 	 e a s e O u t B o u n c e :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 i f   ( ( t / = d )   <   ( 1 / 2 . 7 5 ) )   {  
 	 	 	 r e t u r n   c * ( 7 . 5 6 2 5 * t * t )   +   b ;  
 	 	 }   e l s e   i f   ( t   <   ( 2 / 2 . 7 5 ) )   {  
 	 	 	 r e t u r n   c * ( 7 . 5 6 2 5 * ( t - = ( 1 . 5 / 2 . 7 5 ) ) * t   +   . 7 5 )   +   b ;  
 	 	 }   e l s e   i f   ( t   <   ( 2 . 5 / 2 . 7 5 ) )   {  
 	 	 	 r e t u r n   c * ( 7 . 5 6 2 5 * ( t - = ( 2 . 2 5 / 2 . 7 5 ) ) * t   +   . 9 3 7 5 )   +   b ;  
 	 	 }   e l s e   {  
 	 	 	 r e t u r n   c * ( 7 . 5 6 2 5 * ( t - = ( 2 . 6 2 5 / 2 . 7 5 ) ) * t   +   . 9 8 4 3 7 5 )   +   b ;  
 	 	 }  
 	 } ,  
 	 e a s e I n O u t B o u n c e :   f u n c t i o n   ( x ,   t ,   b ,   c ,   d )   {  
 	 	 i f   ( t   <   d / 2 )   r e t u r n   j Q u e r y . e a s i n g . e a s e I n B o u n c e   ( x ,   t * 2 ,   0 ,   c ,   d )   *   . 5   +   b ;  
 	 	 r e t u r n   j Q u e r y . e a s i n g . e a s e O u t B o u n c e   ( x ,   t * 2 - d ,   0 ,   c ,   d )   *   . 5   +   c * . 5   +   b ;  
 	 }  
 } ) ;  
  
  
  
 / *  
 	 K w i c k s   f o r   j Q u e r y   ( v e r s i o n   1 . 5 . 1 )  
 	 C o p y r i g h t   ( c )   2 0 0 8   J e r e m y   M a r t i n  
 	 h t t p : / / w w w . j e r e m y m a r t i n . n a m e / p r o j e c t s . p h p ? p r o j e c t = k w i c k s  
 	  
 	 L i c e n 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  
  
 	 A n y   a n d   a l l   u s e   o f   t h i s   s c r i p t   m u s t   b e   a c c o m p a n i e d   b y   t h i s   c o p y r i g h t / l i c e n s e   n o t i c e   i n   i t s   p r e s e n t   f o r m .  
 * /  
  
 ( f u n c t i o n ( $ ) {  
 	 $ . f n . k w i c k s   =   f u n c t i o n ( o p t i o n s )   {  
 	 	 v a r   d e f a u l t s   =   {  
 	 	 	 i s V e r t i c a l :   f a l s e ,  
 	 	 	 s t i c k y :   f a l s e ,  
 	 	 	 d e f a u l t K w i c k :   0 ,  
 	 	 	 e v e n t :   ' m o u s e o v e r ' ,  
 	 	 	 s p a c i n g :   0 ,  
 	 	 	 d u r a t i o n :   5 0 0  
 	 	 } ;  
 	 	 v a r   o   =   $ . e x t e n d ( d e f a u l t s ,   o p t i o n s ) ;  
 	 	 v a r   W o H   =   ( o . i s V e r t i c a l   ?   ' h e i g h t '   :   ' w i d t h ' ) ;   / /   W o H   =   W i d t h   o r   H e i g h t  
 	 	 v a r   L o T   =   ( o . i s V e r t i c a l   ?   ' t o p '   :   ' l e f t ' ) ;   / /   L o T   =   L e f t   o r   T o p  
 	 	  
 	 	 r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {  
 	 	 	 c o n t a i n e r   =   $ ( t h i s ) ;  
 	 	 	 v a r   k w i c k s   =   c o n t a i n e r . c h i l d r e n ( ' l i ' ) ;  
 	 	 	 v a r   n o r m W o H   =   k w i c k s . e q ( 0 ) . c s s ( W o H ) . r e p l a c e ( / p x / , ' ' ) ;   / /   n o r m W o H   =   N o r m a l   W i d t h   o r   H e i g h t  
 	 	 	 i f ( ! o . m a x )   {  
 	 	 	 	 o . m a x   =   ( n o r m W o H   *   k w i c k s . s i z e ( ) )   -   ( o . m i n   *   ( k w i c k s . s i z e ( )   -   1 ) ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 o . m i n   =   ( ( n o r m W o H   *   k w i c k s . s i z e ( ) )   -   o . m a x )   /   ( k w i c k s . s i z e ( )   -   1 ) ;  
 	 	 	 }  
 	 	 	 / /   s e t   w i d t h   o f   c o n t a i n e r   u l  
 	 	 	 i f ( o . i s V e r t i c a l )   {  
 	 	 	 	 c o n t a i n e r . c s s ( {  
 	 	 	 	 	 w i d t h   :   k w i c k s . e q ( 0 ) . c s s ( ' w i d t h ' ) ,  
 	 	 	 	 	 h e i g h t   :   ( n o r m W o H   *   k w i c k s . s i z e ( ) )   +   ( o . s p a c i n g   *   ( k w i c k s . s i z e ( )   -   1 ) )   +   ' p x '  
 	 	 	 	 } ) ; 	 	 	 	  
 	 	 	 }   e l s e   {  
 	 	 	 	 c o n t a i n e r . c s s ( {  
 	 	 	 	 	 w i d t h   :   ( n o r m W o H   *   k w i c k s . s i z e ( ) )   +   ( o . s p a c i n g   *   ( k w i c k s . s i z e ( )   -   1 ) )   +   ' p x ' ,  
 	 	 	 	 	 h e i g h t   :   k w i c k s . e q ( 0 ) . c s s ( ' h e i g h t ' )  
 	 	 	 	 } ) ; 	 	 	 	  
 	 	 	 }  
  
 	 	 	 / /   p r e   c a l c u l a t e   l e f t   o r   t o p   v a l u e s   f o r   a l l   k w i c k s   b u t   t h e   f i r s t   a n d   l a s t  
 	 	 	 / /   i   =   i n d e x   o f   c u r r e n t l y   h o v e r e d   k w i c k ,   j   =   i n d e x   o f   k w i c k   w e ' r e   c a l c u l a t i n g  
 	 	 	 v a r   p r e C a l c L o T s   =   [ ] ;   / /   p r e C a l c L o T s   =   p r e - c a l c u l a t e d   L e f t   o r   T o p ' s  
 	 	 	 f o r ( i   =   0 ;   i   <   k w i c k s . s i z e ( ) ;   i + + )   {  
 	 	 	 	 p r e C a l c L o T s [ i ]   =   [ ] ;  
 	 	 	 	 / /   d o n ' t   n e e d   t o   c a l c u l a t e   v a l u e s   f o r   f i r s t   o r   l a s t   k w i c k  
 	 	 	 	 f o r ( j   =   1 ;   j   <   k w i c k s . s i z e ( )   -   1 ;   j + + )   {  
 	 	 	 	 	 i f ( i   = =   j )   {  
 	 	 	 	 	 	 p r e C a l c L o T s [ i ] [ j ]   =   o . i s V e r t i c a l   ?   j   *   o . m i n   +   ( j   *   o . s p a c i n g )   :   j   *   o . m i n   +   ( j   *   o . s p a c i n g ) ;  
 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 p r e C a l c L o T s [ i ] [ j ]   =   ( j   < =   i   ?   ( j   *   o . m i n )   :   ( j - 1 )   *   o . m i n   +   o . m a x )   +   ( j   *   o . s p a c i n g ) ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	  
 	 	 	 / /   l o o p   t h r o u g h   a l l   k w i c k   e l e m e n t s  
 	 	 	 k w i c k s . e a c h ( f u n c t i o n ( i )   {  
 	 	 	 	 v a r   k w i c k   =   $ ( t h i s ) ;  
 	 	 	 	 / /   s e t   i n i t i a l   w i d t h   o r   h e i g h t   a n d   l e f t   o r   t o p   v a l u e s  
 	 	 	 	 / /   s e t   f i r s t   k w i c k  
 	 	 	 	 i f ( i   = = =   0 )   {  
 	 	 	 	 	 k w i c k . c s s ( L o T ,   ' 0 p x ' ) ;  
 	 	 	 	 }    
 	 	 	 	 / /   s e t   l a s t   k w i c k  
 	 	 	 	 e l s e   i f ( i   = =   k w i c k s . s i z e ( )   -   1 )   {  
 	 	 	 	 	 k w i c k . c s s ( o . i s V e r t i c a l   ?   ' b o t t o m '   :   ' r i g h t ' ,   ' 0 p x ' ) ;  
 	 	 	 	 }  
 	 	 	 	 / /   s e t   a l l   o t h e r   k w i c k s  
 	 	 	 	 e l s e   {  
 	 	 	 	 	 i f ( o . s t i c k y )   {  
 	 	 	 	 	 	 k w i c k . c s s ( L o T ,   p r e C a l c L o T s [ o . d e f a u l t K w i c k ] [ i ] ) ;  
 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 k w i c k . c s s ( L o T ,   ( i   *   n o r m W o H )   +   ( i   *   o . s p a c i n g ) ) ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 	 / /   c o r r e c t   s i z e   i n   s t i c k y   m o d e  
 	 	 	 	 i f ( o . s t i c k y )   {  
 	 	 	 	 	 i f ( o . d e f a u l t K w i c k   = =   i )   {  
 	 	 	 	 	 	 k w i c k . c s s ( W o H ,   o . m a x   +   ' p x ' ) ;  
 	 	 	 	 	 	 k w i c k . a d d C l a s s ( ' a c t i v e ' ) ;  
 	 	 	 	 	 }   e l s e   {  
 	 	 	 	 	 	 k w i c k . c s s ( W o H ,   o . m i n   +   ' p x ' ) ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 	 k w i c k . c s s ( {  
 	 	 	 	 	 m a r g i n :   0 ,  
 	 	 	 	 	 p o s i t i o n :   ' a b s o l u t e '  
 	 	 	 	 } ) ;  
 	 	 	 	  
 	 	 	 	 k w i c k . b i n d ( o . e v e n t ,   f u n c t i o n ( )   {  
 	 	 	 	 	 / /   c a l c u l a t e   p r e v i o u s   w i d t h   o r   h e i g h t s   a n d   l e f t   o r   t o p   v a l u e s  
 	 	 	 	 	 v a r   p r e v W o H s   =   [ ] ;   / /   p r e v W o H s   =   p r e v i o u s   W i d t h s   o r   H e i g h t s  
 	 	 	 	 	 v a r   p r e v L o T s   =   [ ] ;   / /   p r e v L o T s   =   p r e v i o u s   L e f t   o r   T o p s  
 	 	 	 	 	 k w i c k s . s t o p ( ) . r e m o v e C l a s s ( ' a c t i v e ' ) ;  
 	 	 	 	 	 f o r ( j   =   0 ;   j   <   k w i c k s . s i z e ( ) ;   j + + )   {  
 	 	 	 	 	 	 p r e v W o H s [ j ]   =   k w i c k s . e q ( j ) . c s s ( W o H ) . r e p l a c e ( / p x / ,   ' ' ) ;  
 	 	 	 	 	 	 p r e v L o T s [ j ]   =   k w i c k s . e q ( j ) . c s s ( L o T ) . r e p l a c e ( / p x / ,   ' ' ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 v a r   a n i O b j   =   { } ;  
 	 	 	 	 	 a n i O b j [ W o H ]   =   o . m a x ;  
 	 	 	 	 	 v a r   m a x D i f   =   o . m a x   -   p r e v W o H s [ i ] ;  
 	 	 	 	 	 v a r   p r e v W o H s M a x D i f R a t i o   =   p r e v W o H s [ i ] / m a x D i f ;  
 	 	 	 	 	 k w i c k . a d d C l a s s ( ' a c t i v e ' ) . a n i m a t e ( a n i O b j ,   {  
 	 	 	 	 	 	 s t e p :   f u n c t i o n ( n o w )   {  
 	 	 	 	 	 	 	 / /   c a l c u l a t e   a n i m a t i o n   c o m p l e t e n e s s   a s   p e r c e n t a g e  
 	 	 	 	 	 	 	 v a r   p e r c e n t a g e   =   m a x D i f   ! =   0   ?   n o w / m a x D i f   -   p r e v W o H s M a x D i f R a t i o   :   1 ;  
 	 	 	 	 	 	 	 / /   a d j s u t   o t h e r   e l e m e n t s   b a s e d   o n   p e r c e n t a g e  
 	 	 	 	 	 	 	 k w i c k s . e a c h ( f u n c t i o n ( j )   {  
 	 	 	 	 	 	 	 	 i f ( j   ! =   i )   {  
 	 	 	 	 	 	 	 	 	 k w i c k s . e q ( j ) . c s s ( W o H ,   p r e v W o H s [ j ]   -   ( ( p r e v W o H s [ j ]   -   o . m i n )   *   p e r c e n t a g e )   +   ' p x ' ) ;  
 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 	 i f ( j   >   0   & &   j   <   k w i c k s . s i z e ( )   -   1 )   {   / /   i f   n o t   t h e   f i r s t   o r   l a s t   k w i c k  
 	 	 	 	 	 	 	 	 	 k w i c k s . e q ( j ) . c s s ( L o T ,   p r e v L o T s [ j ]   -   ( ( p r e v L o T s [ j ]   -   p r e C a l c L o T s [ i ] [ j ] )   *   p e r c e n t a g e )   +   ' p x ' ) ;  
 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 } ) ;  
 	 	 	 	 	 	 } ,  
 	 	 	 	 	 	 d u r a t i o n :   o . d u r a t i o n ,  
 	 	 	 	 	 	 e a s i n g :   o . e a s i n g  
 	 	 	 	 	 } ) ;  
 	 	 	 	 } ) ;  
 	 	 	 } ) ;  
 	 	 	 i f ( ! o . s t i c k y )   {  
 	 	 	 	 c o n t a i n e r . b i n d ( " m o u s e l e a v e " ,   f u n c t i o n ( )   {  
 	 	 	 	 	 v a r   p r e v W o H s   =   [ ] ;  
 	 	 	 	 	 v a r   p r e v L o T s   =   [ ] ;  
 	 	 	 	 	 k w i c k s . r e m o v e C l a s s ( ' a c t i v e ' ) . s t o p ( ) ;  
 	 	 	 	 	 f o r ( i   =   0 ;   i   <   k w i c k s . s i z e ( ) ;   i + + )   {  
 	 	 	 	 	 	 p r e v W o H s [ i ]   =   k w i c k s . e q ( i ) . c s s ( W o H ) . r e p l a c e ( / p x / ,   ' ' ) ;  
 	 	 	 	 	 	 p r e v L o T s [ i ]   =   k w i c k s . e q ( i ) . c s s ( L o T ) . r e p l a c e ( / p x / ,   ' ' ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 v a r   a n i O b j   =   { } ;  
 	 	 	 	 	 a n i O b j [ W o H ]   =   n o r m W o H ;  
 	 	 	 	 	 v a r   n o r m D i f   =   n o r m W o H   -   p r e v W o H s [ 0 ] ;  
 	 	 	 	 	 k w i c k s . e q ( 0 ) . a n i m a t e ( a n i O b j ,   {  
 	 	 	 	 	 	 s t e p :   f u n c t i o n ( n o w )   {  
 	 	 	 	 	 	 	 v a r   p e r c e n t a g e   =   n o r m D i f   ! =   0   ?   ( n o w   -   p r e v W o H s [ 0 ] ) / n o r m D i f   :   1 ;  
 	 	 	 	 	 	 	 f o r ( i   =   1 ;   i   <   k w i c k s . s i z e ( ) ;   i + + )   {  
 	 	 	 	 	 	 	 	 k w i c k s . e q ( i ) . c s s ( W o H ,   p r e v W o H s [ i ]   -   ( ( p r e v W o H s [ i ]   -   n o r m W o H )   *   p e r c e n t a g e )   +   ' p x ' ) ;  
 	 	 	 	 	 	 	 	 i f ( i   <   k w i c k s . s i z e ( )   -   1 )   {  
 	 	 	 	 	 	 	 	 	 k w i c k s . e q ( i ) . c s s ( L o T ,   p r e v L o T s [ i ]   -   ( ( p r e v L o T s [ i ]   -   ( ( i   *   n o r m W o H )   +   ( i   *   o . s p a c i n g ) ) )   *   p e r c e n t a g e )   +   ' p x ' ) ;  
 	 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 } ,  
 	 	 	 	 	 	 d u r a t i o n :   o . d u r a t i o n ,  
 	 	 	 	 	 	 e a s i n g :   o . e a s i n g  
 	 	 	 	 	 } ) ;  
 	 	 	 	 } ) ;  
 	 	 	 }  
 	 	 } ) ;  
 	 } ;  
 } ) ( j Q u e r y ) ;  
  
  
 / * *  
   *   j C a r o u s e l   -   R i d i n g   c a r o u s e l s   w i t h   j Q u e r y  
   *       h t t p : / / s o r g a l l a . c o m / j c a r o u s e l /  
   *  
   *   C o p y r i g h t   ( c )   2 0 0 6   J a n   S o r g a l l a   ( h t t p : / / s o r g a l l a . c o m )  
   *   D u a l   l i c e n s e d   u n d e r   t h e   M I T   ( M I T - L I C E N S E . t x t )  
   *   a n d   G P L   ( G P L - L I C E N S E . t x t )   l i c e n s e s .  
   *  
   *   B u i l t   o n   t o p   o f   t h e   j Q u e r y   l i b r a r y  
   *       h t t p : / / j q u e r y . c o m  
   *  
   *   I n s p i r e d   b y   t h e   " C a r o u s e l   C o m p o n e n t "   b y   B i l l   S c o t t  
   *       h t t p : / / b i l l w s c o t t . c o m / c a r o u s e l /  
   * /  
 e v a l ( f u n c t i o n ( p , a , c , k , e , r ) { e = f u n c t i o n ( c ) { r e t u r n ( c < a ? ' ' : e ( p a r s e I n t ( c / a ) ) ) + ( ( c = c % a ) > 3 5 ? S t r i n g . f r o m C h a r C o d e ( c + 2 9 ) : c . t o S t r i n g ( 3 6 ) ) } ; i f ( ! ' ' . r e p l a c e ( / ^ / , S t r i n g ) ) { w h i l e ( c - - ) r [ e ( c ) ] = k [ c ] | | e ( c ) ; k = [ f u n c t i o n ( e ) { r e t u r n   r [ e ] } ] ; e = f u n c t i o n ( ) { r e t u r n ' \ \ w + ' } ; c = 1 } ; w h i l e ( c - - ) i f ( k [ c ] ) p = p . r e p l a c e ( n e w   R e g E x p ( ' \ \ b ' + e ( c ) + ' \ \ b ' , ' g ' ) , k [ c ] ) ; r e t u r n   p } ( ' ( 9 ( $ ) { $ . 1 s . A = 9 ( o ) { z   4 . 1 4 ( 9 ( ) { 2 H   r ( 4 , o ) } ) } ; 8   q = { W : F , 2 3 : 1 , 1 G : 1 , u : 7 , 1 5 : 3 , 1 6 : 7 , 1 H : \ ' 2 I \ ' , 2 4 : \ ' 2 J \ ' , 1 i : 0 , B : 7 , 1 j : 7 , 1 I : 7 , 2 5 : 7 , 2 6 : 7 , 2 7 : 7 , 2 8 : 7 , 2 9 : 7 , 2 a : 7 , 2 b : 7 , 1 J : \ ' < N > < / N > \ ' , 1 K : \ ' < N > < / N > \ ' , 2 c : \ ' 2 d \ ' , 2 e : \ ' 2 d \ ' , 1 L : 7 , 1 M : 7 } ; $ . A = 9 ( e , o ) { 4 . 5 = $ . 1 7 ( { } , q , o | | { } ) ; 4 . Q = F ; 4 . D = 7 ; 4 . H = 7 ; 4 . t = 7 ; 4 . R = 7 ; 4 . S = 7 ; 4 . O = ! 4 . 5 . W ? \ ' 1 N \ ' : \ ' 2 f \ ' ; 4 . E = ! 4 . 5 . W ? \ ' 2 g \ ' : \ ' 2 h \ ' ; 8   a = \ ' \ ' , 1 d = e . J . 1 d ( \ '   \ ' ) ; 1 k ( 8   i = 0 ; i < 1 d . K ; i + + ) { 6 ( 1 d [ i ] . 2 i ( \ ' A - 2 j \ ' ) ! = - 1 ) { $ ( e ) . 1 t ( 1 d [ i ] ) ; 8   a = 1 d [ i ] ; 1 l } } 6 ( e . 2 k = = \ ' 2 K \ ' | | e . 2 k = = \ ' 2 L \ ' ) { 4 . t = $ ( e ) ; 4 . D = 4 . t . 1 8 ( ) ; 6 ( 4 . D . 1 m ( \ ' A - H \ ' ) ) { 6 ( ! 4 . D . 1 8 ( ) . 1 m ( \ ' A - D \ ' ) ) 4 . D = 4 . D . B ( \ ' < N > < / N > \ ' ) ; 4 . D = 4 . D . 1 8 ( ) } X   6 ( ! 4 . D . 1 m ( \ ' A - D \ ' ) ) 4 . D = 4 . t . B ( \ ' < N > < / N > \ ' ) . 1 8 ( ) } X { 4 . D = $ ( e ) ; 4 . t = $ ( e ) . 2 M ( \ ' > 2 l , > 2 m , N > 2 l , N > 2 m \ ' ) } 6 ( a ! = \ ' \ ' & & 4 . D . 1 8 ( ) [ 0 ] . J . 2 i ( \ ' A - 2 j \ ' ) = = - 1 ) 4 . D . B ( \ ' < N   2 N = "   \ ' + a + \ ' " > < / N > \ ' ) ; 4 . H = 4 . t . 1 8 ( ) ; 6 ( ! 4 . H . K | | ! 4 . H . 1 m ( \ ' A - H \ ' ) ) 4 . H = 4 . t . B ( \ ' < N > < / N > \ ' ) . 1 8 ( ) ; 4 . S = $ ( \ ' . A - 1 1 \ ' , 4 . D ) ; 6 ( 4 . S . u ( ) = = 0 & & 4 . 5 . 1 K ! = 7 ) 4 . S = 4 . H . 1 u ( 4 . 5 . 1 K ) . 1 1 ( ) ; 4 . S . V ( 4 . J ( \ ' A - 1 1 \ ' ) ) ; 4 . R = $ ( \ ' . A - 1 9 \ ' , 4 . D ) ; 6 ( 4 . R . u ( ) = = 0 & & 4 . 5 . 1 J ! = 7 ) 4 . R = 4 . H . 1 u ( 4 . 5 . 1 J ) . 1 1 ( ) ; 4 . R . V ( 4 . J ( \ ' A - 1 9 \ ' ) ) ; 4 . H . V ( 4 . J ( \ ' A - H \ ' ) ) ; 4 . t . V ( 4 . J ( \ ' A - t \ ' ) ) ; 4 . D . V ( 4 . J ( \ ' A - D \ ' ) ) ; 8   b = 4 . 5 . 1 6 ! = 7 ? 1 n . 1 O ( 4 . 1 o ( ) / 4 . 5 . 1 6 ) : 7 ; 8   c = 4 . t . 2 O ( \ ' 1 v \ ' ) ; 8   d = 4 ; 6 ( c . u ( ) > 0 ) { 8   f = 0 , i = 4 . 5 . 1 G ; c . 1 4 ( 9 ( ) { d . 1 P ( 4 , i + + ) ; f + = d . T ( 4 , b ) } ) ; 4 . t . y ( 4 . O , f + \ ' U \ ' ) ; 6 ( ! o | | o . u = = = L ) 4 . 5 . u = c . u ( ) } 4 . D . y ( \ ' 1 w \ ' , \ ' 1 x \ ' ) ; 4 . R . y ( \ ' 1 w \ ' , \ ' 1 x \ ' ) ; 4 . S . y ( \ ' 1 w \ ' , \ ' 1 x \ ' ) ; 4 . 2 n = 9 ( ) { d . 1 9 ( ) } ; 4 . 2 o = 9 ( ) { d . 1 1 ( ) } ; 4 . 1 Q = 9 ( ) { d . 2 p ( ) } ; 6 ( 4 . 5 . 1 j ! = 7 ) 4 . 5 . 1 j ( 4 , \ ' 2 q \ ' ) ; 6 ( $ . 2 r . 2 s ) { 4 . 1 e ( F , F ) ; $ ( 2 t ) . 1 y ( \ ' 2 P \ ' , 9 ( ) { d . 1 z ( ) } ) } X   4 . 1 z ( ) } ; 8   r = $ . A ; r . 1 s = r . 2 Q = { A : \ ' 0 . 2 . 3 \ ' } ; r . 1 s . 1 7 = r . 1 7 = $ . 1 7 ; r . 1 s . 1 7 ( { 1 z : 9 ( ) { 4 . C = 7 ; 4 . G = 7 ; 4 . Y = 7 ; 4 . 1 2 = 7 ; 4 . 1 a = F ; 4 . 1 f = 7 ; 4 . P = 7 ; 4 . Z = F ; 6 ( 4 . Q ) z ; 4 . t . y ( 4 . E , 4 . 1 A ( 4 . 5 . 1 G ) + \ ' U \ ' ) ; 8   p = 4 . 1 A ( 4 . 5 . 2 3 ) ; 4 . Y = 4 . 1 2 = 7 ; 4 . 1 p ( p , F ) ; $ ( 2 t ) . 1 R ( \ ' 2 u \ ' , 4 . 1 Q ) . 1 y ( \ ' 2 u \ ' , 4 . 1 Q ) } , 2 v : 9 ( ) { 4 . t . 2 w ( ) ; 4 . t . y ( 4 . E , \ ' 2 R \ ' ) ; 4 . t . y ( 4 . O , \ ' 2 S \ ' ) ; 6 ( 4 . 5 . 1 j ! = 7 ) 4 . 5 . 1 j ( 4 , \ ' 2 v \ ' ) ; 4 . 1 z ( ) } , 2 p : 9 ( ) { 6 ( 4 . P ! = 7 & & 4 . Z ) 4 . t . y ( 4 . E , r . I ( 4 . t . y ( 4 . E ) ) + 4 . P ) ; 4 . P = 7 ; 4 . Z = F ; 6 ( 4 . 5 . 1 I ! = 7 ) 4 . 5 . 1 I ( 4 ) ; 6 ( 4 . 5 . 1 6 ! = 7 ) { 8   a = 4 ; 8   b = 1 n . 1 O ( 4 . 1 o ( ) / 4 . 5 . 1 6 ) , O = 0 , E = 0 ; $ ( \ ' 1 v \ ' , 4 . t ) . 1 4 ( 9 ( i ) { O + = a . T ( 4 , b ) ; 6 ( i + 1 < a . C ) E = O } ) ; 4 . t . y ( 4 . O , O + \ ' U \ ' ) ; 4 . t . y ( 4 . E , - E + \ ' U \ ' ) } 4 . 1 5 ( 4 . C , F ) } , 2 T : 9 ( ) { 4 . Q = 1 g ; 4 . 1 e ( ) } , 2 U : 9 ( ) { 4 . Q = F ; 4 . 1 e ( ) } , u : 9 ( s ) { 6 ( s ! = L ) { 4 . 5 . u = s ; 6 ( ! 4 . Q ) 4 . 1 e ( ) } z   4 . 5 . u } , 2 V : 9 ( i , a ) { 6 ( a = = L | | ! a ) a = i ; 6 ( 4 . 5 . u ! = = 7 & & a > 4 . 5 . u ) a = 4 . 5 . u ; 1 k ( 8   j = i ; j < = a ; j + + ) { 8   e = 4 . M ( j ) ; 6 ( ! e . K | | e . 1 m ( \ ' A - 1 b - 1 B \ ' ) ) z   F } z   1 g } , M : 9 ( i ) { z   $ ( \ ' . A - 1 b - \ ' + i , 4 . t ) } , 2 x : 9 ( i , s ) { 8   e = 4 . M ( i ) , 1 S = 0 , 2 x = 0 ; 6 ( e . K = = 0 ) { 8   c , e = 4 . 1 C ( i ) , j = r . I ( i ) ; 1 q ( c = 4 . M ( - - j ) ) { 6 ( j < = 0 | | c . K ) { j < = 0 ? 4 . t . 2 y ( e ) : c . 1 T ( e ) ; 1 l } } } X   1 S = 4 . T ( e ) ; e . 1 t ( 4 . J ( \ ' A - 1 b - 1 B \ ' ) ) ; 1 U   s = = \ ' 2 W \ ' ? e . 2 X ( s ) : e . 2 w ( ) . 2 Y ( s ) ; 8   a = 4 . 5 . 1 6 ! = 7 ? 1 n . 1 O ( 4 . 1 o ( ) / 4 . 5 . 1 6 ) : 7 ; 8   b = 4 . T ( e , a ) - 1 S ; 6 ( i > 0 & & i < 4 . C ) 4 . t . y ( 4 . E , r . I ( 4 . t . y ( 4 . E ) ) - b + \ ' U \ ' ) ; 4 . t . y ( 4 . O , r . I ( 4 . t . y ( 4 . O ) ) + b + \ ' U \ ' ) ; z   e } , 1 V : 9 ( i ) { 8   e = 4 . M ( i ) ; 6 ( ! e . K | | ( i > = 4 . C & & i < = 4 . G ) ) z ; 8   d = 4 . T ( e ) ; 6 ( i < 4 . C ) 4 . t . y ( 4 . E , r . I ( 4 . t . y ( 4 . E ) ) + d + \ ' U \ ' ) ; e . 1 V ( ) ; 4 . t . y ( 4 . O , r . I ( 4 . t . y ( 4 . O ) ) - d + \ ' U \ ' ) } , 1 9 : 9 ( ) { 4 . 1 D ( ) ; 6 ( 4 . P ! = 7 & & ! 4 . Z ) 4 . 1 W ( F ) ; X   4 . 1 5 ( ( ( 4 . 5 . B = = \ ' 1 X \ ' | | 4 . 5 . B = = \ ' G \ ' ) & & 4 . 5 . u ! = 7 & & 4 . G = = 4 . 5 . u ) ? 1 : 4 . C + 4 . 5 . 1 5 ) } , 1 1 : 9 ( ) { 4 . 1 D ( ) ; 6 ( 4 . P ! = 7 & & 4 . Z ) 4 . 1 W ( 1 g ) ; X   4 . 1 5 ( ( ( 4 . 5 . B = = \ ' 1 X \ ' | | 4 . 5 . B = = \ ' C \ ' ) & & 4 . 5 . u ! = 7 & & 4 . C = = 1 ) ? 4 . 5 . u : 4 . C - 4 . 5 . 1 5 ) } , 1 W : 9 ( b ) { 6 ( 4 . Q | | 4 . 1 a | | ! 4 . P ) z ; 8   a = r . I ( 4 . t . y ( 4 . E ) ) ; ! b ? a - = 4 . P : a + = 4 . P ; 4 . Z = ! b ; 4 . Y = 4 . C ; 4 . 1 2 = 4 . G ; 4 . 1 p ( a ) } , 1 5 : 9 ( i , a ) { 6 ( 4 . Q | | 4 . 1 a ) z ; 4 . 1 p ( 4 . 1 A ( i ) , a ) } , 1 A : 9 ( i ) { 6 ( 4 . Q | | 4 . 1 a ) z ; i = r . I ( i ) ; 6 ( 4 . 5 . B ! = \ ' 1 c \ ' ) i = i < 1 ? 1 : ( 4 . 5 . u & & i > 4 . 5 . u ? 4 . 5 . u : i ) ; 8   a = 4 . C > i ; 8   b = r . I ( 4 . t . y ( 4 . E ) ) ; 8   f = 4 . 5 . B ! = \ ' 1 c \ ' & & 4 . C < = 1 ? 1 : 4 . C ; 8   c = a ? 4 . M ( f ) : 4 . M ( 4 . G ) ; 8   j = a ? f : f - 1 ; 8   e = 7 , l = 0 , p = F , d = 0 ; 1 q ( a ? - - j > = i : + + j < i ) { e = 4 . M ( j ) ; p = ! e . K ; 6 ( e . K = = 0 ) { e = 4 . 1 C ( j ) . V ( 4 . J ( \ ' A - 1 b - 1 B \ ' ) ) ; c [ a ? \ ' 1 u \ ' : \ ' 1 T \ ' ] ( e ) } c = e ; d = 4 . T ( e ) ; 6 ( p ) l + = d ; 6 ( 4 . C ! = 7 & & ( 4 . 5 . B = = \ ' 1 c \ ' | | ( j > = 1 & & ( 4 . 5 . u = = 7 | | j < = 4 . 5 . u ) ) ) ) b = a ? b + d : b - d } 8   g = 4 . 1 o ( ) ; 8   h = [ ] ; 8   k = 0 , j = i , v = 0 ; 8   c = 4 . M ( i - 1 ) ; 1 q ( + + k ) { e = 4 . M ( j ) ; p = ! e . K ; 6 ( e . K = = 0 ) { e = 4 . 1 C ( j ) . V ( 4 . J ( \ ' A - 1 b - 1 B \ ' ) ) ; c . K = = 0 ? 4 . t . 2 y ( e ) : c [ a ? \ ' 1 u \ ' : \ ' 1 T \ ' ] ( e ) } c = e ; 8   d = 4 . T ( e ) ; 6 ( d = = 0 ) { 2 Z ( \ ' 3 0 :   3 1   1 N / 2 f   3 2   1 k   3 3 .   3 4   3 5   3 6   3 7   3 8   3 9 .   3 a . . . \ ' ) ; z   0 } 6 ( 4 . 5 . B ! = \ ' 1 c \ ' & & 4 . 5 . u ! = = 7 & & j > 4 . 5 . u ) h . 3 b ( e ) ; X   6 ( p ) l + = d ; v + = d ; 6 ( v > = g ) 1 l ; j + + } 1 k ( 8   x = 0 ; x < h . K ; x + + ) h [ x ] . 1 V ( ) ; 6 ( l > 0 ) { 4 . t . y ( 4 . O , 4 . T ( 4 . t ) + l + \ ' U \ ' ) ; 6 ( a ) { b - = l ; 4 . t . y ( 4 . E , r . I ( 4 . t . y ( 4 . E ) ) - l + \ ' U \ ' ) } } 8   n = i + k - 1 ; 6 ( 4 . 5 . B ! = \ ' 1 c \ ' & & 4 . 5 . u & & n > 4 . 5 . u ) n = 4 . 5 . u ; 6 ( j > n ) { k = 0 , j = n , v = 0 ; 1 q ( + + k ) { 8   e = 4 . M ( j - - ) ; 6 ( ! e . K ) 1 l ; v + = 4 . T ( e ) ; 6 ( v > = g ) 1 l } } 8   o = n - k + 1 ; 6 ( 4 . 5 . B ! = \ ' 1 c \ ' & & o < 1 ) o = 1 ; 6 ( 4 . Z & & a ) { b + = 4 . P ; 4 . Z = F } 4 . P = 7 ; 6 ( 4 . 5 . B ! = \ ' 1 c \ ' & & n = = 4 . 5 . u & & ( n - k + 1 ) > = 1 ) { 8   m = r . 1 0 ( 4 . M ( n ) , ! 4 . 5 . W ? \ ' 1 r \ ' : \ ' 1 Y \ ' ) ; 6 ( ( v - m ) > g ) 4 . P = v - g - m } 1 q ( i - - > o ) b + = 4 . T ( 4 . M ( i ) ) ; 4 . Y = 4 . C ; 4 . 1 2 = 4 . G ; 4 . C = o ; 4 . G = n ; z   b } , 1 p : 9 ( p , a ) { 6 ( 4 . Q | | 4 . 1 a ) z ; 4 . 1 a = 1 g ; 8   b = 4 ; 8   c = 9 ( ) { b . 1 a = F ; 6 ( p = = 0 ) b . t . y ( b . E , 0 ) ; 6 ( b . 5 . B = = \ ' 1 X \ ' | | b . 5 . B = = \ ' G \ ' | | b . 5 . u = = 7 | | b . G < b . 5 . u ) b . 2 z ( ) ; b . 1 e ( ) ; b . 1 Z ( \ ' 2 A \ ' ) } ; 4 . 1 Z ( \ ' 3 c \ ' ) ; 6 ( ! 4 . 5 . 1 H | | a = = F ) { 4 . t . y ( 4 . E , p + \ ' U \ ' ) ; c ( ) } X { 8   o = ! 4 . 5 . W ? { \ ' 2 g \ ' : p } : { \ ' 2 h \ ' : p } ; 4 . t . 1 p ( o , 4 . 5 . 1 H , 4 . 5 . 2 4 , c ) } } , 2 z : 9 ( s ) { 6 ( s ! = L ) 4 . 5 . 1 i = s ; 6 ( 4 . 5 . 1 i = = 0 ) z   4 . 1 D ( ) ; 6 ( 4 . 1 f ! = 7 ) z ; 8   a = 4 ; 4 . 1 f = 3 d ( 9 ( ) { a . 1 9 ( ) } , 4 . 5 . 1 i * 3 e ) } , 1 D : 9 ( ) { 6 ( 4 . 1 f = = 7 ) z ; 3 f ( 4 . 1 f ) ; 4 . 1 f = 7 } , 1 e : 9 ( n , p ) { 6 ( n = = L | | n = = 7 ) { 8   n = ! 4 . Q & & 4 . 5 . u ! = = 0 & & ( ( 4 . 5 . B & & 4 . 5 . B ! = \ ' C \ ' ) | | 4 . 5 . u = = 7 | | 4 . G < 4 . 5 . u ) ; 6 ( ! 4 . Q & & ( ! 4 . 5 . B | | 4 . 5 . B = = \ ' C \ ' ) & & 4 . 5 . u ! = 7 & & 4 . G > = 4 . 5 . u ) n = 4 . P ! = 7 & & ! 4 . Z } 6 ( p = = L | | p = = 7 ) { 8   p = ! 4 . Q & & 4 . 5 . u ! = = 0 & & ( ( 4 . 5 . B & & 4 . 5 . B ! = \ ' G \ ' ) | | 4 . C > 1 ) ; 6 ( ! 4 . Q & & ( ! 4 . 5 . B | | 4 . 5 . B = = \ ' G \ ' ) & & 4 . 5 . u ! = 7 & & 4 . C = = 1 ) p = 4 . P ! = 7 & & 4 . Z } 8   a = 4 ; 4 . R [ n ? \ ' 1 y \ ' : \ ' 1 R \ ' ] ( 4 . 5 . 2 c , 4 . 2 n ) [ n ? \ ' 1 t \ ' : \ ' V \ ' ] ( 4 . J ( \ ' A - 1 9 - 1 E \ ' ) ) . 2 0 ( \ ' 1 E \ ' , n ? F : 1 g ) ; 4 . S [ p ? \ ' 1 y \ ' : \ ' 1 R \ ' ] ( 4 . 5 . 2 e , 4 . 2 o ) [ p ? \ ' 1 t \ ' : \ ' V \ ' ] ( 4 . J ( \ ' A - 1 1 - 1 E \ ' ) ) . 2 0 ( \ ' 1 E \ ' , p ? F : 1 g ) ; 6 ( 4 . R . K > 0 & & ( 4 . R [ 0 ] . 1 h = = L | | 4 . R [ 0 ] . 1 h ! = n ) & & 4 . 5 . 1 L ! = 7 ) { 4 . R . 1 4 ( 9 ( ) { a . 5 . 1 L ( a , 4 , n ) } ) ; 4 . R [ 0 ] . 1 h = n } 6 ( 4 . S . K > 0 & & ( 4 . S [ 0 ] . 1 h = = L | | 4 . S [ 0 ] . 1 h ! = p ) & & 4 . 5 . 1 M ! = 7 ) { 4 . S . 1 4 ( 9 ( ) { a . 5 . 1 M ( a , 4 , p ) } ) ; 4 . S [ 0 ] . 1 h = p } } , 1 Z : 9 ( a ) { 8   b = 4 . Y = = 7 ? \ ' 2 q \ ' : ( 4 . Y < 4 . C ? \ ' 1 9 \ ' : \ ' 1 1 \ ' ) ; 4 . 1 3 ( \ ' 2 5 \ ' , a , b ) ; 6 ( 4 . Y ! = = 4 . C ) { 4 . 1 3 ( \ ' 2 6 \ ' , a , b , 4 . C ) ; 4 . 1 3 ( \ ' 2 7 \ ' , a , b , 4 . Y ) } 6 ( 4 . 1 2 ! = = 4 . G ) { 4 . 1 3 ( \ ' 2 8 \ ' , a , b , 4 . G ) ; 4 . 1 3 ( \ ' 2 9 \ ' , a , b , 4 . 1 2 ) } 4 . 1 3 ( \ ' 2 a \ ' , a , b , 4 . C , 4 . G , 4 . Y , 4 . 1 2 ) ; 4 . 1 3 ( \ ' 2 b \ ' , a , b , 4 . Y , 4 . 1 2 , 4 . C , 4 . G ) } , 1 3 : 9 ( a , b , c , d , e , f , g ) { 6 ( 4 . 5 [ a ] = = L | | ( 1 U   4 . 5 [ a ] ! = \ ' 2 B \ ' & & b ! = \ ' 2 A \ ' ) ) z ; 8   h = 1 U   4 . 5 [ a ] = = \ ' 2 B \ ' ? 4 . 5 [ a ] [ b ] : 4 . 5 [ a ] ; 6 ( ! $ . 3 g ( h ) ) z ; 8   j = 4 ; 6 ( d = = = L ) h ( j , c , b ) ; X   6 ( e = = = L ) 4 . M ( d ) . 1 4 ( 9 ( ) { h ( j , 4 , d , c , b ) } ) ; X { 1 k ( 8   i = d ; i < = e ; i + + ) 6 ( i ! = = 7 & & ! ( i > = f & & i < = g ) ) 4 . M ( i ) . 1 4 ( 9 ( ) { h ( j , 4 , i , c , b ) } ) } } , 1 C : 9 ( i ) { z   4 . 1 P ( \ ' < 1 v > < / 1 v > \ ' , i ) } , 1 P : 9 ( e , i ) { 8   a = $ ( e ) . V ( 4 . J ( \ ' A - 1 b \ ' ) ) . V ( 4 . J ( \ ' A - 1 b - \ ' + i ) ) ; a . 2 0 ( \ ' 3 h \ ' , i ) ; z   a } , J : 9 ( c ) { z   c + \ '   \ ' + c + ( ! 4 . 5 . W ? \ ' - 3 i \ ' : \ ' - W \ ' ) } , T : 9 ( e , d ) { 8   a = e . 2 C ! = L ? e [ 0 ] : e ; 8   b = ! 4 . 5 . W ? a . 1 F + r . 1 0 ( a , \ ' 2 D \ ' ) + r . 1 0 ( a , \ ' 1 r \ ' ) : a . 2 E + r . 1 0 ( a , \ ' 2 F \ ' ) + r . 1 0 ( a , \ ' 1 Y \ ' ) ; 6 ( d = = L | | b = = d ) z   b ; 8   w = ! 4 . 5 . W ? d - r . 1 0 ( a , \ ' 2 D \ ' ) - r . 1 0 ( a , \ ' 1 r \ ' ) : d - r . 1 0 ( a , \ ' 2 F \ ' ) - r . 1 0 ( a , \ ' 1 Y \ ' ) ; $ ( a ) . y ( 4 . O , w + \ ' U \ ' ) ; z   4 . T ( a ) } , 1 o : 9 ( ) { z ! 4 . 5 . W ? 4 . H [ 0 ] . 1 F - r . I ( 4 . H . y ( \ ' 3 j \ ' ) ) - r . I ( 4 . H . y ( \ ' 3 k \ ' ) ) : 4 . H [ 0 ] . 2 E - r . I ( 4 . H . y ( \ ' 3 l \ ' ) ) - r . I ( 4 . H . y ( \ ' 3 m \ ' ) ) } , 3 n : 9 ( i , s ) { 6 ( s = = L ) s = 4 . 5 . u ; z   1 n . 3 o ( ( ( ( i - 1 ) / s ) - 1 n . 3 p ( ( i - 1 ) / s ) ) * s ) + 1 } } ) ; r . 1 7 ( { 3 q : 9 ( d ) { z   $ . 1 7 ( q , d | | { } ) } , 1 0 : 9 ( e , p ) { 6 ( ! e ) z   0 ; 8   a = e . 2 C ! = L ? e [ 0 ] : e ; 6 ( p = = \ ' 1 r \ ' & & $ . 2 r . 2 s ) { 8   b = { \ ' 1 w \ ' : \ ' 1 x \ ' , \ ' 3 r \ ' : \ ' 3 s \ ' , \ ' 1 N \ ' : \ ' 1 i \ ' } , 2 1 , 2 2 ; $ . 2 G ( a , b , 9 ( ) { 2 1 = a . 1 F } ) ; b [ \ ' 1 r \ ' ] = 0 ; $ . 2 G ( a , b , 9 ( ) { 2 2 = a . 1 F } ) ; z   2 2 - 2 1 } z   r . I ( $ . y ( a , p ) ) } , I : 9 ( v ) { v = 3 t ( v ) ; z   3 u ( v ) ? 0 : v } } ) } ) ( 3 v ) ; ' , 6 2 , 2 1 8 , ' | | | | t h i s | o p t i o n s | i f | n u l l | v a r | f u n c t i o n | | | | | | | | | | | | | | | | | | | | l i s t | s i z e | | | | c s s | r e t u r n | j c a r o u s e l | w r a p | f i r s t | c o n t a i n e r | l t | f a l s e | l a s t | c l i p | i n t v a l | c l a s s N a m e | l e n g t h | u n d e f i n e d | g e t | d i v | w h | t a i l | l o c k e d | b u t t o n N e x t | b u t t o n P r e v | d i m e n s i o n | p x | a d d C l a s s | v e r t i c a l | e l s e | p r e v F i r s t | i n T a i l | m a r g i n | p r e v | p r e v L a s t | c a l l b a c k | e a c h | s c r o l l | v i s i b l e | e x t e n d | p a r e n t | n e x t | a n i m a t i n g | i t e m | c i r c u l a r | s p l i t | b u t t o n s | t i m e r | t r u e | j c a r o u s e l s t a t e | a u t o | i n i t C a l l b a c k | f o r | b r e a k | h a s C l a s s | M a t h | c l i p p i n g | a n i m a t e | w h i l e | m a r g i n R i g h t | f n | r e m o v e C l a s s | b e f o r e | l i | d i s p l a y | b l o c k | b i n d | s e t u p | p o s | p l a c e h o l d e r | c r e a t e | s t o p A u t o | d i s a b l e d | o f f s e t W i d t h | o f f s e t | a n i m a t i o n | r e l o a d C a l l b a c k | b u t t o n N e x t H T M L | b u t t o n P r e v H T M L | b u t t o n N e x t C a l l b a c k | b u t t o n P r e v C a l l b a c k | w i d t h | c e i l | f o r m a t | f u n c R e s i z e | u n b i n d | o l d | a f t e r | t y p e o f | r e m o v e | s c r o l l T a i l | b o t h | m a r g i n B o t t o m | n o t i f y | a t t r | o W i d t h | o W i d t h 2 | s t a r t | e a s i n g | i t e m L o a d C a l l b a c k | i t e m F i r s t I n C a l l b a c k | i t e m F i r s t O u t C a l l b a c k | i t e m L a s t I n C a l l b a c k | i t e m L a s t O u t C a l l b a c k | i t e m V i s i b l e I n C a l l b a c k | i t e m V i s i b l e O u t C a l l b a c k | b u t t o n N e x t E v e n t | c l i c k | b u t t o n P r e v E v e n t | h e i g h t | l e f t | t o p | i n d e x O f | s k i n | n o d e N a m e | u l | o l | f u n c N e x t | f u n c P r e v | r e l o a d | i n i t | b r o w s e r | s a f a r i | w i n d o w | r e s i z e | r e s e t | e m p t y | a d d | p r e p e n d | s t a r t A u t o | o n A f t e r A n i m a t i o n | o b j e c t | j q u e r y | m a r g i n L e f t | o f f s e t H e i g h t | m a r g i n T o p | s w a p | n e w | n o r m a l | s w i n g | U L | O L | f i n d | c l a s s | c h i l d r e n | l o a d | p r o t o t y p e | 0 p x | 1 0 p x | l o c k | u n l o c k | h a s | s t r i n g | h t m l | a p p e n d | a l e r t | j C a r o u s e l | N o | s e t | i t e m s | T h i s | w i l l | c a u s e | a n | i n f i n i t e | l o o p | A b o r t i n g | p u s h | o n B e f o r e A n i m a t i o n | s e t T i m e o u t | 1 0 0 0 | c l e a r T i m e o u t | i s F u n c t i o n | j c a r o u s e l i n d e x | h o r i z o n t a l | b o r d e r L e f t W i d t h | b o r d e r R i g h t W i d t h | b o r d e r T o p W i d t h | b o r d e r B o t t o m W i d t h | i n d e x | r o u n d | f l o o r | d e f a u l t s | f l o a t | n o n e | p a r s e I n t | i s N a N | j Q u e r y ' . s p l i t ( ' | ' ) , 0 , { } ) )  
  
  
 / * *  
  
   *   j Q u e r y . S c r o l l T o   -   E a s y   e l e m e n t   s c r o l l i n g   u s i n g   j Q u e r y .  
  
   *   C o p y r i g h t   ( c )   2 0 0 7 - 2 0 0 8   A r i e l   F l e s l e r   -   a f l e s l e r ( a t ) g m a i l ( d o t ) c o m   |   h t t p : / / f l e s l e r . b l o g s p o t . c o m  
  
   *   D u a l   l i c e n s e d   u n d e r   M I T   a n d   G P L .  
  
   *   D a t e :   9 / 1 1 / 2 0 0 8  
  
   *   @ a u t h o r   A r i e l   F l e s l e r  
  
   *   @ v e r s i o n   1 . 4  
  
   *  
  
   *   h t t p : / / f l e s l e r . b l o g s p o t . c o m / 2 0 0 7 / 1 0 / j q u e r y s c r o l l t o . h t m l  
  
   * /  
  
 ; ( f u n c t i o n ( h ) { v a r   m = h . s c r o l l T o = f u n c t i o n ( b , c , g ) { h ( w i n d o w ) . s c r o l l T o ( b , c , g ) } ; m . d e f a u l t s = { a x i s : ' y ' , d u r a t i o n : 1 } ; m . w i n d o w = f u n c t i o n ( b ) { r e t u r n   h ( w i n d o w ) . s c r o l l a b l e ( ) } ; h . f n . s c r o l l a b l e = f u n c t i o n ( ) { r e t u r n   t h i s . m a p ( f u n c t i o n ( ) { v a r   b = t h i s . p a r e n t W i n d o w | | t h i s . d e f a u l t V i e w , c = t h i s . n o d e N a m e = = ' # d o c u m e n t ' ? b . f r a m e E l e m e n t | | b : t h i s , g = c . c o n t e n t D o c u m e n t | | ( c . c o n t e n t W i n d o w | | c ) . d o c u m e n t , i = c . s e t I n t e r v a l ; r e t u r n   c . n o d e N a m e = = ' I F R A M E ' | | i & & h . b r o w s e r . s a f a r i ? g . b o d y : i ? g . d o c u m e n t E l e m e n t : t h i s } ) } ; h . f n . s c r o l l T o = f u n c t i o n ( r , j , a ) { i f ( t y p e o f   j = = ' o b j e c t ' ) { a = j ; j = 0 } i f ( t y p e o f   a = = ' f u n c t i o n ' ) a = { o n A f t e r : a } ; a = h . e x t e n d ( { } , m . d e f a u l t s , a ) ; j = j | | a . s p e e d | | a . d u r a t i o n ; a . q u e u e = a . q u e u e & & a . a x i s . l e n g t h > 1 ; i f ( a . q u e u e ) j / = 2 ; a . o f f s e t = n ( a . o f f s e t ) ; a . o v e r = n ( a . o v e r ) ; r e t u r n   t h i s . s c r o l l a b l e ( ) . e a c h ( f u n c t i o n ( ) { v a r   k = t h i s , o = h ( k ) , d = r , l , e = { } , p = o . i s ( ' h t m l , b o d y ' ) ; s w i t c h ( t y p e o f   d ) { c a s e ' n u m b e r ' : c a s e ' s t r i n g ' : i f ( / ^ ( [ + - ] = ) ? \ d + ( p x ) ? $ / . t e s t ( d ) ) { d = n ( d ) ; b r e a k } d = h ( d , t h i s ) ; c a s e ' o b j e c t ' : i f ( d . i s | | d . s t y l e ) l = ( d = h ( d ) ) . o f f s e t ( ) } h . e a c h ( a . a x i s . s p l i t ( ' ' ) , f u n c t i o n ( b , c ) { v a r   g = c = = ' x ' ? ' L e f t ' : ' T o p ' , i = g . t o L o w e r C a s e ( ) , f = ' s c r o l l ' + g , s = k [ f ] , t = c = = ' x ' ? ' W i d t h ' : ' H e i g h t ' , v = t . t o L o w e r C a s e ( ) ; i f ( l ) { e [ f ] = l [ i ] + ( p ? 0 : s - o . o f f s e t ( ) [ i ] ) ; i f ( a . m a r g i n ) { e [ f ] - = p a r s e I n t ( d . c s s ( ' m a r g i n ' + g ) ) | | 0 ; e [ f ] - = p a r s e I n t ( d . c s s ( ' b o r d e r ' + g + ' W i d t h ' ) ) | | 0 } e [ f ] + = a . o f f s e t [ i ] | | 0 ; i f ( a . o v e r [ i ] ) e [ f ] + = d [ v ] ( ) * a . o v e r [ i ] } e l s e   e [ f ] = d [ i ] ; i f ( / ^ \ d + $ / . t e s t ( e [ f ] ) ) e [ f ] = e [ f ] < = 0 ? 0 : M a t h . m i n ( e [ f ] , u ( t ) ) ; i f ( ! b & & a . q u e u e ) { i f ( s ! = e [ f ] ) q ( a . o n A f t e r F i r s t ) ; d e l e t e   e [ f ] } } ) ; q ( a . o n A f t e r ) ; f u n c t i o n   q ( b ) { o . a n i m a t e ( e , j , a . e a s i n g , b & & f u n c t i o n ( ) { b . c a l l ( t h i s , r , a ) } ) } ; f u n c t i o n   u ( b ) { v a r   c = ' s c r o l l ' + b , g = k . o w n e r D o c u m e n t ; r e t u r n   p ? M a t h . m a x ( g . d o c u m e n t E l e m e n t [ c ] , g . b o d y [ c ] ) : k [ c ] } } ) . e n d ( ) } ; f u n c t i o n   n ( b ) { r e t u r n   t y p e o f   b = = ' o b j e c t ' ? b : { t o p : b , l e f t : b } } } ) ( j Q u e r y ) ;  
  
 / * *  
  
   *   j Q u e r y [ a ]   -   A n i m a t e d   s c r o l l i n g   o f   s e r i e s  
  
   *   C o p y r i g h t   ( c )   2 0 0 7 - 2 0 0 8   A r i e l   F l e s l e r   -   a f l e s l e r ( a t ) g m a i l ( d o t ) c o m   |   h t t p : / / f l e s l e r . b l o g s p o t . c o m  
  
   *   D u a l   l i c e n s e d   u n d e r   M I T   a n d   G P L .  
  
   *   D a t e :   3 / 2 0 / 2 0 0 8  
  
   *   @ a u t h o r   A r i e l   F l e s l e r  
  
   *   @ v e r s i o n   1 . 2 . 1  
  
   *  
  
   *   h t t p : / / f l e s l e r . b l o g s p o t . c o m / 2 0 0 8 / 0 2 / j q u e r y s e r i a l s c r o l l . h t m l  
  
   * /  
  
 / / ; ( f u n c t i o n ( $ ) { v a r   a = ' s e r i a l S c r o l l ' , b = ' . ' + a , c = ' b i n d ' , C = $ [ a ] = f u n c t i o n ( b ) { $ . s c r o l l T o . w i n d o w ( ) [ a ] ( b ) } ; C . d e f a u l t s = { d u r a t i o n : 1 e 3 , a x i s : ' x ' , e v e n t : ' c l i c k ' , s t a r t : 0 , s t e p : 1 , l o c k : 1 , c y c l e : 1 , c o n s t a n t : 1 } ; $ . f n [ a ] = f u n c t i o n ( y ) { y = $ . e x t e n d ( { } , C . d e f a u l t s , y ) ; v a r   z = y . e v e n t , A = y . s t e p , B = y . l a z y ; r e t u r n   t h i s . e a c h ( f u n c t i o n ( ) { v a r   j = y . t a r g e t ? t h i s : d o c u m e n t , k = $ ( y . t a r g e t | | t h i s , j ) , l = k [ 0 ] , m = y . i t e m s , o = y . s t a r t , p = y . i n t e r v a l , q = y . n a v i g a t i o n , r ; i f ( ! B ) m = w ( ) ; i f ( y . f o r c e ) t ( { } , o ) ; $ ( y . p r e v | | [ ] , j ) [ c ] ( z , - A , s ) ; $ ( y . n e x t | | [ ] , j ) [ c ] ( z , A , s ) ; i f ( ! l . s s b o u n d ) k [ c ] ( ' p r e v ' + b , - A , s ) [ c ] ( ' n e x t ' + b , A , s ) [ c ] ( ' g o t o ' + b , t ) ; i f ( p ) k [ c ] ( ' s t a r t ' + b , f u n c t i o n ( e ) { i f ( ! p ) { v ( ) ; p = 1 ; u ( ) } } ) [ c ] ( ' s t o p ' + b , f u n c t i o n ( ) { v ( ) ; p = 0 } ) ; k [ c ] ( ' n o t i f y ' + b , f u n c t i o n ( e , a ) { v a r   i = x ( a ) ; i f ( i > - 1 ) o = i } ) ; l . s s b o u n d = 1 ; i f ( y . j u m p ) ( B ? k : w ( ) ) [ c ] ( z , f u n c t i o n ( e ) { t ( e , x ( e . t a r g e t ) ) } ) ; i f ( q ) q = $ ( q , j ) [ c ] ( z , f u n c t i o n ( e ) { e . d a t a = M a t h . r o u n d ( w ( ) . l e n g t h / q . l e n g t h ) * q . i n d e x ( t h i s ) ; t ( e , t h i s ) } ) ; f u n c t i o n   s ( e ) { e . d a t a + = o ; t ( e , t h i s ) } ; f u n c t i o n   t ( e , a ) { i f ( ! i s N a N ( a ) ) { e . d a t a = a ; a = l } v a r   c = e . d a t a , n , d = e . t y p e , f = y . e x c l u d e ? w ( ) . s l i c e ( 0 , - y . e x c l u d e ) : w ( ) , g = f . l e n g t h , h = f [ c ] , i = y . d u r a t i o n ; i f ( d ) e . p r e v e n t D e f a u l t ( ) ; i f ( p ) { v ( ) ; r = s e t T i m e o u t ( u , y . i n t e r v a l ) } i f ( ! h ) { n = c < 0 ? 0 : n = g - 1 ; i f ( o ! = n ) c = n ; e l s e   i f ( ! y . c y c l e ) r e t u r n ; e l s e   c = g - n - 1 ; h = f [ c ] } i f ( ! h | | d & & o = = c | | y . l o c k & & k . i s ( ' : a n i m a t e d ' ) | | d & & y . o n B e f o r e & & y . o n B e f o r e . c a l l ( a , e , h , k , w ( ) , c ) = = = ! 1 ) r e t u r n ; i f ( y . s t o p ) k . q u e u e ( ' f x ' , [ ] ) . s t o p ( ) ; i f ( y . c o n s t a n t ) i = M a t h . a b s ( i / A * ( o - c ) ) ; k . s c r o l l T o ( h , i , y ) . t r i g g e r ( ' n o t i f y ' + b , [ c ] ) } ; f u n c t i o n   u ( ) { k . t r i g g e r ( ' n e x t ' + b ) } ; f u n c t i o n   v ( ) { c l e a r T i m e o u t ( r ) } ; f u n c t i o n   w ( ) { r e t u r n   $ ( m , l ) } ; f u n c t i o n   x ( a ) { i f ( ! i s N a N ( a ) ) r e t u r n   a ; v a r   b = w ( ) , i ; w h i l e ( ( i = b . i n d e x ( a ) ) = = - 1 & & a ! = l ) a = a . p a r e n t N o d e ; r e t u r n   i } } ) } } ) ( j Q u e r y ) ;  
  
 / * 
   *   j Q u e r y . S e r i a l S c r o l l   -   A n i m a t e d   s c r o l l i n g   o f   s e r i e s 
   *   C o p y r i g h t   ( c )   2 0 0 7 - 2 0 0 9   A r i e l   F l e s l e r   -   a f l e s l e r ( a t ) g m a i l ( d o t ) c o m   |   h t t p : / / f l e s l e r . b l o g s p o t . c o m 
   *   D u a l   l i c e n s e d   u n d e r   M I T   a n d   G P L . 
   *   D a t e :   0 6 / 1 4 / 2 0 0 9 
   *   @ a u t h o r   A r i e l   F l e s l e r 
   *   @ v e r s i o n   1 . 2 . 2 
   *   h t t p : / / f l e s l e r . b l o g s p o t . c o m / 2 0 0 8 / 0 2 / j q u e r y s e r i a l s c r o l l . h t m l 
   * / 
 ; ( f u n c t i o n ( a ) { v a r   b = a . s e r i a l S c r o l l = f u n c t i o n ( c ) { r e t u r n   a ( w i n d o w ) . s e r i a l S c r o l l ( c ) } ; b . d e f a u l t s = { d u r a t i o n : 1 e 3 , a x i s : " x " , e v e n t : " c l i c k " , s t a r t : 0 , s t e p : 1 , l o c k : ! 0 , c y c l e : ! 0 , c o n s t a n t : ! 0 } ; a . f n . s e r i a l S c r o l l = f u n c t i o n ( c ) { r e t u r n   t h i s . e a c h ( f u n c t i o n ( ) { v a r   t = a . e x t e n d ( { } , b . d e f a u l t s , c ) , s = t . e v e n t , i = t . s t e p , r = t . l a z y , e = t . t a r g e t ? t h i s : d o c u m e n t , u = a ( t . t a r g e t | | t h i s , e ) , p = u [ 0 ] , m = t . i t e m s , h = t . s t a r t , g = t . i n t e r v a l , k = t . n a v i g a t i o n , l ; i f ( ! r ) { m = d ( ) } i f ( t . f o r c e ) { f ( { } , h ) } a ( t . p r e v | | [ ] , e ) . b i n d ( s , - i , q ) ; a ( t . n e x t | | [ ] , e ) . b i n d ( s , i , q ) ; i f ( ! p . s s b o u n d ) { u . b i n d ( " p r e v . s e r i a l S c r o l l " , - i , q ) . b i n d ( " n e x t . s e r i a l S c r o l l " , i , q ) . b i n d ( " g o t o . s e r i a l S c r o l l " , f ) } i f ( g ) { u . b i n d ( " s t a r t . s e r i a l S c r o l l " , f u n c t i o n ( v ) { i f ( ! g ) { o ( ) ; g = ! 0 ; n ( ) } } ) . b i n d ( " s t o p . s e r i a l S c r o l l " , f u n c t i o n ( ) { o ( ) ; g = ! 1 } ) } u . b i n d ( " n o t i f y . s e r i a l S c r o l l " , f u n c t i o n ( x , w ) { v a r   v = j ( w ) ; i f ( v > - 1 ) { h = v } } ) ; p . s s b o u n d = ! 0 ; i f ( t . j u m p ) { ( r ? u : d ( ) ) . b i n d ( s , f u n c t i o n ( v ) { f ( v , j ( v . t a r g e t ) ) } ) } i f ( k ) { k = a ( k , e ) . b i n d ( s , f u n c t i o n ( v ) { v . d a t a = M a t h . r o u n d ( d ( ) . l e n g t h / k . l e n g t h ) * k . i n d e x ( t h i s ) ; f ( v , t h i s ) } ) } f u n c t i o n   q ( v ) { v . d a t a + = h ; f ( v , t h i s ) } f u n c t i o n   f ( B , z ) { i f ( ! i s N a N ( z ) ) { B . d a t a = z ; z = p } v a r   C = B . d a t a , v , D = B . t y p e , A = t . e x c l u d e ? d ( ) . s l i c e ( 0 , - t . e x c l u d e ) : d ( ) , y = A . l e n g t h , w = A [ C ] , x = t . d u r a t i o n ; i f ( D ) { B . p r e v e n t D e f a u l t ( ) } i f ( g ) { o ( ) ; l = s e t T i m e o u t ( n , t . i n t e r v a l ) } i f ( ! w ) { v = C < 0 ? 0 : y - 1 ; i f ( h ! = v ) { C = v } e l s e { i f ( ! t . c y c l e ) { r e t u r n } e l s e { C = y - v - 1 } } w = A [ C ] } i f ( ! w | | t . l o c k & & u . i s ( " : a n i m a t e d " ) | | D & & t . o n B e f o r e & & t . o n B e f o r e ( B , w , u , d ( ) , C ) = = = ! 1 ) { r e t u r n } i f ( t . s t o p ) { u . q u e u e ( " f x " , [ ] ) . s t o p ( ) } i f ( t . c o n s t a n t ) { x = M a t h . a b s ( x / i * ( h - C ) ) } u . s c r o l l T o ( w , x , t ) . t r i g g e r ( " n o t i f y . s e r i a l S c r o l l " , [ C ] ) } f u n c t i o n   n ( ) { u . t r i g g e r ( " n e x t . s e r i a l S c r o l l " ) } f u n c t i o n   o ( ) { c l e a r T i m e o u t ( l ) } f u n c t i o n   d ( ) { r e t u r n   a ( m , p ) } f u n c t i o n   j ( w ) { i f ( ! i s N a N ( w ) ) { r e t u r n   w } v a r   x = d ( ) , v ; w h i l e ( ( v = x . i n d e x ( w ) ) = = - 1 & & w ! = p ) { w = w . p a r e n t N o d e } r e t u r n   v } } ) } } ) ( j Q u e r y ) ;  
  
  
 / * *  
  
   *   j Q u e r y . L o c a l S c r o l l   -   A n i m a t e d   s c r o l l i n g   n a v i g a t i o n ,   u s i n g   a n c h o r s .  
  
   *   C o p y r i g h t   ( c )   2 0 0 7 - 2 0 0 8   A r i e l   F l e s l e r   -   a f l e s l e r ( a t ) g m a i l ( d o t ) c o m   |   h t t p : / / f l e s l e r . b l o g s p o t . c o m  
  
   *   D u a l   l i c e n s e d   u n d e r   M I T   a n d   G P L .  
  
   *   D a t e :   6 / 3 / 2 0 0 8  
  
   *   @ a u t h o r   A r i e l   F l e s l e r  
  
   *   @ v e r s i o n   1 . 2 . 6  
  
   * * /  
  
 ; ( f u n c t i o n ( $ ) { v a r   g = l o c a t i o n . h r e f . r e p l a c e ( / # . * / , ' ' ) , h = $ . l o c a l S c r o l l = f u n c t i o n ( a ) { $ ( ' b o d y ' ) . l o c a l S c r o l l ( a ) } ; h . d e f a u l t s = { d u r a t i o n : 1 e 3 , a x i s : ' y ' , e v e n t : ' c l i c k ' , s t o p : 1 } ; h . h a s h = f u n c t i o n ( a ) { a = $ . e x t e n d ( { } , h . d e f a u l t s , a ) ; a . h a s h = 0 ; i f ( l o c a t i o n . h a s h ) s e t T i m e o u t ( f u n c t i o n ( ) { i ( 0 , l o c a t i o n , a ) } , 0 ) } ; $ . f n . l o c a l S c r o l l = f u n c t i o n ( b ) { b = $ . e x t e n d ( { } , h . d e f a u l t s , b ) ; r e t u r n ( b . p e r s i s t e n t | | b . l a z y ) ? t h i s . b i n d ( b . e v e n t , f u n c t i o n ( e ) { v a r   a = $ ( [ e . t a r g e t , e . t a r g e t . p a r e n t N o d e ] ) . f i l t e r ( c ) [ 0 ] ; a & & i ( e , a , b ) } ) : t h i s . f i n d ( ' a , a r e a ' ) . f i l t e r ( c ) . b i n d ( b . e v e n t , f u n c t i o n ( e ) { i ( e , t h i s , b ) } ) . e n d ( ) . e n d ( ) ; f u n c t i o n   c ( ) { v a r   a = t h i s ; r e t u r n ! ! a . h r e f & & ! ! a . h a s h & & a . h r e f . r e p l a c e ( a . h a s h , ' ' ) = = g & & ( ! b . f i l t e r | | $ ( a ) . i s ( b . f i l t e r ) ) } } ; f u n c t i o n   i ( e , a , b ) { v a r   c = a . h a s h . s l i c e ( 1 ) , d = d o c u m e n t . g e t E l e m e n t B y I d ( c ) | | d o c u m e n t . g e t E l e m e n t s B y N a m e ( c ) [ 0 ] , f ; i f ( d ) { e & & e . p r e v e n t D e f a u l t ( ) ; f = $ ( b . t a r g e t | | $ . s c r o l l T o . w i n d o w ( ) ) ; i f ( b . l o c k & & f . i s ( ' : a n i m a t e d ' ) | | b . o n B e f o r e & & b . o n B e f o r e . c a l l ( a , e , d , f ) = = = ! 1 ) r e t u r n ; i f ( b . s t o p ) f . q u e u e ( ' f x ' , [ ] ) . s t o p ( ) ; f . s c r o l l T o ( d , b ) . t r i g g e r ( ' n o t i f y . s e r i a l S c r o l l ' , [ d ] ) ; i f ( b . h a s h ) f . q u e u e ( f u n c t i o n ( ) { l o c a t i o n = a . h a s h ; $ ( t h i s ) . d e q u e u e ( ) } ) } } } ) ( j Q u e r y ) ;  
  
  
 / *  
   *   D a t e   F o r m a t   1 . 2 . 3  
   *   ( c )   2 0 0 7 - 2 0 0 9   S t e v e n   L e v i t h a n   < s t e v e n l e v i t h a n . c o m >  
   *   M I T   l i c e n s e  
   *  
   *   I n c l u d e s   e n h a n c e m e n t s   b y   S c o t t   T r e n d a   < s c o t t . t r e n d a . n e t >  
   *   a n d   K r i s   K o w a l   < c i x a r . c o m / ~ k r i s . k o w a l / >  
   *  
   *   A c c e p t s   a   d a t e ,   a   m a s k ,   o r   a   d a t e   a n d   a   m a s k .  
   *   R e t u r n s   a   f o r m a t t e d   v e r s i o n   o f   t h e   g i v e n   d a t e .  
   *   T h e   d a t e   d e f a u l t s   t o   t h e   c u r r e n t   d a t e / t i m e .  
   *   T h e   m a s k   d e f a u l t s   t o   d a t e F o r m a t . m a s k s . d e f a u l t .  
   * /  
  
 v a r   d a t e F o r m a t   =   f u n c t i o n   ( )   {  
 	 v a r 	 t o k e n   =   / d { 1 , 4 } | m { 1 , 4 } | y y ( ? : y y ) ? | ( [ H h M s T t ] ) \ 1 ? | [ L l o S Z ] | " [ ^ " ] * " | ' [ ^ ' ] * ' / g ,  
 	 	 t i m e z o n e   =   / \ b ( ? : [ P M C E A ] [ S D P ] T | ( ? : P a c i f i c | M o u n t a i n | C e n t r a l | E a s t e r n | A t l a n t i c )   ( ? : S t a n d a r d | D a y l i g h t | P r e v a i l i n g )   T i m e | ( ? : G M T | U T C ) ( ? : [ - + ] \ d { 4 } ) ? ) \ b / g ,  
 	 	 t i m e z o n e C l i p   =   / [ ^ - + \ d A - Z ] / g ,  
 	 	 p a d   =   f u n c t i o n   ( v a l ,   l e n )   {  
 	 	 	 v a l   =   S t r i n g ( v a l ) ;  
 	 	 	 l e n   =   l e n   | |   2 ;  
 	 	 	 w h i l e   ( v a l . l e n g t h   <   l e n )   v a l   =   " 0 "   +   v a l ;  
 	 	 	 r e t u r n   v a l ;  
 	 	 } ;  
  
 	 / /   R e g e x e s   a n d   s u p p o r t i n g   f u n c t i o n s   a r e   c a c h e d   t h r o u g h   c l o s u r e  
 	 r e t u r n   f u n c t i o n   ( d a t e ,   m a s k ,   u t c )   {  
 	 	 v a r   d F   =   d a t e F o r m a t ;  
  
 	 	 / /   Y o u   c a n ' t   p r o v i d e   u t c   i f   y o u   s k i p   o t h e r   a r g s   ( u s e   t h e   " U T C : "   m a s k   p r e f i x )  
 	 	 i f   ( a r g u m e n t s . l e n g t h   = =   1   & &   O b j e c t . p r o t o t y p e . t o S t r i n g . c a l l ( d a t e )   = =   " [ o b j e c t   S t r i n g ] "   & &   ! / \ d / . t e s t ( d a t e ) )   {  
 	 	 	 m a s k   =   d a t e ;  
 	 	 	 d a t e   =   u n d e f i n e d ;  
 	 	 }  
  
 	 	 / /   P a s s i n g   d a t e   t h r o u g h   D a t e   a p p l i e s   D a t e . p a r s e ,   i f   n e c e s s a r y  
 	 	 d a t e   =   d a t e   ?   n e w   D a t e ( d a t e )   :   n e w   D a t e ;  
 	 	 i f   ( i s N a N ( d a t e ) )   t h r o w   S y n t a x E r r o r ( " i n v a l i d   d a t e " ) ;  
  
 	 	 m a s k   =   S t r i n g ( d F . m a s k s [ m a s k ]   | |   m a s k   | |   d F . m a s k s [ " d e f a u l t " ] ) ;  
  
 	 	 / /   A l l o w   s e t t i n g   t h e   u t c   a r g u m e n t   v i a   t h e   m a s k  
 	 	 i f   ( m a s k . s l i c e ( 0 ,   4 )   = =   " U T C : " )   {  
 	 	 	 m a s k   =   m a s k . s l i c e ( 4 ) ;  
 	 	 	 u t c   =   t r u e ;  
 	 	 }  
  
 	 	 v a r 	 _   =   u t c   ?   " g e t U T C "   :   " g e t " ,  
 	 	 	 d   =   d a t e [ _   +   " D a t e " ] ( ) ,  
 	 	 	 D   =   d a t e [ _   +   " D a y " ] ( ) ,  
 	 	 	 m   =   d a t e [ _   +   " M o n t h " ] ( ) ,  
 	 	 	 y   =   d a t e [ _   +   " F u l l Y e a r " ] ( ) ,  
 	 	 	 H   =   d a t e [ _   +   " H o u r s " ] ( ) ,  
 	 	 	 M   =   d a t e [ _   +   " M i n u t e s " ] ( ) ,  
 	 	 	 s   =   d a t e [ _   +   " S e c o n d s " ] ( ) ,  
 	 	 	 L   =   d a t e [ _   +   " M i l l i s e c o n d s " ] ( ) ,  
 	 	 	 o   =   u t c   ?   0   :   d a t e . g e t T i m e z o n e O f f s e t ( ) ,  
 	 	 	 f l a g s   =   {  
 	 	 	 	 d :         d ,  
 	 	 	 	 d d :       p a d ( d ) ,  
 	 	 	 	 d d d :     d F . i 1 8 n . d a y N a m e s [ D ] ,  
 	 	 	 	 d d d d :   d F . i 1 8 n . d a y N a m e s [ D   +   7 ] ,  
 	 	 	 	 m :         m   +   1 ,  
 	 	 	 	 m m :       p a d ( m   +   1 ) ,  
 	 	 	 	 m m m :     d F . i 1 8 n . m o n t h N a m e s [ m ] ,  
 	 	 	 	 m m m m :   d F . i 1 8 n . m o n t h N a m e s [ m   +   1 2 ] ,  
 	 	 	 	 y y :       S t r i n g ( y ) . s l i c e ( 2 ) ,  
 	 	 	 	 y y y y :   y ,  
 	 	 	 	 h :         H   %   1 2   | |   1 2 ,  
 	 	 	 	 h h :       p a d ( H   %   1 2   | |   1 2 ) ,  
 	 	 	 	 H :         H ,  
 	 	 	 	 H H :       p a d ( H ) ,  
 	 	 	 	 M :         M ,  
 	 	 	 	 M M :       p a d ( M ) ,  
 	 	 	 	 s :         s ,  
 	 	 	 	 s s :       p a d ( s ) ,  
 	 	 	 	 l :         p a d ( L ,   3 ) ,  
 	 	 	 	 L :         p a d ( L   >   9 9   ?   M a t h . r o u n d ( L   /   1 0 )   :   L ) ,  
 	 	 	 	 t :         H   <   1 2   ?   " a "     :   " p " ,  
 	 	 	 	 t t :       H   <   1 2   ?   " a m "   :   " p m " ,  
 	 	 	 	 T :         H   <   1 2   ?   " A "     :   " P " ,  
 	 	 	 	 T T :       H   <   1 2   ?   " A M "   :   " P M " ,  
 	 	 	 	 Z :         u t c   ?   " U T C "   :   ( S t r i n g ( d a t e ) . m a t c h ( t i m e z o n e )   | |   [ " " ] ) . p o p ( ) . r e p l a c e ( t i m e z o n e C l i p ,   " " ) ,  
 	 	 	 	 o :         ( o   >   0   ?   " - "   :   " + " )   +   p a d ( M a t h . f l o o r ( M a t h . a b s ( o )   /   6 0 )   *   1 0 0   +   M a t h . a b s ( o )   %   6 0 ,   4 ) ,  
 	 	 	 	 S :         [ " t h " ,   " s t " ,   " n d " ,   " r d " ] [ d   %   1 0   >   3   ?   0   :   ( d   %   1 0 0   -   d   %   1 0   ! =   1 0 )   *   d   %   1 0 ]  
 	 	 	 } ;  
  
 	 	 r e t u r n   m a s k . r e p l a c e ( t o k e n ,   f u n c t i o n   ( $ 0 )   {  
 	 	 	 r e t u r n   $ 0   i n   f l a g s   ?   f l a g s [ $ 0 ]   :   $ 0 . s l i c e ( 1 ,   $ 0 . l e n g t h   -   1 ) ;  
 	 	 } ) ;  
 	 } ;  
 } ( ) ;  
  
 / /   S o m e   c o m m o n   f o r m a t   s t r i n g s  
 d a t e F o r m a t . m a s k s   =   {  
 	 " d e f a u l t " :             " d d d   m m m   d d   y y y y   H H : M M : s s " ,  
 	 s h o r t D a t e :             " m / d / y y " ,  
 	 m e d i u m D a t e :           " m m m   d ,   y y y y " ,  
 	 l o n g D a t e :               " m m m m   d ,   y y y y " ,  
 	 f u l l D a t e :               " d d d d ,   m m m m   d ,   y y y y " ,  
 	 s h o r t T i m e :             " h : M M   T T " ,  
 	 m e d i u m T i m e :           " h : M M : s s   T T " ,  
 	 l o n g T i m e :               " h : M M : s s   T T   Z " ,  
 	 i s o D a t e :                 " y y y y - m m - d d " ,  
 	 i s o T i m e :                 " H H : M M : s s " ,  
 	 i s o D a t e T i m e :         " y y y y - m m - d d ' T ' H H : M M : s s " ,  
 	 i s o U t c D a t e T i m e :   " U T C : y y y y - m m - d d ' T ' H H : M M : s s ' Z ' "  
 } ;  
  
 / /   I n t e r n a t i o n a l i z a t i o n   s t r i n g s  
 d a t e F o r m a t . i 1 8 n   =   {  
 	 d a y N a m e s :   [  
 	 	 " S u n " ,   " M o n " ,   " T u e " ,   " W e d " ,   " T h u " ,   " F r i " ,   " S a t " ,  
 	 	 " S u n d a y " ,   " M o n d a y " ,   " T u e s d a y " ,   " W e d n e s d a y " ,   " T h u r s d a y " ,   " F r i d a y " ,   " S a t u r d a y "  
 	 ] ,  
 	 m o n t h N a m e s :   [  
 	 	 " J a n " ,   " F e b " ,   " M a r " ,   " A p r " ,   " M a y " ,   " J u n " ,   " J u l " ,   " A u g " ,   " S e p " ,   " O c t " ,   " N o v " ,   " D e c " ,  
 	 	 " J a n u a r y " ,   " F e b r u a r y " ,   " M a r c h " ,   " A p r i l " ,   " M a y " ,   " J u n e " ,   " J u l y " ,   " A u g u s t " ,   " S e p t e m b e r " ,   " O c t o b e r " ,   " N o v e m b e r " ,   " D e c e m b e r "  
 	 ]  
 } ;  
  
 / /   F o r   c o n v e n i e n c e . . .  
 D a t e . p r o t o t y p e . f o r m a t   =   f u n c t i o n   ( m a s k ,   u t c )   {  
 	 r e t u r n   d a t e F o r m a t ( t h i s ,   m a s k ,   u t c ) ;  
 } ;  
  
  
  
  
  
 / *   c l i c k M e n u   -   v 0 . 1 . 6  
   *   C o p y r i g h t   ( c )   2 0 0 7   R o m a n   W e i c h  
   *   h t t p : / / p . s o h e i . o r g  
   *  
   *   C h a n g e l o g :    
   *   v   0 . 1 . 6   -   2 0 0 7 - 0 9 - 0 6  
   * 	 - f i x :   h a v i n g   a   l i n k   i n   t h e   t o p - l e v e l   m e n u   w o u l d   n o t   o p e n   t h e   m e n u   b u t   c a l l   t h e   l i n k   i n s t e a d  
   *   v   0 . 1 . 5   -   2 0 0 7 - 0 7 - 0 7  
   * 	 - c h a n g e / f i x :   m e n u   o p e n i n g / c l o s i n g   n o w   t h r o u g h   s i m p l e   s h o w ( )   a n d   h i d e ( )   c a l l s   -   b e f o r e   f a d e I n   a n d   f a d e O u t   w e r e   u s e d   f o r   w h i c h   e x t r a   f u n c t i o n s   t o   s t o p   a   a l r e a d y   r u n n i n g   a n i m a t i o n   w e r e   c r e a t e d   - >   t h e y   w e r e    
   * 	 	 	 b u g g y   ( n o t   w o r k i n g   w i t h   t h e   i n t e r f a c e   p l u g i n   i n   j q u e r y 1 . 1 . 2   a n d   n o t   w o r k i n g   w i t h   j q u e r y 1 . 1 . 3   a t   a l l )   a n d   n o w   r e m o v e d  
   * 	 - c h a n g e :   r e m o v e d   o p t i o n :   f a d e T i m e  
   * 	 - c h a n g e :   n o w   u s i n g   t h e   b g i f r a m e   p l u g i n   f o r   a d d i n g   i f r a m e s   i n   i e 6   w h e n   a v a i l a b l e  
   *   v   0 . 1 . 4   -   2 0 0 7 - 0 3 - 2 0  
   * 	 - f i x :   t h e   d e f a u l t   o p t i o n s   w e r e   o v e r w r i t t e n   b y   t h e   c o n t e x t   r e l a t e d   o p t i o n s  
   * 	 - f i x :   h i d i n g   a   s u b m e n u   a l l   h o v e r -   a n d   c l i c k - e v e n t s   w e r e   u n b o u n d ,   e v e n   t h e   o n e s   n o t   d e f i n e d   i n   t h i s   p l u g i n   -   u n b i n d i n g   s h o u l d   w o r k   n o w  
   *   v   0 . 1 . 3   -   2 0 0 7 - 0 3 - 1 3  
   * 	 - f i x :   s o m e   d i s p l a y   p r o b l e m s   i e   h a d   w h e n   n o   w i d t h   w a s   s e t   o n   t h e   s u b m e n u ,   s o   o n   i e   t h e   w i d t h   f o r   e a c h   s u b m e n u   w i l l   b e   e x p l i c i t e l y   s e t  
   * 	 - f i x :   t h e   f i x   t o   t h e   i e - w i d t h - p r o b l e m   i s   a   f i x   t o   t h e   " i e   d o e s   n o t   s u p p o r t   c s s   m i n - w i d t h   s t u f f "   p r o b l e m   t o o   w h i c h   d i s p l a y e d   s o m e   s u b m e n u s   t o o   n a r r o w   ( i t   l o o k e d   j u s t   n o t   r i g h t )  
   * 	 - f i x :   s o m e   b u g s ,   w h e n   u s e r   t h e   w a s   t o o   f a s t   w i t h   t h e   m o u s e  
   *   v   0 . 1 . 2   -   2 0 0 7 - 0 3 - 1 1  
   * 	 - c h a n g e :   m a d e   a   l o t   c h a n g e s   i n   t h e   t r a v e r s i n g   r o u t i n e s   t o   s p e e d   t h i n g s   u p   ( h a v i n g   b e t t e r   m e m o r y   u s a g e   n o w   a s   w e l l )  
   * 	 - c h a n g e :   a d d e d   $ . f n . c l i c k M e n u . s e t D e f a u l t s ( )   f o r   s e t t i n g   g l o b a l   d e f a u l t s  
   * 	 - f i x :   h o v e r b u g   w h e n   a   m a i n   m e n u   i t e m   h a d   n o   s u b m e n u  
   * 	 - f i x :   s o m e   b u g s   i   f o u n d   w h i l e   r e w r i t i n g   m o s t   o f   t h e   s t u f f  
   *   v   0 . 1 . 1   -   2 0 0 7 - 0 3 - 0 4  
   * 	 - c h a n g e :   t h e   w i d t h   o f   t h e   s u b m e n u s   i s   n o   l o n g e r   f i x e d ,   i t s   s e t   i n   t h e   p l u g i n   n o w  
   * 	 - c h a n g e :   t h e   s u b m e n u - a r r o w   i s   n o w   a n   i m g ,   n o t   t h e   b a c k g r o u n d - i m g   o f   t h e   l i s t   e l e m e n t   -   t h a t   a l l o w s   b e t t e r   p o s i t i o n i n g ,   a n d   b a c k g r o u n d - c h a n g e s   o n   h o v e r   ( y o u   h a v e   t o   s e t   t h e   i m a g e   t h r o u g h   t h e   a r r o w S r c   o p t i o n )  
   * 	 - f i x :   c l i c k i n g   o n   a   c l i c k M e n u   w h i l e   a n o t h e r   w a s   a l r e a d y   o p e n ,   d i d n ' t   c l o s e   t h e   o p e n   o n e  
   * 	 - c h a n g e :   c l i c k i n g   o n   t h e   o p e n   m a i n   m e n u   i t e m   w i l l   c l o s e   i t  
   * 	 - f i x :   o n   a n   o p e n   m e n u   m o v i n g   t h e   m o u s e   t o   a   m a i n   m e n u   i t e m   a n d   m o v i n g   i t   f a s t l y   e l s e w e r e   h i d   t h e   w h o l e   m e n u  
   *   v   0 . 1 . 0   -   2 0 0 7 - 0 3 - 0 3  
   * /  
  
 ( f u n c t i o n ( $ )  
 {  
 	 v a r   d e f a u l t s   =   {  
 	 	 o n C l i c k :   f u n c t i o n ( e ) {  
 	 	 	 $ ( t h i s ) . f i n d ( ' > a ' ) . e a c h ( f u n c t i o n ( ) {  
 / / 	 	 	 	 i f   (   t h i s . h r e f   )  
 / / 	 	 	 	 {  
 / / 	 	 	 	 	 w i n d o w . l o c a t i o n   =   t h i s . h r e f ;  
 / / 	 	 	 	 }  
 	 	 	 	 i f   (   t h i s . h r e f   )  
 	 	 	 	 {  
 	 	 	 	         i f   ( t h i s . t a r g e t   = =   " b l a n k "   | |   e . c t r l K e y   )  
 	 	 	 	         {  
 	 	 	 	                 w i n d o w . o p e n ( t h i s . h r e f ) ;  
 	 	 	 	         }  
 	 	 	 	         e l s e    
 	 	 	 	         {  
 	 	 	 	                 w i n d o w . l o c a t i o n   =   t h i s . h r e f ;  
 	 	 	 	         }  
 	 	 	 	 }  
 	 	 	 } ) ;  
 	 	 } ,  
 	 	 a r r o w S r c :   ' ' ,  
 	 	 s u b D e l a y :   3 0 0 ,  
 	 	 m a i n D e l a y :   1 0  
 	 } ;  
  
 	 $ . f n . c l i c k M e n u   =   f u n c t i o n ( o p t i o n s )    
 	 {  
 	 	 v a r   s h o w n   =   f a l s e ;  
 	 	 v a r   l i O f f s e t   =   (   ( $ . b r o w s e r . m s i e )   ?   4   :   2   ) ;  
  
 	 	 v a r   s e t t i n g s   =   $ . e x t e n d ( { } ,   d e f a u l t s ,   o p t i o n s ) ;  
  
 	 	 v a r   h i d e D I V   =   f u n c t i o n ( d i v ,   d e l a y )  
 	 	 {  
 	 	 	 / / a   t i m e r   r u n n i n g   t o   s h o w   t h e   d i v ?  
 	 	 	 i f   (   d i v . t i m e r   & &   ! d i v . i s V i s i b l e   )  
 	 	 	 {  
 	 	 	 	 c l e a r T i m e o u t ( d i v . t i m e r ) ;  
 	 	 	 }  
 	 	 	 e l s e   i f   ( d i v . t i m e r )  
 	 	 	 {  
 	 	 	 	 r e t u r n ;   / / h i d e - t i m e r   a l r e a d y   r u n n i n g  
 	 	 	 }  
 	 	 	 i f   (   d i v . i s V i s i b l e   )  
 	 	 	 {  
 	 	 	 	 d i v . t i m e r   =   s e t T i m e o u t ( f u n c t i o n ( )  
 	 	 	 	 {  
 	 	 	 	 	 / / r e m o v e   e v e n t s  
 	 	 	 	 	 $ ( g e t A l l C h i l d s ( g e t O n e C h i l d ( d i v ,   ' U L ' ) ,   ' L I ' ) ) . u n b i n d ( ' m o u s e o v e r ' ,   l i H o v e r I n ) . u n b i n d ( ' m o u s e o u t ' ,   l i H o v e r O u t ) . u n b i n d ( ' c l i c k ' ,   s e t t i n g s . o n C l i c k ) ;  
 	 	 	 	 	 / / h i d e   i t  
 	 	 	 	 	 $ ( d i v ) . h i d e ( ) ;  
 	 	 	 	 	 d i v . i s V i s i b l e   =   f a l s e ;  
 	 	 	 	 	 d i v . t i m e r   =   n u l l ;  
 	 	 	 	 } ,   d e l a y ) ;  
 	 	 	 }  
 	 	 } ;  
  
 	 	 v a r   s h o w D I V   =   f u n c t i o n ( d i v ,   d e l a y )  
 	 	 {  
 	 	 	 i f   (   d i v . t i m e r   )  
 	 	 	 {  
 	 	 	 	 c l e a r T i m e o u t ( d i v . t i m e r ) ;  
 	 	 	 }  
 	 	 	 i f   (   ! d i v . i s V i s i b l e   )  
 	 	 	 {  
 	 	 	 	 d i v . t i m e r   =   s e t T i m e o u t ( f u n c t i o n ( )  
 	 	 	 	 {  
 	 	 	 	 	 / / c h e c k   i f   t h e   m o u s e   i s   s t i l l   o v e r   t h e   p a r e n t   i t e m   -   i f   n o t   d o n t   s h o w   t h e   s u b m e n u  
 	 	 	 	 	 i f   (   ! c h e c k C l a s s ( d i v . p a r e n t N o d e ,   ' h o v e r ' )   )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 r e t u r n ;  
 	 	 	 	 	 }  
 	 	 	 	 	 / / a s s i g n   e v e n t s   t o   a l l   d i v > u l > l i - e l e m e n t s  
 	 	 	 	 	 $ ( g e t A l l C h i l d s ( g e t O n e C h i l d ( d i v ,   ' U L ' ) ,   ' L I ' ) ) . m o u s e o v e r ( l i H o v e r I n ) . m o u s e o u t ( l i H o v e r O u t ) . c l i c k ( s e t t i n g s . o n C l i c k ) ;  
 	 	 	 	 	 / / p o s i t i o n i n g  
 	 	 	 	 	 i f   (   ! c h e c k C l a s s ( d i v . p a r e n t N o d e ,   ' m a i n ' )   )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 $ ( d i v ) . c s s ( ' l e f t ' ,   d i v . p a r e n t N o d e . o f f s e t W i d t h   -   l i O f f s e t ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 / / s h o w   i t  
 	 	 	 	 	 d i v . i s V i s i b l e   =   t r u e ;   / / w e   u s e   t h i s   o v e r   : v i s i b l e   t o   s p e e d   u p   t r a v e r s i n g  
 	 	 	 	 	 $ ( d i v ) . s h o w ( ) ;  
 	 	 	 	 	 i f   (   $ . b r o w s e r . m s i e   )   / / f i x i n g   a   d i s p l a y - b u g   i n   i e 6   a n d   a d d i n g   m i n - w i d t h  
 	 	 	 	 	 {  
 	 	 	 	 	 	 v a r   c W   =   $ ( g e t O n e C h i l d ( d i v ,   ' U L ' ) ) . w i d t h ( ) ;  
 	 	 	 	 	 	 i f   (   c W   <   1 0 0   )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 c W   =   1 0 0 ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 $ ( d i v ) . c s s ( ' w i d t h ' ,   c W ) ;  
 	 	 	 	 	 }  
 	 	 	 	 	 d i v . t i m e r   =   n u l l ;  
 	 	 	 	 } ,   d e l a y ) ;  
 	 	 	 }  
 	 	 } ;  
  
 	 	 / / s a m e   a s   h o v e r . h a n d l e h o v e r   i n   j q u e r y   -   j u s t   c a n ' t   u s e   h o v e r ( )   d i r e c t l y   -   n e e d   t h e   a b i l i t y   t o   u n b i n d   o n l y   t h e   o n e   h o v e r   e v e n t  
 	 	 v a r   t e s t H a n d l e H o v e r   =   f u n c t i o n ( e )  
 	 	 {  
 	 	 	 / /   C h e c k   i f   m o u s e ( o v e r | o u t )   a r e   s t i l l   w i t h i n   t h e   s a m e   p a r e n t   e l e m e n t  
 	 	 	 v a r   p   =   ( e . t y p e   = =   " m o u s e o v e r "   ?   e . f r o m E l e m e n t   :   e . t o E l e m e n t )   | |   e . r e l a t e d T a r g e t ;  
 	 	 	 / /   T r a v e r s e   u p   t h e   t r e e  
 	 	 	 w h i l e   (   p   & &   p   ! =   t h i s   )  
 	 	 	 {  
 	 	 	 	 t r y  
 	 	 	 	 {    
 	 	 	 	 	 p   =   p . p a r e n t N o d e ;  
 	 	 	 	 }  
 	 	 	 	 c a t c h ( e )  
 	 	 	 	 {    
 	 	 	 	 	 p   =   t h i s ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 / /   I f   w e   a c t u a l l y   j u s t   m o u s e d   o n   t o   a   s u b - e l e m e n t ,   i g n o r e   i t  
 	 	 	 i f   (   p   = =   t h i s   )  
 	 	 	 {  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 }  
 	 	 	 r e t u r n   t r u e ;  
 	 	 } ;  
 	 	  
 	 	 v a r   m a i n H o v e r I n   =   f u n c t i o n ( e )  
 	 	 {  
 	 	 	 / / n o   n e e d   t o   t e s t   e . t a r g e t = = t h i s ,   a s   n o   c h i l d   h a s   t h e   s a m e   e v e n t   b i n d e d  
 	 	 	 / / i t s   p o s s i b l e ,   t h a t   a   m a i n   m e n u   i t e m   s t i l l   h a s   h o v e r   ( i f   i t   h a s   n o   s u b m e n u )   -   t h u s   r e m o v e   i t  
 	 	 	 v a r   l i s   =   g e t A l l C h i l d s ( t h i s . p a r e n t N o d e ,   ' L I ' ) ;  
 	 	 	 v a r   p a t t e r n   =   n e w   R e g E x p ( " ( ^ | \ \ s ) h o v e r ( \ \ s | $ ) " ) ;  
 	 	 	 f o r   ( v a r   i   =   0 ;   i   <   l i s . l e n g t h ;   i + + )  
 	 	 	 {  
 	 	 	 	 i f   (   p a t t e r n . t e s t ( l i s [ i ] . c l a s s N a m e )   )  
 	 	 	 	 {  
 	 	 	 	 	 $ ( l i s [ i ] ) . r e m o v e C l a s s ( ' h o v e r ' ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 $ ( t h i s ) . a d d C l a s s ( ' h o v e r ' ) ;  
 	 	 	 i f   (   s h o w n   )  
 	 	 	 {  
 	 	 	 	 h o v e r I n ( t h i s ,   s e t t i n g s . m a i n D e l a y ) ;  
 	 	 	 }  
 	 	 } ;  
  
 	 	 v a r   l i H o v e r I n   =   f u n c t i o n ( e )  
 	 	 {  
 	 	 	 i f   (   ! t e s t H a n d l e H o v e r ( e )   )  
 	 	 	 {  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 }  
 	 	 	 i f   (   e . t a r g e t   ! =   t h i s   )  
 	 	 	 {  
 	 	 	 	 / / l o o k   w h e t h e r   t h e   t a r g e t   i s   a   d i r e c t   c h i l d   o f   t h i s   ( m a y b e   a n   i m a g e )  
 	 	 	 	 i f   (   ! i s C h i l d ( t h i s ,   e . t a r g e t )   )  
 	 	 	 	 {  
 	 	 	 	 	 r e t u r n ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 h o v e r I n ( t h i s ,   s e t t i n g s . s u b D e l a y ) ;  
 	 	 } ;  
  
 	 	 v a r   h o v e r I n   =   f u n c t i o n ( l i ,   d e l a y )  
 	 	 {  
 	 	 	 v a r   i n n e r D i v   =   g e t O n e C h i l d ( l i ,   ' D I V ' ) ;  
 	 	 	 / / s t o p   r u n n i n g   t i m e r s   f r o m   t h e   o t h e r   m e n u s   o n   t h e   s a m e   l e v e l   -   a   l i t t l e   f a s t e r   t h a n   $ ( ' > * > d i v ' ,   l i . p a r e n t N o d e )  
 	 	 	 v a r   n   =   l i . p a r e n t N o d e . f i r s t C h i l d ;  
 	 	 	 f o r   (   ;   n ;   n   =   n . n e x t S i b l i n g   )    
 	 	 	 {  
 	 	 	 	 i f   (   n . n o d e T y p e   = =   1   & &   n . n o d e N a m e . t o U p p e r C a s e ( )   = =   ' L I '   )  
 	 	 	 	 {  
 	 	 	 	 	 v a r   d i v   =   g e t O n e C h i l d ( n ,   ' D I V ' ) ;  
 	 	 	 	 	 i f   (   d i v   & &   d i v . t i m e r   & &   ! d i v . i s V i s i b l e   )   / / c l e a r   s h o w - d i v   t i m e r  
 	 	 	 	 	 {  
 	 	 	 	 	 	 c l e a r T i m e o u t ( d i v . t i m e r ) ;  
 	 	 	 	 	 	 d i v . t i m e r   =   n u l l ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 / / i s   t h e r e   a   t i m e r   r u n n i n g   t o   h i d e   o n e   o f   t h e   p a r e n t   d i v s ?   s t o p   i t  
 	 	 	 v a r   p N o d e   =   l i . p a r e n t N o d e ;  
 	 	 	 f o r   (   ;   p N o d e ;   p N o d e   =   p N o d e . p a r e n t N o d e   )    
 	 	 	 {  
 	 	 	 	 i f   (   p N o d e . n o d e T y p e   = =   1   & &   p N o d e . n o d e N a m e . t o U p p e r C a s e ( )   = =   ' D I V '   )  
 	 	 	 	 {  
 	 	 	 	 	 i f   ( p N o d e . t i m e r )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 c l e a r T i m e o u t ( p N o d e . t i m e r ) ;  
 	 	 	 	 	 	 p N o d e . t i m e r   =   n u l l ;  
 	 	 	 	 	 	 $ ( p N o d e . p a r e n t N o d e ) . a d d C l a s s ( ' h o v e r ' ) ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 / / h i g h l i g h t   t h e   c u r r e n t   e l e m e n t  
 	 	 	 $ ( l i ) . a d d C l a s s ( ' h o v e r ' ) ;  
 	 	 	 / / i s   t h e   s u b m e n u   a l r e a d y   v i s i b l e ?  
 	 	 	 i f   (   i n n e r D i v   & &   i n n e r D i v . i s V i s i b l e   )  
 	 	 	 {  
 	 	 	 	 / / h i d e - t i m e r   r u n n i n g ?  
 	 	 	 	 i f   (   i n n e r D i v . t i m e r   )  
 	 	 	 	 {  
 	 	 	 	 	 c l e a r T i m e o u t ( i n n e r D i v . t i m e r ) ;  
 	 	 	 	 	 i n n e r D i v . t i m e r   =   n u l l ;  
 	 	 	 	 }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 r e t u r n ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 / / h i d e   a l l   o p e n   m e n u s   o n   t h e   s a m e   l e v e l   a n d   b e l o w   a n d   u n h i g h l i g h t   t h e   l i   i t e m   ( b u t   n o t   t h e   c u r r e n t   s u b m e n u ! )  
 	 	 	 $ ( l i . p a r e n t N o d e . g e t E l e m e n t s B y T a g N a m e ( ' D I V ' ) ) . e a c h ( f u n c t i o n ( ) {  
 	 	 	 	 i f   (   t h i s   ! =   i n n e r D i v   & &   t h i s . i s V i s i b l e   )  
 	 	 	 	 {  
 	 	 	 	 	 h i d e D I V ( t h i s ,   d e l a y ) ;  
 	 	 	 	 	 $ ( t h i s . p a r e n t N o d e ) . r e m o v e C l a s s ( ' h o v e r ' ) ;  
 	 	 	 	 }  
 	 	 	 } ) ;  
 	 	 	 / / s h o w   t h e   s u b m e n u ,   i f   t h e r e   i s   o n e  
 	 	 	 i f   (   i n n e r D i v   )  
 	 	 	 {  
 	 	 	 	 s h o w D I V ( i n n e r D i v ,   d e l a y ) ;  
 	 	 	 }  
 	 	 } ;  
  
 	 	 v a r   l i H o v e r O u t   =   f u n c t i o n ( e )  
 	 	 {  
 	 	 	 i f   (   ! t e s t H a n d l e H o v e r ( e )   )  
 	 	 	 {  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 }  
 	 	 	 i f   (   e . t a r g e t   ! =   t h i s   )  
 	 	 	 {  
 	 	 	 	 i f   (   ! i s C h i l d ( t h i s ,   e . t a r g e t )   )   / / r e t u r n   o n l y   i f   t h e   t a r g e t   i s   n o   d i r e c t   c h i l d   o f   t h i s  
 	 	 	 	 {  
 	 	 	 	 	 r e t u r n ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 / / r e m o v e   t h e   h o v e r   f r o m   t h e   s u b m e n u   i t e m ,   i f   t h e   m o u s e   i s   h o v e r i n g   o u t   o f   t h e   m e n u   ( t h i s   i s   o n l y   f o r   t h e   l a s t   o p e n   ( l e v e l w i s e )   ( s u b - ) m e n u )  
 	 	 	 v a r   d i v   =   g e t O n e C h i l d ( t h i s ,   ' D I V ' ) ;  
 	 	 	 i f   (   ! d i v   )  
 	 	 	 {  
 	 	 	 	 $ ( t h i s ) . r e m o v e C l a s s ( ' h o v e r ' ) ;  
 	 	 	 }  
 	 	 	 e l s e    
 	 	 	 {  
 	 	 	 	 i f   (   ! d i v . i s V i s i b l e   )  
 	 	 	 	 {  
 	 	 	 	 	 $ ( t h i s ) . r e m o v e C l a s s ( ' h o v e r ' ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 } ;  
  
 	 	 v a r   m a i n H o v e r O u t   =   f u n c t i o n ( e )  
 	 	 {  
 	 	 	 / / n o   n e e d   t o   t e s t   e . t a r g e t = = t h i s ,   a s   n o   c h i l d   h a s   t h e   s a m e   e v e n t   b i n d e d  
 	 	 	 / / r e m o v e   h o v e r  
 	 	 	 v a r   d i v   =   g e t O n e C h i l d ( t h i s ,   ' D I V ' ) ;  
 	 	 	 v a r   r e l T a r g e t   =   e . r e l a t e d T a r g e t   | |   e . t o E l e m e n t ;   / / t h i s   i s   u n d e f i n e d   s o m e t i m e s   ( e . g .   w h e n   t h e   m o u s e   m o v e s   o u t   o f   t h e   w i n d o w ) ,   s o   d o n t   r e m o v e   h o v e r   t h e n  
 	 	 	 v a r   p ;  
 	 	 	 i f   (   ! s h o w n   )  
 	 	 	 {  
 	 	 	 	 $ ( t h i s ) . r e m o v e C l a s s ( ' h o v e r ' ) ;  
 	 	 	 }  
 	 	 	 e l s e   i f   (   ! d i v   & &   r e l T a r g e t   )   / / m e n u i t e m   h a s   n o   s u b m e n u ,   s o   d o n t   r e m o v e   t h e   h o v e r   i f   t h e   m o u s e   g o e s   o u t s i d e   t h e   m e n u  
 	 	 	 {  
 	 	 	 	 p   =   f i n d P a r e n t W i t h C l a s s ( e . t a r g e t ,   ' U L ' ,   ' c l i c k M e n u ' ) ;  
 	 	 	 	 i f   (   p . c o n t a i n s ( r e l T a r g e t ) )  
 	 	 	 	 {  
 	 	 	 	 	 $ ( t h i s ) . r e m o v e C l a s s ( ' h o v e r ' ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 e l s e   i f   (   r e l T a r g e t   )  
 	 	 	 {  
 	 	 	 	 / / r e m o v e   h o v e r   o n l y   w h e n   m o v i n g   t o   a n y w h e r e   i n s i d e   t h e   c l i c k m e n u  
 	 	 	 	 p   =   f i n d P a r e n t W i t h C l a s s ( e . t a r g e t ,   ' U L ' ,   ' c l i c k M e n u ' ) ;  
 	 	 	 	 i f   (   ! d i v . i s V i s i b l e   & &   ( p . c o n t a i n s ( r e l T a r g e t ) )   )  
 	 	 	 	 {  
 	 	 	 	 	 $ ( t h i s ) . r e m o v e C l a s s ( ' h o v e r ' ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 } ;  
  
 	 	 v a r   m a i n C l i c k   =   f u n c t i o n ( )  
 	 	 {  
 	 	 	 v a r   d i v   =   g e t O n e C h i l d ( t h i s ,   ' D I V ' ) ;  
 	 	 	 i f   (   d i v   & &   d i v . i s V i s i b l e   )   / / c l i c k e d   o n   a n   o p e n   m a i n - m e n u - i t e m  
 	 	 	 {  
 	 	 	 	 c l e a n ( ) ;  
 	 	 	 	 $ ( t h i s ) . a d d C l a s s ( ' h o v e r ' ) ;  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 h o v e r I n ( t h i s ,   s e t t i n g s . m a i n D e l a y ) ;  
 	 	 	 	 s h o w n   =   t r u e ;  
 	 	 	 	 $ ( d o c u m e n t ) . b i n d ( ' m o u s e d o w n ' ,   c h e c k M o u s e ) ;  
 	 	 	 }  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 } ;  
  
 	 	 v a r   c h e c k M o u s e   =   f u n c t i o n ( e )  
 	 	 {  
 	 	 	 / / i s   t h e   m o u s e   i n s i d e   a   c l i c k m e n u ?   i f   y e s ,   i s   i t   a n   o p e n   ( t h e   c u r r e n t )   o n e ?  
 	 	 	 v a r   v i s   =   f a l s e ;  
 	 	 	 v a r   c m   =   f i n d P a r e n t W i t h C l a s s ( e . t a r g e t ,   ' U L ' ,   ' c l i c k M e n u ' ) ;  
 	 	 	 i f   (   c m   )  
 	 	 	 {  
 	 	 	 	 $ ( c m . g e t E l e m e n t s B y T a g N a m e ( ' D I V ' ) ) . e a c h ( f u n c t i o n ( ) {  
 	 	 	 	 	 i f   (   t h i s . i s V i s i b l e   )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 v i s   =   t r u e ;  
 	 	 	 	 	 }  
 	 	 	 	 } ) ;  
 	 	 	 }  
 	 	 	 i f   (   ! v i s   )  
 	 	 	 {  
 	 	 	 	 c l e a n ( ) ;  
 	 	 	 }  
 	 	 } ;  
  
 	 	 v a r   c l e a n   =   f u n c t i o n ( )  
 	 	 {  
 	 	 	 / / r e m o v e   t i m e o u t   a n d   h i d e   t h e   d i v s  
 	 	 	 $ ( ' u l . c l i c k M e n u   d i v . o u t e r b o x ' ) . e a c h ( f u n c t i o n ( ) {  
 	 	 	 	 i f   (   t h i s . t i m e r   )  
 	 	 	 	 {  
 	 	 	 	 	 c l e a r T i m e o u t ( t h i s . t i m e r ) ;  
 	 	 	 	 	 t h i s . t i m e r   =   n u l l ;  
 	 	 	 	 }  
 	 	 	 	 i f   (   t h i s . i s V i s i b l e   )  
 	 	 	 	 {  
 	 	 	 	 	 $ ( t h i s ) . h i d e ( ) ;  
 	 	 	 	 	 t h i s . i s V i s i b l e   =   f a l s e ;  
 	 	 	 	 }  
 	 	 	 } ) ;  
 	 	 	 $ ( ' u l . c l i c k M e n u   l i ' ) . r e m o v e C l a s s ( ' h o v e r ' ) ;  
 	 	 	 / / r e m o v e   e v e n t s  
 	 	 	 $ ( ' u l . c l i c k M e n u > l i   l i ' ) . u n b i n d ( ' m o u s e o v e r ' ,   l i H o v e r I n ) . u n b i n d ( ' m o u s e o u t ' ,   l i H o v e r O u t ) . u n b i n d ( ' c l i c k ' ,   s e t t i n g s . o n C l i c k ) ;  
 	 	 	 $ ( d o c u m e n t ) . u n b i n d ( ' m o u s e d o w n ' ,   c h e c k M o u s e ) ;  
 	 	 	 s h o w n   =   f a l s e ;  
 	 	 } ;  
  
 	 	 v a r   g e t O n e C h i l d   =   f u n c t i o n ( e l e m ,   n a m e )  
 	 	 {  
 	 	 	 i f   (   ! e l e m   )  
 	 	 	 {  
 	 	 	 	 r e t u r n   n u l l ;  
 	 	 	 }  
 	 	 	 v a r   n   =   e l e m . f i r s t C h i l d ;  
 	 	 	 f o r   (   ;   n ;   n   =   n . n e x t S i b l i n g   )    
 	 	 	 {  
 	 	 	 	 i f   (   n . n o d e T y p e   = =   1   & &   n . n o d e N a m e . t o U p p e r C a s e ( )   = =   n a m e   )  
 	 	 	 	 {  
 	 	 	 	 	 r e t u r n   n ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 r e t u r n   n u l l ;  
 	 	 } ;  
  
 	 	 v a r   g e t A l l C h i l d s   =   f u n c t i o n ( e l e m ,   n a m e )  
 	 	 {  
 	 	 	 i f   (   ! e l e m   )  
 	 	 	 {  
 	 	 	 	 r e t u r n   [ ] ;  
 	 	 	 }  
 	 	 	 v a r   r   =   [ ] ;  
 	 	 	 v a r   n   =   e l e m . f i r s t C h i l d ;  
 	 	 	 f o r   (   ;   n ;   n   =   n . n e x t S i b l i n g   )    
 	 	 	 {  
 	 	 	 	 i f   (   n . n o d e T y p e   = =   1   & &   n . n o d e N a m e . t o U p p e r C a s e ( )   = =   n a m e   )  
 	 	 	 	 {  
 	 	 	 	 	 r [ r . l e n g t h ]   =   n ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 r e t u r n   r ;  
 	 	 } ;  
  
 	 	 v a r   f i n d P a r e n t W i t h C l a s s   =   f u n c t i o n ( e l e m ,   s e a r c h T a g ,   s e a r c h C l a s s )  
 	 	 {  
 	 	 	 v a r   p N o d e   =   e l e m . p a r e n t N o d e ;  
 	 	 	 v a r   p a t t e r n   =   n e w   R e g E x p ( " ( ^ | \ \ s ) "   +   s e a r c h C l a s s   +   " ( \ \ s | $ ) " ) ;  
 	 	 	 f o r   (   ;   p N o d e ;   p N o d e   =   p N o d e . p a r e n t N o d e   )  
 	 	 	 {  
 	 	 	 	 i f   (   p N o d e . n o d e T y p e   = =   1   & &   p N o d e . n o d e N a m e . t o U p p e r C a s e ( )   = =   s e a r c h T a g   & &   p a t t e r n . t e s t ( p N o d e . c l a s s N a m e )   )  
 	 	 	 	 {  
 	 	 	 	 	 r e t u r n   p N o d e ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 r e t u r n   n u l l ;  
 	 	 } ;  
 	 	  
 	 	 v a r   c h e c k C l a s s   =   f u n c t i o n ( e l e m ,   s e a r c h C l a s s )  
 	 	 {  
 	 	 	 v a r   p a t t e r n   =   n e w   R e g E x p ( " ( ^ | \ \ s ) "   +   s e a r c h C l a s s   +   " ( \ \ s | $ ) " ) ;  
 	 	 	 i f   (   p a t t e r n . t e s t ( e l e m . c l a s s N a m 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   i s C h i l d   =   f u n c t i o n ( e l e m ,   c h i l d E l e m )  
 	 	 {  
 	 	 	 v a r   n   =   e l e m . f i r s t C h i l d ;  
 	 	 	 f o r   (   ;   n ;   n   =   n . n e x t S i b l i n g   )    
 	 	 	 {  
 	 	 	 	 i f   (   n   = =   c h i l d E l e m   )  
 	 	 	 	 {  
 	 	 	 	 	 r e t u r n   t r u e ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 } ;  
  
 	         r e t u r n   t h i s . e a c h ( f u n c t i o n ( )  
 	 	 {  
 	 	 	 / / a d d   . c o n t a i n s ( )   t o   m o z i l l a   -   h t t p : / / w w w . q u i r k s m o d e . o r g / b l o g / a r c h i v e s / 2 0 0 6 / 0 1 / c o n t a i n s _ f o r _ m o . h t m l  
 	 	 	 i f   ( w i n d o w . N o d e   & &   N o d e . p r o t o t y p e   & &   ! N o d e . p r o t o t y p e . c o n t a i n s )  
 	 	 	 {  
 	 	 	 	 N o d e . p r o t o t y p e . c o n t a i n s   =   f u n c t i o n ( a r g )    
 	 	 	 	 {  
 	 	 	 	 	 r e t u r n   ! ! ( t h i s . c o m p a r e D o c u m e n t P o s i t i o n ( a r g )   &   1 6 ) ;  
 	 	 	 	 } ;  
 	 	 	 }  
 	 	 	 / / a d d   c l a s s  
 	 	 	 i f   (   ! c h e c k C l a s s ( t h i s ,   ' c l i c k M e n u ' )   )  
 	 	 	 {  
 	 	 	 	 $ ( t h i s ) . a d d C l a s s ( ' c l i c k M e n u ' ) ;  
 	 	 	 }  
 	 	 	 / / a d d   s h a d o w s  
 	 	 	 $ ( ' u l ' ,   t h i s ) . s h a d o w B o x ( ) ;  
 	 	 	 / / i e 6 ?   -   a d d   i f r a m e s  
 	 	 	 i f   (   $ . b r o w s e r . m s i e   & &   ( ! $ . b r o w s e r . v e r s i o n   | |   p a r s e I n t ( $ . b r o w s e r . v e r s i o n )   < =   6 )   )  
 	 	 	 {  
 	 	 	 	 i f   (   $ . f n . b g i f r a m e   )  
 	 	 	 	 {  
 	 	 	 	 	 $ ( ' d i v . o u t e r b o x ' ,   t h i s ) . b g i f r a m e ( ) ;  
 	 	 	 	 }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 / *   t h a n k s   t o   M a r k   G i b s o n   -   h t t p : / / w w w . n a b b l e . c o m / f o r u m / V i e w P o s t . j t p ? p o s t = 6 5 0 4 4 1 4 & f r a m e d = y   * /  
 	 	 	 	 	 $ ( ' d i v . o u t e r b o x ' ,   t h i s ) . a p p e n d ( ' < i f r a m e   s t y l e = " d i s p l a y : b l o c k ; p o s i t i o n : a b s o l u t e ; t o p : 0 ; l e f t : 0 ; z - i n d e x : - 1 ; f i l t e r : m a s k ( ) ; '   +    
 	 	 	 	 	 	 	 	 	 ' w i d t h : e x p r e s s i o n ( t h i s . p a r e n t N o d e . o f f s e t W i d t h ) ; h e i g h t : e x p r e s s i o n ( t h i s . p a r e n t N o d e . o f f s e t H e i g h t ) " / > ' ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 / / a s s i g n   e v e n t s  
 	 	 	 $ ( t h i s ) . b i n d ( ' c l o s e m e n u ' ,   f u n c t i o n ( ) { c l e a n ( ) ; } ) ;   / / a s s i g n   c l o s e m e n u - e v e n t ,   t h r o u g h   w i c h   t h e   m e n u   c a n   b e   c l o s e d   f r o m   o u t s i d e   t h e   p l u g i n  
 	 	 	 / / a d d   c l i c k   e v e n t   h a n d l i n g ,   i f   t h e r e   a r e   a n y   e l e m e n t s   i n s i d e   t h e   m a i n   m e n u  
 	 	 	 v a r   l i E l e m s   =   g e t A l l C h i l d s ( t h i s ,   ' L I ' ) ;  
 	 	 	 f o r   (   v a r   j   =   0 ;   j   <   l i E l e m s . l e n g t h ;   j + +   )  
 	 	 	 {  
 	 	 	 	 i f   (   g e t O n e C h i l d ( g e t O n e C h i l d ( g e t O n e C h i l d ( l i E l e m s [ j ] ,   ' D I V ' ) ,   ' U L ' ) ,   ' L I ' )   )   / /   > d i v > u l > l i  
 	 	 	 	 {  
 	 	 	 	 	 $ ( l i E l e m s [ j ] ) . c l i c k ( m a i n C l i c k ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 / / a d d   h o v e r   e v e n t   h a n d l i n g   a n d   a s s i g n   c l a s s e s  
 	 	 	 $ ( l i E l e m s ) . h o v e r ( m a i n H o v e r I n ,   m a i n H o v e r O u t ) . a d d C l a s s ( ' m a i n ' ) . f i n d ( ' > d i v ' ) . a d d C l a s s ( ' i n n e r ' ) ;  
 	 	 	 / / a d d   t h e   l i t t l e   a r r o w   b e f o r e   e a c h   s u b m e n u  
 	 	 	 i f   (   s e t t i n g s . a r r o w S r c   )  
 	 	 	 {  
 	 	 	 	 $ ( ' d i v . i n n e r   d i v . o u t e r b o x ' ,   t h i s ) . b e f o r e ( ' < i m g   s r c = " '   +   s e t t i n g s . a r r o w S r c   +   ' "   c l a s s = " l i A r r o w "   / > ' ) ;  
 	 	 	 }  
  
 	 	 	 / / t h e   f l o a t i n g   l i s t   e l e m e n t s   a r e   d e s t r o y i n g   t h e   l a y o u t . . s o   m a k e   i t   n i c e   a g a i n . .  
 	 	 	 $ ( t h i s ) . w r a p ( ' < d i v   c l a s s = " c m D i v " > < / d i v > ' ) . a f t e r ( ' < d i v   s t y l e = " c l e a r :   b o t h ;   v i s i b i l i t y :   h i d d e n ; " > < / d i v > ' ) ;  
 	         } ) ;  
 	 } ;  
 	 $ . f n . c l i c k M e n u . s e t D e f a u l t s   =   f u n c t i o n ( o )  
 	 {  
 	 	 $ . e x t e n d ( d e f a u l t s ,   o ) ;  
 	 } ;  
 } ) ( j Q u e r y ) ;  
  
 ( f u n c t i o n ( $ )  
 {  
 	 $ . f n . s h a d o w B o x   =   f u n c t i o n ( )   {  
 	         r e t u r n   t h i s . e a c h ( f u n c t i o n ( )  
 	 	 {  
 	 	 	 v a r   o u t e r   =   $ ( ' < d i v   c l a s s = " o u t e r b o x " > < / d i v > ' ) . g e t ( 0 ) ;  
 	 	 	 i f   (   $ ( t h i s ) . c s s ( ' p o s i t i o n ' )   = =   ' a b s o l u t e '   )  
 	 	 	 {  
 	 	 	 	 / / i f   t h e   c h i l d ( t h i s )   i s   p o s i t i o n e d   a b o l u t e ,   w e   h a v e   t o   u s e   r e l a t i v e   p o s i t i o n i n g   a n d   s h r i n k   t h e   o u t e r b o x   a c c o r d i n g l y   t o   t h e   i n n e r b o x  
 	 	 	 	 $ ( o u t e r ) . c s s ( { p o s i t i o n : ' r e l a t i v e ' ,   w i d t h : t h i s . o f f s e t W i d t h ,   h e i g h t : t h i s . o f f s e t H e i g h t } ) ;  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 / / s h r i n k   t h e   o u t e r b o x  
 	 	 	 	 $ ( o u t e r ) . c s s ( ' p o s i t i o n ' ,   ' a b s o l u t e ' ) ;  
 	 	 	 }  
 	 	 	 / / a d d   t h e   b o x e s  
 	 	 	 $ ( t h i s ) . a d d C l a s s ( ' i n n e r B o x ' ) . w r a p ( o u t e r ) .  
 	 	 	 	 	 b e f o r e ( ' < d i v   c l a s s = " s h a d o w b o x 1 " > < / d i v > < d i v   c l a s s = " s h a d o w b o x 2 " > < / d i v > < d i v   c l a s s = " s h a d o w b o x 3 " > < / d i v > ' ) ;  
 	         } ) ;  
 	 } ;  
 } ) ( j Q u e r y ) ;  
  
  
  
 / * !  
   *   j Q u e r y   C y c l e   P l u g i n   ( w i t h   T r a n s i t i o n   D e f i n i t i o n s )  
   *   E x a m p l e s   a n d   d o c u m e n t a t i o n   a t :   h t t p : / / j q u e r y . m a l s u p . c o m / c y c l e /  
   *   C o p y r i g h t   ( c )   2 0 0 7 - 2 0 1 0   M .   A l s u p  
   *   V e r s i o n :   2 . 8 4   ( 3 0 - M A R - 2 0 1 0 )  
   *   D u a l   l i c e n s e d   u n d e r   t h e   M I T   a n d   G P L   l i c e n s e s :  
   *   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  
   *   h t t p : / / w w w . g n u . o r g / l i c e n s e s / g p l . h t m l  
   *   R e q u i r e s :   j Q u e r y   v 1 . 2 . 6   o r   l a t e r  
   * /  
 ; ( f u n c t i o n ( $ )   {  
  
 v a r   v e r   =   ' 2 . 8 4 ' ;  
  
 / /   i f   $ . s u p p o r t   i s   n o t   d e f i n e d   ( p r e   j Q u e r y   1 . 3 )   a d d   w h a t   I   n e e d  
 i f   ( $ . s u p p o r t   = =   u n d e f i n e d )   {  
 	 $ . s u p p o r t   =   {  
 	 	 o p a c i t y :   ! ( $ . b r o w s e r . m s i e )  
 	 } ;  
 }  
  
 f u n c t i o n   d e b u g ( s )   {  
 	 i f   ( $ . f n . c y c l e . d e b u g )  
 	 	 l o g ( s ) ;  
 } 	 	  
 f u n c t i o n   l o g ( )   {  
 	 i f   ( w i n d o w . c o n s o l e   & &   w i n d o w . c o n s o l e . l o g )  
 	 	 w i n d o w . c o n s o l e . l o g ( ' [ c y c l e ]   '   +   A r r a y . p r o t o t y p e . j o i n . c a l l ( a r g u m e n t s , '   ' ) ) ;  
 } ;  
  
 / /   t h e   o p t i o n s   a r g   c a n   b e . . .  
 / /       a   n u m b e r     -   i n d i c a t e s   a n   i m m e d i a t e   t r a n s i t i o n   s h o u l d   o c c u r   t o   t h e   g i v e n   s l i d e   i n d e x  
 / /       a   s t r i n g     -   ' p a u s e ' ,   ' r e s u m e ' ,   ' t o g g l e ' ,   ' n e x t ' ,   ' p r e v ' ,   ' s t o p ' ,   ' d e s t r o y '   o r   t h e   n a m e   o f   a   t r a n s i t i o n   e f f e c t   ( i e ,   ' f a d e ' ,   ' z o o m ' ,   e t c )  
 / /       a n   o b j e c t   -   p r o p e r t i e s   t o   c o n t r o l   t h e   s l i d e s h o w  
 / /  
 / /   t h e   a r g 2   a r g   c a n   b e . . .  
 / /       t h e   n a m e   o f   a n   f x   ( o n l y   u s e d   i n   c o n j u n c t i o n   w i t h   a   n u m e r i c   v a l u e   f o r   ' o p t i o n s ' )  
 / /       t h e   v a l u e   t r u e   ( o n l y   u s e d   i n   f i r s t   a r g   = =   ' r e s u m e ' )   a n d   i n d i c a t e s  
 / / 	   t h a t   t h e   r e s u m e   s h o u l d   o c c u r   i m m e d i a t e l y   ( n o t   w a i t   f o r   n e x t   t i m e o u t )  
  
 $ . f n . c y c l e   =   f u n c t i o n ( o p t i o n s ,   a r g 2 )   {  
 	 v a r   o   =   {   s :   t h i s . s e l e c t o r ,   c :   t h i s . c o n t e x t   } ;  
  
 	 / /   i n   1 . 3 +   w e   c a n   f i x   m i s t a k e s   w i t h   t h e   r e a d y   s t a t e  
 	 i f   ( t h i s . l e n g t h   = = =   0   & &   o p t i o n s   ! =   ' s t o p ' )   {  
 	 	 i f   ( ! $ . i s R e a d y   & &   o . s )   {  
 	 	 	 l o g ( ' D O M   n o t   r e a d y ,   q u e u i n g   s l i d e s h o w ' ) ;  
 	 	 	 $ ( f u n c t i o n ( )   {  
 	 	 	 	 $ ( o . s , o . c ) . c y c l e ( o p t i o n s , a r g 2 ) ;  
 	 	 	 } ) ;  
 	 	 	 r e t u r n   t h i s ;  
 	 	 }  
 	 	 / /   i s   y o u r   D O M   r e a d y ?     h t t p : / / d o c s . j q u e r y . c o m / T u t o r i a l s : I n t r o d u c i n g _ $ ( d o c u m e n t ) . r e a d y ( )  
 	 	 l o g ( ' t e r m i n a t i n g ;   z e r o   e l e m e n t s   f o u n d   b y   s e l e c t o r '   +   ( $ . i s R e a d y   ?   ' '   :   '   ( D O M   n o t   r e a d y ) ' ) ) ;  
 	 	 r e t u r n   t h i s ;  
 	 }  
  
 	 / /   i t e r a t e   t h e   m a t c h e d   n o d e s e t  
 	 r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {  
 	 	 v a r   o p t s   =   h a n d l e A r g u m e n t s ( t h i s ,   o p t i o n s ,   a r g 2 ) ;  
 	 	 i f   ( o p t s   = = =   f a l s e )  
 	 	 	 r e t u r n ;  
  
 	 	 o p t s . u p d a t e A c t i v e P a g e r L i n k   =   o p t s . u p d a t e A c t i v e P a g e r L i n k   | |   $ . f n . c y c l e . u p d a t e A c t i v e P a g e r L i n k ;  
 	 	  
 	 	 / /   s t o p   e x i s t i n g   s l i d e s h o w   f o r   t h i s   c o n t a i n e r   ( i f   t h e r e   i s   o n e )  
 	 	 i f   ( t h i s . c y c l e T i m e o u t )  
 	 	 	 c l e a r T i m e o u t ( t h i s . c y c l e T i m e o u t ) ;  
 	 	 t h i s . c y c l e T i m e o u t   =   t h i s . c y c l e P a u s e   =   0 ;  
  
 	 	 v a r   $ c o n t   =   $ ( t h i s ) ;  
 	 	 v a r   $ s l i d e s   =   o p t s . s l i d e E x p r   ?   $ ( o p t s . s l i d e E x p r ,   t h i s )   :   $ c o n t . c h i l d r e n ( ) ;  
 	 	 v a r   e l s   =   $ s l i d e s . g e t ( ) ;  
 	 	 i f   ( e l s . l e n g t h   <   2 )   {  
 	 	 	 l o g ( ' t e r m i n a t i n g ;   t o o   f e w   s l i d e s :   '   +   e l s . l e n g t h ) ;  
 	 	 	 r e t u r n ;  
 	 	 }  
  
 	 	 v a r   o p t s 2   =   b u i l d O p t i o n s ( $ c o n t ,   $ s l i d e s ,   e l s ,   o p t s ,   o ) ;  
 	 	 i f   ( o p t s 2   = = =   f a l s e )  
 	 	 	 r e t u r n ;  
  
 	 	 v a r   s t a r t T i m e   =   o p t s 2 . c o n t i n u o u s   ?   1 0   :   g e t T i m e o u t ( o p t s 2 . c u r r S l i d e ,   o p t s 2 . n e x t S l i d e ,   o p t s 2 ,   ! o p t s 2 . r e v ) ;  
  
 	 	 / /   i f   i t ' s   a n   a u t o   s l i d e s h o w ,   k i c k   i t   o f f  
 	 	 i f   ( s t a r t T i m e )   {  
 	 	 	 s t a r t T i m e   + =   ( o p t s 2 . d e l a y   | |   0 ) ;  
 	 	 	 i f   ( s t a r t T i m e   <   1 0 )  
 	 	 	 	 s t a r t T i m e   =   1 0 ;  
 	 	 	 d e b u g ( ' f i r s t   t i m e o u t :   '   +   s t a r t T i m e ) ;  
 	 	 	 t h i s . c y c l e T i m e o u t   =   s e t T i m e o u t ( f u n c t i o n ( ) { g o ( e l s , o p t s 2 , 0 , ! o p t s 2 . r e v ) } ,   s t a r t T i m e ) ;  
 	 	 }  
 	 } ) ;  
 } ;  
  
 / /   p r o c e s s   t h e   a r g s   t h a t   w e r e   p a s s e d   t o   t h e   p l u g i n   f n  
 f u n c t i o n   h a n d l e A r g u m e n t s ( c o n t ,   o p t i o n s ,   a r g 2 )   {  
 	 i f   ( c o n t . c y c l e S t o p   = =   u n d e f i n e d )  
 	 	 c o n t . c y c l e S t o p   =   0 ;  
 	 i f   ( o p t i o n s   = = =   u n d e f i n e d   | |   o p t i o n s   = = =   n u l l )  
 	 	 o p t i o n s   =   { } ;  
 	 i f   ( o p t i o n s . c o n s t r u c t o r   = =   S t r i n g )   {  
 	 	 s w i t c h ( o p t i o n s )   {  
 	 	 c a s e   ' d e s t r o y ' :  
 	 	 c a s e   ' s t o p ' :  
 	 	 	 v a r   o p t s   =   $ ( c o n t ) . d a t a ( ' c y c l e . o p t s ' ) ;  
 	 	 	 i f   ( ! o p t s )  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 c o n t . c y c l e S t o p + + ;   / /   c a l l b a c k s   l o o k   f o r   c h a n g e  
 	 	 	 i f   ( c o n t . c y c l e T i m e o u t )  
 	 	 	 	 c l e a r T i m e o u t ( c o n t . c y c l e T i m e o u t ) ;  
 	 	 	 c o n t . c y c l e T i m e o u t   =   0 ;  
 	 	 	 $ ( c o n t ) . r e m o v e D a t a ( ' c y c l e . o p t s ' ) ;  
 	 	 	 i f   ( o p t i o n s   = =   ' d e s t r o y ' )  
 	 	 	 	 d e s t r o y ( o p t s ) ;  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 c a s e   ' t o g g l e ' :  
 	 	 	 c o n t . c y c l e P a u s e   =   ( c o n t . c y c l e P a u s e   = = =   1 )   ?   0   :   1 ;  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 c a s e   ' p a u s e ' :  
 	 	 	 c o n t . c y c l e P a u s e   =   1 ;  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 c a s e   ' r e s u m e ' :  
 	 	 	 c o n t . c y c l e P a u s e   =   0 ;  
 	 	 	 i f   ( a r g 2   = = =   t r u e )   {   / /   r e s u m e   n o w !  
 	 	 	 	 o p t i o n s   =   $ ( c o n t ) . d a t a ( ' c y c l e . o p t s ' ) ;  
 	 	 	 	 i f   ( ! o p t i o n s )   {  
 	 	 	 	 	 l o g ( ' o p t i o n s   n o t   f o u n d ,   c a n   n o t   r e s u m e ' ) ;  
 	 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 	 }  
 	 	 	 	 i f   ( c o n t . c y c l e T i m e o u t )   {  
 	 	 	 	 	 c l e a r T i m e o u t ( c o n t . c y c l e T i m e o u t ) ;  
 	 	 	 	 	 c o n t . c y c l e T i m e o u t   =   0 ;  
 	 	 	 	 }  
 	 	 	 	 g o ( o p t i o n s . e l e m e n t s ,   o p t i o n s ,   1 ,   1 ) ;  
 	 	 	 }  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 c a s e   ' p r e v ' :  
 	 	 c a s e   ' n e x t ' :  
 	 	 	 v a r   o p t s   =   $ ( c o n t ) . d a t a ( ' c y c l e . o p t s ' ) ;  
 	 	 	 i f   ( ! o p t s )   {  
 	 	 	 	 l o g ( ' o p t i o n s   n o t   f o u n d ,   " p r e v / n e x t "   i g n o r e d ' ) ;  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 }  
 	 	 	 $ . f n . c y c l e [ o p t i o n s ] ( o p t s ) ;  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 d e f a u l t :  
 	 	 	 o p t i o n s   =   {   f x :   o p t i o n s   } ;  
 	 	 } ;  
 	 	 r e t u r n   o p t i o n s ;  
 	 }  
 	 e l s e   i f   ( o p t i o n s . c o n s t r u c t o r   = =   N u m b e r )   {  
 	 	 / /   g o   t o   t h e   r e q u e s t e d   s l i d e  
 	 	 v a r   n u m   =   o p t i o n s ;  
 	 	 o p t i o n s   =   $ ( c o n t ) . d a t a ( ' c y c l e . o p t s ' ) ;  
 	 	 i f   ( ! o p t i o n s )   {  
 	 	 	 l o g ( ' o p t i o n s   n o t   f o u n d ,   c a n   n o t   a d v a n c e   s l i d e ' ) ;  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 }  
 	 	 i f   ( n u m   <   0   | |   n u m   > =   o p t i o n s . e l e m e n t s . l e n g t h )   {  
 	 	 	 l o g ( ' i n v a l i d   s l i d e   i n d e x :   '   +   n u m ) ;  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 }  
 	 	 o p t i o n s . n e x t S l i d e   =   n u m ;  
 	 	 i f   ( c o n t . c y c l e T i m e o u t )   {  
 	 	 	 c l e a r T i m e o u t ( c o n t . c y c l e T i m e o u t ) ;  
 	 	 	 c o n t . c y c l e T i m e o u t   =   0 ;  
 	 	 }  
 	 	 i f   ( t y p e o f   a r g 2   = =   ' s t r i n g ' )  
 	 	 	 o p t i o n s . o n e T i m e F x   =   a r g 2 ;  
 	 	 g o ( o p t i o n s . e l e m e n t s ,   o p t i o n s ,   1 ,   n u m   > =   o p t i o n s . c u r r S l i d e ) ;  
 	 	 r e t u r n   f a l s e ;  
 	 }  
 	 r e t u r n   o p t i o n s ;  
 } ;  
  
 f u n c t i o n   r e m o v e F i l t e r ( e l ,   o p t s )   {  
 	 i f   ( ! $ . s u p p o r t . o p a c i t y   & &   o p t s . c l e a r t y p e   & &   e l . s t y l e . f i l t e r )   {  
 	 	 t r y   {   e l . s t y l e . r e m o v e A t t r i b u t e ( ' f i l t e r ' ) ;   }  
 	 	 c a t c h ( s m o t h e r )   { }   / /   h a n d l e   o l d   o p e r a   v e r s i o n s  
 	 }  
 } ;  
  
 / /   u n b i n d   e v e n t   h a n d l e r s  
 f u n c t i o n   d e s t r o y ( o p t s )   {  
 	 i f   ( o p t s . n e x t )  
 	 	 $ ( o p t s . n e x t ) . u n b i n d ( o p t s . p r e v N e x t E v e n t ) ;  
 	 i f   ( o p t s . p r e v )  
 	 	 $ ( o p t s . p r e v ) . u n b i n d ( o p t s . p r e v N e x t E v e n t ) ;  
 	  
 	 i f   ( o p t s . p a g e r   | |   o p t s . p a g e r A n c h o r B u i l d e r )  
 	 	 $ . e a c h ( o p t s . p a g e r A n c h o r s   | |   [ ] ,   f u n c t i o n ( )   {  
 	 	 	 t h i s . u n b i n d ( ) . r e m o v e ( ) ;  
 	 	 } ) ;  
 	 o p t s . p a g e r A n c h o r s   =   n u l l ;  
 	 i f   ( o p t s . d e s t r o y )   / /   c a l l b a c k  
 	 	 o p t s . d e s t r o y ( o p t s ) ;  
 } ;  
  
 / /   o n e - t i m e   i n i t i a l i z a t i o n  
 f u n c t i o n   b u i l d O p t i o n s ( $ c o n t ,   $ s l i d e s ,   e l s ,   o p t i o n s ,   o )   {  
 	 / /   s u p p o r t   m e t a d a t a   p l u g i n   ( v 1 . 0   a n d   v 2 . 0 )  
 	 v a r   o p t s   =   $ . e x t e n d ( { } ,   $ . f n . c y c l e . d e f a u l t s ,   o p t i o n s   | |   { } ,   $ . m e t a d a t a   ?   $ c o n t . m e t a d a t a ( )   :   $ . m e t a   ?   $ c o n t . d a t a ( )   :   { } ) ;  
 	 i f   ( o p t s . a u t o s t o p )  
 	 	 o p t s . c o u n t d o w n   =   o p t s . a u t o s t o p C o u n t   | |   e l s . l e n g t h ;  
  
 	 v a r   c o n t   =   $ c o n t [ 0 ] ;  
 	 $ c o n t . d a t a ( ' c y c l e . o p t s ' ,   o p t s ) ;  
 	 o p t s . $ c o n t   =   $ c o n t ;  
 	 o p t s . s t o p C o u n t   =   c o n t . c y c l e S t o p ;  
 	 o p t s . e l e m e n t s   =   e l s ;  
 	 o p t s . b e f o r e   =   o p t s . b e f o r e   ?   [ o p t s . b e f o r e ]   :   [ ] ;  
 	 o p t s . a f t e r   =   o p t s . a f t e r   ?   [ o p t s . a f t e r ]   :   [ ] ;  
 	 o p t s . a f t e r . u n s h i f t ( f u n c t i o n ( ) {   o p t s . b u s y = 0 ;   } ) ;  
  
 	 / /   p u s h   s o m e   a f t e r   c a l l b a c k s  
 	 i f   ( ! $ . s u p p o r t . o p a c i t y   & &   o p t s . c l e a r t y p e )  
 	 	 o p t s . a f t e r . p u s h ( f u n c t i o n ( )   {   r e m o v e F i l t e r ( t h i s ,   o p t s ) ;   } ) ;  
 	 i f   ( o p t s . c o n t i n u o u s )  
 	 	 o p t s . a f t e r . p u s h ( f u n c t i o n ( )   {   g o ( e l s , o p t s , 0 , ! o p t s . r e v ) ;   } ) ;  
  
 	 s a v e O r i g i n a l O p t s ( o p t s ) ;  
  
 	 / /   c l e a r T y p e   c o r r e c t i o n s  
 	 i f   ( ! $ . s u p p o r t . o p a c i t y   & &   o p t s . c l e a r t y p e   & &   ! o p t s . c l e a r t y p e N o B g )  
 	 	 c l e a r T y p e F i x ( $ s l i d e s ) ;  
  
 	 / /   c o n t a i n e r   r e q u i r e s   n o n - s t a t i c   p o s i t i o n   s o   t h a t   s l i d e s   c a n   b e   p o s i t i o n   w i t h i n  
 	 i f   ( $ c o n t . c s s ( ' p o s i t i o n ' )   = =   ' s t a t i c ' )  
 	 	 $ c o n t . c s s ( ' p o s i t i o n ' ,   ' r e l a t i v e ' ) ;  
 	 i f   ( o p t s . w i d t h )  
 	 	 $ c o n t . w i d t h ( o p t s . w i d t h ) ;  
 	 i f   ( o p t s . h e i g h t   & &   o p t s . h e i g h t   ! =   ' a u t o ' )  
 	 	 $ c o n t . h e i g h t ( o p t s . h e i g h t ) ;  
  
 	 i f   ( o p t s . s t a r t i n g S l i d e )  
 	 	 o p t s . s t a r t i n g S l i d e   =   p a r s e I n t ( o p t s . s t a r t i n g S l i d e ) ;  
  
 	 / /   i f   r a n d o m ,   m i x   u p   t h e   s l i d e   a r r a y  
 	 i f   ( o p t s . r a n d o m )   {  
 	 	 o p t s . r a n d o m M a p   =   [ ] ;  
 	 	 f o r   ( v a r   i   =   0 ;   i   <   e l s . l e n g t h ;   i + + )  
 	 	 	 o p t s . r a n d o m M a p . p u s h ( i ) ;  
 	 	 o p t s . r a n d o m M a p . s o r t ( f u n c t i o n ( a , b )   { r e t u r n   M a t h . r a n d o m ( )   -   0 . 5 ; } ) ;  
 	 	 o p t s . r a n d o m I n d e x   =   1 ;  
 	 	 o p t s . s t a r t i n g S l i d e   =   o p t s . r a n d o m M a p [ 1 ] ;  
 	 }  
 	 e l s e   i f   ( o p t s . s t a r t i n g S l i d e   > =   e l s . l e n g t h )  
 	 	 o p t s . s t a r t i n g S l i d e   =   0 ;   / /   c a t c h   b o g u s   i n p u t  
 	 o p t s . c u r r S l i d e   =   o p t s . s t a r t i n g S l i d e   | |   0 ;  
 	 v a r   f i r s t   =   o p t s . s t a r t i n g S l i d e ;  
  
 	 / /   s e t   p o s i t i o n   a n d   z I n d e x   o n   a l l   t h e   s l i d e s  
 	 $ s l i d e s . c s s ( { p o s i t i o n :   ' a b s o l u t e ' ,   t o p : 0 ,   l e f t : 0 } ) . h i d e ( ) . e a c h ( f u n c t i o n ( i )   {  
 	 	 v a r   z   =   f i r s t   ?   i   > =   f i r s t   ?   e l s . l e n g t h   -   ( i - f i r s t )   :   f i r s t - i   :   e l s . l e n g t h - i ;  
 	 	 $ ( t h i s ) . c s s ( ' z - i n d e x ' ,   z )  
 	 } ) ;  
  
 	 / /   m a k e   s u r e   f i r s t   s l i d e   i s   v i s i b l e  
 	 $ ( e l s [ f i r s t ] ) . c s s ( ' o p a c i t y ' , 1 ) . s h o w ( ) ;   / /   o p a c i t y   b i t   n e e d e d   t o   h a n d l e   r e s t a r t   u s e   c a s e  
 	 r e m o v e F i l t e r ( e l s [ f i r s t ] ,   o p t s ) ;  
  
 	 / /   s t r e t c h   s l i d e s  
 	 i f   ( o p t s . f i t   & &   o p t s . w i d t h )  
 	 	 $ s l i d e s . w i d t h ( o p t s . w i d t h ) ;  
 	 i f   ( o p t s . f i t   & &   o p t s . h e i g h t   & &   o p t s . h e i g h t   ! =   ' a u t o ' )  
 	 	 $ s l i d e s . h e i g h t ( o p t s . h e i g h t ) ;  
  
 	 / /   s t r e t c h   c o n t a i n e r  
 	 v a r   r e s h a p e   =   o p t s . c o n t a i n e r R e s i z e   & &   ! $ c o n t . i n n e r H e i g h t ( ) ;  
 	 i f   ( r e s h a p e )   {   / /   d o   t h i s   o n l y   i f   c o n t a i n e r   h a s   n o   s i z e   h t t p : / / t i n y u r l . c o m / d a 2 o a 9  
 	 	 v a r   m a x w   =   0 ,   m a x h   =   0 ;  
 	 	 f o r ( v a r   j = 0 ;   j   <   e l s . l e n g t h ;   j + + )   {  
 	 	 	 v a r   $ e   =   $ ( e l s [ j ] ) ,   e   =   $ e [ 0 ] ,   w   =   $ e . o u t e r W i d t h ( ) ,   h   =   $ e . o u t e r H e i g h t ( ) ;  
 	 	 	 i f   ( ! w )   w   =   e . o f f s e t W i d t h   | |   e . w i d t h   | |   $ e . a t t r ( ' w i d t h ' )  
 	 	 	 i f   ( ! h )   h   =   e . o f f s e t H e i g h t   | |   e . h e i g h t   | |   $ e . a t t r ( ' h e i g h t ' ) ;  
 	 	 	 m a x w   =   w   >   m a x w   ?   w   :   m a x w ;  
 	 	 	 m a x h   =   h   >   m a x h   ?   h   :   m a x h ;  
 	 	 }  
 	 	 i f   ( m a x w   >   0   & &   m a x h   >   0 )  
 	 	 	 $ c o n t . c s s ( { w i d t h : m a x w + ' p x ' , h e i g h t : m a x h + ' p x ' } ) ;  
 	 }  
  
 	 i f   ( o p t s . p a u s e )  
 	 	 $ c o n t . h o v e r ( f u n c t i o n ( ) { t h i s . c y c l e P a u s e + + ; } , f u n c t i o n ( ) { t h i s . c y c l e P a u s e - - ; } ) ;  
  
 	 i f   ( s u p p o r t M u l t i T r a n s i t i o n s ( o p t s )   = = =   f a l s e )  
 	 	 r e t u r n   f a l s e ;  
  
 	 / /   a p p a r e n t l y   a   l o t   o f   p e o p l e   u s e   i m a g e   s l i d e s h o w s   w i t h o u t   h e i g h t / w i d t h   a t t r i b u t e s   o n   t h e   i m a g e s .  
 	 / /   C y c l e   2 . 5 0 +   r e q u i r e s   t h e   s i z i n g   i n f o   f o r   e v e r y   s l i d e ;   t h i s   b l o c k   t r i e s   t o   d e a l   w i t h   t h a t .  
 	 v a r   r e q u e u e   =   f a l s e ;  
 	 o p t i o n s . r e q u e u e A t t e m p t s   =   o p t i o n s . r e q u e u e A t t e m p t s   | |   0 ;  
 	 $ s l i d e s . e a c h ( f u n c t i o n ( )   {  
 	 	 / /   t r y   t o   g e t   h e i g h t / w i d t h   o f   e a c h   s l i d e  
 	 	 v a r   $ e l   =   $ ( t h i s ) ;  
 	 	 t h i s . c y c l e H   =   ( o p t s . f i t   & &   o p t s . h e i g h t )   ?   o p t s . h e i g h t   :   ( $ e l . h e i g h t ( )   | |   t h i s . o f f s e t H e i g h t   | |   t h i s . h e i g h t   | |   $ e l . a t t r ( ' h e i g h t ' )   | |   0 ) ;  
 	 	 t h i s . c y c l e W   =   ( o p t s . f i t   & &   o p t s . w i d t h )   ?   o p t s . w i d t h   :   ( $ e l . w i d t h ( )   | |   t h i s . o f f s e t W i d t h   | |   t h i s . w i d t h   | |   $ e l . a t t r ( ' w i d t h ' )   | |   0 ) ;  
  
 	 	 i f   (   $ e l . i s ( ' i m g ' )   )   {  
 	 	 	 / /   s i g h . .     s n i f f i n g ,   h a c k i n g ,   s h r u g g i n g . . .     t h i s   c r a p p y   h a c k   t r i e s   t o   a c c o u n t   f o r   w h a t   b r o w s e r s   d o   w h e n  
 	 	 	 / /   a n   i m a g e   i s   b e i n g   d o w n l o a d e d   a n d   t h e   m a r k u p   d i d   n o t   i n c l u d e   s i z i n g   i n f o   ( h e i g h t / w i d t h   a t t r i b u t e s ) ;  
 	 	 	 / /   t h e r e   s e e m s   t o   b e   s o m e   " d e f a u l t "   s i z e s   u s e d   i n   t h i s   s i t u a t i o n  
 	 	 	 v a r   l o a d i n g I E 	 =   ( $ . b r o w s e r . m s i e     & &   t h i s . c y c l e W   = =   2 8   & &   t h i s . c y c l e H   = =   3 0   & &   ! t h i s . c o m p l e t e ) ;  
 	 	 	 v a r   l o a d i n g F F 	 =   ( $ . b r o w s e r . m o z i l l a   & &   t h i s . c y c l e W   = =   3 4   & &   t h i s . c y c l e H   = =   1 9   & &   ! t h i s . c o m p l e t e ) ;  
 	 	 	 v a r   l o a d i n g O p 	 =   ( $ . b r o w s e r . o p e r a   & &   ( ( t h i s . c y c l e W   = =   4 2   & &   t h i s . c y c l e H   = =   1 9 )   | |   ( t h i s . c y c l e W   = =   3 7   & &   t h i s . c y c l e H   = =   1 7 ) )   & &   ! t h i s . c o m p l e t e ) ;  
 	 	 	 v a r   l o a d i n g O t h e r   =   ( t h i s . c y c l e H   = =   0   & &   t h i s . c y c l e W   = =   0   & &   ! t h i s . c o m p l e t e ) ;  
 	 	 	 / /   d o n ' t   r e q u e u e   f o r   i m a g e s   t h a t   a r e   s t i l l   l o a d i n g   b u t   h a v e   a   v a l i d   s i z e  
 	 	 	 i f   ( l o a d i n g I E   | |   l o a d i n g F F   | |   l o a d i n g O p   | |   l o a d i n g O t h e r )   {  
 	 	 	 	 i f   ( o . s   & &   o p t s . r e q u e u e O n I m a g e N o t L o a d e d   & &   + + o p t i o n s . r e q u e u e A t t e m p t s   <   1 0 0 )   {   / /   t r a c k   r e t r y   c o u n t   s o   w e   d o n ' t   l o o p   f o r e v e r  
 	 	 	 	 	 l o g ( o p t i o n s . r e q u e u e A t t e m p t s , '   -   i m g   s l i d e   n o t   l o a d e d ,   r e q u e u i n g   s l i d e s h o w :   ' ,   t h i s . s r c ,   t h i s . c y c l e W ,   t h i s . c y c l e H ) ;  
 	 	 	 	 	 s e t T i m e o u t ( f u n c t i o n ( )   { $ ( o . s , o . c ) . c y c l e ( o p t i o n s ) } ,   o p t s . r e q u e u e T i m e o u t ) ;  
 	 	 	 	 	 r e q u e u e   =   t r u e ;  
 	 	 	 	 	 r e t u r n   f a l s e ;   / /   b r e a k   e a c h   l o o p  
 	 	 	 	 }  
 	 	 	 	 e l s e   {  
 	 	 	 	 	 l o g ( ' c o u l d   n o t   d e t e r m i n e   s i z e   o f   i m a g e :   ' + t h i s . s r c ,   t h i s . c y c l e W ,   t h i s . c y c l e H ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 r e t u r n   t r u e ;  
 	 } ) ;  
  
 	 i f   ( r e q u e u e )  
 	 	 r e t u r n   f a l s e ;  
  
 	 o p t s . c s s B e f o r e   =   o p t s . c s s B e f o r e   | |   { } ;  
 	 o p t s . a n i m I n   =   o p t s . a n i m I n   | |   { } ;  
 	 o p t s . a n i m O u t   =   o p t s . a n i m O u t   | |   { } ;  
  
 	 $ s l i d e s . n o t ( ' : e q ( ' + f i r s t + ' ) ' ) . c s s ( o p t s . c s s B e f o r e ) ;  
 	 i f   ( o p t s . c s s F i r s t )  
 	 	 $ ( $ s l i d e s [ f i r s t ] ) . c s s ( o p t s . c s s F i r s t ) ;  
  
 	 i f   ( o p t s . t i m e o u t )   {  
 	 	 o p t s . t i m e o u t   =   p a r s e I n t ( o p t s . t i m e o u t ) ;  
 	 	 / /   e n s u r e   t h a t   t i m e o u t   a n d   s p e e d   s e t t i n g s   a r e   s a n e  
 	 	 i f   ( o p t s . s p e e d . c o n s t r u c t o r   = =   S t r i n g )  
 	 	 	 o p t s . s p e e d   =   $ . f x . s p e e d s [ o p t s . s p e e d ]   | |   p a r s e I n t ( o p t s . s p e e d ) ;  
 	 	 i f   ( ! o p t s . s y n c )  
 	 	 	 o p t s . s p e e d   =   o p t s . s p e e d   /   2 ;  
 	 	  
 	 	 v a r   b u f f e r   =   o p t s . f x   = =   ' s h u f f l e '   ?   5 0 0   :   2 5 0 ;  
 	 	 w h i l e ( ( o p t s . t i m e o u t   -   o p t s . s p e e d )   <   b u f f e r )   / /   s a n i t i z e   t i m e o u t  
 	 	 	 o p t s . t i m e o u t   + =   o p t s . s p e e d ;  
 	 }  
 	 i f   ( o p t s . e a s i n g )  
 	 	 o p t s . e a s e I n   =   o p t s . e a s e O u t   =   o p t s . e a s i n g ;  
 	 i f   ( ! o p t s . s p e e d I n )  
 	 	 o p t s . s p e e d I n   =   o p t s . s p e e d ;  
 	 i f   ( ! o p t s . s p e e d O u t )  
 	 	 o p t s . s p e e d O u t   =   o p t s . s p e e d ;  
  
 	 o p t s . s l i d e C o u n t   =   e l s . l e n g t h ;  
 	 o p t s . c u r r S l i d e   =   o p t s . l a s t S l i d e   =   f i r s t ;  
 	 i f   ( o p t s . r a n d o m )   {  
 	 	 i f   ( + + o p t s . r a n d o m I n d e x   = =   e l s . l e n g t h )  
 	 	 	 o p t s . r a n d o m I n d e x   =   0 ;  
 	 	 o p t s . n e x t S l i d e   =   o p t s . r a n d o m M a p [ o p t s . r a n d o m I n d e x ] ;  
 	 }  
 	 e l s e  
 	 	 o p t s . n e x t S l i d e   =   o p t s . s t a r t i n g S l i d e   > =   ( e l s . l e n g t h - 1 )   ?   0   :   o p t s . s t a r t i n g S l i d e + 1 ;  
  
 	 / /   r u n   t r a n s i t i o n   i n i t   f n  
 	 i f   ( ! o p t s . m u l t i F x )   {  
 	 	 v a r   i n i t   =   $ . f n . c y c l e . t r a n s i t i o n s [ o p t s . f x ] ;  
 	 	 i f   ( $ . i s F u n c t i o n ( i n i t ) )  
 	 	 	 i n i t ( $ c o n t ,   $ s l i d e s ,   o p t s ) ;  
 	 	 e l s e   i f   ( o p t s . f x   ! =   ' c u s t o m '   & &   ! o p t s . m u l t i F x )   {  
 	 	 	 l o g ( ' u n k n o w n   t r a n s i t i o n :   '   +   o p t s . f x , ' ;   s l i d e s h o w   t e r m i n a t i n g ' ) ;  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 }  
 	 }  
  
 	 / /   f i r e   a r t i f i c i a l   e v e n t s  
 	 v a r   e 0   =   $ s l i d e s [ f i r s t ] ;  
 	 i f   ( o p t s . b e f o r e . l e n g t h )  
 	 	 o p t s . b e f o r e [ 0 ] . a p p l y ( e 0 ,   [ e 0 ,   e 0 ,   o p t s ,   t r u e ] ) ;  
 	 i f   ( o p t s . a f t e r . l e n g t h   >   1 )  
 	 	 o p t s . a f t e r [ 1 ] . a p p l y ( e 0 ,   [ e 0 ,   e 0 ,   o p t s ,   t r u e ] ) ;  
  
 	 i f   ( o p t s . n e x t )  
 	 	 $ ( o p t s . n e x t ) . b i n d ( o p t s . p r e v N e x t E v e n t , f u n c t i o n ( ) { r e t u r n   a d v a n c e ( o p t s , o p t s . r e v ? - 1 : 1 ) } ) ;  
 	 i f   ( o p t s . p r e v )  
 	 	 $ ( o p t s . p r e v ) . b i n d ( o p t s . p r e v N e x t E v e n t , f u n c t i o n ( ) { r e t u r n   a d v a n c e ( o p t s , o p t s . r e v ? 1 : - 1 ) } ) ;  
 	 i f   ( o p t s . p a g e r   | |   o p t s . p a g e r A n c h o r B u i l d e r )  
 	 	 b u i l d P a g e r ( e l s , o p t s ) ;  
  
 	 e x p o s e A d d S l i d e ( o p t s ,   e l s ) ;  
  
 	 r e t u r n   o p t s ;  
 } ;  
  
 / /   s a v e   o f f   o r i g i n a l   o p t s   s o   w e   c a n   r e s t o r e   a f t e r   c l e a r i n g   s t a t e  
 f u n c t i o n   s a v e O r i g i n a l O p t s ( o p t s )   {  
 	 o p t s . o r i g i n a l   =   {   b e f o r e :   [ ] ,   a f t e r :   [ ]   } ;  
 	 o p t s . o r i g i n a l . c s s B e f o r e   =   $ . e x t e n d ( { } ,   o p t s . c s s B e f o r e ) ;  
 	 o p t s . o r i g i n a l . c s s A f t e r     =   $ . e x t e n d ( { } ,   o p t s . c s s A f t e r ) ;  
 	 o p t s . o r i g i n a l . a n i m I n 	 =   $ . e x t e n d ( { } ,   o p t s . a n i m I n ) ;  
 	 o p t s . o r i g i n a l . a n i m O u t       =   $ . e x t e n d ( { } ,   o p t s . a n i m O u t ) ;  
 	 $ . e a c h ( o p t s . b e f o r e ,   f u n c t i o n ( )   {   o p t s . o r i g i n a l . b e f o r e . p u s h ( t h i s ) ;   } ) ;  
 	 $ . e a c h ( o p t s . a f t e r ,     f u n c t i o n ( )   {   o p t s . o r i g i n a l . a f t e r . p u s h ( t h i s ) ;   } ) ;  
 } ;  
  
 f u n c t i o n   s u p p o r t M u l t i T r a n s i t i o n s ( o p t s )   {  
 	 v a r   i ,   t x ,   t x s   =   $ . f n . c y c l e . t r a n s i t i o n s ;  
 	 / /   l o o k   f o r   m u l t i p l e   e f f e c t s  
 	 i f   ( o p t s . f x . i n d e x O f ( ' , ' )   >   0 )   {  
 	 	 o p t s . m u l t i F x   =   t r u e ;  
 	 	 o p t s . f x s   =   o p t s . f x . r e p l a c e ( / \ s * / g , ' ' ) . s p l i t ( ' , ' ) ;  
 	 	 / /   d i s c a r d   a n y   b o g u s   e f f e c t   n a m e s  
 	 	 f o r   ( i = 0 ;   i   <   o p t s . f x s . l e n g t h ;   i + + )   {  
 	 	 	 v a r   f x   =   o p t s . f x s [ i ] ;  
 	 	 	 t x   =   t x s [ f x ] ;  
 	 	 	 i f   ( ! t x   | |   ! t x s . h a s O w n P r o p e r t y ( f x )   | |   ! $ . i s F u n c t i o n ( t x ) )   {  
 	 	 	 	 l o g ( ' d i s c a r d i n g   u n k n o w n   t r a n s i t i o n :   ' , f x ) ;  
 	 	 	 	 o p t s . f x s . s p l i c e ( i , 1 ) ;  
 	 	 	 	 i - - ;  
 	 	 	 }  
 	 	 }  
 	 	 / /   i f   w e   h a v e   a n   e m p t y   l i s t   t h e n   w e   t h r e w   e v e r y t h i n g   a w a y !  
 	 	 i f   ( ! o p t s . f x s . l e n g t h )   {  
 	 	 	 l o g ( ' N o   v a l i d   t r a n s i t i o n s   n a m e d ;   s l i d e s h o w   t e r m i n a t i n g . ' ) ;  
 	 	 	 r e t u r n   f a l s e ;  
 	 	 }  
 	 }  
 	 e l s e   i f   ( o p t s . f x   = =   ' a l l ' )   {     / /   a u t o - g e n   t h e   l i s t   o f   t r a n s i t i o n s  
 	 	 o p t s . m u l t i F x   =   t r u e ;  
 	 	 o p t s . f x s   =   [ ] ;  
 	 	 f o r   ( p   i n   t x s )   {  
 	 	 	 t x   =   t x s [ p ] ;  
 	 	 	 i f   ( t x s . h a s O w n P r o p e r t y ( p )   & &   $ . i s F u n c t i o n ( t x ) )  
 	 	 	 	 o p t s . f x s . p u s h ( p ) ;  
 	 	 }  
 	 }  
 	 i f   ( o p t s . m u l t i F x   & &   o p t s . r a n d o m i z e E f f e c t s )   {  
 	 	 / /   m u n g e   t h e   f x s   a r r a y   t o   m a k e   e f f e c t   s e l e c t i o n   r a n d o m  
 	 	 v a r   r 1   =   M a t h . f l o o r ( M a t h . r a n d o m ( )   *   2 0 )   +   3 0 ;  
 	 	 f o r   ( i   =   0 ;   i   <   r 1 ;   i + + )   {  
 	 	 	 v a r   r 2   =   M a t h . f l o o r ( M a t h . r a n d o m ( )   *   o p t s . f x s . l e n g t h ) ;  
 	 	 	 o p t s . f x s . p u s h ( o p t s . f x s . s p l i c e ( r 2 , 1 ) [ 0 ] ) ;  
 	 	 }  
 	 	 d e b u g ( ' r a n d o m i z e d   f x   s e q u e n c e :   ' , o p t s . f x s ) ;  
 	 }  
 	 r e t u r n   t r u e ;  
 } ;  
  
 / /   p r o v i d e   a   m e c h a n i s m   f o r   a d d i n g   s l i d e s   a f t e r   t h e   s l i d e s h o w   h a s   s t a r t e d  
 f u n c t i o n   e x p o s e A d d S l i d e ( o p t s ,   e l s )   {  
 	 o p t s . a d d S l i d e   =   f u n c t i o n ( n e w S l i d e ,   p r e p e n d )   {  
 	 	 v a r   $ s   =   $ ( n e w S l i d e ) ,   s   =   $ s [ 0 ] ;  
 	 	 i f   ( ! o p t s . a u t o s t o p C o u n t )  
 	 	 	 o p t s . c o u n t d o w n + + ;  
 	 	 e l s [ p r e p e n d ? ' u n s h i f t ' : ' p u s h ' ] ( s ) ;  
 	 	 i f   ( o p t s . e l s )  
 	 	 	 o p t s . e l s [ p r e p e n d ? ' u n s h i f t ' : ' p u s h ' ] ( s ) ;   / /   s h u f f l e   n e e d s   t h i s  
 	 	 o p t s . s l i d e C o u n t   =   e l s . l e n g t h ;  
  
 	 	 $ s . c s s ( ' p o s i t i o n ' , ' a b s o l u t e ' ) ;  
 	 	 $ s [ p r e p e n d ? ' p r e p e n d T o ' : ' a p p e n d T o ' ] ( o p t s . $ c o n t ) ;  
  
 	 	 i f   ( p r e p e n d )   {  
 	 	 	 o p t s . c u r r S l i d e + + ;  
 	 	 	 o p t s . n e x t S l i d e + + ;  
 	 	 }  
  
 	 	 i f   ( ! $ . s u p p o r t . o p a c i t y   & &   o p t s . c l e a r t y p e   & &   ! o p t s . c l e a r t y p e N o B g )  
 	 	 	 c l e a r T y p e F i x ( $ s ) ;  
  
 	 	 i f   ( o p t s . f i t   & &   o p t s . w i d t h )  
 	 	 	 $ s . w i d t h ( o p t s . w i d t h ) ;  
 	 	 i f   ( o p t s . f i t   & &   o p t s . h e i g h t   & &   o p t s . h e i g h t   ! =   ' a u t o ' )  
 	 	 	 $ s l i d e s . h e i g h t ( o p t s . h e i g h t ) ;  
 	 	 s . c y c l e H   =   ( o p t s . f i t   & &   o p t s . h e i g h t )   ?   o p t s . h e i g h t   :   $ s . h e i g h t ( ) ;  
 	 	 s . c y c l e W   =   ( o p t s . f i t   & &   o p t s . w i d t h )   ?   o p t s . w i d t h   :   $ s . w i d t h ( ) ;  
  
 	 	 $ s . c s s ( o p t s . c s s B e f o r e ) ;  
  
 	 	 i f   ( o p t s . p a g e r   | |   o p t s . p a g e r A n c h o r B u i l d e r )  
 	 	 	 $ . f n . c y c l e . c r e a t e P a g e r A n c h o r ( e l s . l e n g t h - 1 ,   s ,   $ ( o p t s . p a g e r ) ,   e l s ,   o p t s ) ;  
  
 	 	 i f   ( $ . i s F u n c t i o n ( o p t s . o n A d d S l i d e ) )  
 	 	 	 o p t s . o n A d d S l i d e ( $ s ) ;  
 	 	 e l s e  
 	 	 	 $ s . h i d e ( ) ;   / /   d e f a u l t   b e h a v i o r  
 	 } ;  
 }  
  
 / /   r e s e t   i n t e r n a l   s t a t e ;   w e   d o   t h i s   o n   e v e r y   p a s s   i n   o r d e r   t o   s u p p o r t   m u l t i p l e   e f f e c t s  
 $ . f n . c y c l e . r e s e t S t a t e   =   f u n c t i o n ( o p t s ,   f x )   {  
 	 f x   =   f x   | |   o p t s . f x ;  
 	 o p t s . b e f o r e   =   [ ] ;   o p t s . a f t e r   =   [ ] ;  
 	 o p t s . c s s B e f o r e   =   $ . e x t e n d ( { } ,   o p t s . o r i g i n a l . c s s B e f o r e ) ;  
 	 o p t s . c s s A f t e r     =   $ . e x t e n d ( { } ,   o p t s . o r i g i n a l . c s s A f t e r ) ;  
 	 o p t s . a n i m I n 	 =   $ . e x t e n d ( { } ,   o p t s . o r i g i n a l . a n i m I n ) ;  
 	 o p t s . a n i m O u t       =   $ . e x t e n d ( { } ,   o p t s . o r i g i n a l . a n i m O u t ) ;  
 	 o p t s . f x F n   =   n u l l ;  
 	 $ . e a c h ( o p t s . o r i g i n a l . b e f o r e ,   f u n c t i o n ( )   {   o p t s . b e f o r e . p u s h ( t h i s ) ;   } ) ;  
 	 $ . e a c h ( o p t s . o r i g i n a l . a f t e r ,     f u n c t i o n ( )   {   o p t s . a f t e r . p u s h ( t h i s ) ;   } ) ;  
  
 	 / /   r e - i n i t  
 	 v a r   i n i t   =   $ . f n . c y c l e . t r a n s i t i o n s [ f x ] ;  
 	 i f   ( $ . i s F u n c t i o n ( i n i t ) )  
 	 	 i n i t ( o p t s . $ c o n t ,   $ ( o p t s . e l e m e n t s ) ,   o p t s ) ;  
 } ;  
  
 / /   t h i s   i s   t h e   m a i n   e n g i n e   f n ,   i t   h a n d l e s   t h e   t i m e o u t s ,   c a l l b a c k s   a n d   s l i d e   i n d e x   m g m t  
 f u n c t i o n   g o ( e l s ,   o p t s ,   m a n u a l ,   f w d )   {  
 	 / /   o p t s . b u s y   i s   t r u e   i f   w e ' r e   i n   t h e   m i d d l e   o f   a n   a n i m a t i o n  
 	 i f   ( m a n u a l   & &   o p t s . b u s y   & &   o p t s . m a n u a l T r u m p )   {  
 	 	 / /   l e t   m a n u a l   t r a n s i t i o n s   r e q u e s t s   t r u m p   a c t i v e   o n e s  
 	 	 d e b u g ( ' m a n u a l T r u m p   i n   g o ( ) ,   s t o p p i n g   a c t i v e   t r a n s i t i o n ' ) ;  
 	 	 $ ( e l s ) . s t o p ( t r u e , t r u e ) ;  
 	 	 o p t s . b u s y   =   f a l s e ;  
 	 }  
 	 / /   d o n ' t   b e g i n   a n o t h e r   t i m e o u t - b a s e d   t r a n s i t i o n   i f   t h e r e   i s   o n e   a c t i v e  
 	 i f   ( o p t s . b u s y )   {  
 	 	 d e b u g ( ' t r a n s i t i o n   a c t i v e ,   i g n o r i n g   n e w   t x   r e q u e s t ' ) ;  
 	 	 r e t u r n ;  
 	 }  
  
 	 v a r   p   =   o p t s . $ c o n t [ 0 ] ,   c u r r   =   e l s [ o p t s . c u r r S l i d e ] ,   n e x t   =   e l s [ o p t s . n e x t S l i d e ] ;  
  
 	 / /   s t o p   c y c l i n g   i f   w e   h a v e   a n   o u t s t a n d i n g   s t o p   r e q u e s t  
 	 i f   ( p . c y c l e S t o p   ! =   o p t s . s t o p C o u n t   | |   p . c y c l e T i m e o u t   = = =   0   & &   ! m a n u a l )  
 	 	 r e t u r n ;  
  
 	 / /   c h e c k   t o   s e e   i f   w e   s h o u l d   s t o p   c y c l i n g   b a s e d   o n   a u t o s t o p   o p t i o n s  
 	 i f   ( ! m a n u a l   & &   ! p . c y c l e P a u s e   & &  
 	 	 ( ( o p t s . a u t o s t o p   & &   ( - - o p t s . c o u n t d o w n   < =   0 ) )   | |  
 	 	 ( o p t s . n o w r a p   & &   ! o p t s . r a n d o m   & &   o p t s . n e x t S l i d e   <   o p t s . c u r r S l i d e ) ) )   {  
 	 	 i f   ( o p t s . e n d )  
 	 	 	 o p t s . e n d ( o p t s ) ;  
 	 	 r e t u r n ;  
 	 }  
  
 	 / /   i f   s l i d e s h o w   i s   p a u s e d ,   o n l y   t r a n s i t i o n   o n   a   m a n u a l   t r i g g e r  
 	 v a r   c h a n g e d   =   f a l s e ;  
 	 i f   ( ( m a n u a l   | |   ! p . c y c l e P a u s e )   & &   ( o p t s . n e x t S l i d e   ! =   o p t s . c u r r S l i d e ) )   {  
 	 	 c h a n g e d   =   t r u e ;  
 	 	 v a r   f x   =   o p t s . f x ;  
 	 	 / /   k e e p   t r y i n g   t o   g e t   t h e   s l i d e   s i z e   i f   w e   d o n ' t   h a v e   i t   y e t  
 	 	 c u r r . c y c l e H   =   c u r r . c y c l e H   | |   $ ( c u r r ) . h e i g h t ( ) ;  
 	 	 c u r r . c y c l e W   =   c u r r . c y c l e W   | |   $ ( c u r r ) . w i d t h ( ) ;  
 	 	 n e x t . c y c l e H   =   n e x t . c y c l e H   | |   $ ( n e x t ) . h e i g h t ( ) ;  
 	 	 n e x t . c y c l e W   =   n e x t . c y c l e W   | |   $ ( n e x t ) . w i d t h ( ) ;  
  
 	 	 / /   s u p p o r t   m u l t i p l e   t r a n s i t i o n   t y p e s  
 	 	 i f   ( o p t s . m u l t i F x )   {  
 	 	 	 i f   ( o p t s . l a s t F x   = =   u n d e f i n e d   | |   + + o p t s . l a s t F x   > =   o p t s . f x s . l e n g t h )  
 	 	 	 	 o p t s . l a s t F x   =   0 ;  
 	 	 	 f x   =   o p t s . f x s [ o p t s . l a s t F x ] ;  
 	 	 	 o p t s . c u r r F x   =   f x ;  
 	 	 }  
  
 	 	 / /   o n e - t i m e   f x   o v e r r i d e s   a p p l y   t o :     $ ( ' d i v ' ) . c y c l e ( 3 , ' z o o m ' ) ;  
 	 	 i f   ( o p t s . o n e T i m e F x )   {  
 	 	 	 f x   =   o p t s . o n e T i m e F x ;  
 	 	 	 o p t s . o n e T i m e F x   =   n u l l ;  
 	 	 }  
  
 	 	 $ . f n . c y c l e . r e s e t S t a t e ( o p t s ,   f x ) ;  
  
 	 	 / /   r u n   t h e   b e f o r e   c a l l b a c k s  
 	 	 i f   ( o p t s . b e f o r e . l e n g t h )  
 	 	 	 $ . e a c h ( o p t s . b e f o r e ,   f u n c t i o n ( i , o )   {  
 	 	 	 	 i f   ( p . c y c l e S t o p   ! =   o p t s . s t o p C o u n t )   r e t u r n ;  
 	 	 	 	 o . a p p l y ( n e x t ,   [ c u r r ,   n e x t ,   o p t s ,   f w d ] ) ;  
 	 	 	 } ) ;  
  
 	 	 / /   s t a g e   t h e   a f t e r   c a l l a c k s  
 	 	 v a r   a f t e r   =   f u n c t i o n ( )   {  
 	 	 	 $ . e a c h ( o p t s . a f t e r ,   f u n c t i o n ( i , o )   {  
 	 	 	 	 i f   ( p . c y c l e S t o p   ! =   o p t s . s t o p C o u n t )   r e t u r n ;  
 	 	 	 	 o . a p p l y ( n e x t ,   [ c u r r ,   n e x t ,   o p t s ,   f w d ] ) ;  
 	 	 	 } ) ;  
 	 	 } ;  
  
 	 	 d e b u g ( ' t x   f i r i n g ;   c u r r S l i d e :   '   +   o p t s . c u r r S l i d e   +   ' ;   n e x t S l i d e :   '   +   o p t s . n e x t S l i d e ) ;  
 	 	  
 	 	 / /   g e t   r e a d y   t o   p e r f o r m   t h e   t r a n s i t i o n  
 	 	 o p t s . b u s y   =   1 ;  
 	 	 i f   ( o p t s . f x F n )   / /   f x   f u n c t i o n   p r o v i d e d ?  
 	 	 	 o p t s . f x F n ( c u r r ,   n e x t ,   o p t s ,   a f t e r ,   f w d ,   m a n u a l   & &   o p t s . f a s t O n E v e n t ) ;  
 	 	 e l s e   i f   ( $ . i s F u n c t i o n ( $ . f n . c y c l e [ o p t s . f x ] ) )   / /   f x   p l u g i n   ?  
 	 	 	 $ . f n . c y c l e [ o p t s . f x ] ( c u r r ,   n e x t ,   o p t s ,   a f t e r ,   f w d ,   m a n u a l   & &   o p t s . f a s t O n E v e n t ) ;  
 	 	 e l s e  
 	 	 	 $ . f n . c y c l e . c u s t o m ( c u r r ,   n e x t ,   o p t s ,   a f t e r ,   f w d ,   m a n u a l   & &   o p t s . f a s t O n E v e n t ) ;  
 	 }  
  
 	 i f   ( ! p . c y c l e P a u s e )   {  
 	 	 / /   c a l c u l a t e   t h e   n e x t   s l i d e  
 	 	 o p t s . l a s t S l i d e   =   o p t s . c u r r S l i d e ;  
 	 	 i f   ( o p t s . r a n d o m )   {  
 	 	 	 o p t s . c u r r S l i d e   =   o p t s . n e x t S l i d e ;  
 	 	 	 i f   ( + + o p t s . r a n d o m I n d e x   = =   e l s . l e n g t h )  
 	 	 	 	 o p t s . r a n d o m I n d e x   =   0 ;  
 	 	 	 o p t s . n e x t S l i d e   =   o p t s . r a n d o m M a p [ o p t s . r a n d o m I n d e x ] ;  
 	 	 	 i f   ( o p t s . n e x t S l i d e   = =   o p t s . c u r r S l i d e )  
 	 	 	 	 o p t s . n e x t S l i d e   =   ( o p t s . c u r r S l i d e   = =   o p t s . s l i d e C o u n t   -   1 )   ?   0   :   o p t s . c u r r S l i d e   +   1 ;  
 	 	 }  
 	 	 e l s e   {   / /   s e q u e n c e  
 	 	 	 v a r   r o l l   =   ( o p t s . n e x t S l i d e   +   1 )   = =   e l s . l e n g t h ;  
 	 	 	 o p t s . n e x t S l i d e   =   r o l l   ?   0   :   o p t s . n e x t S l i d e + 1 ;  
 	 	 	 o p t s . c u r r S l i d e   =   r o l l   ?   e l s . l e n g t h - 1   :   o p t s . n e x t S l i d e - 1 ;  
 	 	 }  
 	 }  
 	  
 	 i f   ( c h a n g e d   & &   o p t s . p a g e r )  
 	 	 o p t s . u p d a t e A c t i v e P a g e r L i n k ( o p t s . p a g e r ,   o p t s . c u r r S l i d e ,   o p t s . a c t i v e P a g e r C l a s s ) ;  
  
 	 / /   s t a g e   t h e   n e x t   t r a n s i t i o n  
 	 v a r   m s   =   0 ;  
 	 i f   ( o p t s . t i m e o u t   & &   ! o p t s . c o n t i n u o u s )  
 	 	 m s   =   g e t T i m e o u t ( c u r r ,   n e x t ,   o p t s ,   f w d ) ;  
 	 e l s e   i f   ( o p t s . c o n t i n u o u s   & &   p . c y c l e P a u s e )   / /   c o n t i n u o u s   s h o w s   w o r k   o f f   a n   a f t e r   c a l l b a c k ,   n o t   t h i s   t i m e r   l o g i c  
 	 	 m s   =   1 0 ;  
 	 i f   ( m s   >   0 )  
 	 	 p . c y c l e T i m e o u t   =   s e t T i m e o u t ( f u n c t i o n ( ) {   g o ( e l s ,   o p t s ,   0 ,   ! o p t s . r e v )   } ,   m s ) ;  
 } ;  
  
 / /   i n v o k e d   a f t e r   t r a n s i t i o n  
 $ . f n . c y c l e . u p d a t e A c t i v e P a g e r L i n k   =   f u n c t i o n ( p a g e r ,   c u r r S l i d e ,   c l s N a m e )   {  
       $ ( p a g e r ) . e a c h ( f u n c t i o n ( )   {  
               $ ( t h i s ) . c h i l d r e n ( ) . r e m o v e C l a s s ( c l s N a m e ) . e q ( c u r r S l i d e ) . a d d C l a s s ( c l s N a m e ) ;  
       } ) ;  
 } ;  
  
 / /   c a l c u l a t e   t i m e o u t   v a l u e   f o r   c u r r e n t   t r a n s i t i o n  
 f u n c t i o n   g e t T i m e o u t ( c u r r ,   n e x t ,   o p t s ,   f w d )   {  
 	 i f   ( o p t s . t i m e o u t F n )   {  
 	 	 / /   c a l l   u s e r   p r o v i d e d   c a l c   f n  
 	 	 v a r   t   =   o p t s . t i m e o u t F n ( c u r r , n e x t , o p t s , f w d ) ;  
 	 	 w h i l e   ( ( t   -   o p t s . s p e e d )   <   2 5 0 )   / /   s a n i t i z e   t i m e o u t  
 	 	 	 t   + =   o p t s . s p e e d ;  
 	 	 d e b u g ( ' c a l c u l a t e d   t i m e o u t :   '   +   t   +   ' ;   s p e e d :   '   +   o p t s . s p e e d ) ;  
 	 	 i f   ( t   ! = =   f a l s e )  
 	 	 	 r e t u r n   t ;  
 	 }  
 	 r e t u r n   o p t s . t i m e o u t ;  
 } ;  
  
 / /   e x p o s e   n e x t / p r e v   f u n c t i o n ,   c a l l e r   m u s t   p a s s   i n   s t a t e  
 $ . f n . c y c l e . n e x t   =   f u n c t i o n ( o p t s )   {   a d v a n c e ( o p t s ,   o p t s . r e v ? - 1 : 1 ) ;   } ;  
 $ . f n . c y c l e . p r e v   =   f u n c t i o n ( o p t s )   {   a d v a n c e ( o p t s ,   o p t s . r e v ? 1 : - 1 ) ; } ;  
  
 / /   a d v a n c e   s l i d e   f o r w a r d   o r   b a c k  
 f u n c t i o n   a d v a n c e ( o p t s ,   v a l )   {  
 	 v a r   e l s   =   o p t s . e l e m e n t s ;  
 	 v a r   p   =   o p t s . $ c o n t [ 0 ] ,   t i m e o u t   =   p . c y c l e T i m e o u t ;  
 	 i f   ( t i m e o u t )   {  
 	 	 c l e a r T i m e o u t ( t i m e o u t ) ;  
 	 	 p . c y c l e T i m e o u t   =   0 ;  
 	 }  
 	 i f   ( o p t s . r a n d o m   & &   v a l   <   0 )   {  
 	 	 / /   m o v e   b a c k   t o   t h e   p r e v i o u s l y   d i s p l a y   s l i d e  
 	 	 o p t s . r a n d o m I n d e x - - ;  
 	 	 i f   ( - - o p t s . r a n d o m I n d e x   = =   - 2 )  
 	 	 	 o p t s . r a n d o m I n d e x   =   e l s . l e n g t h - 2 ;  
 	 	 e l s e   i f   ( o p t s . r a n d o m I n d e x   = =   - 1 )  
 	 	 	 o p t s . r a n d o m I n d e x   =   e l s . l e n g t h - 1 ;  
 	 	 o p t s . n e x t S l i d e   =   o p t s . r a n d o m M a p [ o p t s . r a n d o m I n d e x ] ;  
 	 }  
 	 e l s e   i f   ( o p t s . r a n d o m )   {  
 	 	 o p t s . n e x t S l i d e   =   o p t s . r a n d o m M a p [ o p t s . r a n d o m I n d e x ] ;  
 	 }  
 	 e l s e   {  
 	 	 o p t s . n e x t S l i d e   =   o p t s . c u r r S l i d e   +   v a l ;  
 	 	 i f   ( o p t s . n e x t S l i d e   <   0 )   {  
 	 	 	 i f   ( o p t s . n o w r a p )   r e t u r n   f a l s e ;  
 	 	 	 o p t s . n e x t S l i d e   =   e l s . l e n g t h   -   1 ;  
 	 	 }  
 	 	 e l s e   i f   ( o p t s . n e x t S l i d e   > =   e l s . l e n g t h )   {  
 	 	 	 i f   ( o p t s . n o w r a p )   r e t u r n   f a l s e ;  
 	 	 	 o p t s . n e x t S l i d e   =   0 ;  
 	 	 }  
 	 }  
  
 	 v a r   c b   =   o p t s . o n P r e v N e x t E v e n t   | |   o p t s . p r e v N e x t C l i c k ;   / /   p r e v N e x t C l i c k   i s   d e p r e c a t e d  
 	 i f   ( $ . i s F u n c t i o n ( c b ) )  
 	 	 c b ( v a l   >   0 ,   o p t s . n e x t S l i d e ,   e l s [ o p t s . n e x t S l i d e ] ) ;  
 	 g o ( e l s ,   o p t s ,   1 ,   v a l > = 0 ) ;  
 	 r e t u r n   f a l s e ;  
 } ;  
  
 f u n c t i o n   b u i l d P a g e r ( e l s ,   o p t s )   {  
 	 v a r   $ p   =   $ ( o p t s . p a g e r ) ;  
 	 $ . e a c h ( e l s ,   f u n c t i o n ( i , o )   {  
 	 	 $ . f n . c y c l e . c r e a t e P a g e r A n c h o r ( i , o , $ p , e l s , o p t s ) ;  
 	 } ) ;  
 	 o p t s . u p d a t e A c t i v e P a g e r L i n k ( o p t s . p a g e r ,   o p t s . s t a r t i n g S l i d e ,   o p t s . a c t i v e P a g e r C l a s s ) ;  
 } ;  
  
 $ . f n . c y c l e . c r e a t e P a g e r A n c h o r   =   f u n c t i o n ( i ,   e l ,   $ p ,   e l s ,   o p t s )   {  
 	 v a r   a ;  
 	 i f   ( $ . i s F u n c t i o n ( o p t s . p a g e r A n c h o r B u i l d e r ) )   {  
 	 	 a   =   o p t s . p a g e r A n c h o r B u i l d e r ( i , e l ) ;  
 	 	 d e b u g ( ' p a g e r A n c h o r B u i l d e r ( ' + i + ' ,   e l )   r e t u r n e d :   '   +   a ) ;  
 	 }  
 	 e l s e  
 	 	 a   =   ' < a   h r e f = " # " > ' + ( i + 1 ) + ' < / a > ' ;  
 	 	  
 	 i f   ( ! a )  
 	 	 r e t u r n ;  
 	 v a r   $ a   =   $ ( a ) ;  
 	 / /   d o n ' t   r e p a r e n t   i f   a n c h o r   i s   i n   t h e   d o m  
 	 i f   ( $ a . p a r e n t s ( ' b o d y ' ) . l e n g t h   = = =   0 )   {  
 	 	 v a r   a r r   =   [ ] ;  
 	 	 i f   ( $ p . l e n g t h   >   1 )   {  
 	 	 	 $ p . e a c h ( f u n c t i o n ( )   {  
 	 	 	 	 v a r   $ c l o n e   =   $ a . c l o n e ( t r u e ) ;  
 	 	 	 	 $ ( t h i s ) . a p p e n d ( $ c l o n e ) ;  
 	 	 	 	 a r r . p u s h ( $ c l o n e [ 0 ] ) ;  
 	 	 	 } ) ;  
 	 	 	 $ a   =   $ ( a r r ) ;  
 	 	 }  
 	 	 e l s e   {  
 	 	 	 $ a . a p p e n d T o ( $ p ) ;  
 	 	 }  
 	 }  
  
 	 o p t s . p a g e r A n c h o r s   =     o p t s . p a g e r A n c h o r s   | |   [ ] ;  
 	 o p t s . p a g e r A n c h o r s . p u s h ( $ a ) ;  
 	 $ a . b i n d ( o p t s . p a g e r 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 ( ) ;  
 	 	 o p t s . n e x t S l i d e   =   i ;  
 	 	 v a r   p   =   o p t s . $ c o n t [ 0 ] ,   t i m e o u t   =   p . c y c l e T i m e o u t ;  
 	 	 i f   ( t i m e o u t )   {  
 	 	 	 c l e a r T i m e o u t ( t i m e o u t ) ;  
 	 	 	 p . c y c l e T i m e o u t   =   0 ;  
 	 	 }  
 	 	 v a r   c b   =   o p t s . o n P a g e r E v e n t   | |   o p t s . p a g e r C l i c k ;   / /   p a g e r C l i c k   i s   d e p r e c a t e d  
 	 	 i f   ( $ . i s F u n c t i o n ( c b ) )  
 	 	 	 c b ( o p t s . n e x t S l i d e ,   e l s [ o p t s . n e x t S l i d e ] ) ;  
 	 	 g o ( e l s , o p t s , 1 , o p t s . c u r r S l i d e   <   i ) ;   / /   t r i g g e r   t h e   t r a n s  
 / / 	 	 r e t u r n   f a l s e ;   / /   < = =   a l l o w   b u b b l e  
 	 } ) ;  
 	  
 	 i f   (   !   / ^ c l i c k / . t e s t ( o p t s . p a g e r E v e n t )   & &   ! o p t s . a l l o w P a g e r C l i c k B u b b l e )  
 	 	 $ a . b i n d ( ' c l i c k . c y c l e ' ,   f u n c t i o n ( ) { r e t u r n   f a l s e ; } ) ;   / /   s u p p r e s s   c l i c k  
 	  
 	 i f   ( o p t s . p a u s e O n P a g e r H o v e r )  
 	 	 $ a . h o v e r ( f u n c t i o n ( )   {   o p t s . $ c o n t [ 0 ] . c y c l e P a u s e + + ;   } ,   f u n c t i o n ( )   {   o p t s . $ c o n t [ 0 ] . c y c l e P a u s e - - ;   }   ) ;  
 } ;  
  
 / /   h e l p e r   f n   t o   c a l c u l a t e   t h e   n u m b e r   o f   s l i d e s   b e t w e e n   t h e   c u r r e n t   a n d   t h e   n e x t  
 $ . f n . c y c l e . h o p s F r o m L a s t   =   f u n c t i o n ( o p t s ,   f w d )   {  
 	 v a r   h o p s ,   l   =   o p t s . l a s t S l i d e ,   c   =   o p t s . c u r r S l i d e ;  
 	 i f   ( f w d )  
 	 	 h o p s   =   c   >   l   ?   c   -   l   :   o p t s . s l i d e C o u n t   -   l ;  
 	 e l s e  
 	 	 h o p s   =   c   <   l   ?   l   -   c   :   l   +   o p t s . s l i d e C o u n t   -   c ;  
 	 r e t u r n   h o p s ;  
 } ;  
  
 / /   f i x   c l e a r T y p e   p r o b l e m s   i n   i e 6   b y   s e t t i n g   a n   e x p l i c i t   b g   c o l o r  
 / /   ( o t h e r w i s e   t e x t   s l i d e s   l o o k   h o r r i b l e   d u r i n g   a   f a d e   t r a n s i t i o n )  
 f u n c t i o n   c l e a r T y p e F i x ( $ s l i d e s )   {  
 	 d e b u g ( ' a p p l y i n g   c l e a r T y p e   b a c k g r o u n d - c o l o r   h a c k ' ) ;  
 	 f u n c t i o n   h e x ( s )   {  
 	 	 s   =   p a r s e I n t ( s ) . t o S t r i n g ( 1 6 ) ;  
 	 	 r e t u r n   s . l e n g t h   <   2   ?   ' 0 ' + s   :   s ;  
 	 } ;  
 	 f u n c t i o n   g e t B g ( e )   {  
 	 	 f o r   (   ;   e   & &   e . n o d e N a m e . t o L o w e r C a s e ( )   ! =   ' h t m l ' ;   e   =   e . p a r e n t N o d e )   {  
 	 	 	 v a r   v   =   $ . c s s ( e , ' b a c k g r o u n d - c o l o r ' ) ;  
 	 	 	 i f   ( v . i n d e x O f ( ' r g b ' )   > =   0   )   {  
 	 	 	 	 v a r   r g b   =   v . m a t c h ( / \ d + / g ) ;  
 	 	 	 	 r e t u r n   ' # ' +   h e x ( r g b [ 0 ] )   +   h e x ( r g b [ 1 ] )   +   h e x ( r g b [ 2 ] ) ;  
 	 	 	 }  
 	 	 	 i f   ( v   & &   v   ! =   ' t r a n s p a r e n t ' )  
 	 	 	 	 r e t u r n   v ;  
 	 	 }  
 	 	 r e t u r n   ' # f f f f f f ' ;  
 	 } ;  
 	 $ s l i d e s . e a c h ( f u n c t i o n ( )   {   $ ( t h i s ) . c s s ( ' b a c k g r o u n d - c o l o r ' ,   g e t B g ( t h i s ) ) ;   } ) ;  
 } ;  
  
 / /   r e s e t   c o m m o n   p r o p s   b e f o r e   t h e   n e x t   t r a n s i t i o n  
 $ . f n . c y c l e . c o m m o n R e s e t   =   f u n c t i o n ( c u r r , n e x t , o p t s , w , h , r e v )   {  
 	 $ ( o p t s . e l e m e n t s ) . n o t ( c u r r ) . h i d e ( ) ;  
 	 o p t s . c s s B e f o r e . o p a c i t y   =   1 ;  
 	 o p t s . c s s B e f o r e . d i s p l a y   =   ' b l o c k ' ;  
 	 i f   ( w   ! = =   f a l s e   & &   n e x t . c y c l e W   >   0 )  
 	 	 o p t s . c s s B e f o r e . w i d t h   =   n e x t . c y c l e W ;  
 	 i f   ( h   ! = =   f a l s e   & &   n e x t . c y c l e H   >   0 )  
 	 	 o p t s . c s s B e f o r e . h e i g h t   =   n e x t . c y c l e H ;  
 	 o p t s . c s s A f t e r   =   o p t s . c s s A f t e r   | |   { } ;  
 	 o p t s . c s s A f t e r . d i s p l a y   =   ' n o n e ' ;  
 	 $ ( c u r r ) . c s s ( ' z I n d e x ' , o p t s . s l i d e C o u n t   +   ( r e v   = = =   t r u e   ?   1   :   0 ) ) ;  
 	 $ ( n e x t ) . c s s ( ' z I n d e x ' , o p t s . s l i d e C o u n t   +   ( r e v   = = =   t r u e   ?   0   :   1 ) ) ;  
 } ;  
  
 / /   t h e   a c t u a l   f n   f o r   e f f e c t i n g   a   t r a n s i t i o n  
 $ . f n . c y c l e . c u s t o m   =   f u n c t i o n ( c u r r ,   n e x t ,   o p t s ,   c b ,   f w d ,   s p e e d O v e r r i d e )   {  
 	 v a r   $ l   =   $ ( c u r r ) ,   $ n   =   $ ( n e x t ) ;  
 	 v a r   s p e e d I n   =   o p t s . s p e e d I n ,   s p e e d O u t   =   o p t s . s p e e d O u t ,   e a s e I n   =   o p t s . e a s e I n ,   e a s e O u t   =   o p t s . e a s e O u t ;  
 	 $ n . c s s ( o p t s . c s s B e f o r e ) ;  
 	 i f   ( s p e e d O v e r r i d e )   {  
 	 	 i f   ( t y p e o f   s p e e d O v e r r i d e   = =   ' n u m b e r ' )  
 	 	 	 s p e e d I n   =   s p e e d O u t   =   s p e e d O v e r r i d e ;  
 	 	 e l s e  
 	 	 	 s p e e d I n   =   s p e e d O u t   =   1 ;  
 	 	 e a s e I n   =   e a s e O u t   =   n u l l ;  
 	 }  
 	 v a r   f n   =   f u n c t i o n ( )   { $ n . a n i m a t e ( o p t s . a n i m I n ,   s p e e d I n ,   e a s e I n ,   c b ) } ;  
 	 $ l . a n i m a t e ( o p t s . a n i m O u t ,   s p e e d O u t ,   e a s e O u t ,   f u n c t i o n ( )   {  
 	 	 i f   ( o p t s . c s s A f t e r )   $ l . c s s ( o p t s . c s s A f t e r ) ;  
 	 	 i f   ( ! o p t s . s y n c )   f n ( ) ;  
 	 } ) ;  
 	 i f   ( o p t s . s y n c )   f n ( ) ;  
 } ;  
  
 / /   t r a n s i t i o n   d e f i n i t i o n s   -   o n l y   f a d e   i s   d e f i n e d   h e r e ,   t r a n s i t i o n   p a c k   d e f i n e s   t h e   r e s t  
 $ . f n . c y c l e . t r a n s i t i o n s   =   {  
 	 f a d e :   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 	 $ s l i d e s . n o t ( ' : e q ( ' + o p t s . c u r r S l i d e + ' ) ' ) . c s s ( ' o p a c i t y ' , 0 ) ;  
 	 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r , n e x t , o p t s )   {  
 	 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s ) ;  
 	 	 	 o p t s . c s s B e f o r e . o p a c i t y   =   0 ;  
 	 	 } ) ;  
 	 	 o p t s . a n i m I n 	       =   {   o p a c i t y :   1   } ;  
 	 	 o p t s . a n i m O u t       =   {   o p a c i t y :   0   } ;  
 	 	 o p t s . c s s B e f o r e   =   {   t o p :   0 ,   l e f t :   0   } ;  
 	 }  
 } ;  
  
 $ . f n . c y c l e . v e r   =   f u n c t i o n ( )   {   r e t u r n   v e r ;   } ;  
  
 / /   o v e r r i d e   t h e s e   g l o b a l l y   i f   y o u   l i k e   ( t h e y   a r e   a l l   o p t i o n a l )  
 $ . f n . c y c l e . d e f a u l t s   =   {  
 	 f x : 	 	 	     ' f a d e ' ,   / /   n a m e   o f   t r a n s i t i o n   e f f e c t   ( o r   c o m m a   s e p a r a t e d   n a m e s ,   e x :   ' f a d e , s c r o l l U p , s h u f f l e ' )  
 	 t i m e o u t : 	       4 0 0 0 ,     / /   m i l l i s e c o n d s   b e t w e e n   s l i d e   t r a n s i t i o n s   ( 0   t o   d i s a b l e   a u t o   a d v a n c e )  
 	 t i m e o u t F n :           n u l l ,     / /   c a l l b a c k   f o r   d e t e r m i n i n g   p e r - s l i d e   t i m e o u t   v a l u e :     f u n c t i o n ( c u r r S l i d e E l e m e n t ,   n e x t S l i d e E l e m e n t ,   o p t i o n s ,   f o r w a r d F l a g )  
 	 c o n t i n u o u s : 	       0 , 	     / /   t r u e   t o   s t a r t   n e x t   t r a n s i t i o n   i m m e d i a t e l y   a f t e r   c u r r e n t   o n e   c o m p l e t e s  
 	 s p e e d : 	 	       1 0 0 0 ,     / /   s p e e d   o f   t h e   t r a n s i t i o n   ( a n y   v a l i d   f x   s p e e d   v a l u e )  
 	 s p e e d I n : 	       n u l l ,     / /   s p e e d   o f   t h e   ' i n '   t r a n s i t i o n  
 	 s p e e d O u t : 	       n u l l ,     / /   s p e e d   o f   t h e   ' o u t '   t r a n s i t i o n  
 	 n e x t : 	 	       n u l l ,     / /   s e l e c t o r   f o r   e l e m e n t   t o   u s e   a s   e v e n t   t r i g g e r   f o r   n e x t   s l i d e  
 	 p r e v : 	 	       n u l l ,     / /   s e l e c t o r   f o r   e l e m e n t   t o   u s e   a s   e v e n t   t r i g g e r   f o r   p r e v i o u s   s l i d e  
 / / 	 p r e v N e x t C l i c k :   n u l l ,     / /   @ d e p r e c a t e d ;   p l e a s e   u s e   o n P r e v N e x t E v e n t   i n s t e a d  
 	 o n P r e v N e x t E v e n t :   n u l l ,     / /   c a l l b a c k   f n   f o r   p r e v / n e x t   e v e n t s :   f u n c t i o n ( i s N e x t ,   z e r o B a s e d S l i d e I n d e x ,   s l i d e E l e m e n t )  
 	 p r e v N e x t E v e n t : ' c l i c k . c y c l e ' , / /   e v e n t   w h i c h   d r i v e s   t h e   m a n u a l   t r a n s i t i o n   t o   t h e   p r e v i o u s   o r   n e x t   s l i d e  
 	 p a g e r : 	 	       n u l l ,     / /   s e l e c t o r   f o r   e l e m e n t   t o   u s e   a s   p a g e r   c o n t a i n e r  
 	 / / p a g e r C l i c k       n u l l ,     / /   @ d e p r e c a t e d ;   p l e a s e   u s e   o n P a g e r E v e n t   i n s t e a d  
 	 o n P a g e r E v e n t :     n u l l ,     / /   c a l l b a c k   f n   f o r   p a g e r   e v e n t s :   f u n c t i o n ( z e r o B a s e d S l i d e I n d e x ,   s l i d e E l e m e n t )  
 	 p a g e r E v e n t : 	     ' c l i c k . c y c l e ' ,   / /   n a m e   o f   e v e n t   w h i c h   d r i v e s   t h e   p a g e r   n a v i g a t i o n  
 	 a l l o w P a g e r C l i c k B u b b l e :   f a l s e ,   / /   a l l o w s   o r   p r e v e n t s   c l i c k   e v e n t   o n   p a g e r   a n c h o r s   f r o m   b u b b l i n g  
 	 p a g e r A n c h o r B u i l d e r :   n u l l ,   / /   c a l l b a c k   f n   f o r   b u i l d i n g   a n c h o r   l i n k s :     f u n c t i o n ( i n d e x ,   D O M e l e m e n t )  
 	 b e f o r e : 	 	       n u l l ,     / /   t r a n s i t i o n   c a l l b a c k   ( s c o p e   s e t   t o   e l e m e n t   t o   b e   s h o w n ) : 	   f u n c t i o n ( c u r r S l i d e E l e m e n t ,   n e x t S l i d e E l e m e n t ,   o p t i o n s ,   f o r w a r d F l a g )  
 	 a f t e r : 	 	       n u l l ,     / /   t r a n s i t i o n   c a l l b a c k   ( s c o p e   s e t   t o   e l e m e n t   t h a t   w a s   s h o w n ) :     f u n c t i o n ( c u r r S l i d e E l e m e n t ,   n e x t S l i d e E l e m e n t ,   o p t i o n s ,   f o r w a r d F l a g )  
 	 e n d : 	 	       n u l l ,     / /   c a l l b a c k   i n v o k e d   w h e n   t h e   s l i d e s h o w   t e r m i n a t e s   ( u s e   w i t h   a u t o s t o p   o r   n o w r a p   o p t i o n s ) :   f u n c t i o n ( o p t i o n s )  
 	 e a s i n g : 	 	       n u l l ,     / /   e a s i n g   m e t h o d   f o r   b o t h   i n   a n d   o u t   t r a n s i t i o n s  
 	 e a s e I n : 	 	       n u l l ,     / /   e a s i n g   f o r   " i n "   t r a n s i t i o n  
 	 e a s e O u t : 	       n u l l ,     / /   e a s i n g   f o r   " o u t "   t r a n s i t i o n  
 	 s h u f f l e : 	       n u l l ,     / /   c o o r d s   f o r   s h u f f l e   a n i m a t i o n ,   e x :   {   t o p : 1 5 ,   l e f t :   2 0 0   }  
 	 a n i m I n : 	 	       n u l l ,     / /   p r o p e r t i e s   t h a t   d e f i n e   h o w   t h e   s l i d e   a n i m a t e s   i n  
 	 a n i m O u t : 	       n u l l ,     / /   p r o p e r t i e s   t h a t   d e f i n e   h o w   t h e   s l i d e   a n i m a t e s   o u t  
 	 c s s B e f o r e : 	       n u l l ,     / /   p r o p e r t i e s   t h a t   d e f i n e   t h e   i n i t i a l   s t a t e   o f   t h e   s l i d e   b e f o r e   t r a n s i t i o n i n g   i n  
 	 c s s A f t e r : 	       n u l l ,     / /   p r o p e r t i e s   t h a t   d e f i n e d   t h e   s t a t e   o f   t h e   s l i d e   a f t e r   t r a n s i t i o n i n g   o u t  
 	 f x F n : 	 	       n u l l ,     / /   f u n c t i o n   u s e d   t o   c o n t r o l   t h e   t r a n s i t i o n :   f u n c t i o n ( c u r r S l i d e E l e m e n t ,   n e x t S l i d e E l e m e n t ,   o p t i o n s ,   a f t e r C a l b a c k ,   f o r w a r d F l a g )  
 	 h e i g h t : 	 	     ' a u t o ' ,   / /   c o n t a i n e r   h e i g h t  
 	 s t a r t i n g S l i d e :   0 , 	     / /   z e r o - b a s e d   i n d e x   o f   t h e   f i r s t   s l i d e   t o   b e   d i s p l a y e d  
 	 s y n c : 	 	       1 , 	     / /   t r u e   i f   i n / o u t   t r a n s i t i o n s   s h o u l d   o c c u r   s i m u l t a n e o u s l y  
 	 r a n d o m : 	 	       0 , 	     / /   t r u e   f o r   r a n d o m ,   f a l s e   f o r   s e q u e n c e   ( n o t   a p p l i c a b l e   t o   s h u f f l e   f x )  
 	 f i t : 	 	       0 , 	     / /   f o r c e   s l i d e s   t o   f i t   c o n t a i n e r  
 	 c o n t a i n e r R e s i z e :   1 , 	     / /   r e s i z e   c o n t a i n e r   t o   f i t   l a r g e s t   s l i d e  
 	 p a u s e : 	 	       0 , 	     / /   t r u e   t o   e n a b l e   " p a u s e   o n   h o v e r "  
 	 p a u s e O n P a g e r H o v e r :   0 ,   / /   t r u e   t o   p a u s e   w h e n   h o v e r i n g   o v e r   p a g e r   l i n k  
 	 a u t o s t o p : 	       0 , 	     / /   t r u e   t o   e n d   s l i d e s h o w   a f t e r   X   t r a n s i t i o n s   ( w h e r e   X   = =   s l i d e   c o u n t )  
 	 a u t o s t o p C o u n t :   0 , 	     / /   n u m b e r   o f   t r a n s i t i o n s   ( o p t i o n a l l y   u s e d   w i t h   a u t o s t o p   t o   d e f i n e   X )  
 	 d e l a y : 	 	       0 , 	     / /   a d d i t i o n a l   d e l a y   ( i n   m s )   f o r   f i r s t   t r a n s i t i o n   ( h i n t :   c a n   b e   n e g a t i v e )  
 	 s l i d e E x p r : 	       n u l l ,     / /   e x p r e s s i o n   f o r   s e l e c t i n g   s l i d e s   ( i f   s o m e t h i n g   o t h e r   t h a n   a l l   c h i l d r e n   i s   r e q u i r e d )  
 	 c l e a r t y p e : 	       ! $ . s u p p o r t . o p a c i t y ,     / /   t r u e   i f   c l e a r T y p e   c o r r e c t i o n s   s h o u l d   b e   a p p l i e d   ( f o r   I E )  
 	 c l e a r t y p e N o B g :   f a l s e ,   / /   s e t   t o   t r u e   t o   d i s a b l e   e x t r a   c l e a r t y p e   f i x i n g   ( l e a v e   f a l s e   t o   f o r c e   b a c k g r o u n d   c o l o r   s e t t i n g   o n   s l i d e s )  
 	 n o w r a p : 	 	       0 , 	     / /   t r u e   t o   p r e v e n t   s l i d e s h o w   f r o m   w r a p p i n g  
 	 f a s t O n E v e n t :       0 , 	     / /   f o r c e   f a s t   t r a n s i t i o n s   w h e n   t r i g g e r e d   m a n u a l l y   ( v i a   p a g e r   o r   p r e v / n e x t ) ;   v a l u e   = =   t i m e   i n   m s  
 	 r a n d o m i z e E f f e c t s :   1 ,     / /   v a l i d   w h e n   m u l t i p l e   e f f e c t s   a r e   u s e d ;   t r u e   t o   m a k e   t h e   e f f e c t   s e q u e n c e   r a n d o m  
 	 r e v : 	 	       0 , 	   / /   c a u s e s   a n i m a t i o n s   t o   t r a n s i t i o n   i n   r e v e r s e  
 	 m a n u a l T r u m p :       t r u e ,     / /   c a u s e s   m a n u a l   t r a n s i t i o n   t o   s t o p   a n   a c t i v e   t r a n s i t i o n   i n s t e a d   o f   b e i n g   i g n o r e d  
 	 r e q u e u e O n I m a g e N o t L o a d e d :   t r u e ,   / /   r e q u e u e   t h e   s l i d e s h o w   i f   a n y   i m a g e   s l i d e s   a r e   n o t   y e t   l o a d e d  
 	 r e q u e u e T i m e o u t :   2 5 0 ,     / /   m s   d e l a y   f o r   r e q u e u e  
 	 a c t i v e P a g e r C l a s s :   ' a c t i v e S l i d e ' ,   / /   c l a s s   n a m e   u s e d   f o r   t h e   a c t i v e   p a g e r   l i n k  
 	 u p d a t e A c t i v e P a g e r L i n k :   n u l l   / /   c a l l b a c k   f n   i n v o k e d   t o   u p d a t e   t h e   a c t i v e   p a g e r   l i n k   ( a d d s / r e m o v e s   a c t i v e P a g e r C l a s s   s t y l e )  
 } ;  
  
 } ) ( j Q u e r y ) ;  
  
  
 / * !  
   *   j Q u e r y   C y c l e   P l u g i n   T r a n s i t i o n   D e f i n i t i o n s  
   *   T h i s   s c r i p t   i s   a   p l u g i n   f o r   t h e   j Q u e r y   C y c l e   P l u g i n  
   *   E x a m p l e s   a n d   d o c u m e n t a t i o n   a t :   h t t p : / / m a l s u p . c o m / j q u e r y / c y c l e /  
   *   C o p y r i g h t   ( c )   2 0 0 7 - 2 0 0 8   M .   A l s u p  
   *   V e r s i o n : 	   2 . 7 2  
   *   D u a l   l i c e n s e d   u n d e r   t h e   M I T   a n d   G P L   l i c e n s e s :  
   *   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  
   *   h t t p : / / w w w . g n u . o r g / l i c e n s e s / g p l . h t m l  
   * /  
 ( f u n c t i o n ( $ )   {  
  
 / /  
 / /   T h e s e   f u n c t i o n s   d e f i n e   o n e - t i m e   s l i d e   i n i t i a l i z a t i o n   f o r   t h e   n a m e d  
 / /   t r a n s i t i o n s .   T o   s a v e   f i l e   s i z e   f e e l   f r e e   t o   r e m o v e   a n y   o f   t h e s e   t h a t   y o u  
 / /   d o n ' t   n e e d .  
 / /  
 $ . f n . c y c l e . t r a n s i t i o n s . n o n e   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 o p t s . f x F n   =   f u n c t i o n ( c u r r , n e x t , o p t s , a f t e r ) {  
 	 	 $ ( n e x t ) . s h o w ( ) ;  
 	 	 $ ( c u r r ) . h i d e ( ) ;  
 	 	 a f t e r ( ) ;  
 	 } ;  
 }  
  
 / /   s c r o l l U p / D o w n / L e f t / R i g h t  
 $ . f n . c y c l e . t r a n s i t i o n s . s c r o l l U p   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 $ c o n t . c s s ( ' o v e r f l o w ' , ' h i d d e n ' ) ;  
 	 o p t s . b e f o r e . p u s h ( $ . f n . c y c l e . c o m m o n R e s e t ) ;  
 	 v a r   h   =   $ c o n t . h e i g h t ( ) ;  
 	 o p t s . c s s B e f o r e   = {   t o p :   h ,   l e f t :   0   } ;  
 	 o p t s . c s s F i r s t   =   {   t o p :   0   } ;  
 	 o p t s . a n i m I n 	     =   {   t o p :   0   } ;  
 	 o p t s . a n i m O u t     =   {   t o p :   - h   } ;  
 } ;  
 $ . f n . c y c l e . t r a n s i t i o n s . s c r o l l D o w n   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 $ c o n t . c s s ( ' o v e r f l o w ' , ' h i d d e n ' ) ;  
 	 o p t s . b e f o r e . p u s h ( $ . f n . c y c l e . c o m m o n R e s e t ) ;  
 	 v a r   h   =   $ c o n t . h e i g h t ( ) ;  
 	 o p t s . c s s F i r s t   =   {   t o p :   0   } ;  
 	 o p t s . c s s B e f o r e =   {   t o p :   - h ,   l e f t :   0   } ;  
 	 o p t s . a n i m I n 	     =   {   t o p :   0   } ;  
 	 o p t s . a n i m O u t     =   {   t o p :   h   } ;  
 } ;  
 $ . f n . c y c l e . t r a n s i t i o n s . s c r o l l L e f t   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 $ c o n t . c s s ( ' o v e r f l o w ' , ' h i d d e n ' ) ;  
 	 o p t s . b e f o r e . p u s h ( $ . f n . c y c l e . c o m m o n R e s e t ) ;  
 	 v a r   w   =   $ c o n t . w i d t h ( ) ;  
 	 o p t s . c s s F i r s t   =   {   l e f t :   0   } ;  
 	 o p t s . c s s B e f o r e =   {   l e f t :   w ,   t o p :   0   } ;  
 	 o p t s . a n i m I n 	     =   {   l e f t :   0   } ;  
 	 o p t s . a n i m O u t     =   {   l e f t :   0 - w   } ;  
 } ;  
 $ . f n . c y c l e . t r a n s i t i o n s . s c r o l l R i g h t   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 $ c o n t . c s s ( ' o v e r f l o w ' , ' h i d d e n ' ) ;  
 	 o p t s . b e f o r e . p u s h ( $ . f n . c y c l e . c o m m o n R e s e t ) ;  
 	 v a r   w   =   $ c o n t . w i d t h ( ) ;  
 	 o p t s . c s s F i r s t   =   {   l e f t :   0   } ;  
 	 o p t s . c s s B e f o r e =   {   l e f t :   - w ,   t o p :   0   } ;  
 	 o p t s . a n i m I n 	     =   {   l e f t :   0   } ;  
 	 o p t s . a n i m O u t     =   {   l e f t :   w   } ;  
 } ;  
 $ . f n . c y c l e . t r a n s i t i o n s . s c r o l l H o r z   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 $ c o n t . c s s ( ' o v e r f l o w ' , ' h i d d e n ' ) . w i d t h ( ) ;  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s ,   f w d )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s ) ;  
 	 	 o p t s . c s s B e f o r e . l e f t   =   f w d   ?   ( n e x t . c y c l e W - 1 )   :   ( 1 - n e x t . c y c l e W ) ;  
 	 	 o p t s . a n i m O u t . l e f t   =   f w d   ?   - c u r r . c y c l e W   :   c u r r . c y c l e W ;  
 	 } ) ;  
 	 o p t s . c s s F i r s t   =   {   l e f t :   0   } ;  
 	 o p t s . c s s B e f o r e =   {   t o p :   0   } ;  
 	 o p t s . a n i m I n       =   {   l e f t :   0   } ;  
 	 o p t s . a n i m O u t     =   {   t o p :   0   } ;  
 } ;  
 $ . f n . c y c l e . t r a n s i t i o n s . s c r o l l V e r t   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 $ c o n t . c s s ( ' o v e r f l o w ' , ' h i d d e n ' ) ;  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s ,   f w d )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s ) ;  
 	 	 o p t s . c s s B e f o r e . t o p   =   f w d   ?   ( 1 - n e x t . c y c l e H )   :   ( n e x t . c y c l e H - 1 ) ;  
 	 	 o p t s . a n i m O u t . t o p   =   f w d   ?   c u r r . c y c l e H   :   - c u r r . c y c l e H ;  
 	 } ) ;  
 	 o p t s . c s s F i r s t   =   {   t o p :   0   } ;  
 	 o p t s . c s s B e f o r e =   {   l e f t :   0   } ;  
 	 o p t s . a n i m I n       =   {   t o p :   0   } ;  
 	 o p t s . a n i m O u t     =   {   l e f t :   0   } ;  
 } ;  
  
 / /   s l i d e X / s l i d e Y  
 $ . f n . c y c l e . t r a n s i t i o n s . s l i d e X   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ ( o p t s . e l e m e n t s ) . n o t ( c u r r ) . h i d e ( ) ;  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , f a l s e , t r u e ) ;  
 	 	 o p t s . a n i m I n . w i d t h   =   n e x t . c y c l e W ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   l e f t :   0 ,   t o p :   0 ,   w i d t h :   0   } ;  
 	 o p t s . a n i m I n 	   =   {   w i d t h :   ' s h o w '   } ;  
 	 o p t s . a n i m O u t   =   {   w i d t h :   0   } ;  
 } ;  
 $ . f n . c y c l e . t r a n s i t i o n s . s l i d e Y   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ ( o p t s . e l e m e n t s ) . n o t ( c u r r ) . h i d e ( ) ;  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , t r u e , f a l s e ) ;  
 	 	 o p t s . a n i m I n . h e i g h t   =   n e x t . c y c l e H ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   l e f t :   0 ,   t o p :   0 ,   h e i g h t :   0   } ;  
 	 o p t s . a n i m I n 	   =   {   h e i g h t :   ' s h o w '   } ;  
 	 o p t s . a n i m O u t   =   {   h e i g h t :   0   } ;  
 } ;  
  
 / /   s h u f f l e  
 $ . f n . c y c l e . t r a n s i t i o n s . s h u f f l e   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 v a r   i ,   w   =   $ c o n t . c s s ( ' o v e r f l o w ' ,   ' v i s i b l e ' ) . w i d t h ( ) ;  
 	 $ s l i d e s . c s s ( { l e f t :   0 ,   t o p :   0 } ) ;  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r , n e x t , o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , t r u e , t r u e , t r u e ) ;  
 	 } ) ;  
 	 / /   o n l y   a d j u s t   s p e e d   o n c e !  
 	 i f   ( ! o p t s . s p e e d A d j u s t e d )   {  
 	 	 o p t s . s p e e d   =   o p t s . s p e e d   /   2 ;   / /   s h u f f l e   h a s   2   t r a n s i t i o n s  
 	 	 o p t s . s p e e d A d j u s t e d   =   t r u e ;  
 	 }  
 	 o p t s . r a n d o m   =   0 ;  
 	 o p t s . s h u f f l e   =   o p t s . s h u f f l e   | |   { l e f t : - w ,   t o p : 1 5 } ;  
 	 o p t s . e l s   =   [ ] ;  
 	 f o r   ( i = 0 ;   i   <   $ s l i d e s . l e n g t h ;   i + + )  
 	 	 o p t s . e l s . p u s h ( $ s l i d e s [ i ] ) ;  
  
 	 f o r   ( i = 0 ;   i   <   o p t s . c u r r S l i d e ;   i + + )  
 	 	 o p t s . e l s . p u s h ( o p t s . e l s . s h i f t ( ) ) ;  
  
 	 / /   c u s t o m   t r a n s i t i o n   f n   ( h a t   t i p   t o   B e n j a m i n   S t e r l i n g   f o r   t h i s   b i t   o f   s w e e t n e s s ! )  
 	 o p t s . f x F n   =   f u n c t i o n ( c u r r ,   n e x t ,   o p t s ,   c b ,   f w d )   {  
 	 	 v a r   $ e l   =   f w d   ?   $ ( c u r r )   :   $ ( n e x t ) ;  
 	 	 $ ( n e x t ) . c s s ( o p t s . c s s B e f o r e ) ;  
 	 	 v a r   c o u n t   =   o p t s . s l i d e C o u n t ;  
 	 	 $ e l . a n i m a t e ( o p t s . s h u f f l e ,   o p t s . s p e e d I n ,   o p t s . e a s e I n ,   f u n c t i o n ( )   {  
 	 	 	 v a r   h o p s   =   $ . f n . c y c l e . h o p s F r o m L a s t ( o p t s ,   f w d ) ;  
 	 	 	 f o r   ( v a r   k = 0 ;   k   <   h o p s ;   k + + )  
 	 	 	 	 f w d   ?   o p t s . e l s . p u s h ( o p t s . e l s . s h i f t ( ) )   :   o p t s . e l s . u n s h i f t ( o p t s . e l s . p o p ( ) ) ;  
 	 	 	 i f   ( f w d )   {  
 	 	 	 	 f o r   ( v a r   i = 0 ,   l e n = o p t s . e l s . l e n g t h ;   i   <   l e n ;   i + + )  
 	 	 	 	 	 $ ( o p t s . e l s [ i ] ) . c s s ( ' z - i n d e x ' ,   l e n - i + c o u n t ) ;  
 	 	 	 }  
 	 	 	 e l s e   {  
 	 	 	 	 v a r   z   =   $ ( c u r r ) . c s s ( ' z - i n d e x ' ) ;  
 	 	 	 	 $ e l . c s s ( ' z - i n d e x ' ,   p a r s e I n t ( z ) + 1 + c o u n t ) ;  
 	 	 	 }  
 	 	 	 $ e l . a n i m a t e ( { l e f t : 0 ,   t o p : 0 } ,   o p t s . s p e e d O u t ,   o p t s . e a s e O u t ,   f u n c t i o n ( )   {  
 	 	 	 	 $ ( f w d   ?   t h i s   :   c u r r ) . h i d e ( ) ;  
 	 	 	 	 i f   ( c b )   c b ( ) ;  
 	 	 	 } ) ;  
 	 	 } ) ;  
 	 } ;  
 	 o p t s . c s s B e f o r e   =   {   d i s p l a y :   ' b l o c k ' ,   o p a c i t y :   1 ,   t o p :   0 ,   l e f t :   0   } ;  
 } ;  
  
 / /   t u r n U p / D o w n / L e f t / R i g h t  
 $ . f n . c y c l e . t r a n s i t i o n s . t u r n U p   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , t r u e , f a l s e ) ;  
 	 	 o p t s . c s s B e f o r e . t o p   =   n e x t . c y c l e H ;  
 	 	 o p t s . a n i m I n . h e i g h t   =   n e x t . c y c l e H ;  
 	 } ) ;  
 	 o p t s . c s s F i r s t     =   {   t o p :   0   } ;  
 	 o p t s . c s s B e f o r e   =   {   l e f t :   0 ,   h e i g h t :   0   } ;  
 	 o p t s . a n i m I n 	       =   {   t o p :   0   } ;  
 	 o p t s . a n i m O u t       =   {   h e i g h t :   0   } ;  
 } ;  
 $ . f n . c y c l e . t r a n s i t i o n s . t u r n D o w n   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , t r u e , f a l s e ) ;  
 	 	 o p t s . a n i m I n . h e i g h t   =   n e x t . c y c l e H ;  
 	 	 o p t s . a n i m O u t . t o p       =   c u r r . c y c l e H ;  
 	 } ) ;  
 	 o p t s . c s s F i r s t     =   {   t o p :   0   } ;  
 	 o p t s . c s s B e f o r e   =   {   l e f t :   0 ,   t o p :   0 ,   h e i g h t :   0   } ;  
 	 o p t s . a n i m O u t       =   {   h e i g h t :   0   } ;  
 } ;  
 $ . f n . c y c l e . t r a n s i t i o n s . t u r n L e f t   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , f a l s e , t r u e ) ;  
 	 	 o p t s . c s s B e f o r e . l e f t   =   n e x t . c y c l e W ;  
 	 	 o p t s . a n i m I n . w i d t h   =   n e x t . c y c l e W ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   t o p :   0 ,   w i d t h :   0     } ;  
 	 o p t s . a n i m I n 	       =   {   l e f t :   0   } ;  
 	 o p t s . a n i m O u t       =   {   w i d t h :   0   } ;  
 } ;  
 $ . f n . c y c l e . t r a n s i t i o n s . t u r n R i g h t   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , f a l s e , t r u e ) ;  
 	 	 o p t s . a n i m I n . w i d t h   =   n e x t . c y c l e W ;  
 	 	 o p t s . a n i m O u t . l e f t   =   c u r r . c y c l e W ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   t o p :   0 ,   l e f t :   0 ,   w i d t h :   0   } ;  
 	 o p t s . a n i m I n 	       =   {   l e f t :   0   } ;  
 	 o p t s . a n i m O u t       =   {   w i d t h :   0   } ;  
 } ;  
  
 / /   z o o m  
 $ . f n . c y c l e . t r a n s i t i o n s . z o o m   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , f a l s e , f a l s e , t r u e ) ;  
 	 	 o p t s . c s s B e f o r e . t o p   =   n e x t . c y c l e H / 2 ;  
 	 	 o p t s . c s s B e f o r e . l e f t   =   n e x t . c y c l e W / 2 ;  
 	 	 o p t s . a n i m I n 	       =   {   t o p :   0 ,   l e f t :   0 ,   w i d t h :   n e x t . c y c l e W ,   h e i g h t :   n e x t . c y c l e H   } ;  
 	 	 o p t s . a n i m O u t       =   {   w i d t h :   0 ,   h e i g h t :   0 ,   t o p :   c u r r . c y c l e H / 2 ,   l e f t :   c u r r . c y c l e W / 2   } ;  
 	 } ) ;  
 	 o p t s . c s s F i r s t   =   {   t o p : 0 ,   l e f t :   0   } ;  
 	 o p t s . c s s B e f o r e   =   {   w i d t h :   0 ,   h e i g h t :   0   } ;  
 } ;  
  
 / /   f a d e Z o o m  
 $ . f n . c y c l e . t r a n s i t i o n s . f a d e Z o o m   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , f a l s e , f a l s e ) ;  
 	 	 o p t s . c s s B e f o r e . l e f t   =   n e x t . c y c l e W / 2 ;  
 	 	 o p t s . c s s B e f o r e . t o p   =   n e x t . c y c l e H / 2 ;  
 	 	 o p t s . a n i m I n 	 =   {   t o p :   0 ,   l e f t :   0 ,   w i d t h :   n e x t . c y c l e W ,   h e i g h t :   n e x t . c y c l e H   } ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   w i d t h :   0 ,   h e i g h t :   0   } ;  
 	 o p t s . a n i m O u t     =   {   o p a c i t y :   0   } ;  
 } ;  
  
 / /   b l i n d X  
 $ . f n . c y c l e . t r a n s i t i o n s . b l i n d X   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 v a r   w   =   $ c o n t . c s s ( ' o v e r f l o w ' , ' h i d d e n ' ) . w i d t h ( ) ;  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s ) ;  
 	 	 o p t s . a n i m I n . w i d t h   =   n e x t . c y c l e W ;  
 	 	 o p t s . a n i m O u t . l e f t       =   c u r r . c y c l e W ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   l e f t :   w ,   t o p :   0   } ;  
 	 o p t s . a n i m I n   =   {   l e f t :   0   } ;  
 	 o p t s . a n i m O u t     =   {   l e f t :   w   } ;  
 } ;  
 / /   b l i n d Y  
 $ . f n . c y c l e . t r a n s i t i o n s . b l i n d Y   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 v a r   h   =   $ c o n t . c s s ( ' o v e r f l o w ' , ' h i d d e n ' ) . h e i g h t ( ) ;  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s ) ;  
 	 	 o p t s . a n i m I n . h e i g h t   =   n e x t . c y c l e H ;  
 	 	 o p t s . a n i m O u t . t o p       =   c u r r . c y c l e H ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   t o p :   h ,   l e f t :   0   } ;  
 	 o p t s . a n i m I n   =   {   t o p :   0   } ;  
 	 o p t s . a n i m O u t     =   {   t o p :   h   } ;  
 } ;  
 / /   b l i n d Z  
 $ . f n . c y c l e . t r a n s i t i o n s . b l i n d Z   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 v a r   h   =   $ c o n t . c s s ( ' o v e r f l o w ' , ' h i d d e n ' ) . h e i g h t ( ) ;  
 	 v a r   w   =   $ c o n t . w i d t h ( ) ;  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s ) ;  
 	 	 o p t s . a n i m I n . h e i g h t   =   n e x t . c y c l e H ;  
 	 	 o p t s . a n i m O u t . t o p       =   c u r r . c y c l e H ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   t o p :   h ,   l e f t :   w   } ;  
 	 o p t s . a n i m I n   =   {   t o p :   0 ,   l e f t :   0   } ;  
 	 o p t s . a n i m O u t     =   {   t o p :   h ,   l e f t :   w   } ;  
 } ;  
  
 / /   g r o w X   -   g r o w   h o r i z o n t a l l y   f r o m   c e n t e r e d   0   w i d t h  
 $ . f n . c y c l e . t r a n s i t i o n s . g r o w X   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , f a l s e , t r u e ) ;  
 	 	 o p t s . c s s B e f o r e . l e f t   =   t h i s . c y c l e W / 2 ;  
 	 	 o p t s . a n i m I n   =   {   l e f t :   0 ,   w i d t h :   t h i s . c y c l e W   } ;  
 	 	 o p t s . a n i m O u t   =   {   l e f t :   0   } ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   w i d t h :   0 ,   t o p :   0   } ;  
 } ;  
 / /   g r o w Y   -   g r o w   v e r t i c a l l y   f r o m   c e n t e r e d   0   h e i g h t  
 $ . f n . c y c l e . t r a n s i t i o n s . g r o w Y   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , t r u e , f a l s e ) ;  
 	 	 o p t s . c s s B e f o r e . t o p   =   t h i s . c y c l e H / 2 ;  
 	 	 o p t s . a n i m I n   =   {   t o p :   0 ,   h e i g h t :   t h i s . c y c l e H   } ;  
 	 	 o p t s . a n i m O u t   =   {   t o p :   0   } ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   h e i g h t :   0 ,   l e f t :   0   } ;  
 } ;  
  
 / /   c u r t a i n X   -   s q u e e z e   i n   b o t h   e d g e s   h o r i z o n t a l l y  
 $ . f n . c y c l e . t r a n s i t i o n s . c u r t a i n X   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , f a l s e , t r u e , t r u e ) ;  
 	 	 o p t s . c s s B e f o r e . l e f t   =   n e x t . c y c l e W / 2 ;  
 	 	 o p t s . a n i m I n   =   {   l e f t :   0 ,   w i d t h :   t h i s . c y c l e W   } ;  
 	 	 o p t s . a n i m O u t   =   {   l e f t :   c u r r . c y c l e W / 2 ,   w i d t h :   0   } ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   t o p :   0 ,   w i d t h :   0   } ;  
 } ;  
 / /   c u r t a i n Y   -   s q u e e z e   i n   b o t h   e d g e s   v e r t i c a l l y  
 $ . f n . c y c l e . t r a n s i t i o n s . c u r t a i n Y   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , t r u e , f a l s e , t r u e ) ;  
 	 	 o p t s . c s s B e f o r e . t o p   =   n e x t . c y c l e H / 2 ;  
 	 	 o p t s . a n i m I n   =   {   t o p :   0 ,   h e i g h t :   n e x t . c y c l e H   } ;  
 	 	 o p t s . a n i m O u t   =   {   t o p :   c u r r . c y c l e H / 2 ,   h e i g h t :   0   } ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   l e f t :   0 ,   h e i g h t :   0   } ;  
 } ;  
  
 / /   c o v e r   -   c u r r   s l i d e   c o v e r e d   b y   n e x t   s l i d e  
 $ . f n . c y c l e . t r a n s i t i o n s . c o v e r   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 v a r   d   =   o p t s . d i r e c t i o n   | |   ' l e f t ' ;  
 	 v a r   w   =   $ c o n t . c s s ( ' o v e r f l o w ' , ' h i d d e n ' ) . w i d t h ( ) ;  
 	 v a r   h   =   $ c o n t . h e i g h t ( ) ;  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s ) ;  
 	 	 i f   ( d   = =   ' r i g h t ' )  
 	 	 	 o p t s . c s s B e f o r e . l e f t   =   - w ;  
 	 	 e l s e   i f   ( d   = =   ' u p ' )  
 	 	 	 o p t s . c s s B e f o r e . t o p   =   h ;  
 	 	 e l s e   i f   ( d   = =   ' d o w n ' )  
 	 	 	 o p t s . c s s B e f o r e . t o p   =   - h ;  
 	 	 e l s e  
 	 	 	 o p t s . c s s B e f o r e . l e f t   =   w ;  
 	 } ) ;  
 	 o p t s . a n i m I n   =   {   l e f t :   0 ,   t o p :   0 } ;  
 	 o p t s . a n i m O u t   =   {   o p a c i t y :   1   } ;  
 	 o p t s . c s s B e f o r e   =   {   t o p :   0 ,   l e f t :   0   } ;  
 } ;  
  
 / /   u n c o v e r   -   c u r r   s l i d e   m o v e s   o f f   n e x t   s l i d e  
 $ . f n . c y c l e . t r a n s i t i o n s . u n c o v e r   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 v a r   d   =   o p t s . d i r e c t i o n   | |   ' l e f t ' ;  
 	 v a r   w   =   $ c o n t . c s s ( ' o v e r f l o w ' , ' h i d d e n ' ) . w i d t h ( ) ;  
 	 v a r   h   =   $ c o n t . h e i g h t ( ) ;  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , t r u e , t r u e , t r u e ) ;  
 	 	 i f   ( d   = =   ' r i g h t ' )  
 	 	 	 o p t s . a n i m O u t . l e f t   =   w ;  
 	 	 e l s e   i f   ( d   = =   ' u p ' )  
 	 	 	 o p t s . a n i m O u t . t o p   =   - h ;  
 	 	 e l s e   i f   ( d   = =   ' d o w n ' )  
 	 	 	 o p t s . a n i m O u t . t o p   =   h ;  
 	 	 e l s e  
 	 	 	 o p t s . a n i m O u t . l e f t   =   - w ;  
 	 } ) ;  
 	 o p t s . a n i m I n   =   {   l e f t :   0 ,   t o p :   0   } ;  
 	 o p t s . a n i m O u t   =   {   o p a c i t y :   1   } ;  
 	 o p t s . c s s B e f o r e   =   {   t o p :   0 ,   l e f t :   0   } ;  
 } ;  
  
 / /   t o s s   -   m o v e   t o p   s l i d e   a n d   f a d e   a w a y  
 $ . f n . c y c l e . t r a n s i t i o n s . t o s s   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 v a r   w   =   $ c o n t . c s s ( ' o v e r f l o w ' , ' v i s i b l e ' ) . w i d t h ( ) ;  
 	 v a r   h   =   $ c o n t . h e i g h t ( ) ;  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , t r u e , t r u e , t r u e ) ;  
 	 	 / /   p r o v i d e   d e f a u l t   t o s s   s e t t i n g s   i f   a n i m O u t   n o t   p r o v i d e d  
 	 	 i f   ( ! o p t s . a n i m O u t . l e f t   & &   ! o p t s . a n i m O u t . t o p )  
 	 	 	 o p t s . a n i m O u t   =   {   l e f t :   w * 2 ,   t o p :   - h / 2 ,   o p a c i t y :   0   } ;  
 	 	 e l s e  
 	 	 	 o p t s . a n i m O u t . o p a c i t y   =   0 ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   l e f t :   0 ,   t o p :   0   } ;  
 	 o p t s . a n i m I n   =   {   l e f t :   0   } ;  
 } ;  
  
 / /   w i p e   -   c l i p   a n i m a t i o n  
 $ . f n . c y c l e . t r a n s i t i o n s . w i p e   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {  
 	 v a r   w   =   $ c o n t . c s s ( ' o v e r f l o w ' , ' h i d d e n ' ) . w i d t h ( ) ;  
 	 v a r   h   =   $ c o n t . h e i g h t ( ) ;  
 	 o p t s . c s s B e f o r e   =   o p t s . c s s B e f o r e   | |   { } ;  
 	 v a r   c l i p ;  
 	 i f   ( o p t s . c l i p )   {  
 	 	 i f   ( / l 2 r / . t e s t ( o p t s . c l i p ) )  
 	 	 	 c l i p   =   ' r e c t ( 0 p x   0 p x   ' + h + ' p x   0 p x ) ' ;  
 	 	 e l s e   i f   ( / r 2 l / . t e s t ( o p t s . c l i p ) )  
 	 	 	 c l i p   =   ' r e c t ( 0 p x   ' + w + ' p x   ' + h + ' p x   ' + w + ' p x ) ' ;  
 	 	 e l s e   i f   ( / t 2 b / . t e s t ( o p t s . c l i p ) )  
 	 	 	 c l i p   =   ' r e c t ( 0 p x   ' + w + ' p x   0 p x   0 p x ) ' ;  
 	 	 e l s e   i f   ( / b 2 t / . t e s t ( o p t s . c l i p ) )  
 	 	 	 c l i p   =   ' r e c t ( ' + h + ' p x   ' + w + ' p x   ' + h + ' p x   0 p x ) ' ;  
 	 	 e l s e   i f   ( / z o o m / . t e s t ( o p t s . c l i p ) )   {  
 	 	 	 v a r   t o p   =   p a r s e I n t ( h / 2 ) ;  
 	 	 	 v a r   l e f t   =   p a r s e I n t ( w / 2 ) ;  
 	 	 	 c l i p   =   ' r e c t ( ' + t o p + ' p x   ' + l e f t + ' p x   ' + t o p + ' p x   ' + l e f t + ' p x ) ' ;  
 	 	 }  
 	 }  
  
 	 o p t s . c s s B e f o r e . c l i p   =   o p t s . c s s B e f o r e . c l i p   | |   c l i p   | |   ' r e c t ( 0 p x   0 p x   0 p x   0 p x ) ' ;  
  
 	 v a r   d   =   o p t s . c s s B e f o r e . c l i p . m a t c h ( / ( \ d + ) / g ) ;  
 	 v a r   t   =   p a r s e I n t ( d [ 0 ] ) ,   r   =   p a r s e I n t ( d [ 1 ] ) ,   b   =   p a r s e I n t ( d [ 2 ] ) ,   l   =   p a r s e I n t ( d [ 3 ] ) ;  
  
 	 o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {  
 	 	 i f   ( c u r r   = =   n e x t )   r e t u r n ;  
 	 	 v a r   $ c u r r   =   $ ( c u r r ) ,   $ n e x t   =   $ ( n e x t ) ;  
 	 	 $ . f n . c y c l e . c o m m o n R e s e t ( c u r r , n e x t , o p t s , t r u e , t r u e , f a l s e ) ;  
 	 	 o p t s . c s s A f t e r . d i s p l a y   =   ' b l o c k ' ;  
  
 	 	 v a r   s t e p   =   1 ,   c o u n t   =   p a r s e I n t ( ( o p t s . s p e e d I n   /   1 3 ) )   -   1 ;  
 	 	 ( f u n c t i o n   f ( )   {  
 	 	 	 v a r   t t   =   t   ?   t   -   p a r s e I n t ( s t e p   *   ( t / c o u n t ) )   :   0 ;  
 	 	 	 v a r   l l   =   l   ?   l   -   p a r s e I n t ( s t e p   *   ( l / c o u n t ) )   :   0 ;  
 	 	 	 v a r   b b   =   b   <   h   ?   b   +   p a r s e I n t ( s t e p   *   ( ( h - b ) / c o u n t   | |   1 ) )   :   h ;  
 	 	 	 v a r   r r   =   r   <   w   ?   r   +   p a r s e I n t ( s t e p   *   ( ( w - r ) / c o u n t   | |   1 ) )   :   w ;  
 	 	 	 $ n e x t . c s s ( {   c l i p :   ' r e c t ( ' + t t + ' p x   ' + r r + ' p x   ' + b b + ' p x   ' + l l + ' p x ) '   } ) ;  
 	 	 	 ( s t e p + +   < =   c o u n t )   ?   s e t T i m e o u t ( f ,   1 3 )   :   $ c u r r . c s s ( ' d i s p l a y ' ,   ' n o n e ' ) ;  
 	 	 } ) ( ) ;  
 	 } ) ;  
 	 o p t s . c s s B e f o r e   =   {   d i s p l a y :   ' b l o c k ' ,   o p a c i t y :   1 ,   t o p :   0 ,   l e f t :   0   } ;  
 	 o p t s . a n i m I n 	       =   {   l e f t :   0   } ;  
 	 o p t s . a n i m O u t       =   {   l e f t :   0   } ;  
 } ;  
  
 } ) ( j Q u e r y ) ;  
  
 
