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