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