ÿþ/ * *   < C o n t a i n s >   * *  
  
 1 .     P N G   f i x   ( v   1 . 2 )  
 2 .     C y c l e   ( v   2 . 6 3 )  
 3 .     I m a g e   R e s i z e r   ( v   1 . 0 )  
 4 .     I m a g e   T o o l t i p   ( v   1 . 0 )  
 5 .     S u c k e r f i s h   m e n u   ( v   0 . 5 )  
 6 .     T h i c k b o x   ( v   3 . 1 )  
 7 .     I n n e r f a d e   ( v   1 . 0 )  
 8 .     T o o l t i p   ( v   1 . 1 )  
 9 .     A j a x   f o r m   ( v   1 . 0 )  
 1 0 .   C o l o r   a n m a t i o n s   ( v   1 . 0 )  
 1 1 .   A c c o r d i o n   ( v   0 . 1 )  
 1 2 .   A j a x   s l i d e s h o w   ( v   0 . 1 )  
 1 3 .   S h o p p i n g C a r t   ( v   0 . 1 )  
 1 4 .   L o a d S u b M e n u   ( v   0 . 1 )  
 1 5 .   G o o g l e   M a p s   ( v   1 . 0 )  
  
 < / C o n t a i n s >  
 < F u n c t i o n S e t u p >  
  
 ( f u n c t i o n ( $ ) {  
 $ . f n . e x t e n d ( {  
 F u n c t i o n N a m e :   f u n c t i o n ( S e t t i n g s )   {   / / T o D o ;   A p p l y i n g   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 ( ) {  
 } ) ;  
 }  
 } ) ;  
 } ) ( j Q u e r y ) ;  
  
 < / F u n c t i o n S e t u p >  
  
 * * /  
  
  
 / /   P N G   F i x  
  
 / * *  
 *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 *   j Q u e r y - P l u g i n   " p n g F i x "  
 *   V e r s i o n :   1 . 2 ,   0 9 . 0 3 . 2 0 0 9  
 *   b y   A n d r e a s   E b e r h a r d ,   a n d r e a s . e b e r h a r d @ g m a i l . c o m  
 *                                             h t t p : / / j q u e r y . a n d r e a s e b e r h a r d . d e /  
 *  
 *   C o p y r i g h t   ( c )   2 0 0 7   A n d r e a s   E b e r h a r d  
 *   L i c e n s e d   u n d e r   G P L   ( 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 / g p l - l i c e n s e . p h p )  
 *  
 *   C h a n g e l o g :  
 *         0 9 . 0 3 . 2 0 0 9   V e r s i o n   1 . 2  
 *         -   U p d a t e   f o r   j Q u e r y   1 . 3 . x ,   r e m o v e d   @   f r o m   s e l e c t o r s  
 *         1 1 . 0 9 . 2 0 0 7   V e r s i o n   1 . 1  
 *         -   r e m o v e d   n o C o n f l i c t  
 *         -   a d d e d   p n g - s u p p o r t   f o r   i n p u t   t y p e = i m a g e  
 *         -   0 1 . 0 8 . 2 0 0 7   C S S   b a c k g r o u n d - i m a g e   s u p p o r t   e x t e n s i o n   a d d e d   b y   S c o t t   J e h l ,   s c o t t @ f i l a m e n t g r o u p . c o m ,   h t t p : / / w w w . f i l a m e n t g r o u p . c o m  
 *         3 1 . 0 5 . 2 0 0 7   i n i t i a l   V e r s i o n   1 . 0  
 *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 *   @ e x a m p l e   $ ( f u n c t i o n ( ) { $ ( d o c u m e n t ) . p n g F i x ( ) ; } ) ;  
 *   @ d e s c   F i x e s   a l l   P N G ' s   i n   t h e   d o c u m e n t   o n   d o c u m e n t . r e a d y  
 *  
 *   j Q u e r y ( f u n c t i o n ( ) { j Q u e r y ( d o c u m e n t ) . p n g F i x ( ) ; } ) ;  
 *   @ d e s c   F i x e s   a l l   P N G ' s   i n   t h e   d o c u m e n t   o n   d o c u m e n t . r e a d y   w h e n   u s i n g   n o C o n f l i c t  
 *  
 *   @ e x a m p l e   $ ( f u n c t i o n ( ) { $ ( ' d i v . e x a m p l e s ' ) . p n g F i x ( ) ; } ) ;  
 *   @ d e s c   F i x e s   a l l   P N G ' s   w i t h i n   d i v   w i t h   c l a s s   e x a m p l e s  
 *  
 *   @ e x a m p l e   $ ( f u n c t i o n ( ) { $ ( ' d i v . e x a m p l e s ' ) . p n g F i x (   {   b l a n k g i f : ' e x t . g i f '   }   ) ; } ) ;  
 *   @ d e s c   F i x e s   a l l   P N G ' s   w i t h i n   d i v   w i t h   c l a s s   e x a m p l e s ,   p r o v i d e s   b l a n k   g i f   f o r   i n p u t   w i t h   p n g  
 *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 * /  
  
 ( f u n c t i o n ( $ )   {  
  
         j Q u e r y . f n . p n g F i x   =   f u n c t i o n ( s e t t i n g s )   {  
  
                 / /   S e t t i n g s  
                 s e t t i n g s   =   j Q u e r y . e x t e n d ( {  
                         b l a n k g i f :   ' b l a n k . g i f '  
                 } ,   s e t t i n g s ) ;  
  
                 v a r   i e 5 5   =   ( n a v i g a t o r . a p p N a m e   = =   " M i c r o s o f t   I n t e r n e t   E x p l o r e r "   & &   p a r s e I n t ( n a v i g a t o r . a p p V e r s i o n )   = =   4   & &   n a v i g a t o r . a p p V e r s i o n . i n d e x O f ( " M S I E   5 . 5 " )   ! =   - 1 ) ;  
                 v a r   i e 6   =   ( n a v i g a t o r . a p p N a m e   = =   " M i c r o s o f t   I n t e r n e t   E x p l o r e r "   & &   p a r s e I n t ( n a v i g a t o r . a p p V e r s i o n )   = =   4   & &   n a v i g a t o r . a p p V e r s i o n . i n d e x O f ( " M S I E   6 . 0 " )   ! =   - 1 ) ;  
  
                 i f   ( j Q u e r y . b r o w s e r . m s i e   & &   ( i e 5 5   | |   i e 6 ) )   {  
  
                         / / f i x   i m a g e s   w i t h   p n g - s o u r c e  
                         j Q u e r y ( t h i s ) . f i n d ( " i m g [ s r c $ = . p n g ] " ) . e a c h ( f u n c t i o n ( )   {  
  
                                 j Q u e r y ( t h i s ) . a t t r ( ' w i d t h ' ,   j Q u e r y ( t h i s ) . w i d t h ( ) ) ;  
                                 j Q u e r y ( t h i s ) . a t t r ( ' h e i g h t ' ,   j Q u e r y ( t h i s ) . h e i g h t ( ) ) ;  
  
                                 v a r   p r e v S t y l e   =   ' ' ;  
                                 v a r   s t r N e w H T M L   =   ' ' ;  
                                 v a r   i m g I d   =   ( j Q u e r y ( t h i s ) . a t t r ( ' i d ' ) )   ?   ' i d = " '   +   j Q u e r y ( t h i s ) . a t t r ( ' i d ' )   +   ' "   '   :   ' ' ;  
                                 v a r   i m g C l a s s   =   ( j Q u e r y ( t h i s ) . a t t r ( ' c l a s s ' ) )   ?   ' c l a s s = " '   +   j Q u e r y ( t h i s ) . a t t r ( ' c l a s s ' )   +   ' "   '   :   ' ' ;  
                                 v a r   i m g T i t l e   =   ( j Q u e r y ( t h i s ) . a t t r ( ' t i t l e ' ) )   ?   ' t i t l e = " '   +   j Q u e r y ( t h i s ) . a t t r ( ' t i t l e ' )   +   ' "   '   :   ' ' ;  
                                 v a r   i m g A l t   =   ( j Q u e r y ( t h i s ) . a t t r ( ' a l t ' ) )   ?   ' a l t = " '   +   j Q u e r y ( t h i s ) . a t t r ( ' a l t ' )   +   ' "   '   :   ' ' ;  
                                 v a r   i m g A l i g n   =   ( j Q u e r y ( t h i s ) . a t t r ( ' a l i g n ' ) )   ?   ' f l o a t : '   +   j Q u e r y ( t h i s ) . a t t r ( ' a l i g n ' )   +   ' ; '   :   ' ' ;  
                                 v a r   i m g H a n d   =   ( j Q u e r y ( t h i s ) . p a r e n t ( ) . a t t r ( ' h r e f ' ) )   ?   ' c u r s o r : h a n d ; '   :   ' ' ;  
                                 i f   ( t h i s . s t y l e . b o r d e r )   {  
                                         p r e v S t y l e   + =   ' b o r d e r : '   +   t h i s . s t y l e . b o r d e r   +   ' ; ' ;  
                                         t h i s . s t y l e . b o r d e r   =   ' ' ;  
                                 }  
                                 i f   ( t h i s . s t y l e . p a d d i n g )   {  
                                         p r e v S t y l e   + =   ' p a d d i n g : '   +   t h i s . s t y l e . p a d d i n g   +   ' ; ' ;  
                                         t h i s . s t y l e . p a d d i n g   =   ' ' ;  
                                 }  
                                 i f   ( t h i s . s t y l e . m a r g i n )   {  
                                         p r e v S t y l e   + =   ' m a r g i n : '   +   t h i s . s t y l e . m a r g i n   +   ' ; ' ;  
                                         t h i s . s t y l e . m a r g i n   =   ' ' ;  
                                 }  
                                 v a r   i m g S t y l e   =   ( t h i s . s t y l e . c s s T e x t ) ;  
  
                                 s t r N e w H T M L   + =   ' < s p a n   '   +   i m g I d   +   i m g C l a s s   +   i m g T i t l e   +   i m g A l t ;  
                                 s t r N e w H T M L   + =   ' s t y l e = " p o s i t i o n : r e l a t i v e ; w h i t e - s p a c e : p r e - l i n e ; d i s p l a y : i n l i n e - b l o c k ; b a c k g r o u n d : t r a n s p a r e n t ; '   +   i m g A l i g n   +   i m g H a n d ;  
                                 s t r N e w H T M L   + =   ' w i d t h : '   +   j Q u e r y ( t h i s ) . w i d t h ( )   +   ' p x ; '   +   ' h e i g h t : '   +   j Q u e r y ( t h i s ) . h e i g h t ( )   +   ' p x ; ' ;  
                                 s t r N e w H T M L   + =   ' f i l t e r : p r o g i d : D X I m a g e T r a n s f o r m . M i c r o s o f t . A l p h a I m a g e L o a d e r '   +   ' ( s r c = \ ' '   +   j Q u e r y ( t h i s ) . a t t r ( ' s r c ' )   +   ' \ ' ,   s i z i n g M e t h o d = \ ' s c a l e \ ' ) ; ' ;  
                                 s t r N e w H T M L   + =   i m g S t y l e   +   ' " > < / s p a n > ' ;  
                                 i f   ( p r e v S t y l e   ! =   ' ' )   {  
                                         s t r N e w H T M L   =   ' < s p a n   s t y l e = " p o s i t i o n : r e l a t i v e ; d i s p l a y : i n l i n e - b l o c k ; '   +   p r e v S t y l e   +   i m g H a n d   +   ' w i d t h : '   +   j Q u e r y ( t h i s ) . w i d t h ( )   +   ' p x ; '   +   ' h e i g h t : '   +   j Q u e r y ( t h i s ) . h e i g h t ( )   +   ' p x ; '   +   ' " > '   +   s t r N e w H T M L   +   ' < / s p a n > ' ;  
                                 }  
  
                                 j Q u e r y ( t h i s ) . h i d e ( ) ;  
                                 j Q u e r y ( t h i s ) . a f t e r ( s t r N e w H T M L ) ;  
  
                         } ) ;  
  
                         / /   f i x   c s s   b a c k g r o u n d   p n g s  
                         j Q u e r y ( t h i s ) . f i n d ( " * " ) . e a c h ( f u n c t i o n ( )   {  
                                 v a r   b g I M G   =   j Q u e r y ( t h i s ) . c s s ( ' b a c k g r o u n d - i m a g e ' ) ;  
                                 i f   ( b g I M G . i n d e x O f ( " . p n g " )   ! =   - 1 )   {  
                                         v a r   i e b g   =   b g I M G . s p l i t ( ' u r l ( " ' ) [ 1 ] . s p l i t ( ' " ) ' ) [ 0 ] ;  
                                         j Q u e r y ( t h i s ) . c s s ( ' b a c k g r o u n d - i m a g e ' ,   ' n o n e ' ) ;  
                                         j Q u e r y ( t h i s ) . g e t ( 0 ) . r u n t i m e S t y l e . f i l t e r   =   " p r o g i d : D X I m a g e T r a n s f o r m . M i c r o s o f t . A l p h a I m a g e L o a d e r ( s r c = ' "   +   i e b g   +   " ' , s i z i n g M e t h o d = ' s c a l e ' ) " ;  
                                 }  
                         } ) ;  
  
                         / / f i x   i n p u t   w i t h   p n g - s o u r c e  
                         j Q u e r y ( t h i s ) . f i n d ( " i n p u t [ s r c $ = . p n g ] " ) . e a c h ( f u n c t i o n ( )   {  
                                 v a r   b g I M G   =   j Q u e r y ( t h i s ) . a t t r ( ' s r c ' ) ;  
                                 j Q u e r y ( t h i s ) . g e t ( 0 ) . r u n t i m e S t y l e . f i l t e r   =   ' p r o g i d : D X I m a g e T r a n s f o r m . M i c r o s o f t . A l p h a I m a g e L o a d e r '   +   ' ( s r c = \ ' '   +   b g I M G   +   ' \ ' ,   s i z i n g M e t h o d = \ ' s c a l e \ ' ) ; ' ;  
                                 j Q u e r y ( t h i s ) . a t t r ( ' s r c ' ,   s e t t i n g s . b l a n k g i f )  
                         } ) ;  
  
                 }  
  
                 r e t u r n   j Q u e r y ;  
  
         } ;  
  
 } ) ( j Q u e r y ) ;  
  
  
 / /   C y c l e  
  
 / *  
 *   j Q u e r y   C y c l e   P l u g i n   ( w i t h   T r a n s i t i o n   D e f i n i t i o n s )  
 *   E x a m p l e s   a n d   d o c u m e n t a t i o n   a t :   h t t p : / / j q u e r y . m a l s u p . c o m / c y c l e /  
 *   C o p y r i g h t   ( c )   2 0 0 7 - 2 0 0 9   M .   A l s u p  
 *   V e r s i o n :   2 . 6 3   ( 1 7 - M A R - 2 0 0 9 )  
 *   D u a l   l i c e n s e d   u n d e r   t h e   M I T   a n d   G P L   l i c e n s e s :  
 *   h t t p : / / w w w . o p e n s o u r c e . o r g / l i c e n s e s / m i t - l i c e n s e . p h p  
 *   h t t p : / / w w w . g n u . o r g / l i c e n s e s / g p l . h t m l  
 *   R e q u i r e s :   j Q u e r y   v 1 . 2 . 6   o r   l a t e r  
 *  
 *   O r i g i n a l l y   b a s e d   o n   t h e   w o r k   o f :  
 * 	 1 )   M a t t   O a k e s  
 * 	 2 )   T o r s t e n   B a l d e s   ( h t t p : / / m e d i e n f r e u n d e . c o m / l a b / i n n e r f a d e / )  
 * 	 3 )   B e n j a m i n   S t e r l i n g   ( h t t p : / / w w w . b e n j a m i n s t e r l i n g . c o m / e x p e r i m e n t s / j q S h u f f l e / )  
 * /  
 ;   ( f u n c t i o n ( $ )   {   v a r   v e r   =   " 2 . 6 3 " ;   i f   ( $ . s u p p o r t   = =   u n d e f i n e d )   {   $ . s u p p o r t   =   {   o p a c i t y :   ! ( $ . b r o w s e r . m s i e )   } ;   }   f u n c t i o n   l o g ( )   {   i f   ( w i n d o w . c o n s o l e   & &   w i n d o w . c o n s o l e . l o g )   {   w i n d o w . c o n s o l e . l o g ( " [ c y c l e ]   "   +   A r r a y . p r o t o t y p e . j o i n . c a l l ( a r g u m e n t s ,   "   " ) ) ;   }   }   $ . f n . c y c l e   =   f u n c t i o n ( o p t i o n s ,   a r g 2 )   {   v a r   o   =   {   s :   t h i s . s e l e c t o r ,   c :   t h i s . c o n t e x t   } ;   i f   ( t h i s . l e n g t h   = =   0   & &   o p t i o n s   ! =   " s t o p " )   {   i f   ( ! $ . i s R e a d y   & &   o . s )   {   l o g ( " D O M   n o t   r e a d y ,   q u e u i n g   s l i d e s h o w " ) ;   $ ( f u n c t i o n ( )   {   $ ( o . s ,   o . c ) . c y c l e ( o p t i o n s ,   a r g 2 ) ;   } ) ;   r e t u r n   t h i s ;   }   l o g ( " t e r m i n a t i n g ;   z e r o   e l e m e n t s   f o u n d   b y   s e l e c t o r "   +   ( $ . i s R e a d y   ?   " "   :   "   ( D O M   n o t   r e a d y ) " ) ) ;   r e t u r n   t h i s ;   }   r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {   o p t i o n s   =   h a n d l e A r g u m e n t s ( t h i s ,   o p t i o n s ,   a r g 2 ) ;   i f   ( o p t i o n s   = = =   f a l s e )   {   r e t u r n ;   }   i f   ( t h i s . c y c l e T i m e o u t )   {   c l e a r T i m e o u t ( t h i s . c y c l e T i m e o u t ) ;   }   t h i s . c y c l e T i m e o u t   =   t h i s . c y c l e P a u s e   =   0 ;   v a r   $ c o n t   =   $ ( t h i s ) ;   v a r   $ s l i d e s   =   o p t i o n s . s l i d e E x p r   ?   $ ( o p t i o n s . s l i d e E x p r ,   t h i s )   :   $ c o n t . c h i l d r e n ( ) ;   v a r   e l s   =   $ s l i d e s . g e t ( ) ;   i f   ( e l s . l e n g t h   <   2 )   {   l o g ( " t e r m i n a t i n g ;   t o o   f e w   s l i d e s :   "   +   e l s . l e n g t h ) ;   r e t u r n ;   }   v a r   o p t s   =   b u i l d O p t i o n s ( $ c o n t ,   $ s l i d e s ,   e l s ,   o p t i o n s ,   o ) ;   i f   ( o p t s   = = =   f a l s e )   {   r e t u r n ;   }   i f   ( o p t s . t i m e o u t   | |   o p t s . c o n t i n u o u s )   {   t h i s . c y c l e T i m e o u t   =   s e t T i m e o u t ( f u n c t i o n ( )   {   g o ( e l s ,   o p t s ,   0 ,   ! o p t s . r e v ) ;   } ,   o p t s . c o n t i n u o u s   ?   1 0   :   o p t s . t i m e o u t   +   ( o p t s . d e l a y   | |   0 ) ) ;   }   } ) ;   } ;   f u n c t i o n   h a n d l e A r g u m e n t s ( c o n t ,   o p t i o n s ,   a r g 2 )   {   i f   ( c o n t . c y c l e S t o p   = =   u n d e f i n e d )   {   c o n t . c y c l e S t o p   =   0 ;   }   i f   ( o p t i o n s   = = =   u n d e f i n e d   | |   o p t i o n s   = = =   n u l l )   {   o p t i o n s   =   { } ;   }   i f   ( o p t i o n s . c o n s t r u c t o r   = =   S t r i n g )   {   s w i t c h   ( o p t i o n s )   {   c a s e   " s t o p " :   c o n t . c y c l e S t o p + + ;   i f   ( c o n t . c y c l e T i m e o u t )   {   c l e a r T i m e o u t ( c o n t . c y c l e T i m e o u t ) ;   }   c o n t . c y c l e T i m e o u t   =   0 ;   $ ( c o n t ) . r e m o v e D a t a ( " c y c l e . o p t s " ) ;   r e t u r n   f a l s e ;   c a s e   " p a u s e " :   c o n t . c y c l e P a u s e   =   1 ;   r e t u r n   f a l s e ;   c a s e   " r e s u m e " :   c o n t . c y c l e P a u s e   =   0 ;   i f   ( a r g 2   = = =   t r u e )   {   o p t i o n s   =   $ ( c o n t ) . d a t a ( " c y c l e . o p t s " ) ;   i f   ( ! o p t i o n s )   {   l o g ( " o p t i o n s   n o t   f o u n d ,   c a n   n o t   r e s u m e " ) ;   r e t u r n   f a l s e ;   }   i f   ( c o n t . c y c l e T i m e o u t )   {   c l e a r T i m e o u t ( c o n t . c y c l e T i m e o u t ) ;   c o n t . c y c l e T i m e o u t   =   0 ;   }   g o ( o p t i o n s . e l e m e n t s ,   o p t i o n s ,   1 ,   1 ) ;   }   r e t u r n   f a l s e ;   d e f a u l t :   o p t i o n s   =   {   f x :   o p t i o n s   } ;   }   }   e l s e   {   i f   ( o p t i o n s . c o n s t r u c t o r   = =   N u m b e r )   {   v a r   n u m   =   o p t i o n s ;   o p t i o n s   =   $ ( c o n t ) . d a t a ( " c y c l e . o p t s " ) ;   i f   ( ! o p t i o n s )   {   l o g ( " o p t i o n s   n o t   f o u n d ,   c a n   n o t   a d v a n c e   s l i d e " ) ;   r e t u r n   f a l s e ;   }   i f   ( n u m   <   0   | |   n u m   > =   o p t i o n s . e l e m e n t s . l e n g t h )   {   l o g ( " i n v a l i d   s l i d e   i n d e x :   "   +   n u m ) ;   r e t u r n   f a l s e ;   }   o p t i o n s . n e x t S l i d e   =   n u m ;   i f   ( c o n t . c y c l e T i m e o u t )   {   c l e a r T i m e o u t ( t h i s . c y c l e T i m e o u t ) ;   c o n t . c y c l e T i m e o u t   =   0 ;   }   i f   ( t y p e o f   a r g 2   = =   " s t r i n g " )   {   o p t i o n s . o n e T i m e F x   =   a r g 2 ;   }   g o ( o p t i o n s . e l e m e n t s ,   o p t i o n s ,   1 ,   n u m   > =   o p t i o n s . c u r r S l i d e ) ;   r e t u r n   f a l s e ;   }   }   r e t u r n   o p t i o n s ;   }   f u n c t i o n   r e m o v e F i l t e r ( e l ,   o p t s )   {   i f   ( ! $ . s u p p o r t . o p a c i t y   & &   o p t s . c l e a r t y p e   & &   e l . s t y l e . f i l t e r )   {   t r y   {   e l . s t y l e . r e m o v e A t t r i b u t e ( " f i l t e r " ) ;   }   c a t c h   ( s m o t h e r )   {   }   }   }   f u n c t i o n   b u i l d O p t i o n s ( $ c o n t ,   $ s l i d e s ,   e l s ,   o p t i o n s ,   o )   {   v a r   o p t s   =   $ . e x t e n d ( { } ,   $ . f n . c y c l e . d e f a u l t s ,   o p t i o n s   | |   { } ,   $ . m e t a d a t a   ?   $ c o n t . m e t a d a t a ( )   :   $ . m e t a   ?   $ c o n t . d a t a ( )   :   { } ) ;   i f   ( o p t s . a u t o s t o p )   {   o p t s . c o u n t d o w n   =   o p t s . a u t o s t o p C o u n t   | |   e l s . l e n g t h ;   }   v a r   c o n t   =   $ c o n t [ 0 ] ;   $ c o n t . d a t a ( " c y c l e . o p t s " ,   o p t s ) ;   o p t s . $ c o n t   =   $ c o n t ;   o p t s . s t o p C o u n t   =   c o n t . c y c l e S t o p ;   o p t s . e l e m e n t s   =   e l s ;   o p t s . b e f o r e   =   o p t s . b e f o r e   ?   [ o p t s . b e f o r e ]   :   [ ] ;   o p t s . a f t e r   =   o p t s . a f t e r   ?   [ o p t s . a f t e r ]   :   [ ] ;   o p t s . a f t e r . u n s h i f t ( f u n c t i o n ( )   {   o p t s . b u s y   =   0 ;   } ) ;   i f   ( ! $ . s u p p o r t . o p a c i t y   & &   o p t s . c l e a r t y p e )   {   o p t s . a f t e r . p u s h ( f u n c t i o n ( )   {   r e m o v e F i l t e r ( t h i s ,   o p t s ) ;   } ) ;   }   i f   ( o p t s . c o n t i n u o u s )   {   o p t s . a f t e r . p u s h ( f u n c t i o n ( )   {   g o ( e l s ,   o p t s ,   0 ,   ! o p t s . r e v ) ;   } ) ;   }   s a v e O r i g i n a l O p t s ( o p t s ) ;   i f   ( ! $ . s u p p o r t . o p a c i t y   & &   o p t s . c l e a r t y p e   & &   ! o p t s . c l e a r t y p e N o B g )   {   c l e a r T y p e F i x ( $ s l i d e s ) ;   }   i f   ( $ c o n t . c s s ( " p o s i t i o n " )   = =   " s t a t i c " )   {   $ c o n t . c s s ( " p o s i t i o n " ,   " r e l a t i v e " ) ;   }   i f   ( o p t s . w i d t h )   {   $ c o n t . w i d t h ( o p t s . w i d t h ) ;   }   i f   ( o p t s . h e i g h t   & &   o p t s . h e i g h t   ! =   " a u t o " )   {   $ c o n t . h e i g h t ( o p t s . h e i g h t ) ;   }   i f   ( o p t s . s t a r t i n g S l i d e )   {   o p t s . s t a r t i n g S l i d e   =   p a r s e I n t ( o p t s . s t a r t i n g S l i d e ) ;   }   i f   ( o p t s . r a n d o m )   {   o p t s . r a n d o m M a p   =   [ ] ;   f o r   ( v a r   i   =   0 ;   i   <   e l s . l e n g t h ;   i + + )   {   o p t s . r a n d o m M a p . p u s h ( i ) ;   }   o p t s . r a n d o m M a p . s o r t ( f u n c t i o n ( a ,   b )   {   r e t u r n   M a t h . r a n d o m ( )   -   0 . 5 ;   } ) ;   o p t s . r a n d o m I n d e x   =   0 ;   o p t s . s t a r t i n g S l i d e   =   o p t s . r a n d o m M a p [ 0 ] ;   }   e l s e   {   i f   ( o p t s . s t a r t i n g S l i d e   > =   e l s . l e n g t h )   {   o p t s . s t a r t i n g S l i d e   =   0 ;   }   }   o p t s . c u r r S l i d e   =   o p t s . s t a r t i n g S l i d e   =   o p t s . s t a r t i n g S l i d e   | |   0 ;   v a r   f i r s t   =   o p t s . s t a r t i n g S l i d e ;   $ s l i d e s . c s s ( {   p o s i t i o n :   " a b s o l u t e " ,   t o p :   0 ,   l e f t :   0   } ) . h i d e ( ) . e a c h ( f u n c t i o n ( i )   {   v a r   z   =   f i r s t   ?   i   > =   f i r s t   ?   e l s . l e n g t h   -   ( i   -   f i r s t )   :   f i r s t   -   i   :   e l s . l e n g t h   -   i ;   $ ( t h i s ) . c s s ( " z - i n d e x " ,   z ) ;   } ) ;   $ ( e l s [ f i r s t ] ) . c s s ( " o p a c i t y " ,   1 ) . s h o w ( ) ;   r e m o v e F i l t e r ( e l s [ f i r s t ] ,   o p t s ) ;   i f   ( o p t s . f i t   & &   o p t s . w i d t h )   {   $ s l i d e s . w i d t h ( o p t s . w i d t h ) ;   }   i f   ( o p t s . f i t   & &   o p t s . h e i g h t   & &   o p t s . h e i g h t   ! =   " a u t o " )   {   $ s l i d e s . h e i g h t ( o p t s . h e i g h t ) ;   }   v a r   r e s h a p e   =   o p t s . c o n t a i n e r R e s i z e   & &   ! $ c o n t . i n n e r H e i g h t ( ) ;   i f   ( r e s h a p e )   {   v a r   m a x w   =   0 ,   m a x h   =   0 ;   f o r   ( v a r   i   =   0 ;   i   <   e l s . l e n g t h ;   i + + )   {   v a r   $ e   =   $ ( e l s [ i ] ) ,   e   =   $ e [ 0 ] ,   w   =   $ e . o u t e r W i d t h ( ) ,   h   =   $ e . o u t e r H e i g h t ( ) ;   i f   ( ! w )   {   w   =   e . o f f s e t W i d t h ;   }   i f   ( ! h )   {   h   =   e . o f f s e t H e i g h t ;   }   m a x w   =   w   >   m a x w   ?   w   :   m a x w ;   m a x h   =   h   >   m a x h   ?   h   :   m a x h ;   }   i f   ( m a x w   >   0   & &   m a x h   >   0 )   {   $ c o n t . c s s ( {   w i d t h :   m a x w   +   " p x " ,   h e i g h t :   m a x h   +   " p x "   } ) ;   }   }   i f   ( o p t s . p a u s e )   {   $ c o n t . h o v e r ( f u n c t i o n ( )   {   t h i s . c y c l e P a u s e + + ;   } ,   f u n c t i o n ( )   {   t h i s . c y c l e P a u s e - - ;   } ) ;   }   i f   ( s u p p o r t M u l t i T r a n s i t i o n s ( o p t s )   = = =   f a l s e )   {   r e t u r n   f a l s e ;   }   i f   ( ! o p t s . m u l t i F x )   {   v a r   i n i t   =   $ . f n . c y c l e . t r a n s i t i o n s [ o p t s . f x ] ;   i f   ( $ . i s F u n c t i o n ( i n i t ) )   {   i n i t ( $ c o n t ,   $ s l i d e s ,   o p t s ) ;   }   e l s e   {   i f   ( o p t s . f x   ! =   " c u s t o m "   & &   ! o p t s . m u l t i F x )   {   l o g ( " u n k n o w n   t r a n s i t i o n :   "   +   o p t s . f x ,   " ;   s l i d e s h o w   t e r m i n a t i n g " ) ;   r e t u r n   f a l s e ;   }   }   }   v a r   r e q u e u e   =   f a l s e ;   o p t i o n s . r e q u e u e A t t e m p t s   =   o p t i o n s . r e q u e u e A t t e m p t s   | |   0 ;   $ s l i d e s . e a c h ( f u n c t i o n ( )   {   v a r   $ e l   =   $ ( t h i s ) ;   t h i s . c y c l e H   =   ( o p t s . f i t   & &   o p t s . h e i g h t )   ?   o p t s . h e i g h t   :   $ e l . h e i g h t ( ) ;   t h i s . c y c l e W   =   ( o p t s . f i t   & &   o p t s . w i d t h )   ?   o p t s . w i d t h   :   $ e l . w i d t h ( ) ;   i f   ( $ e l . i s ( " i m g " ) )   {   v a r   l o a d i n g I E   =   ( $ . b r o w s e r . m s i e   & &   t h i s . c y c l e W   = =   2 8   & &   t h i s . c y c l e H   = =   3 0   & &   ! t h i s . c o m p l e t e ) ;   v a r   l o a d i n g O p   =   ( $ . b r o w s e r . o p e r a   & &   t h i s . c y c l e W   = =   4 2   & &   t h i s . c y c l e H   = =   1 9   & &   ! t h i s . c o m p l e t e ) ;   v a r   l o a d i n g O t h e r   =   ( t h i s . c y c l e H   = =   0   & &   t h i s . c y c l e W   = =   0   & &   ! t h i s . c o m p l e t e ) ;   i f   ( l o a d i n g I E   | |   l o a d i n g O p   | |   l o a d i n g O t h e r )   {   i f   ( o . s   & &   o p t s . r e q u e u e O n I m a g e N o t L o a d e d   & &   + + o p t i o n s . r e q u e u e A t t e m p t s   <   1 0 0 )   {   l o g ( o p t i o n s . r e q u e u e A t t e m p t s ,   "   -   i m g   s l i d e   n o t   l o a d e d ,   r e q u e u i n g   s l i d e s h o w :   " ,   t h i s . s r c ,   t h i s . c y c l e W ,   t h i s . c y c l e H ) ;   s e t T i m e o u t ( f u n c t i o n ( )   {   $ ( o . s ,   o . c ) . c y c l e ( o p t i o n s ) ;   } ,   o p t s . r e q u e u e T i m e o u t ) ;   r e q u e u e   =   t r u e ;   r e t u r n   f a l s e ;   }   e l s e   {   l o g ( " c o u l d   n o t   d e t e r m i n e   s i z e   o f   i m a g e :   "   +   t h i s . s r c ,   t h i s . c y c l e W ,   t h i s . c y c l e H ) ;   }   }   }   r e t u r n   t r u e ;   } ) ;   i f   ( r e q u e u e )   {   r e t u r n   f a l s e ;   }   o p t s . c s s B e f o r e   =   o p t s . c s s B e f o r e   | |   { } ;   o p t s . a n i m I n   =   o p t s . a n i m I n   | |   { } ;   o p t s . a n i m O u t   =   o p t s . a n i m O u t   | |   { } ;   $ s l i d e s . n o t ( " : e q ( "   +   f i r s t   +   " ) " ) . c s s ( o p t s . c s s B e f o r e ) ;   i f   ( o p t s . c s s F i r s t )   {   $ ( $ s l i d e s [ f i r s t ] ) . c s s ( o p t s . c s s F i r s t ) ;   }   i f   ( o p t s . t i m e o u t )   {   o p t s . t i m e o u t   =   p a r s e I n t ( o p t s . t i m e o u t ) ;   i f   ( o p t s . s p e e d . c o n s t r u c t o r   = =   S t r i n g )   {   o p t s . s p e e d   =   $ . f x . s p e e d s [ o p t s . s p e e d ]   | |   p a r s e I n t ( o p t s . s p e e d ) ;   }   i f   ( ! o p t s . s y n c )   {   o p t s . s p e e d   =   o p t s . s p e e d   /   2 ;   }   w h i l e   ( ( o p t s . t i m e o u t   -   o p t s . s p e e d )   <   2 5 0 )   {   o p t s . t i m e o u t   + =   o p t s . s p e e d ;   }   }   i f   ( o p t s . e a s i n g )   {   o p t s . e a s e I n   =   o p t s . e a s e O u t   =   o p t s . e a s i n g ;   }   i f   ( ! o p t s . s p e e d I n )   {   o p t s . s p e e d I n   =   o p t s . s p e e d ;   }   i f   ( ! o p t s . s p e e d O u t )   {   o p t s . s p e e d O u t   =   o p t s . s p e e d ;   }   o p t s . s l i d e C o u n t   =   e l s . l e n g t h ;   o p t s . c u r r S l i d e   =   o p t s . l a s t S l i d e   =   f i r s t ;   i f   ( o p t s . r a n d o m )   {   o p t s . n e x t S l i d e   =   o p t s . c u r r S l i d e ;   i f   ( + + o p t s . r a n d o m I n d e x   = =   e l s . l e n g t h )   {   o p t s . r a n d o m I n d e x   =   0 ;   }   o p t s . n e x t S l i d e   =   o p t s . r a n d o m M a p [ o p t s . r a n d o m I n d e x ] ;   }   e l s e   {   o p t s . n e x t S l i d e   =   o p t s . s t a r t i n g S l i d e   > =   ( e l s . l e n g t h   -   1 )   ?   0   :   o p t s . s t a r t i n g S l i d e   +   1 ;   }   v a r   e 0   =   $ s l i d e s [ f i r s t ] ;   i f   ( o p t s . b e f o r e . l e n g t h )   {   o p t s . b e f o r e [ 0 ] . a p p l y ( e 0 ,   [ e 0 ,   e 0 ,   o p t s ,   t r u e ] ) ;   }   i f   ( o p t s . a f t e r . l e n g t h   >   1 )   {   o p t s . a f t e r [ 1 ] . a p p l y ( e 0 ,   [ e 0 ,   e 0 ,   o p t s ,   t r u e ] ) ;   }   i f   ( o p t s . n e x t )   {   $ ( o p t s . n e x t ) . c l i c k ( f u n c t i o n ( )   {   r e t u r n   a d v a n c e ( o p t s ,   o p t s . r e v   ?   - 1   :   1 ) ;   } ) ;   }   i f   ( o p t s . p r e v )   {   $ ( o p t s . p r e v ) . c l i c k ( f u n c t i o n ( )   {   r e t u r n   a d v a n c e ( o p t s ,   o p t s . r e v   ?   1   :   - 1 ) ;   } ) ;   }   i f   ( o p t s . p a g e r )   {   b u i l d P a g e r ( e l s ,   o p t s ) ;   }   e x p o s e A d d S l i d e ( o p t s ,   e l s ) ;   r e t u r n   o p t s ;   }   f u n c t i o n   s a v e O r i g i n a l O p t s ( o p t s )   {   o p t s . o r i g i n a l   =   {   b e f o r e :   [ ] ,   a f t e r :   [ ]   } ;   o p t s . o r i g i n a l . c s s B e f o r e   =   $ . e x t e n d ( { } ,   o p t s . c s s B e f o r e ) ;   o p t s . o r i g i n a l . c s s A f t e r   =   $ . e x t e n d ( { } ,   o p t s . c s s A f t e r ) ;   o p t s . o r i g i n a l . a n i m I n   =   $ . e x t e n d ( { } ,   o p t s . a n i m I n ) ;   o p t s . o r i g i n a l . a n i m O u t   =   $ . e x t e n d ( { } ,   o p t s . a n i m O u t ) ;   $ . e a c h ( o p t s . b e f o r e ,   f u n c t i o n ( )   {   o p t s . o r i g i n a l . b e f o r e . p u s h ( t h i s ) ;   } ) ;   $ . e a c h ( o p t s . a f t e r ,   f u n c t i o n ( )   {   o p t s . o r i g i n a l . a f t e r . p u s h ( t h i s ) ;   } ) ;   }   f u n c t i o n   s u p p o r t M u l t i T r a n s i t i o n s ( o p t s )   {   v a r   t x s   =   $ . f n . c y c l e . t r a n s i t i o n s ;   i f   ( o p t s . f x . i n d e x O f ( " , " )   >   0 )   {   o p t s . m u l t i F x   =   t r u e ;   o p t s . f x s   =   o p t s . f x . r e p l a c e ( / \ s * / g ,   " " ) . s p l i t ( " , " ) ;   f o r   ( v a r   i   =   0 ;   i   <   o p t s . f x s . l e n g t h ;   i + + )   {   v a r   f x   =   o p t s . f x s [ i ] ;   v a r   t x   =   t x s [ f x ] ;   i f   ( ! t x   | |   ! t x s . h a s O w n P r o p e r t y ( f x )   | |   ! $ . i s F u n c t i o n ( t x ) )   {   l o g ( " d i s c a r d i n g   u n k n o w n   t r a n s i t i o n :   " ,   f x ) ;   o p t s . f x s . s p l i c e ( i ,   1 ) ;   i - - ;   }   }   i f   ( ! o p t s . f x s . l e n g t h )   {   l o g ( " N o   v a l i d   t r a n s i t i o n s   n a m e d ;   s l i d e s h o w   t e r m i n a t i n g . " ) ;   r e t u r n   f a l s e ;   }   }   e l s e   {   i f   ( o p t s . f x   = =   " a l l " )   {   o p t s . m u l t i F x   =   t r u e ;   o p t s . f x s   =   [ ] ;   f o r   ( p   i n   t x s )   {   v a r   t x   =   t x s [ p ] ;   i f   ( t x s . h a s O w n P r o p e r t y ( p )   & &   $ . i s F u n c t i o n ( t x ) )   {   o p t s . f x s . p u s h ( p ) ;   }   }   }   }   i f   ( o p t s . m u l t i F x   & &   o p t s . r a n d o m i z e E f f e c t s )   {   v a r   r 1   =   M a t h . f l o o r ( M a t h . r a n d o m ( )   *   2 0 )   +   3 0 ;   f o r   ( v a r   i   =   0 ;   i   <   r 1 ;   i + + )   {   v a r   r 2   =   M a t h . f l o o r ( M a t h . r a n d o m ( )   *   o p t s . f x s . l e n g t h ) ;   o p t s . f x s . p u s h ( o p t s . f x s . s p l i c e ( r 2 ,   1 ) [ 0 ] ) ;   }   l o g ( " r a n d o m i z e d   f x   s e q u e n c e :   " ,   o p t s . f x s ) ;   }   r e t u r n   t r u e ;   }   f u n c t i o n   e x p o s e A d d S l i d e ( o p t s ,   e l s )   {   o p t s . a d d S l i d e   =   f u n c t i o n ( n e w S l i d e ,   p r e p e n d )   {   v a r   $ s   =   $ ( n e w S l i d e ) ,   s   =   $ s [ 0 ] ;   i f   ( ! o p t s . a u t o s t o p C o u n t )   {   o p t s . c o u n t d o w n + + ;   }   e l s [ p r e p e n d   ?   " u n s h i f t "   :   " p u s h " ] ( s ) ;   i f   ( o p t s . e l s )   {   o p t s . e l s [ p r e p e n d   ?   " u n s h i f t "   :   " p u s h " ] ( s ) ;   }   o p t s . s l i d e C o u n t   =   e l s . l e n g t h ;   $ s . c s s ( " p o s i t i o n " ,   " a b s o l u t e " ) ;   $ s [ p r e p e n d   ?   " p r e p e n d T o "   :   " a p p e n d T o " ] ( o p t s . $ c o n t ) ;   i f   ( p r e p e n d )   {   o p t s . c u r r S l i d e + + ;   o p t s . n e x t S l i d e + + ;   }   i f   ( ! $ . s u p p o r t . o p a c i t y   & &   o p t s . c l e a r t y p e   & &   ! o p t s . c l e a r t y p e N o B g )   {   c l e a r T y p e F i x ( $ s ) ;   }   i f   ( o p t s . f i t   & &   o p t s . w i d t h )   {   $ s . w i d t h ( o p t s . w i d t h ) ;   }   i f   ( o p t s . f i t   & &   o p t s . h e i g h t   & &   o p t s . h e i g h t   ! =   " a u t o " )   {   $ s l i d e s . h e i g h t ( o p t s . h e i g h t ) ;   }   s . c y c l e H   =   ( o p t s . f i t   & &   o p t s . h e i g h t )   ?   o p t s . h e i g h t   :   $ s . h e i g h t ( ) ;   s . c y c l e W   =   ( o p t s . f i t   & &   o p t s . w i d t h )   ?   o p t s . w i d t h   :   $ s . w i d t h ( ) ;   $ s . c s s ( o p t s . c s s B e f o r e ) ;   i f   ( o p t s . p a g e r )   {   $ . f n . c y c l e . c r e a t e P a g e r A n c h o r ( e l s . l e n g t h   -   1 ,   s ,   $ ( o p t s . p a g e r ) ,   e l s ,   o p t s ) ;   }   i f   ( $ . i s F u n c t i o n ( o p t s . o n A d d S l i d e ) )   {   o p t s . o n A d d S l i d e ( $ s ) ;   }   e l s e   {   $ s . h i d e ( ) ;   }   } ;   }   $ . f n . c y c l e . r e s e t S t a t e   =   f u n c t i o n ( o p t s ,   f x )   {   f x   =   f x   | |   o p t s . f x ;   o p t s . b e f o r e   =   [ ] ;   o p t s . a f t e r   =   [ ] ;   o p t s . c s s B e f o r e   =   $ . e x t e n d ( { } ,   o p t s . o r i g i n a l . c s s B e f o r e ) ;   o p t s . c s s A f t e r   =   $ . e x t e n d ( { } ,   o p t s . o r i g i n a l . c s s A f t e r ) ;   o p t s . a n i m I n   =   $ . e x t e n d ( { } ,   o p t s . o r i g i n a l . a n i m I n ) ;   o p t s . a n i m O u t   =   $ . e x t e n d ( { } ,   o p t s . o r i g i n a l . a n i m O u t ) ;   o p t s . f x F n   =   n u l l ;   $ . e a c h ( o p t s . o r i g i n a l . b e f o r e ,   f u n c t i o n ( )   {   o p t s . b e f o r e . p u s h ( t h i s ) ;   } ) ;   $ . e a c h ( o p t s . o r i g i n a l . a f t e r ,   f u n c t i o n ( )   {   o p t s . a f t e r . p u s h ( t h i s ) ;   } ) ;   v a r   i n i t   =   $ . f n . c y c l e . t r a n s i t i o n s [ f x ] ;   i f   ( $ . i s F u n c t i o n ( i n i t ) )   {   i n i t ( o p t s . $ c o n t ,   $ ( o p t s . e l e m e n t s ) ,   o p t s ) ;   }   } ;   f u n c t i o n   g o ( e l s ,   o p t s ,   m a n u a l ,   f w d )   {   i f   ( m a n u a l   & &   o p t s . b u s y   & &   o p t s . m a n u a l T r u m p )   {   $ ( e l s ) . s t o p ( t r u e ,   t r u e ) ;   o p t s . b u s y   =   f a l s e ;   }   i f   ( o p t s . b u s y )   {   r e t u r n ;   }   v a r   p   =   o p t s . $ c o n t [ 0 ] ,   c u r r   =   e l s [ o p t s . c u r r S l i d e ] ,   n e x t   =   e l s [ o p t s . n e x t S l i d e ] ;   i f   ( p . c y c l e S t o p   ! =   o p t s . s t o p C o u n t   | |   p . c y c l e T i m e o u t   = = =   0   & &   ! m a n u a l )   {   r e t u r n ;   }   i f   ( ! m a n u a l   & &   ! p . c y c l e P a u s e   & &   ( ( o p t s . a u t o s t o p   & &   ( - - o p t s . c o u n t d o w n   < =   0 ) )   | |   ( o p t s . n o w r a p   & &   ! o p t s . r a n d o m   & &   o p t s . n e x t S l i d e   <   o p t s . c u r r S l i d e ) ) )   {   i f   ( o p t s . e n d )   {   o p t s . e n d ( o p t s ) ;   }   r e t u r n ;   }   i f   ( m a n u a l   | |   ! p . c y c l e P a u s e )   {   v a r   f x   =   o p t s . f x ;   c u r r . c y c l e H   =   c u r r . c y c l e H   | |   $ ( c u r r ) . h e i g h t ( ) ;   c u r r . c y c l e W   =   c u r r . c y c l e W   | |   $ ( c u r r ) . w i d t h ( ) ;   n e x t . c y c l e H   =   n e x t . c y c l e H   | |   $ ( n e x t ) . h e i g h t ( ) ;   n e x t . c y c l e W   =   n e x t . c y c l e W   | |   $ ( n e x t ) . w i d t h ( ) ;   i f   ( o p t s . m u l t i F x )   {   i f   ( o p t s . l a s t F x   = =   u n d e f i n e d   | |   + + o p t s . l a s t F x   > =   o p t s . f x s . l e n g t h )   {   o p t s . l a s t F x   =   0 ;   }   f x   =   o p t s . f x s [ o p t s . l a s t F x ] ;   o p t s . c u r r F x   =   f x ;   }   i f   ( o p t s . o n e T i m e F x )   {   f x   =   o p t s . o n e T i m e F x ;   o p t s . o n e T i m e F x   =   n u l l ;   }   $ . f n . c y c l e . r e s e t S t a t e ( o p t s ,   f x ) ;   i f   ( o p t s . b e f o r e . l e n g t h )   {   $ . e a c h ( o p t s . b e f o r e ,   f u n c t i o n ( i ,   o )   {   i f   ( p . c y c l e S t o p   ! =   o p t s . s t o p C o u n t )   {   r e t u r n ;   }   o . a p p l y ( n e x t ,   [ c u r r ,   n e x t ,   o p t s ,   f w d ] ) ;   } ) ;   }   v a r   a f t e r   =   f u n c t i o n ( )   {   $ . e a c h ( o p t s . a f t e r ,   f u n c t i o n ( i ,   o )   {   i f   ( p . c y c l e S t o p   ! =   o p t s . s t o p C o u n t )   {   r e t u r n ;   }   o . a p p l y ( n e x t ,   [ c u r r ,   n e x t ,   o p t s ,   f w d ] ) ;   } ) ;   } ;   i f   ( o p t s . n e x t S l i d e   ! =   o p t s . c u r r S l i d e )   {   o p t s . b u s y   =   1 ;   i f   ( o p t s . f x F n )   {   o p t s . f x F n ( c u r r ,   n e x t ,   o p t s ,   a f t e r ,   f w d ) ;   }   e l s e   {   i f   ( $ . i s F u n c t i o n ( $ . f n . c y c l e [ o p t s . f x ] ) )   {   $ . f n . c y c l e [ o p t s . f x ] ( c u r r ,   n e x t ,   o p t s ,   a f t e r ) ;   }   e l s e   {   $ . f n . c y c l e . c u s t o m ( c u r r ,   n e x t ,   o p t s ,   a f t e r ,   m a n u a l   & &   o p t s . f a s t O n E v e n t ) ;   }   }   }   o p t s . l a s t S l i d e   =   o p t s . c u r r S l i d e ;   i f   ( o p t s . r a n d o m )   {   o p t s . c u r r S l i d e   =   o p t s . n e x t S l i d e ;   i f   ( + + o p t s . r a n d o m I n d e x   = =   e l s . l e n g t h )   {   o p t s . r a n d o m I n d e x   =   0 ;   }   o p t s . n e x t S l i d e   =   o p t s . r a n d o m M a p [ o p t s . r a n d o m I n d e x ] ;   }   e l s e   {   v a r   r o l l   =   ( o p t s . n e x t S l i d e   +   1 )   = =   e l s . l e n g t h ;   o p t s . n e x t S l i d e   =   r o l l   ?   0   :   o p t s . n e x t S l i d e   +   1 ;   o p t s . c u r r S l i d e   =   r o l l   ?   e l s . l e n g t h   -   1   :   o p t s . n e x t S l i d e   -   1 ;   }   i f   ( o p t s . p a g e r )   {   $ . f n . c y c l e . u p d a t e A c t i v e P a g e r L i n k ( o p t s . p a g e r ,   o p t s . c u r r S l i d e ) ;   }   }   v a r   m s   =   0 ;   i f   ( o p t s . t i m e o u t   & &   ! o p t s . c o n t i n u o u s )   {   m s   =   g e t T i m e o u t ( c u r r ,   n e x t ,   o p t s ,   f w d ) ;   }   e l s e   {   i f   ( o p t s . c o n t i n u o u s   & &   p . c y c l e P a u s e )   {   m s   =   1 0 ;   }   }   i f   ( m s   >   0 )   {   p . c y c l e T i m e o u t   =   s e t T i m e o u t ( f u n c t i o n ( )   {   g o ( e l s ,   o p t s ,   0 ,   ! o p t s . r e v ) ;   } ,   m s ) ;   }   }   $ . f n . c y c l e . u p d a t e A c t i v e P a g e r L i n k   =   f u n c t i o n ( p a g e r ,   c u r r S l i d e )   {   $ ( p a g e r ) . f i n d ( " a " ) . r e m o v e C l a s s ( " a c t i v e S l i d e " ) . f i l t e r ( " a : e q ( "   +   c u r r S l i d e   +   " ) " ) . a d d C l a s s ( " a c t i v e S l i d e " ) ;   } ;   f u n c t i o n   g e t T i m e o u t ( c u r r ,   n e x t ,   o p t s ,   f w d )   {   i f   ( o p t s . t i m e o u t F n )   {   v a r   t   =   o p t s . t i m e o u t F n ( c u r r ,   n e x t ,   o p t s ,   f w d ) ;   i f   ( t   ! = =   f a l s e )   {   r e t u r n   t ;   }   }   r e t u r n   o p t s . t i m e o u t ;   }   $ . f n . c y c l e . n e x t   =   f u n c t i o n ( o p t s )   {   a d v a n c e ( o p t s ,   o p t s . r e v   ?   - 1   :   1 ) ;   } ;   $ . f n . c y c l e . p r e v   =   f u n c t i o n ( o p t s )   {   a d v a n c e ( o p t s ,   o p t s . r e v   ?   1   :   - 1 ) ;   } ;   f u n c t i o n   a d v a n c e ( o p t s ,   v a l )   {   v a r   e l s   =   o p t s . e l e m e n t s ;   v a r   p   =   o p t s . $ c o n t [ 0 ] ,   t i m e o u t   =   p . c y c l e T i m e o u t ;   i f   ( t i m e o u t )   {   c l e a r T i m e o u t ( t i m e o u t ) ;   p . c y c l e T i m e o u t   =   0 ;   }   i f   ( o p t s . r a n d o m   & &   v a l   <   0 )   {   o p t s . r a n d o m I n d e x - - ;   i f   ( - - o p t s . r a n d o m I n d e x   = =   - 2 )   {   o p t s . r a n d o m I n d e x   =   e l s . l e n g t h   -   2 ;   }   e l s e   {   i f   ( o p t s . r a n d o m I n d e x   = =   - 1 )   {   o p t s . r a n d o m I n d e x   =   e l s . l e n g t h   -   1 ;   }   }   o p t s . n e x t S l i d e   =   o p t s . r a n d o m M a p [ o p t s . r a n d o m I n d e x ] ;   }   e l s e   {   i f   ( o p t s . r a n d o m )   {   i f   ( + + o p t s . r a n d o m I n d e x   = =   e l s . l e n g t h )   {   o p t s . r a n d o m I n d e x   =   0 ;   }   o p t s . n e x t S l i d e   =   o p t s . r a n d o m M a p [ o p t s . r a n d o m I n d e x ] ;   }   e l s e   {   o p t s . n e x t S l i d e   =   o p t s . c u r r S l i d e   +   v a l ;   i f   ( o p t s . n e x t S l i d e   <   0 )   {   i f   ( o p t s . n o w r a p )   {   r e t u r n   f a l s e ;   }   o p t s . n e x t S l i d e   =   e l s . l e n g t h   -   1 ;   }   e l s e   {   i f   ( o p t s . n e x t S l i d e   > =   e l s . l e n g t h )   {   i f   ( o p t s . n o w r a p )   {   r e t u r n   f a l s e ;   }   o p t s . n e x t S l i d e   =   0 ;   }   }   }   }   i f   ( $ . i s F u n c t i o n ( o p t s . p r e v N e x t C l i c k ) )   {   o p t s . p r e v N e x t C l i c k ( v a l   >   0 ,   o p t s . n e x t S l i d e ,   e l s [ o p t s . n e x t S l i d e ] ) ;   }   g o ( e l s ,   o p t s ,   1 ,   v a l   > =   0 ) ;   r e t u r n   f a l s e ;   }   f u n c t i o n   b u i l d P a g e r ( e l s ,   o p t s )   {   v a r   $ p   =   $ ( o p t s . p a g e r ) ;   $ . e a c h ( e l s ,   f u n c t i o n ( i ,   o )   {   $ . f n . c y c l e . c r e a t e P a g e r A n c h o r ( i ,   o ,   $ p ,   e l s ,   o p t s ) ;   } ) ;   $ . f n . c y c l e . u p d a t e A c t i v e P a g e r L i n k ( o p t s . p a g e r ,   o p t s . s t a r t i n g S l i d e ) ;   }   $ . f n . c y c l e . c r e a t e P a g e r A n c h o r   =   f u n c t i o n ( i ,   e l ,   $ p ,   e l s ,   o p t s )   {   v a r   a   =   ( $ . i s F u n c t i o n ( o p t s . p a g e r A n c h o r B u i l d e r ) )   ?   o p t s . p a g e r A n c h o r B u i l d e r ( i ,   e l )   :   ' < a   h r e f = " # " > '   +   ( i   +   1 )   +   " < / a > " ;   i f   ( ! a )   {   r e t u r n ;   }   v a r   $ a   =   $ ( a ) ;   i f   ( $ a . p a r e n t s ( " b o d y " ) . l e n g t h   = =   0 )   {   $ a . a p p e n d T o ( $ p ) ;   }   $ a . b i n d ( o p t s . p a g e r E v e n t ,   f u n c t i o n ( )   {   o p t s . n e x t S l i d e   =   i ;   v a r   p   =   o p t s . $ c o n t [ 0 ] ,   t i m e o u t   =   p . c y c l e T i m e o u t ;   i f   ( t i m e o u t )   {   c l e a r T i m e o u t ( t i m e o u t ) ;   p . c y c l e T i m e o u t   =   0 ;   }   i f   ( $ . i s F u n c t i o n ( o p t s . p a g e r C l i c k ) )   {   o p t s . p a g e r C l i c k ( o p t s . n e x t S l i d e ,   e l s [ o p t s . n e x t S l i d e ] ) ;   }   g o ( e l s ,   o p t s ,   1 ,   o p t s . c u r r S l i d e   <   i ) ;   r e t u r n   f a l s e ;   } ) ;   i f   ( o p t s . p a u s e O n P a g e r H o v e r )   {   $ a . h o v e r ( f u n c t i o n ( )   {   o p t s . $ c o n t [ 0 ] . c y c l e P a u s e + + ;   } ,   f u n c t i o n ( )   {   o p t s . $ c o n t [ 0 ] . c y c l e P a u s e - - ;   } ) ;   }   } ;   $ . f n . c y c l e . h o p s F r o m L a s t   =   f u n c t i o n ( o p t s ,   f w d )   {   v a r   h o p s ,   l   =   o p t s . l a s t S l i d e ,   c   =   o p t s . c u r r S l i d e ;   i f   ( f w d )   {   h o p s   =   c   >   l   ?   c   -   l   :   o p t s . s l i d e C o u n t   -   l ;   }   e l s e   {   h o p s   =   c   <   l   ?   l   -   c   :   l   +   o p t s . s l i d e C o u n t   -   c ;   }   r e t u r n   h o p s ;   } ;   f u n c t i o n   c l e a r T y p e F i x ( $ s l i d e s )   {   f u n c t i o n   h e x ( s )   {   s   =   p a r s e I n t ( s ) . t o S t r i n g ( 1 6 ) ;   r e t u r n   s . l e n g t h   <   2   ?   " 0 "   +   s   :   s ;   }   f u n c t i o n   g e t B g ( e )   {   f o r   ( ;   e   & &   e . n o d e N a m e . t o L o w e r C a s e ( )   ! =   " h t m l " ;   e   =   e . p a r e n t N o d e )   {   v a r   v   =   $ . c s s ( e ,   " b a c k g r o u n d - c o l o r " ) ;   i f   ( v . i n d e x O f ( " r g b " )   > =   0 )   {   v a r   r g b   =   v . m a t c h ( / \ d + / g ) ;   r e t u r n   " # "   +   h e x ( r g b [ 0 ] )   +   h e x ( r g b [ 1 ] )   +   h e x ( r g b [ 2 ] ) ;   }   i f   ( v   & &   v   ! =   " t r a n s p a r e n t " )   {   r e t u r n   v ;   }   }   r e t u r n   " # f f f f f f " ;   }   $ s l i d e s . e a c h ( f u n c t i o n ( )   {   $ ( t h i s ) . c s s ( " b a c k g r o u n d - c o l o r " ,   g e t B g ( t h i s ) ) ;   } ) ;   }   $ . f n . c y c l e . c o m m o n R e s e t   =   f u n c t i o n ( c u r r ,   n e x t ,   o p t s ,   w ,   h ,   r e v )   {   $ ( o p t s . e l e m e n t s ) . n o t ( c u r r ) . h i d e ( ) ;   o p t s . c s s B e f o r e . o p a c i t y   =   1 ;   o p t s . c s s B e f o r e . d i s p l a y   =   " b l o c k " ;   i f   ( w   ! = =   f a l s e   & &   n e x t . c y c l e W   >   0 )   {   o p t s . c s s B e f o r e . w i d t h   =   n e x t . c y c l e W ;   }   i f   ( h   ! = =   f a l s e   & &   n e x t . c y c l e H   >   0 )   {   o p t s . c s s B e f o r e . h e i g h t   =   n e x t . c y c l e H ;   }   o p t s . c s s A f t e r   =   o p t s . c s s A f t e r   | |   { } ;   o p t s . c s s A f t e r . d i s p l a y   =   " n o n e " ;   $ ( c u r r ) . c s s ( " z I n d e x " ,   o p t s . s l i d e C o u n t   +   ( r e v   = = =   t r u e   ?   1   :   0 ) ) ;   $ ( n e x t ) . c s s ( " z I n d e x " ,   o p t s . s l i d e C o u n t   +   ( r e v   = = =   t r u e   ?   0   :   1 ) ) ;   } ;   $ . f n . c y c l e . c u s t o m   =   f u n c t i o n ( c u r r ,   n e x t ,   o p t s ,   c b ,   s p e e d O v e r r i d e )   {   v a r   $ l   =   $ ( c u r r ) ,   $ n   =   $ ( n e x t ) ;   v a r   s p e e d I n   =   o p t s . s p e e d I n ,   s p e e d O u t   =   o p t s . s p e e d O u t ,   e a s e I n   =   o p t s . e a s e I n ,   e a s e O u t   =   o p t s . e a s e O u t ;   $ n . c s s ( o p t s . c s s B e f o r e ) ;   i f   ( s p e e d O v e r r i d e )   {   i f   ( t y p e o f   s p e e d O v e r r i d e   = =   " n u m b e r " )   {   s p e e d I n   =   s p e e d O u t   =   s p e e d O v e r r i d e ;   }   e l s e   {   s p e e d I n   =   s p e e d O u t   =   1 ;   }   e a s e I n   =   e a s e O u t   =   n u l l ;   }   v a r   f n   =   f u n c t i o n ( )   {   $ n . a n i m a t e ( o p t s . a n i m I n ,   s p e e d I n ,   e a s e I n ,   c b ) ;   } ;   $ l . a n i m a t e ( o p t s . a n i m O u t ,   s p e e d O u t ,   e a s e O u t ,   f u n c t i o n ( )   {   i f   ( o p t s . c s s A f t e r )   {   $ l . c s s ( o p t s . c s s A f t e r ) ;   }   i f   ( ! o p t s . s y n c )   {   f n ( ) ;   }   } ) ;   i f   ( o p t s . s y n c )   {   f n ( ) ;   }   } ;   $ . f n . c y c l e . t r a n s i t i o n s   =   {   f a d e :   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   $ s l i d e s . n o t ( " : e q ( "   +   o p t s . c u r r S l i d e   +   " ) " ) . c s s ( " o p a c i t y " ,   0 ) ;   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ) ;   o p t s . c s s B e f o r e . o p a c i t y   =   0 ;   } ) ;   o p t s . a n i m I n   =   {   o p a c i t y :   1   } ;   o p t s . a n i m O u t   =   {   o p a c i t y :   0   } ;   o p t s . c s s B e f o r e   =   {   t o p :   0 ,   l e f t :   0   } ;   }   } ;   $ . f n . c y c l e . v e r   =   f u n c t i o n ( )   {   r e t u r n   v e r ;   } ;   $ . f n . c y c l e . d e f a u l t s   =   {   f x :   " f a d e " ,   t i m e o u t :   4 0 0 0 ,   t i m e o u t F n :   n u l l ,   c o n t i n u o u s :   0 ,   s p e e d :   1 0 0 0 ,   s p e e d I n :   n u l l ,   s p e e d O u t :   n u l l ,   n e x t :   n u l l ,   p r e v :   n u l l ,   p r e v N e x t C l i c k :   n u l l ,   p a g e r :   n u l l ,   p a g e r C l i c k :   n u l l ,   p a g e r E v e n t :   " c l i c k " ,   p a g e r A n c h o r B u i l d e r :   n u l l ,   b e f o r e :   n u l l ,   a f t e r :   n u l l ,   e n d :   n u l l ,   e a s i n g :   n u l l ,   e a s e I n :   n u l l ,   e a s e O u t :   n u l l ,   s h u f f l e :   n u l l ,   a n i m I n :   n u l l ,   a n i m O u t :   n u l l ,   c s s B e f o r e :   n u l l ,   c s s A f t e r :   n u l l ,   f x F n :   n u l l ,   h e i g h t :   " a u t o " ,   s t a r t i n g S l i d e :   0 ,   s y n c :   1 ,   r a n d o m :   0 ,   f i t :   0 ,   c o n t a i n e r R e s i z e :   1 ,   p a u s e :   0 ,   p a u s e O n P a g e r H o v e r :   0 ,   a u t o s t o p :   0 ,   a u t o s t o p C o u n t :   0 ,   d e l a y :   0 ,   s l i d e E x p r :   n u l l ,   c l e a r t y p e :   ! $ . s u p p o r t . o p a c i t y ,   n o w r a p :   0 ,   f a s t O n E v e n t :   0 ,   r a n d o m i z e E f f e c t s :   1 ,   r e v :   0 ,   m a n u a l T r u m p :   t r u e ,   r e q u e u e O n I m a g e N o t L o a d e d :   t r u e ,   r e q u e u e T i m e o u t :   2 5 0   } ;   } ) ( j Q u e r y ) ;  
 / *  
 *   j Q u e r y   C y c l e   P l u g i n   T r a n s i t i o n   D e f i n i t i o n s  
 *   T h i s   s c r i p t   i s   a   p l u g i n   f o r   t h e   j Q u e r y   C y c l e   P l u g i n  
 *   E x a m p l e s   a n d   d o c u m e n t a t i o n   a t :   h t t p : / / m a l s u p . c o m / j q u e r y / c y c l e /  
 *   C o p y r i g h t   ( c )   2 0 0 7 - 2 0 0 8   M .   A l s u p  
 *   V e r s i o n : 	   2 . 5 2  
 *   D u a l   l i c e n s e d   u n d e r   t h e   M I T   a n d   G P L   l i c e n s e s :  
 *   h t t p : / / w w w . o p e n s o u r c e . o r g / l i c e n s e s / m i t - l i c e n s e . p h p  
 *   h t t p : / / w w w . g n u . o r g / l i c e n s e s / g p l . h t m l  
 * /  
 ;   ( f u n c t i o n ( $ )   {   $ . f n . c y c l e . t r a n s i t i o n s . s c r o l l U p   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   $ c o n t . c s s ( " o v e r f l o w " ,   " h i d d e n " ) ;   o p t s . b e f o r e . p u s h ( $ . f n . c y c l e . c o m m o n R e s e t ) ;   v a r   h   =   $ c o n t . h e i g h t ( ) ;   o p t s . c s s B e f o r e   =   {   t o p :   h ,   l e f t :   0   } ;   o p t s . c s s F i r s t   =   {   t o p :   0   } ;   o p t s . a n i m I n   =   {   t o p :   0   } ;   o p t s . a n i m O u t   =   {   t o p :   - h   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . s c r o l l D o w n   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   $ c o n t . c s s ( " o v e r f l o w " ,   " h i d d e n " ) ;   o p t s . b e f o r e . p u s h ( $ . f n . c y c l e . c o m m o n R e s e t ) ;   v a r   h   =   $ c o n t . h e i g h t ( ) ;   o p t s . c s s F i r s t   =   {   t o p :   0   } ;   o p t s . c s s B e f o r e   =   {   t o p :   - h ,   l e f t :   0   } ;   o p t s . a n i m I n   =   {   t o p :   0   } ;   o p t s . a n i m O u t   =   {   t o p :   h   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . s c r o l l L e f t   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   $ c o n t . c s s ( " o v e r f l o w " ,   " h i d d e n " ) ;   o p t s . b e f o r e . p u s h ( $ . f n . c y c l e . c o m m o n R e s e t ) ;   v a r   w   =   $ c o n t . w i d t h ( ) ;   o p t s . c s s F i r s t   =   {   l e f t :   0   } ;   o p t s . c s s B e f o r e   =   {   l e f t :   w ,   t o p :   0   } ;   o p t s . a n i m I n   =   {   l e f t :   0   } ;   o p t s . a n i m O u t   =   {   l e f t :   0   -   w   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . s c r o l l R i g h t   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   $ c o n t . c s s ( " o v e r f l o w " ,   " h i d d e n " ) ;   o p t s . b e f o r e . p u s h ( $ . f n . c y c l e . c o m m o n R e s e t ) ;   v a r   w   =   $ c o n t . w i d t h ( ) ;   o p t s . c s s F i r s t   =   {   l e f t :   0   } ;   o p t s . c s s B e f o r e   =   {   l e f t :   - w ,   t o p :   0   } ;   o p t s . a n i m I n   =   {   l e f t :   0   } ;   o p t s . a n i m O u t   =   {   l e f t :   w   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . s c r o l l H o r z   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   $ c o n t . c s s ( " o v e r f l o w " ,   " h i d d e n " ) . w i d t h ( ) ;   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s ,   f w d )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ) ;   o p t s . c s s B e f o r e . l e f t   =   f w d   ?   ( n e x t . c y c l e W   -   1 )   :   ( 1   -   n e x t . c y c l e W ) ;   o p t s . a n i m O u t . l e f t   =   f w d   ?   - c u r r . c y c l e W   :   c u r r . c y c l e W ;   } ) ;   o p t s . c s s F i r s t   =   {   l e f t :   0   } ;   o p t s . c s s B e f o r e   =   {   t o p :   0   } ;   o p t s . a n i m I n   =   {   l e f t :   0   } ;   o p t s . a n i m O u t   =   {   t o p :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . s c r o l l V e r t   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   $ c o n t . c s s ( " o v e r f l o w " ,   " h i d d e n " ) ;   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s ,   f w d )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ) ;   o p t s . c s s B e f o r e . t o p   =   f w d   ?   ( 1   -   n e x t . c y c l e H )   :   ( n e x t . c y c l e H   -   1 ) ;   o p t s . a n i m O u t . t o p   =   f w d   ?   c u r r . c y c l e H   :   - c u r r . c y c l e H ;   } ) ;   o p t s . c s s F i r s t   =   {   t o p :   0   } ;   o p t s . c s s B e f o r e   =   {   l e f t :   0   } ;   o p t s . a n i m I n   =   {   t o p :   0   } ;   o p t s . a n i m O u t   =   {   l e f t :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . s l i d e X   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ ( o p t s . e l e m e n t s ) . n o t ( c u r r ) . h i d e ( ) ;   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   f a l s e ,   t r u e ) ;   o p t s . a n i m I n . w i d t h   =   n e x t . c y c l e W ;   } ) ;   o p t s . c s s B e f o r e   =   {   l e f t :   0 ,   t o p :   0 ,   w i d t h :   0   } ;   o p t s . a n i m I n   =   {   w i d t h :   " s h o w "   } ;   o p t s . a n i m O u t   =   {   w i d t h :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . s l i d e Y   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ ( o p t s . e l e m e n t s ) . n o t ( c u r r ) . h i d e ( ) ;   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   t r u e ,   f a l s e ) ;   o p t s . a n i m I n . h e i g h t   =   n e x t . c y c l e H ;   } ) ;   o p t s . c s s B e f o r e   =   {   l e f t :   0 ,   t o p :   0 ,   h e i g h t :   0   } ;   o p t s . a n i m I n   =   {   h e i g h t :   " s h o w "   } ;   o p t s . a n i m O u t   =   {   h e i g h t :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . s h u f f l e   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   v a r   w   =   $ c o n t . c s s ( " o v e r f l o w " ,   " v i s i b l e " ) . w i d t h ( ) ;   $ s l i d e s . c s s ( {   l e f t :   0 ,   t o p :   0   } ) ;   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   t r u e ,   t r u e ,   t r u e ) ;   } ) ;   o p t s . s p e e d   =   o p t s . s p e e d   /   2 ;   o p t s . r a n d o m   =   0 ;   o p t s . s h u f f l e   =   o p t s . s h u f f l e   | |   {   l e f t :   - w ,   t o p :   1 5   } ;   o p t s . e l s   =   [ ] ;   f o r   ( v a r   i   =   0 ;   i   <   $ s l i d e s . l e n g t h ;   i + + )   {   o p t s . e l s . p u s h ( $ s l i d e s [ i ] ) ;   }   f o r   ( v a r   i   =   0 ;   i   <   o p t s . c u r r S l i d e ;   i + + )   {   o p t s . e l s . p u s h ( o p t s . e l s . s h i f t ( ) ) ;   }   o p t s . f x F n   =   f u n c t i o n ( c u r r ,   n e x t ,   o p t s ,   c b ,   f w d )   {   v a r   $ e l   =   f w d   ?   $ ( c u r r )   :   $ ( n e x t ) ;   $ ( n e x t ) . c s s ( o p t s . c s s B e f o r e ) ;   v a r   c o u n t   =   o p t s . s l i d e C o u n t ;   $ e l . a n i m a t e ( o p t s . s h u f f l e ,   o p t s . s p e e d I n ,   o p t s . e a s e I n ,   f u n c t i o n ( )   {   v a r   h o p s   =   $ . f n . c y c l e . h o p s F r o m L a s t ( o p t s ,   f w d ) ;   f o r   ( v a r   k   =   0 ;   k   <   h o p s ;   k + + )   {   f w d   ?   o p t s . e l s . p u s h ( o p t s . e l s . s h i f t ( ) )   :   o p t s . e l s . u n s h i f t ( o p t s . e l s . p o p ( ) ) ;   }   i f   ( f w d )   {   f o r   ( v a r   i   =   0 ,   l e n   =   o p t s . e l s . l e n g t h ;   i   <   l e n ;   i + + )   {   $ ( o p t s . e l s [ i ] ) . c s s ( " z - i n d e x " ,   l e n   -   i   +   c o u n t ) ;   }   }   e l s e   {   v a r   z   =   $ ( c u r r ) . c s s ( " z - i n d e x " ) ;   $ e l . c s s ( " z - i n d e x " ,   p a r s e I n t ( z )   +   1   +   c o u n t ) ;   }   $ e l . a n i m a t e ( {   l e f t :   0 ,   t o p :   0   } ,   o p t s . s p e e d O u t ,   o p t s . e a s e O u t ,   f u n c t i o n ( )   {   $ ( f w d   ?   t h i s   :   c u r r ) . h i d e ( ) ;   i f   ( c b )   {   c b ( ) ;   }   } ) ;   } ) ;   } ;   o p t s . c s s B e f o r e   =   {   d i s p l a y :   " b l o c k " ,   o p a c i t y :   1 ,   t o p :   0 ,   l e f t :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . t u r n U p   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   t r u e ,   f a l s e ) ;   o p t s . c s s B e f o r e . t o p   =   n e x t . c y c l e H ;   o p t s . a n i m I n . h e i g h t   =   n e x t . c y c l e H ;   } ) ;   o p t s . c s s F i r s t   =   {   t o p :   0   } ;   o p t s . c s s B e f o r e   =   {   l e f t :   0 ,   h e i g h t :   0   } ;   o p t s . a n i m I n   =   {   t o p :   0   } ;   o p t s . a n i m O u t   =   {   h e i g h t :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . t u r n D o w n   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   t r u e ,   f a l s e ) ;   o p t s . a n i m I n . h e i g h t   =   n e x t . c y c l e H ;   o p t s . a n i m O u t . t o p   =   c u r r . c y c l e H ;   } ) ;   o p t s . c s s F i r s t   =   {   t o p :   0   } ;   o p t s . c s s B e f o r e   =   {   l e f t :   0 ,   t o p :   0 ,   h e i g h t :   0   } ;   o p t s . a n i m O u t   =   {   h e i g h t :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . t u r n L e f t   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   f a l s e ,   t r u e ) ;   o p t s . c s s B e f o r e . l e f t   =   n e x t . c y c l e W ;   o p t s . a n i m I n . w i d t h   =   n e x t . c y c l e W ;   } ) ;   o p t s . c s s B e f o r e   =   {   t o p :   0 ,   w i d t h :   0   } ;   o p t s . a n i m I n   =   {   l e f t :   0   } ;   o p t s . a n i m O u t   =   {   w i d t h :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . t u r n R i g h t   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   f a l s e ,   t r u e ) ;   o p t s . a n i m I n . w i d t h   =   n e x t . c y c l e W ;   o p t s . a n i m O u t . l e f t   =   c u r r . c y c l e W ;   } ) ;   o p t s . c s s B e f o r e   =   {   t o p :   0 ,   l e f t :   0 ,   w i d t h :   0   } ;   o p t s . a n i m I n   =   {   l e f t :   0   } ;   o p t s . a n i m O u t   =   {   w i d t h :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . z o o m   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   f a l s e ,   f a l s e ,   t r u e ) ;   o p t s . c s s B e f o r e . t o p   =   n e x t . c y c l e H   /   2 ;   o p t s . c s s B e f o r e . l e f t   =   n e x t . c y c l e W   /   2 ;   o p t s . a n i m I n   =   {   t o p :   0 ,   l e f t :   0 ,   w i d t h :   n e x t . c y c l e W ,   h e i g h t :   n e x t . c y c l e H   } ;   o p t s . a n i m O u t   =   {   w i d t h :   0 ,   h e i g h t :   0 ,   t o p :   c u r r . c y c l e H   /   2 ,   l e f t :   c u r r . c y c l e W   /   2   } ;   } ) ;   o p t s . c s s F i r s t   =   {   t o p :   0 ,   l e f t :   0   } ;   o p t s . c s s B e f o r e   =   {   w i d t h :   0 ,   h e i g h t :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . f a d e Z o o m   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   f a l s e ,   f a l s e ) ;   o p t s . c s s B e f o r e . l e f t   =   n e x t . c y c l e W   /   2 ;   o p t s . c s s B e f o r e . t o p   =   n e x t . c y c l e H   /   2 ;   o p t s . a n i m I n   =   {   t o p :   0 ,   l e f t :   0 ,   w i d t h :   n e x t . c y c l e W ,   h e i g h t :   n e x t . c y c l e H   } ;   } ) ;   o p t s . c s s B e f o r e   =   {   w i d t h :   0 ,   h e i g h t :   0   } ;   o p t s . a n i m O u t   =   {   o p a c i t y :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . b l i n d X   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   v a r   w   =   $ c o n t . c s s ( " o v e r f l o w " ,   " h i d d e n " ) . w i d t h ( ) ;   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ) ;   o p t s . a n i m I n . w i d t h   =   n e x t . c y c l e W ;   o p t s . a n i m O u t . l e f t   =   c u r r . c y c l e W ;   } ) ;   o p t s . c s s B e f o r e   =   {   l e f t :   w ,   t o p :   0   } ;   o p t s . a n i m I n   =   {   l e f t :   0   } ;   o p t s . a n i m O u t   =   {   l e f t :   w   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . b l i n d Y   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   v a r   h   =   $ c o n t . c s s ( " o v e r f l o w " ,   " h i d d e n " ) . h e i g h t ( ) ;   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ) ;   o p t s . a n i m I n . h e i g h t   =   n e x t . c y c l e H ;   o p t s . a n i m O u t . t o p   =   c u r r . c y c l e H ;   } ) ;   o p t s . c s s B e f o r e   =   {   t o p :   h ,   l e f t :   0   } ;   o p t s . a n i m I n   =   {   t o p :   0   } ;   o p t s . a n i m O u t   =   {   t o p :   h   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . b l i n d Z   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   v a r   h   =   $ c o n t . c s s ( " o v e r f l o w " ,   " h i d d e n " ) . h e i g h t ( ) ;   v a r   w   =   $ c o n t . w i d t h ( ) ;   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ) ;   o p t s . a n i m I n . h e i g h t   =   n e x t . c y c l e H ;   o p t s . a n i m O u t . t o p   =   c u r r . c y c l e H ;   } ) ;   o p t s . c s s B e f o r e   =   {   t o p :   h ,   l e f t :   w   } ;   o p t s . a n i m I n   =   {   t o p :   0 ,   l e f t :   0   } ;   o p t s . a n i m O u t   =   {   t o p :   h ,   l e f t :   w   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . g r o w X   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   f a l s e ,   t r u e ) ;   o p t s . c s s B e f o r e . l e f t   =   t h i s . c y c l e W   /   2 ;   o p t s . a n i m I n   =   {   l e f t :   0 ,   w i d t h :   t h i s . c y c l e W   } ;   o p t s . a n i m O u t   =   {   l e f t :   0   } ;   } ) ;   o p t s . c s s B e f o r e   =   {   w i d t h :   0 ,   t o p :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . g r o w Y   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   t r u e ,   f a l s e ) ;   o p t s . c s s B e f o r e . t o p   =   t h i s . c y c l e H   /   2 ;   o p t s . a n i m I n   =   {   t o p :   0 ,   h e i g h t :   t h i s . c y c l e H   } ;   o p t s . a n i m O u t   =   {   t o p :   0   } ;   } ) ;   o p t s . c s s B e f o r e   =   {   h e i g h t :   0 ,   l e f t :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . c u r t a i n X   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   f a l s e ,   t r u e ,   t r u e ) ;   o p t s . c s s B e f o r e . l e f t   =   n e x t . c y c l e W   /   2 ;   o p t s . a n i m I n   =   {   l e f t :   0 ,   w i d t h :   t h i s . c y c l e W   } ;   o p t s . a n i m O u t   =   {   l e f t :   c u r r . c y c l e W   /   2 ,   w i d t h :   0   } ;   } ) ;   o p t s . c s s B e f o r e   =   {   t o p :   0 ,   w i d t h :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . c u r t a i n Y   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   t r u e ,   f a l s e ,   t r u e ) ;   o p t s . c s s B e f o r e . t o p   =   n e x t . c y c l e H   /   2 ;   o p t s . a n i m I n   =   {   t o p :   0 ,   h e i g h t :   n e x t . c y c l e H   } ;   o p t s . a n i m O u t   =   {   t o p :   c u r r . c y c l e H   /   2 ,   h e i g h t :   0   } ;   } ) ;   o p t s . c s s B e f o r e   =   {   l e f t :   0 ,   h e i g h t :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . c o v e r   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   v a r   d   =   o p t s . d i r e c t i o n   | |   " l e f t " ;   v a r   w   =   $ c o n t . c s s ( " o v e r f l o w " ,   " h i d d e n " ) . w i d t h ( ) ;   v a r   h   =   $ c o n t . h e i g h t ( ) ;   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ) ;   i f   ( d   = =   " r i g h t " )   {   o p t s . c s s B e f o r e . l e f t   =   - w ;   }   e l s e   {   i f   ( d   = =   " u p " )   {   o p t s . c s s B e f o r e . t o p   =   h ;   }   e l s e   {   i f   ( d   = =   " d o w n " )   {   o p t s . c s s B e f o r e . t o p   =   - h ;   }   e l s e   {   o p t s . c s s B e f o r e . l e f t   =   w ;   }   }   }   } ) ;   o p t s . a n i m I n   =   {   l e f t :   0 ,   t o p :   0   } ;   o p t s . a n i m O u t   =   {   o p a c i t y :   1   } ;   o p t s . c s s B e f o r e   =   {   t o p :   0 ,   l e f t :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . u n c o v e r   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   v a r   d   =   o p t s . d i r e c t i o n   | |   " l e f t " ;   v a r   w   =   $ c o n t . c s s ( " o v e r f l o w " ,   " h i d d e n " ) . w i d t h ( ) ;   v a r   h   =   $ c o n t . h e i g h t ( ) ;   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   t r u e ,   t r u e ,   t r u e ) ;   i f   ( d   = =   " r i g h t " )   {   o p t s . a n i m O u t . l e f t   =   w ;   }   e l s e   {   i f   ( d   = =   " u p " )   {   o p t s . a n i m O u t . t o p   =   - h ;   }   e l s e   {   i f   ( d   = =   " d o w n " )   {   o p t s . a n i m O u t . t o p   =   h ;   }   e l s e   {   o p t s . a n i m O u t . l e f t   =   - w ;   }   }   }   } ) ;   o p t s . a n i m I n   =   {   l e f t :   0 ,   t o p :   0   } ;   o p t s . a n i m O u t   =   {   o p a c i t y :   1   } ;   o p t s . c s s B e f o r e   =   {   t o p :   0 ,   l e f t :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . t o s s   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   v a r   w   =   $ c o n t . c s s ( " o v e r f l o w " ,   " v i s i b l e " ) . w i d t h ( ) ;   v a r   h   =   $ c o n t . h e i g h t ( ) ;   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   t r u e ,   t r u e ,   t r u e ) ;   i f   ( ! o p t s . a n i m O u t . l e f t   & &   ! o p t s . a n i m O u t . t o p )   {   o p t s . a n i m O u t   =   {   l e f t :   w   *   2 ,   t o p :   - h   /   2 ,   o p a c i t y :   0   } ;   }   e l s e   {   o p t s . a n i m O u t . o p a c i t y   =   0 ;   }   } ) ;   o p t s . c s s B e f o r e   =   {   l e f t :   0 ,   t o p :   0   } ;   o p t s . a n i m I n   =   {   l e f t :   0   } ;   } ;   $ . f n . c y c l e . t r a n s i t i o n s . w i p e   =   f u n c t i o n ( $ c o n t ,   $ s l i d e s ,   o p t s )   {   v a r   w   =   $ c o n t . c s s ( " o v e r f l o w " ,   " h i d d e n " ) . w i d t h ( ) ;   v a r   h   =   $ c o n t . h e i g h t ( ) ;   o p t s . c s s B e f o r e   =   o p t s . c s s B e f o r e   | |   { } ;   v a r   c l i p ;   i f   ( o p t s . c l i p )   {   i f   ( / l 2 r / . t e s t ( o p t s . c l i p ) )   {   c l i p   =   " r e c t ( 0 p x   0 p x   "   +   h   +   " p x   0 p x ) " ;   }   e l s e   {   i f   ( / r 2 l / . t e s t ( o p t s . c l i p ) )   {   c l i p   =   " r e c t ( 0 p x   "   +   w   +   " p x   "   +   h   +   " p x   "   +   w   +   " p x ) " ;   }   e l s e   {   i f   ( / t 2 b / . t e s t ( o p t s . c l i p ) )   {   c l i p   =   " r e c t ( 0 p x   "   +   w   +   " p x   0 p x   0 p x ) " ;   }   e l s e   {   i f   ( / b 2 t / . t e s t ( o p t s . c l i p ) )   {   c l i p   =   " r e c t ( "   +   h   +   " p x   "   +   w   +   " p x   "   +   h   +   " p x   0 p x ) " ;   }   e l s e   {   i f   ( / z o o m / . t e s t ( o p t s . c l i p ) )   {   v a r   t   =   p a r s e I n t ( h   /   2 ) ;   v a r   l   =   p a r s e I n t ( w   /   2 ) ;   c l i p   =   " r e c t ( "   +   t   +   " p x   "   +   l   +   " p x   "   +   t   +   " p x   "   +   l   +   " p x ) " ;   }   }   }   }   }   }   o p t s . c s s B e f o r e . c l i p   =   o p t s . c s s B e f o r e . c l i p   | |   c l i p   | |   " r e c t ( 0 p x   0 p x   0 p x   0 p x ) " ;   v a r   d   =   o p t s . c s s B e f o r e . c l i p . m a t c h ( / ( \ d + ) / g ) ;   v a r   t   =   p a r s e I n t ( d [ 0 ] ) ,   r   =   p a r s e I n t ( d [ 1 ] ) ,   b   =   p a r s e I n t ( d [ 2 ] ) ,   l   =   p a r s e I n t ( d [ 3 ] ) ;   o p t s . b e f o r e . p u s h ( f u n c t i o n ( c u r r ,   n e x t ,   o p t s )   {   i f   ( c u r r   = =   n e x t )   {   r e t u r n ;   }   v a r   $ c u r r   =   $ ( c u r r ) ,   $ n e x t   =   $ ( n e x t ) ;   $ . f n . c y c l e . c o m m o n R e s e t ( c u r r ,   n e x t ,   o p t s ,   t r u e ,   t r u e ,   f a l s e ) ;   o p t s . c s s A f t e r . d i s p l a y   =   " b l o c k " ;   v a r   s t e p   =   1 ,   c o u n t   =   p a r s e I n t ( ( o p t s . s p e e d I n   /   1 3 ) )   -   1 ;   ( f u n c t i o n   f ( )   {   v a r   t t   =   t   ?   t   -   p a r s e I n t ( s t e p   *   ( t   /   c o u n t ) )   :   0 ;   v a r   l l   =   l   ?   l   -   p a r s e I n t ( s t e p   *   ( l   /   c o u n t ) )   :   0 ;   v a r   b b   =   b   <   h   ?   b   +   p a r s e I n t ( s t e p   *   ( ( h   -   b )   /   c o u n t   | |   1 ) )   :   h ;   v a r   r r   =   r   <   w   ?   r   +   p a r s e I n t ( s t e p   *   ( ( w   -   r )   /   c o u n t   | |   1 ) )   :   w ;   $ n e x t . c s s ( {   c l i p :   " r e c t ( "   +   t t   +   " p x   "   +   r r   +   " p x   "   +   b b   +   " p x   "   +   l l   +   " p x ) "   } ) ;   ( s t e p + +   < =   c o u n t )   ?   s e t T i m e o u t ( f ,   1 3 )   :   $ c u r r . c s s ( " d i s p l a y " ,   " n o n e " ) ;   } ) ( ) ;   } ) ;   o p t s . c s s B e f o r e   =   {   d i s p l a y :   " b l o c k " ,   o p a c i t y :   1 ,   t o p :   0 ,   l e f t :   0   } ;   o p t s . a n i m I n   =   {   l e f t :   0   } ;   o p t s . a n i m O u t   =   {   l e f t :   0   } ;   } ;   } ) ( j Q u e r y ) ;  
  
 / /   I m a g e   R e s i z e r  
  
 ( f u n c t i o n ( $ )   {  
         $ . f n . e x t e n d ( {  
                 I m a g e R e s i z e r :   f u n c t i o n ( i ,   S e t t i n g s )   {   / / T o D o ;   A p p l y i n g   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 ( )   {  
                                 / / h i d e   i m a g e  
                                 $ ( t h i s ) . f i n d ( " i m g " ) . h i d e ( ) ;  
  
                                 / / s e t   a d d i t i o n a l   p r o p e r t i e s  
                                 $ ( t h i s ) . c s s ( " o v e r f l o w " ,   " h i d d e n " ) ;  
                                 $ ( t h i s ) . f i n d ( " i m g " ) . c s s ( " - m s - i n t e r p o l a t i o n - m o d e " ,   " b i c u b i c " ) ;  
  
                                 / / g e t   m a x i m a l   d i m e n s i o n s  
                                 v a r   M a x H e i g h t   =   $ ( t h i s ) . h e i g h t ( ) ;  
                                 v a r   M a x W i d t h   =   $ ( t h i s ) . w i d t h ( ) ;  
  
                                 / / g e t   i m a g e   d i m e n s i o n s  
                                 v a r   I m a g e H e i g h t   =   $ ( t h i s ) . f i n d ( " i m g " ) . h e i g h t ( ) ;  
                                 v a r   I m a g e W i d t h   =   $ ( t h i s ) . f i n d ( " i m g " ) . w i d t h ( ) ;  
  
                                 i f   ( M a x H e i g h t   <   I m a g e H e i g h t   & &   M a x W i d t h   <   I m a g e W i d t h )   {  
                                         / / x s c a l e   i m a g e  
                                         $ ( t h i s ) . f i n d ( " i m g " ) . w i d t h ( M a x W i d t h ) ;  
  
                                         / / g e t   n e w   i m a g e   d i m e n s i o n  
                                         v a r   N e w I m a g e H e i g h t   =   $ ( t h i s ) . f i n d ( " i m g " ) . h e i g h t ( ) ;  
  
                                         i f   ( N e w I m a g e H e i g h t   <   M a x H e i g h t )   {  
                                                 / / r e s e t   i m a g e   d i m e n s i o n  
                                                 $ ( t h i s ) . f i n d ( " i m g " ) . w i d t h ( " " ) ;  
  
                                                 / / y s c a l e   i m a g e  
                                                 $ ( t h i s ) . f i n d ( " i m g " ) . h e i g h t ( M a x H e i g h t ) ;  
                                         }  
  
                                         / / g e t   t h e   o v e r f l o w   d i m e n s i o n s  
                                         v a r   x O v e r f l o w   =   $ ( t h i s ) . f i n d ( " i m g " ) . w i d t h ( )   -   M a x W i d t h ;  
                                         v a r   y O v e r f l o w   =   $ ( t h i s ) . f i n d ( " i m g " ) . h e i g h t ( )   -   M a x H e i g h t ;  
  
                                         / / c e n t e r   i m a g e  
                                         $ ( t h i s ) . f i n d ( " i m g " ) . c s s ( " m a r g i n - l e f t " ,   - x O v e r f l o w   /   2 ) ;  
                                         $ ( t h i s ) . f i n d ( " i m g " ) . c s s ( " m a r g i n - t o p " ,   - y O v e r f l o w   /   2 ) ;  
  
                                         N e w I m a g e H e i g h t   =   $ ( t h i s ) . f i n d ( " i m g " ) . h e i g h t ( ) ;  
                                         N e w I m a g e W i d t h   =   $ ( t h i s ) . f i n d ( " i m g " ) . w i d t h ( ) ;  
                                 }  
                                 e l s e   {  
                                         / / g e t   t h e   o v e r f l o w   d i m e n s i o n s  
                                         v a r   x V o i d   =   ( M a x W i d t h   -   I m a g e W i d t h )   /   2 ;  
                                         v a r   y V o i d   =   ( M a x H e i g h t   -   I m a g e H e i g h t )   /   2 ;  
  
                                         / / c e n t e r   i m a g e  
                                         $ ( t h i s ) . f i n d ( " i m g " ) . c s s ( " m a r g i n - l e f t " ,   x V o i d ) ;  
                                         $ ( t h i s ) . f i n d ( " i m g " ) . c s s ( " m a r g i n - t o p " ,   y V o i d ) ;  
                                 }  
  
                                 / / c h e c k   i f   i m a g e s   a r e   l o a d e d  
                                 i f   ( I m a g e H e i g h t   = =   0   | |   I m a g e W i d t h   = =   0 )   {  
                                         $ ( t h i s ) . I m a g e R e s i z e r ( i ,   S e t t i n g s ) ;  
                                 }  
  
                                 / / s h o w   i m a g e  
                                 $ ( t h i s ) . f i n d ( " i m g " ) . s h o w ( ) ;  
                         } ) ;  
                 }  
         } ) ;  
 } ) ( j Q u e r y ) ;  
  
 / /   I m a g e   T o o l t i p  
  
 ( f u n c t i o n ( $ )   {  
         $ . f n . e x t e n d ( {  
                 I m a g e T o o l t i p :   f u n c t i o n ( S e t t i n g s )   {   / / T o D o ;   A p p l y i n g   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 ( )   {  
  
                                 $ ( t h i s ) . f i n d ( " . P i c t u r e " ) . h i d e ( ) ;  
  
                                 $ ( t h i s ) . h o v e r ( f u n c t i o n ( )   {  
                                         $ ( t h i s ) . c h i l d r e n ( " . P i c t u r e " ) . f a d e I n ( 5 0 0 ) ;  
                                 } ) ;  
  
                                 $ ( t h i s ) . m o u s e o u t ( f u n c t i o n ( )   {  
                                         $ ( t h i s ) . c h i l d r e n ( " . P i c t u r e " ) . f a d e O u t ( 1 0 0 ) ;  
                                 } ) ;  
                         } ) ;  
                 }  
         } ) ;  
 } ) ( j Q u e r y ) ;  
  
 / /   S u c k e r f i s h  
  
 / *   -   c s s   -   /  
          
 u l  
 {  
 p o s i t i o n : r e l a t i v e ;  
 l i s t - s t y l e : n o n e ;  
 m a r g i n : 0 ;    
 p a d d i n g : 0 ;  
 h e i g h t : 2 6 p x ;    
 }  
          
 u l   l i  
 {  
 f l o a t : l e f t ;    
 h e i g h t : 2 6 p x ;  
 }  
          
 u l   l i   a  
 {  
 d i s p l a y : i n l i n e - b l o c k ;   < - -   V E R Y   I M P O R T A N T    
 l i n e - h e i g h t : 2 6 p x ;  
 }  
          
 /   -   p r e d e c e n d i n g   l e v e l   -   /  
          
 u l   l i   u l  
 {  
 d i s p l a y : n o n e ;  
 p o s i t i o n : a b s o l u t e ;  
 t o p : 2 6 p x ;  
 c l e a r : l e f t ;  
 }  
  
 u l   l i   u l   l i  
 {  
 p o s i t i o n : r e l a t i v e ;  
 f l o a t : n o n e ;  
 }  
          
 u l   l i   u l   l i   u l  
 {  
 d i s p l a y : n o n e ;  
 p o s i t i o n : a b s o l u t e ;  
 t o p : 0 ;  
 }  
  
          
          
 < - - - - - - - - - - - - - - - - - - - - - * /  
  
 ( f u n c t i o n ( $ )   {  
         $ . f n . e x t e n d ( {  
                 S u c k e r f i s h :   f u n c t i o n ( S e t t i n g s )   {   / / T o D o ;   A p p l y i n g   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 ( )   {                                  
                                 $ ( t h i s ) . f i n d ( " l i " ) . h o v e r ( f u n c t i o n ( )   {  
                                         $ ( t h i s ) . c h i l d r e n ( " u l " ) . s h o w ( ) ;  
                                 } ,   f u n c t i o n ( )   {  
                                         $ ( t h i s ) . c h i l d r e n ( " u l " ) . h i d e ( ) ;  
                                 } )  
                         } ) ;  
                 }  
         } ) ;  
 } ) ( j Q u e r y ) ;  
  
 / /   T h i c k b o x  
  
 / *  
 *   T h i c k b o x   3 . 1   -   O n e   B o x   T o   R u l e   T h e m   A l l .  
 *   B y   C o d y   L i n d l e y   ( h t t p : / / w w w . c o d y l i n d l e y . c o m )  
 *   C o p y r i g h t   ( c )   2 0 0 7   c o d y   l i n d l e y  
 *   L i c e n s e d   u n d e r   t h e   M I T   L i c e n s e :   h t t p : / / w w w . o p e n s o u r c e . o r g / l i c e n s e s / m i t - l i c e n s e . p h p  
 * /  
  
 v a r   t b _ p a t h T o I m a g e   =   " _ i m a g e s / l o a d i n g . g i f " ;  
  
 / * ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !   e d i t   b e l o w   t h i s   l i n e   a t   y o u r   o w n   r i s k   ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! * /  
  
 / / o n   p a g e   l o a d   c a l l   t b _ i n i t  
 $ ( d o c u m e n t ) . r e a d y ( f u n c t i o n ( )   {  
         t b _ i n i t ( ' a . t h i c k b o x ,   a r e a . t h i c k b o x ,   i n p u t . t h i c k b o x ' ) ;   / / p a s s   w h e r e   t o   a p p l y   t h i c k b o x  
         i m g L o a d e r   =   n e w   I m a g e ( ) ;   / /   p r e l o a d   i m a g e  
         i m g L o a d e r . s r c   =   t b _ p a t h T o I m a g e ;  
 } ) ;  
  
 / / a d d   t h i c k b o x   t o   h r e f   &   a r e a   e l e m e n t s   t h a t   h a v e   a   c l a s s   o f   . t h i c k b o x  
 f u n c t i o n   t b _ i n i t ( d o m C h u n k )   {  
         $ ( d o m C h u n k ) . c l i c k ( f u n c t i o n ( )   {  
                 v a r   t   =   t h i s . t i t l e   | |   t h i s . n a m e   | |   n u l l ;  
                 v a r   a   =   t h i s . h r e f   | |   t h i s . a l t ;  
                 v a r   g   =   t h i s . r e l   | |   f a l s e ;  
                 t b _ s h o w ( t ,   a ,   g ) ;  
                 t h i s . b l u r ( ) ;  
                 r e t u r n   f a l s e ;  
         } ) ;  
 }  
  
 f u n c t i o n   t b _ s h o w ( c a p t i o n ,   u r l ,   i m a g e G r o u p )   { / / f u n c t i o n   c a l l e d   w h e n   t h e   u s e r   c l i c k s   o n   a   t h i c k b o x   l i n k  
  
         t r y   {  
                 i f   ( t y p e o f   d o c u m e n t . b o d y . s t y l e . m a x H e i g h t   = = =   " u n d e f i n e d " )   { / / i f   I E   6  
                         $ ( " b o d y " ,   " h t m l " ) . c s s ( {   h e i g h t :   " 1 0 0 % " ,   w i d t h :   " 1 0 0 % "   } ) ;  
                         $ ( " h t m l " ) . c s s ( " o v e r f l o w " ,   " h i d d e n " ) ;  
                         i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( " T B _ H i d e S e l e c t " )   = = =   n u l l )   { / / i f r a m e   t o   h i d e   s e l e c t   e l e m e n t s   i n   i e 6  
                                 $ ( " b o d y " ) . a p p e n d ( " < i f r a m e   i d = ' T B _ H i d e S e l e c t ' > < / i f r a m e > < d i v   i d = ' T B _ o v e r l a y ' > < / d i v > < d i v   i d = ' T B _ w i n d o w ' > < / d i v > " ) ;  
                                 / / $ ( " # T B _ o v e r l a y " ) . c l i c k ( t b _ r e m o v e ) ;  
                         }  
                 }   e l s e   { / / a l l   o t h e r s  
                         i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( " T B _ o v e r l a y " )   = = =   n u l l )   {  
                                 $ ( " b o d y " ) . a p p e n d ( " < d i v   i d = ' T B _ o v e r l a y ' > < / d i v > < d i v   i d = ' T B _ w i n d o w ' > < / d i v > " ) ;  
                                 / / $ ( " # T B _ o v e r l a y " ) . c l i c k ( t b _ r e m o v e ) ;  
                         }  
                 }  
  
                 i f   ( t b _ d e t e c t M a c X F F ( ) )   {  
                         $ ( " # T B _ o v e r l a y " ) . a d d C l a s s ( " T B _ o v e r l a y M a c F F B G H a c k " ) ;   / / u s e   p n g   o v e r l a y   s o   h i d e   f l a s h  
                 }   e l s e   {  
                         $ ( " # T B _ o v e r l a y " ) . a d d C l a s s ( " T B _ o v e r l a y B G " ) ;   / / u s e   b a c k g r o u n d   a n d   o p a c i t y  
                 }  
  
                 i f   ( c a p t i o n   = = =   n u l l )   {   c a p t i o n   =   " " ;   }  
                 / / $ ( " b o d y " ) . a p p e n d ( " < d i v   i d = ' T B _ l o a d ' > < i m g   s r c = ' "   +   i m g L o a d e r . s r c   +   " '   / > < / d i v > " ) ;   / / a d d   l o a d e r   t o   t h e   p a g e  
                 / / $ ( ' # T B _ l o a d ' ) . s h o w ( ) ;   / / s h o w   l o a d e r  
  
                 v a r   b a s e U R L ;  
                 i f   ( u r l . i n d e x O f ( " ? " )   ! = =   - 1 )   {   / / f f   t h e r e   i s   a   q u e r y   s t r i n g   i n v o l v e d  
                         b a s e U R L   =   u r l . s u b s t r ( 0 ,   u r l . i n d e x O f ( " ? " ) ) ;  
                 }   e l s e   {  
                         b a s e U R L   =   u r l ;  
                 }  
  
                 v a r   u r l S t r i n g   =   / \ . j p g $ | \ . j p e g $ | \ . p n g $ | \ . g i f $ | \ . b m p $ / ;  
                 v a r   u r l T y p e   =   b a s e U R L . t o L o w e r C a s e ( ) . m a t c h ( u r l S t r i n g ) ;  
  
                 i f   ( u r l T y p e   = =   ' . j p g '   | |   u r l T y p e   = =   ' . j p e g '   | |   u r l T y p e   = =   ' . p n g '   | |   u r l T y p e   = =   ' . g i f '   | |   u r l T y p e   = =   ' . b m p ' )   { / / c o d e   t o   s h o w   i m a g e s  
  
                         T B _ P r e v C a p t i o n   =   " " ;  
                         T B _ P r e v U R L   =   " " ;  
                         T B _ P r e v H T M L   =   " " ;  
                         T B _ N e x t C a p t i o n   =   " " ;  
                         T B _ N e x t U R L   =   " " ;  
                         T B _ N e x t H T M L   =   " " ;  
                         T B _ i m a g e C o u n t   =   " " ;  
                         T B _ F o u n d U R L   =   f a l s e ;  
                         i f   ( i m a g e G r o u p )   {  
                                 T B _ T e m p A r r a y   =   $ ( " a [ @ r e l = "   +   i m a g e G r o u p   +   " ] " ) . g e t ( ) ;  
                                 f o r   ( T B _ C o u n t e r   =   0 ;   ( ( T B _ C o u n t e r   <   T B _ T e m p A r r a y . l e n g t h )   & &   ( T B _ N e x t H T M L   = = =   " " ) ) ;   T B _ C o u n t e r + + )   {  
                                         v a r   u r l T y p e T e m p   =   T B _ T e m p A r r a y [ T B _ C o u n t e r ] . h r e f . t o L o w e r C a s e ( ) . m a t c h ( u r l S t r i n g ) ;  
                                         i f   ( ! ( T B _ T e m p A r r a y [ T B _ C o u n t e r ] . h r e f   = =   u r l ) )   {  
                                                 i f   ( T B _ F o u n d U R L )   {  
                                                         T B _ N e x t C a p t i o n   =   T B _ T e m p A r r a y [ T B _ C o u n t e r ] . t i t l e ;  
                                                         T B _ N e x t U R L   =   T B _ T e m p A r r a y [ T B _ C o u n t e r ] . h r e f ;  
                                                         T B _ N e x t H T M L   =   " < s p a n   i d = ' T B _ n e x t ' > & n b s p ; & n b s p ; < a   h r e f = ' # ' > N e x t   & g t ; < / a > < / s p a n > " ;  
                                                 }   e l s e   {  
                                                         T B _ P r e v C a p t i o n   =   T B _ T e m p A r r a y [ T B _ C o u n t e r ] . t i t l e ;  
                                                         T B _ P r e v U R L   =   T B _ T e m p A r r a y [ T B _ C o u n t e r ] . h r e f ;  
                                                         T B _ P r e v H T M L   =   " < s p a n   i d = ' T B _ p r e v ' > & n b s p ; & n b s p ; < a   h r e f = ' # ' > & l t ;   P r e v < / a > < / s p a n > " ;  
                                                 }  
                                         }   e l s e   {  
                                                 T B _ F o u n d U R L   =   t r u e ;  
                                                 T B _ i m a g e C o u n t   =   " I m a g e   "   +   ( T B _ C o u n t e r   +   1 )   +   "   o f   "   +   ( T B _ T e m p A r r a y . l e n g t h ) ;  
                                         }  
                                 }  
                         }  
  
                         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 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 l o a d   =   n u l l ;  
  
                                 / /   R e s i z i n g   l a r g e   i m a g e s   -   o r g i n a l   b y   C h r i s t i a n   M o n t o y a   e d i t e d   b y   m e .  
                                 v a r   p a g e s i z e   =   t b _ g e t P a g e S i z e ( ) ;  
                                 v a r   x   =   p a g e s i z e [ 0 ]   -   1 5 0 ;  
                                 v a r   y   =   p a g e s i z e [ 1 ]   -   1 5 0 ;  
                                 v a r   i m a g e W i d t h   =   i m g P r e l o a d e r . w i d t h ;  
                                 v a r   i m a g e 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 f   ( i m a g e W i d t h   >   x )   {  
                                         i m a g e H e i g h t   =   i m a g e H e i g h t   *   ( x   /   i m a g e W i d t h ) ;  
                                         i m a g e W i d t h   =   x ;  
                                         i f   ( i m a g e H e i g h t   >   y )   {  
                                                 i m a g e W i d t h   =   i m a g e W i d t h   *   ( y   /   i m a g e H e i g h t ) ;  
                                                 i m a g e H e i g h t   =   y ;  
                                         }  
                                 }   e l s e   i f   ( i m a g e H e i g h t   >   y )   {  
                                         i m a g e W i d t h   =   i m a g e W i d t h   *   ( y   /   i m a g e H e i g h t ) ;  
                                         i m a g e H e i g h t   =   y ;  
                                         i f   ( i m a g e W i d t h   >   x )   {  
                                                 i m a g e H e i g h t   =   i m a g e H e i g h t   *   ( x   /   i m a g e W i d t h ) ;  
                                                 i m a g e W i d t h   =   x ;  
                                         }  
                                 }  
                                 / /   E n d   R e s i z i n g  
  
                                 T B _ W I D T H   =   i m a g e W i d t h   +   3 0 ;  
                                 T B _ H E I G H T   =   i m a g e H e i g h t   +   6 0 ;  
                                 $ ( " # T B _ w i n d o w " ) . a p p e n d ( " < a   h r e f = ' '   i d = ' T B _ I m a g e O f f '   t i t l e = ' C l o s e ' > < i m g   i d = ' T B _ I m a g e '   s r c = ' "   +   u r l   +   " '   w i d t h = ' "   +   i m a g e W i d t h   +   " '   h e i g h t = ' "   +   i m a g e H e i g h t   +   " '   a l t = ' "   +   c a p t i o n   +   " ' / > < / a > "   +   " < d i v   i d = ' T B _ c a p t i o n ' > "   +   c a p t i o n   +   " < d i v   i d = ' T B _ s e c o n d L i n e ' > "   +   T B _ i m a g e C o u n t   +   T B _ P r e v H T M L   +   T B _ N e x t H T M L   +   " < / d i v > < / d i v > < d i v   i d = ' T B _ c l o s e W i n d o w ' > < a   h r e f = ' # '   i d = ' T B _ c l o s e W i n d o w B u t t o n '   t i t l e = ' C l o s e ' > s l u i t e n < / a > < / d i v > " ) ;  
  
                                 $ ( " # T B _ c l o s e W i n d o w B u t t o n " ) . c l i c k ( t b _ r e m o v e ) ;  
  
                                 i f   ( ! ( T B _ P r e v H T M L   = = =   " " ) )   {  
                                         f u n c t i o n   g o P r e v ( )   {  
                                                 i f   ( $ ( d o c u m e n t ) . u n b i n d ( " c l i c k " ,   g o P r e v ) )   {   $ ( d o c u m e n t ) . u n b i n d ( " c l i c k " ,   g o P r e v ) ;   }  
                                                 $ ( " # T B _ w i n d o w " ) . r e m o v e ( ) ;  
                                                 $ ( " b o d y " ) . a p p e n d ( " < d i v   i d = ' T B _ w i n d o w ' > < / d i v > " ) ;  
                                                 t b _ s h o w ( T B _ P r e v C a p t i o n ,   T B _ P r e v U R L ,   i m a g e G r o u p ) ;  
                                                 r e t u r n   f a l s e ;  
                                         }  
                                         $ ( " # T B _ p r e v " ) . c l i c k ( g o P r e v ) ;  
                                 }  
  
                                 i f   ( ! ( T B _ N e x t H T M L   = = =   " " ) )   {  
                                         f u n c t i o n   g o N e x t ( )   {  
                                                 $ ( " # T B _ w i n d o w " ) . r e m o v e ( ) ;  
                                                 $ ( " b o d y " ) . a p p e n d ( " < d i v   i d = ' T B _ w i n d o w ' > < / d i v > " ) ;  
                                                 t b _ s h o w ( T B _ N e x t C a p t i o n ,   T B _ N e x t U R L ,   i m a g e G r o u p ) ;  
                                                 r e t u r n   f a l s e ;  
                                         }  
                                         $ ( " # T B _ n e x t " ) . c l i c k ( g o N e x t ) ;  
  
                                 }  
  
                                 d o c u m e n t . o n k e y d o w n   =   f u n c t i o n ( e )   {  
                                         i f   ( e   = =   n u l l )   {   / /   i e  
                                                 k e y c o d e   =   e v e n t . k e y C o d e ;  
                                         }   e l s e   {   / /   m o z i l l a  
                                                 k e y c o d e   =   e . w h i c h ;  
                                         }  
                                         i f   ( k e y c o d e   = =   2 7 )   {   / /   c l o s e  
                                                 t b _ r e m o v e ( ) ;  
                                         }   e l s e   i f   ( k e y c o d e   = =   1 9 0 )   {   / /   d i s p l a y   p r e v i o u s   i m a g e  
                                                 i f   ( ! ( T B _ N e x t H T M L   = =   " " ) )   {  
                                                         d o c u m e n t . o n k e y d o w n   =   " " ;  
                                                         g o N e x t ( ) ;  
                                                 }  
                                         }   e l s e   i f   ( k e y c o d e   = =   1 8 8 )   {   / /   d i s p l a y   n e x t   i m a g e  
                                                 i f   ( ! ( T B _ P r e v H T M L   = =   " " ) )   {  
                                                         d o c u m e n t . o n k e y d o w n   =   " " ;  
                                                         g o P r e v ( ) ;  
                                                 }  
                                         }  
                                 } ;  
  
                                 t b _ p o s i t i o n ( ) ;  
                                 $ ( " # T B _ l o a d " ) . r e m o v e ( ) ;  
                                 $ ( " # T B _ I m a g e O f f " ) . c l i c k ( t b _ r e m o v e ) ;  
                                 $ ( " # T B _ w i n d o w " ) . c s s ( {   d i s p l a y :   " b l o c k "   } ) ;   / / f o r   s a f a r i   u s i n g   c s s   i n s t e a d   o f   s h o w  
                         } ;  
  
                         i m g P r e l o a d e r . s r c   =   u r l ;  
                 }   e l s e   { / / c o d e   t o   s h o w   h t m l  
  
                         v a r   q u e r y S t r i n g   =   u r l . r e p l a c e ( / ^ [ ^ \ ? ] + \ ? ? / ,   ' ' ) ;  
                         v a r   p a r a m s   =   t b _ p a r s e Q u e r y ( q u e r y S t r i n g ) ;  
  
                         T B _ W I D T H   =   ( p a r a m s [ ' w i d t h ' ]   *   1 )   +   3 0   | |   6 3 0 ;   / / d e f a u l t s   t o   6 3 0   i f   n o   p a r a m a t e r s   w e r e   a d d e d   t o   U R L  
                         T B _ H E I G H T   =   ( p a r a m s [ ' h e i g h t ' ]   *   1 )   +   4 0   | |   4 4 0 ;   / / d e f a u l t s   t o   4 4 0   i f   n o   p a r a m a t e r s   w e r e   a d d e d   t o   U R L  
                         a j a x C o n t e n t W   =   T B _ W I D T H   -   3 0 ;  
                         a j a x C o n t e n t H   =   T B _ H E I G H T   -   4 5 ;  
  
                         i f   ( u r l . i n d e x O f ( ' T B _ i f r a m e ' )   ! =   - 1 )   { / /   e i t h e r   i f r a m e   o r   a j a x   w i n d o w 	 	  
                                 u r l N o Q u e r y   =   u r l . s p l i t ( ' T B _ ' ) ;  
                                 $ ( " # T B _ i f r a m e C o n t e n t " ) . r e m o v e ( ) ;  
                                 i f   ( p a r a m s [ ' m o d a l ' ]   ! =   " t r u e " )   { / / i f r a m e   n o   m o d a l  
                                         $ ( " # T B _ w i n d o w " ) . a p p e n d ( " < d i v   i d = ' T B _ t i t l e ' > < d i v   i d = ' T B _ c l o s e A j a x W i n d o w ' > < a   h r e f = ' # '   i d = ' T B _ c l o s e W i n d o w B u t t o n '   t i t l e = ' C l o s e ' > s l u i t e n < / a > < / d i v > < / d i v > < 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 o Q u e r y [ 0 ]   +   " '   i d = ' T B _ i f r a m e C o n t e n t '   n a m e = ' T B _ i f r a m e C o n t e n t "   +   M a t h . r o u n d ( M a t h . r a n d o m ( )   *   1 0 0 0 )   +   " '   o n l o a d = ' t b _ s h o w I f r a m e ( ) '   s t y l e = ' w i d t h : "   +   ( a j a x C o n t e n t W   +   2 9 )   +   " p x ; h e i g h t : "   +   ( a j a x C o n t e n t H   +   1 7 )   +   " p x ; '   >   < / i f r a m e > " ) ;  
                                 }   e l s e   { / / i f r a m e   m o d a l  
                                         $ ( " # T B _ o v e r l a y " ) . u n b i n d ( ) ;  
                                         $ ( " # T B _ w i n d o w " ) . a p p e n d ( " < 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 o Q u e r y [ 0 ]   +   " '   i d = ' T B _ i f r a m e C o n t e n t '   n a m e = ' T B _ i f r a m e C o n t e n t "   +   M a t h . r o u n d ( M a t h . r a n d o m ( )   *   1 0 0 0 )   +   " '   o n l o a d = ' t b _ s h o w I f r a m e ( ) '   s t y l e = ' w i d t h : "   +   ( a j a x C o n t e n t W   +   2 9 )   +   " p x ; h e i g h t : "   +   ( a j a x C o n t e n t H   +   1 7 )   +   " p x ; ' >   < / i f r a m e > " ) ;  
                                 }  
                         }   e l s e   { / /   n o t   a n   i f r a m e ,   a j a x  
                                 i f   ( $ ( " # T B _ w i n d o w " ) . c s s ( " d i s p l a y " )   ! =   " b l o c k " )   {  
                                         i f   ( p a r a m s [ ' m o d a l ' ]   ! =   " t r u e " )   { / / a j a x   n o   m o d a l  
                                                 $ ( " # T B _ w i n d o w " ) . a p p e n d ( " < d i v   i d = ' T B _ t i t l e ' > < d i v   i d = ' T B _ a j a x W i n d o w T i t l e ' > "   +   c a p t i o n   +   " < / d i v > < d i v   i d = ' T B _ c l o s e A j a x W i n d o w ' > < a   h r e f = ' # '   i d = ' T B _ c l o s e W i n d o w B u t t o n ' > s l u i t e n < / a > < / d i v > < / d i v > < d i v   i d = ' T B _ a j a x C o n t e n t '   s t y l e = ' w i d t h : "   +   a j a x C o n t e n t W   +   " p x ; h e i g h t : "   +   a j a x C o n t e n t H   +   " p x ' > < / d i v > " ) ;  
                                         }   e l s e   { / / a j a x   m o d a l  
                                                 $ ( " # T B _ o v e r l a y " ) . u n b i n d ( ) ;  
                                                 $ ( " # T B _ w i n d o w " ) . a p p e n d ( " < d i v   i d = ' T B _ a j a x C o n t e n t '   c l a s s = ' T B _ m o d a l '   s t y l e = ' w i d t h : "   +   a j a x C o n t e n t W   +   " p x ; h e i g h t : "   +   a j a x C o n t e n t H   +   " p x ; ' > < / d i v > " ) ;  
                                         }  
                                 }   e l s e   { / / t h i s   m e a n s   t h e   w i n d o w   i s   a l r e a d y   u p ,   w e   a r e   j u s t   l o a d i n g   n e w   c o n t e n t   v i a   a j a x  
                                         $ ( " # T B _ a j a x C o n t e n t " ) [ 0 ] . s t y l e . w i d t h   =   a j a x C o n t e n t W   +   " p x " ;  
                                         $ ( " # T B _ a j a x C o n t e n t " ) [ 0 ] . s t y l e . h e i g h t   =   a j a x C o n t e n t H   +   " p x " ;  
                                         $ ( " # T B _ a j a x C o n t e n t " ) [ 0 ] . s c r o l l T o p   =   0 ;  
                                         $ ( " # T B _ a j a x W i n d o w T i t l e " ) . h t m l ( c a p t i o n ) ;  
                                 }  
                         }  
  
                         $ ( " # T B _ c l o s e W i n d o w B u t t o n " ) . c l i c k ( t b _ r e m o v e ) ;  
  
                         i f   ( u r l . i n d e x O f ( ' T B _ i n l i n e ' )   ! =   - 1 )   {  
                                 $ ( " # T B _ a j a x C o n t e n t " ) . a p p e n d ( $ ( ' # '   +   p a r a m s [ ' i n l i n e I d ' ] ) . c h i l d r e n ( ) ) ;  
                                 $ ( " # T B _ w i n d o w " ) . u n l o a d ( f u n c t i o n ( )   {  
                                         $ ( ' # '   +   p a r a m s [ ' i n l i n e I d ' ] ) . a p p e n d ( $ ( " # T B _ a j a x C o n t e n t " ) . c h i l d r e n ( ) ) ;   / /   m o v e   e l e m e n t s   b a c k   w h e n   y o u ' r e   f i n i s h e d  
                                 } ) ;  
                                 t b _ p o s i t i o n ( ) ;  
                                 $ ( " # T B _ l o a d " ) . r e m o v e ( ) ;  
                                 $ ( " # T B _ w i n d o w " ) . c s s ( {   d i s p l a y :   " b l o c k "   } ) ;  
                         }   e l s e   i f   ( u r l . i n d e x O f ( ' T B _ i f r a m e ' )   ! =   - 1 )   {  
                                 t b _ p o s i t i o n ( ) ;  
                                 i f   ( $ . b r o w s e r . s a f a r i )   { / / s a f a r i   n e e d s   h e l p   b e c a u s e   i t   w i l l   n o t   f i r e   i f r a m e   o n l o a d  
                                         $ ( " # T B _ l o a d " ) . r e m o v e ( ) ;  
                                         $ ( " # T B _ w i n d o w " ) . c s s ( {   d i s p l a y :   " b l o c k "   } ) ;  
                                 }  
                         }   e l s e   {  
                                 $ ( " # T B _ a j a x C o n t e n t " ) . l o a d ( u r l   + =   " & r a n d o m = "   +   ( n e w   D a t e ( ) . g e t T i m e ( ) ) ,   f u n c t i o n ( )   { / / t o   d o   a   p o s t   c h a n g e   t h i s   l o a d   m e t h o d  
                                         t b _ p o s i t i o n ( ) ;  
                                         $ ( " # T B _ l o a d " ) . r e m o v e ( ) ;  
                                         t b _ i n i t ( " # T B _ a j a x C o n t e n t   a . t h i c k b o x " ) ;  
                                         $ ( " # T B _ w i n d o w " ) . c s s ( {   d i s p l a y :   " b l o c k "   } ) ;  
                                 } ) ;  
                         }  
  
                 }  
  
                 i f   ( ! p a r a m s [ ' m o d a l ' ] )   {  
                         d o c u m e n t . o n k e y u p   =   f u n c t i o n ( e )   {  
                                 i f   ( e   = =   n u l l )   {   / /   i e  
                                         k e y c o d e   =   e v e n t . k e y C o d e ;  
                                 }   e l s e   {   / /   m o z i l l a  
                                         k e y c o d e   =   e . w h i c h ;  
                                 }  
                                 i f   ( k e y c o d e   = =   2 7 )   {   / /   c l o s e  
                                         t b _ r e m o v e ( ) ;  
                                 }  
                         } ;  
                 }  
  
         }   c a t c h   ( e )   {  
                 / / n o t h i n g   h e r e  
         }  
 }  
  
 / / h e l p e r   f u n c t i o n s   b e l o w  
 f u n c t i o n   t b _ s h o w I f r a m e ( )   {  
         $ ( " # T B _ l o a d " ) . r e m o v e ( ) ;  
         $ ( " # T B _ w i n d o w " ) . c s s ( {   d i s p l a y :   " b l o c k "   } ) ;  
 }  
  
 f u n c t i o n   t b _ r e m o v e ( )   {  
         $ ( " # T B _ i m a g e O f f " ) . u n b i n d ( " c l i c k " ) ;  
         $ ( " # T B _ c l o s e W i n d o w B u t t o n " ) . u n b i n d ( " c l i c k " ) ;  
         $ ( " # T B _ w i n d o w " ) . f a d e O u t ( " f a s t " ,   f u n c t i o n ( )   {   $ ( ' # T B _ w i n d o w , # T B _ o v e r l a y , # T B _ H i d e S e l e c t ' ) . t r i g g e r ( " u n l o a d " ) . u n b i n d ( ) . r e m o v e ( ) ;   } ) ;  
         $ ( " # T B _ l o a d " ) . r e m o v e ( ) ;  
         i f   ( t y p e o f   d o c u m e n t . b o d y . s t y l e . m a x H e i g h t   = =   " u n d e f i n e d " )   { / / i f   I E   6  
                 $ ( " b o d y " ,   " h t m l " ) . c s s ( {   h e i g h t :   " a u t o " ,   w i d t h :   " a u t o "   } ) ;  
                 $ ( " h t m l " ) . c s s ( " o v e r f l o w " ,   " " ) ;  
         }  
         d o c u m e n t . o n k e y d o w n   =   " " ;  
         d o c u m e n t . o n k e y u p   =   " " ;  
  
         r e t u r n   f a l s e ;  
 }  
  
 f u n c t i o n   s h o p f u r t h e r ( )   {  
         v a r   l o c   =   p a r e n t . w i n d o w . l o c a t i o n ;  
         p a r e n t . w i n d o w . l o c a t i o n   =   l o c ;  
 }  
  
 f u n c t i o n   t b _ p o s i t i o n ( )   {  
         $ ( " # T B _ w i n d o w " ) . c s s ( {   m a r g i n L e f t :   ' - '   +   p a r s e I n t ( ( T B _ W I D T H   /   2 ) ,   1 0 )   +   ' p x ' ,   w i d t h :   T B _ W I D T H   +   ' p x '   } ) ;  
         i f   ( ! ( j Q u e r y . b r o w s e r . m s i e   & &   j Q u e r y . b r o w s e r . v e r s i o n   <   7 ) )   {   / /   t a k e   a w a y   I E 6  
                 $ ( " # T B _ w i n d o w " ) . c s s ( {   m a r g i n T o p :   ' - '   +   p a r s e I n t ( ( T B _ H E I G H T   /   2 ) ,   1 0 )   +   ' p x '   } ) ;  
         }  
 }  
  
 f u n c t i o n   t b _ p a r s e Q u e r y ( q u e r y )   {  
         v a r   P a r a m s   =   { } ;  
         i f   ( ! q u e r y )   {   r e t u r n   P a r a m s ;   }   / /   r e t u r n   e m p t y   o b j e c t  
         v a r   P a i r s   =   q u e r y . s p l i t ( / [ ; & ] / ) ;  
         f o r   ( v a r   i   =   0 ;   i   <   P a i r s . l e n g t h ;   i + + )   {  
                 v a r   K e y V a l   =   P a i r s [ i ] . s p l i t ( ' = ' ) ;  
                 i f   ( ! K e y V a l   | |   K e y V a l . l e n g t h   ! =   2 )   {   c o n t i n u e ;   }  
                 v a r   k e y   =   u n e s c a p e ( K e y V a l [ 0 ] ) ;  
                 v a r   v a l   =   u n e s c a p e ( K e y V a l [ 1 ] ) ;  
                 v a l   =   v a l . r e p l a c e ( / \ + / g ,   '   ' ) ;  
                 P a r a m s [ k e y ]   =   v a l ;  
         }  
         r e t u r n   P a r a m s ;  
 }  
  
 f u n c t i o n   t b _ g e t P a g e S i z e ( )   {  
         v a r   d e   =   d o c u m e n t . d o c u m e n t E l e m e n t ;  
         v a r   w   =   w i n d o w . i n n e r W i d t h   | |   s e l f . i n n e r W i d t h   | |   ( d e   & &   d e . c l i e n t W i d t h )   | |   d o c u m e n t . b o d y . c l i e n t W i d t h ;  
         v a r   h   =   w i n d o w . i n n e r H e i g h t   | |   s e l f . i n n e r H e i g h t   | |   ( d e   & &   d e . c l i e n t H e i g h t )   | |   d o c u m e n t . b o d y . c l i e n t H e i g h t ;  
         a r r a y P a g e S i z e   =   [ w ,   h ] ;  
         r e t u r n   a r r a y P a g e S i z e ;  
 }  
  
 f u n c t i o n   t b _ d e t e c t M a c X F F ( )   {  
         v a r   u s e r A g e n t   =   n a v i g a t o r . u s e r A g e n t . t o L o w e r C a s e ( ) ;  
         i f   ( u s e r A g e n t . i n d e x O f ( ' m a c ' )   ! =   - 1   & &   u s e r A g e n t . i n d e x O f ( ' f i r e f o x ' )   ! =   - 1 )   {  
                 r e t u r n   t r u e ;  
         }  
 }  
  
 / /   j q u e r y . i n n e r f a d e . j s  
  
 / /   D a t u m :   2 0 0 8 - 0 2 - 1 4  
 / /   F i r m a :   M e d i e n f r e u n d e   H o f m a n n   &   B a l d e s   G b R  
 / /   A u t h o r :   T o r s t e n   B a l d e s  
 / /   M a i l :   t . b a l d e s @ m e d i e n f r e u n d e . c o m  
 / /   W e b :   h t t p : / / m e d i e n f r e u n d e . c o m  
  
 / /   b a s e d   o n   t h e   w o r k   o f   M a t t   O a k e s   h t t p : / / p o r t f o l i o . g i z o n e . c o . u k / a p p l i c a t i o n s / s l i d e s h o w /  
 / /   a n d   R a l f   S .   E n g e l s c h a l l   h t t p : / / t r a i n o f t h o u g h t s . o r g /  
  
 / /   *  
 / /   *     < u l   i d = " n e w s " >    
 / /   *             < l i > c o n t e n t   1 < / l i >  
 / /   *             < l i > c o n t e n t   2 < / l i >  
 / /   *             < l i > c o n t e n t   3 < / l i >  
 / /   *     < / u l >  
 / /   *      
 / /   *     $ ( ' # n e w s ' ) . i n n e r f a d e ( {    
 / /   * 	     a n i m a t i o n t y p e :   T y p e   o f   a n i m a t i o n   ' f a d e '   o r   ' s l i d e '   ( D e f a u l t :   ' f a d e ' ) ,    
 / /   * 	     s p e e d :   F a d i n g - / S l i d i n g - S p e e d   i n   m i l l i s e c o n d s   o r   k e y w o r d s   ( s l o w ,   n o r m a l   o r   f a s t )   ( D e f a u l t :   ' n o r m a l ' ) ,    
 / /   * 	     t i m e o u t :   T i m e   b e t w e e n   t h e   f a d e s   i n   m i l l i s e c o n d s   ( D e f a u l t :   ' 2 0 0 0 ' ) ,    
 / /   * 	     t y p e :   T y p e   o f   s l i d e s h o w :   ' s e q u e n c e ' ,   ' r a n d o m '   o r   ' r a n d o m _ s t a r t '   ( D e f a u l t :   ' s e q u e n c e ' ) ,    
 / /   *   	 	 c o n t a i n e r h e i g h t :   H e i g h t   o f   t h e   c o n t a i n i n g   e l e m e n t   i n   a n y   c s s - h e i g h t - v a l u e   ( D e f a u l t :   ' a u t o ' ) ,  
 / /   * 	     r u n n i n g c l a s s :   C S S - C l a s s   w h i c h   t h e   c o n t a i n e r   g e t ýÿs   a p p l i e d   ( D e f a u l t :   ' i n n e r f a d e ' ) ,  
 / /   * 	     c h i l d r e n :   o p t i o n a l   c h i l d r e n   s e l e c t o r   ( D e f a u l t :   n u l l )  
 / /   *     } ) ;    
 / /   *  
  
 / /   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   * /  
  
  
 ( f u n c t i o n ( $ )   {  
  
         $ . f n . i n n e r f a d e   =   f u n c t i o n ( o p t i o n s )   {  
                 r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   {  
                         $ . i n n e r f a d e ( t h i s ,   o p t i o n s ) ;  
                 } ) ;  
         } ;  
  
         $ . i n n e r f a d e   =   f u n c t i o n ( c o n t a i n e r ,   o p t i o n s )   {  
                 v a r   s e t t i n g s   =   {  
                         ' a n i m a t i o n t y p e ' :   ' f a d e ' ,  
                         ' s p e e d ' :   ' n o r m a l ' ,  
                         ' t y p e ' :   ' s e q u e n c e ' ,  
                         ' t i m e o u t ' :   2 0 0 0 ,  
                         ' c o n t a i n e r h e i g h t ' :   ' a u t o ' ,  
                         ' r u n n i n g c l a s s ' :   ' i n n e r f a d e ' ,  
                         ' c h i l d r e n ' :   n u l l  
                 } ;  
                 i f   ( o p t i o n s )  
                         $ . e x t e n d ( s e t t i n g s ,   o p t i o n s ) ;  
                 i f   ( s e t t i n g s . c h i l d r e n   = = =   n u l l )  
                         v a r   e l e m e n t s   =   $ ( c o n t a i n e r ) . c h i l d r e n ( ) ;  
                 e l s e  
                         v a r   e l e m e n t s   =   $ ( c o n t a i n e r ) . c h i l d r e n ( s e t t i n g s . c h i l d r e n ) ;  
                 i f   ( e l e m e n t s . l e n g t h   >   1 )   {  
                         $ ( c o n t a i n e r ) . c s s ( ' p o s i t i o n ' ,   ' r e l a t i v e ' ) . c s s ( ' h e i g h t ' ,   s e t t i n g s . c o n t a i n e r h e i g h t ) . a d d C l a s s ( s e t t i n g s . r u n n i n g c l a s s ) ;  
                         f o r   ( v a r   i   =   0 ;   i   <   e l e m e n t s . l e n g t h ;   i + + )   {  
                                 $ ( e l e m e n t s [ i ] ) . c s s ( ' z - i n d e x ' ,   S t r i n g ( e l e m e n t s . l e n g t h   -   i ) ) . c s s ( ' p o s i t i o n ' ,   ' a b s o l u t e ' ) . h i d e ( ) ;  
                         } ;  
                         i f   ( s e t t i n g s . t y p e   = =   " s e q u e n c e " )   {  
                                 s e t T i m e o u t ( f u n c t i o n ( )   {  
                                         $ . i n n e r f a d e . n e x t ( e l e m e n t s ,   s e t t i n g s ,   1 ,   0 ) ;  
                                 } ,   s e t t i n g s . t i m e o u t ) ;  
                                 $ ( e l e m e n t s [ 0 ] ) . s h o w ( ) ;  
                         }   e l s e   i f   ( s e t t i n g s . t y p e   = =   " r a n d o m " )   {  
                                 v a r   l a s t   =   M a t h . f l o o r ( M a t h . r a n d o m ( )   *   ( e l e m e n t s . l e n g t h ) ) ;  
                                 s e t T i m e o u t ( f u n c t i o n ( )   {  
                                         d o   {  
                                                 c u r r e n t   =   M a t h . f l o o r ( M a t h . r a n d o m ( )   *   ( e l e m e n t s . l e n g t h ) ) ;  
                                         }   w h i l e   ( l a s t   = =   c u r r e n t ) ;  
                                         $ . i n n e r f a d e . n e x t ( e l e m e n t s ,   s e t t i n g s ,   c u r r e n t ,   l a s t ) ;  
                                 } ,   s e t t i n g s . t i m e o u t ) ;  
                                 $ ( e l e m e n t s [ l a s t ] ) . s h o w ( ) ;  
                         }   e l s e   i f   ( s e t t i n g s . t y p e   = =   ' r a n d o m _ s t a r t ' )   {  
                                 s e t t i n g s . t y p e   =   ' s e q u e n c e ' ;  
                                 v a r   c u r r e n t   =   M a t h . f l o o r ( M a t h . r a n d o m ( )   *   ( e l e m e n t s . l e n g t h ) ) ;  
                                 s e t T i m e o u t ( f u n c t i o n ( )   {  
                                         $ . i n n e r f a d e . n e x t ( e l e m e n t s ,   s e t t i n g s ,   ( c u r r e n t   +   1 )   %   e l e m e n t s . l e n g t h ,   c u r r e n t ) ;  
                                 } ,   s e t t i n g s . t i m e o u t ) ;  
                                 $ ( e l e m e n t s [ c u r r e n t ] ) . s h o w ( ) ;  
                         }   e l s e   {  
                                 a l e r t ( ' I n n e r f a d e - T y p e   m u s t   e i t h e r   b e   \ ' s e q u e n c e \ ' ,   \ ' r a n d o m \ '   o r   \ ' r a n d o m _ s t a r t \ ' ' ) ;  
                         }  
                 }  
         } ;  
  
         $ . i n n e r f a d e . n e x t   =   f u n c t i o n ( e l e m e n t s ,   s e t t i n g s ,   c u r r e n t ,   l a s t )   {  
                 i f   ( s e t t i n g s . a n i m a t i o n t y p e   = =   ' s l i d e ' )   {  
                         $ ( e l e m e n t s [ l a s t ] ) . s l i d e U p ( s e t t i n g s . s p e e d ) ;  
                         $ ( e l e m e n t s [ c u r r e n t ] ) . s l i d e D o w n ( s e t t i n g s . s p e e d ) ;  
                 }   e l s e   i f   ( s e t t i n g s . a n i m a t i o n t y p e   = =   ' f a d e ' )   {  
                         $ ( e l e m e n t s [ l a s t ] ) . f a d e O u t ( s e t t i n g s . s p e e d ) ;  
                         $ ( e l e m e n t s [ c u r r e n t ] ) . f a d e I n ( s e t t i n g s . s p e e d ,   f u n c t i o n ( )   {  
                                 r e m o v e F i l t e r ( $ ( t h i s ) [ 0 ] ) ;  
                         } ) ;  
                 }   e l s e  
                         a l e r t ( ' I n n e r f a d e - a n i m a t i o n t y p e   m u s t   e i t h e r   b e   \ ' s l i d e \ '   o r   \ ' f a d e \ ' ' ) ;  
                 i f   ( s e t t i n g s . t y p e   = =   " s e q u e n c e " )   {  
                         i f   ( ( c u r r e n t   +   1 )   <   e l e m e n t s . l e n g t h )   {  
                                 c u r r e n t   =   c u r r e n t   +   1 ;  
                                 l a s t   =   c u r r e n t   -   1 ;  
                         }   e l s e   {  
                                 c u r r e n t   =   0 ;  
                                 l a s t   =   e l e m e n t s . l e n g t h   -   1 ;  
                         }  
                 }   e l s e   i f   ( s e t t i n g s . t y p e   = =   " r a n d o m " )   {  
                         l a s t   =   c u r r e n t ;  
                         w h i l e   ( c u r r e n t   = =   l a s t )  
                                 c u r r e n t   =   M a t h . f l o o r ( M a t h . r a n d o m ( )   *   e l e m e n t s . l e n g t h ) ;  
                 }   e l s e  
                         a l e r t ( ' I n n e r f a d e - T y p e   m u s t   e i t h e r   b e   \ ' s e q u e n c e \ ' ,   \ ' r a n d o m \ '   o r   \ ' r a n d o m _ s t a r t \ ' ' ) ;  
                 s e t T i m e o u t ( ( f u n c t i o n ( )   {  
                         $ . i n n e r f a d e . n e x t ( e l e m e n t s ,   s e t t i n g s ,   c u r r e n t ,   l a s t ) ;  
                 } ) ,   s e t t i n g s . t i m e o u t ) ;  
         } ;  
  
 } ) ( j Q u e r y ) ;  
  
 / /   * * * *   r e m o v e   O p a c i t y - F i l t e r   i n   i e   * * * *  
 f u n c t i o n   r e m o v e F i l t e r ( e l e m e n t )   {  
         i f   ( e l e m e n t . s t y l e . r e m o v e A t t r i b u t e )   {  
                 e l e m e n t . 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 ' ) ;  
         }  
 }  
  
 / /   T o o l t i p  
  
 ( f u n c t i o n ( $ )   {  
         $ . f n . e x t e n d ( {  
                 T o o l t i p :   f u n c t i o n ( 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 ( )   {  
  
                                 $ ( t h i s ) . c s s ( " c u r s o r " ,   " p o i n t e r " ) ;  
  
                                 $ ( t h i s ) . h o v e r ( f u n c t i o n ( )   {  
  
                                         / /   R e m o v e   t h e   t i p   i f   p r e s e n t  
                                         i f   ( $ ( t h i s ) . f i n d ( " . B a l l o o n " ) )   {  
                                                 $ ( t h i s ) . f i n d ( " . B a l l o o n " ) . r e m o v e ( ) ;  
                                         }  
  
                                         / /   B u i l d   t e   t i p  
                                         v a r   T i p   =   " < d i v   c l a s s = ' B a l l o o n ' > " ;  
                                         T i p   + =   " < d i v   c l a s s = ' T o p ' > < / d i v > " ;  
                                         T i p   + =   " < d i v   c l a s s = ' M a i n A r e a ' > " ;  
                                         T i p   + =   " < d i v   c l a s s = ' L e f t S i d e ' > < / d i v > " ;  
                                         T i p   + =   " < d i v   c l a s s = ' "   +   S e t t i n g s . W r a p p e r   +   " ' > " ;  
                                         T i p   + =   $ ( t h i s ) . a t t r ( " t i t l e " ) ;  
                                         T i p   + =   " < a   h r e f = ' "   +   $ ( t h i s ) . a t t r ( " h r e f " )   +   " '   t i t l e = ' "   +   $ ( t h i s ) . a t t r ( " h r e f " )   +   " ' > "   +   S e t t i n g s . L i n k T e x t   +   " < / a > " ;  
                                         T i p   + =   " < / d i v > " ;  
                                         T i p   + =   " < d i v   c l a s s = ' R i g h t S i d e ' > < / d i v > " ;  
                                         T i p   + =   " < / d i v > " ;  
                                         T i p   + =   " < d i v   c l a s s = ' B o t t o m ' > < / d i v > " ;  
                                         T i p   + =   " < / d i v > " ;  
  
                                         / /   A p p e n d   t o   e l e m e n t  
                                         $ ( t h i s ) . a p p e n d ( T i p ) ;  
  
                                         / /   R e s e t / s e t   s o m e   c s s   p r o p e r t i e s  
                                         $ ( t h i s ) . f i n d ( " . "   +   S e t t i n g s . W r a p p e r ) . c s s ( " l i n e - h e i g h t " ,   S e t t i n g s . L i n e H e i g h t   +   " p x " ) ;  
                                         $ ( t h i s ) . c s s ( " z - i n d e x " ,   " 9 9 9 9 " ) ;  
  
                                         / /   P u s h   u p   t i p    
                                         v a r   H e i g h t   =   $ ( t h i s ) . f i n d ( " . T i p T e x t " ) . h e i g h t ( ) ;  
  
                                         $ ( t h i s ) . f i n d ( " . L e f t S i d e " ) . h e i g h t ( H e i g h t ) ;  
                                         $ ( t h i s ) . f i n d ( " . R i g h t S i d e " ) . h e i g h t ( H e i g h t ) ;  
  
                                         v a r   T o p M a r g i n   =   $ ( t h i s ) . f i n d ( " . B a l l o o n " ) . c s s ( " t o p " ) . r e p l a c e ( " p x " ,   " " ) ;  
                                         $ ( t h i s ) . f i n d ( " . B a l l o o n " ) . c s s ( " t o p " ,   p a r s e I n t ( T o p M a r g i n )   -   H e i g h t ) ;  
  
                                         / /   S h o w   t i p 	 	 	 	 	 	 	 	 	 	 	 	  
                                         $ ( t h i s ) . p n g F i x ( ) ;  
                                         i f   ( $ . b r o w s e r . m s i e )   {  
                                                 $ ( t h i s ) . f i n d ( " . B a l l o o n " ) . s h o w ( ) ;  
                                         }  
                                         e l s e   {  
                                                 $ ( t h i s ) . f i n d ( " . B a l l o o n " ) . h i d e ( ) . f a d e I n ( S e t t i n g s . S p e e d ) ;  
                                         }  
  
                                 } ,   f u n c t i o n ( )   {  
                                         / /   H i d e   t i p  
                                         i f   ( $ . b r o w s e r . m s i e )   {  
                                                 $ ( t h i s ) . f i n d ( " . B a l l o o n " ) . h i d e ( ) ;  
                                         }  
                                         e l s e   {  
                                                 $ ( t h i s ) . f i n d ( " . B a l l o o n " ) . f a d e O u t ( S e t t i n g s . S p e e d ) ;  
                                         }  
                                 } ) ;  
                         } ) ;  
                 }  
         } ) ;  
 } ) ( j Q u e r y ) ;  
  
 / /   A j a x   f o r m  
  
 / *  
 *   P l u g i n :   A j a x   f o r m   ( v 1 . 0 )  
 *   A u t h o r :   R i k   V e r b e e k  
 *   L a s t   c h a n g e   d a t e :   1 8 / 0 9 / 2 0 0 9    
 * /  
  
 ( f u n c t i o n ( $ )   {  
         $ . f n . e x t e n d ( {  
                 A j a x F o r m :   f u n c t i o n ( S e t t i n g s )   {   / / T o D o ;   A p p l y i n g   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 ( )   {  
                                 / /   G e t   s e t t i n g s  
                                 v a r   F o r m T i t l e   =   $ ( t h i s ) . a t t r ( " t i t l e " ) ;  
                                 v a r   F o r m A c t i o n   =   S e t t i n g s . A c t i o n ;  
                                 v a r   M a i l T o   =   S e t t i n g s . T o ;  
                                 v a r   M a i l F r o m   =   S e t t i n g s . F r o m ;  
                                 v a r   M e s s a g e   =   S e t t i n g s . M e s s a g e ;  
                                 v a r   F a l s e F r o m H E X   =   S e t t i n g s . F a l s e F r o m H E X ;  
                                 v a r   F a l s e T o H E X   =   S e t t i n g s . F a l s e T o H E X ;  
                                 v a r   T r u e H E X   =   S e t t i n g s . T r u e H E X ;  
                                 v a r   C o n v e r s i o n I D   =   S e t t i n g s . C o n v e r s i o n I D ;  
                                 v a r   C o n v e r s i o n L a b e l   =   S e t t i n g s . C o n v e r s i o n L a b e l ;  
                                 v a r   F a l s e T e x t   =   S e t t i n g s . F a l s e T e x t ;  
  
                                 / /   S e t   G o o g l e   c o n v e r s i o n   s t u f f  
                                 v a r   g o o g l e _ c o n v e r s i o n _ i d   =   C o n v e r s i o n I D ;  
                                 v a r   g o o g l e _ c o n v e r s i o n _ l a n g u a g e   =   " n l " ;  
                                 v a r   g o o g l e _ c o n v e r s i o n _ f o r m a t   =   " 3 " ;  
                                 v a r   g o o g l e _ c o n v e r s i o n _ c o l o r   =   " f f f f f f " ;  
                                 v a r   g o o g l e _ c o n v e r s i o n _ l a b e l   =   C o n v e r s i o n L a b e l ;  
  
                                 / /   S e t   s o m e   v a r s  
                                 v a r   F o r m   =   $ ( t h i s ) ;  
                                 v a r   H t m l   =   F o r m . h t m l ( ) ;  
                                 v a r   O b j e c t s   =   n e w   A r r a y ( ) ;  
                                 v a r   i   =   0 ;  
                                 v a r   U s e r E m a i l ;  
  
                                 / /   C r e a t e   t h e   l o a d i n g   a n i m a t i o n  
                                 v a r   L o a d   =   " < d i v   c l a s s = ' A j a x L o a d e r ' > " ;  
                                 L o a d   + =   " < d i v   c l a s s = ' L o a d e r I m a g e ' > < / d i v > " ;  
                                 L o a d   + =   " < / d i v > " ;  
  
                                 $ ( F o r m ) . c h i l d r e n ( ) . f i n d ( " : i n p u t " ,   " : s e l e c t " ,   " : t e x t a r e a " ) . e a c h ( f u n c t i o n ( )   {  
                                         $ ( t h i s ) . c l i c k ( f u n c t i o n ( )   {  
                                                 i f   ( $ ( t h i s ) . v a l ( )   = =   F a l s e T e x t )   {  
                                                         $ ( t h i s ) . v a l ( " " ) ;  
                                                 }  
                                         } ) ;  
                                 } ) ;  
  
                                 $ ( t h i s ) . f i n d ( " . B u t t o n ,   . F o r m B u t t o n " ) . c l i c k ( f u n c t i o n ( )   {  
                                         / /   I n i t i a l i s i z e   s o m e   v a r s  
                                         v a r   V a l i d   =   t r u e ;  
                                         v a r   N a m e A t t r   =   n e w   A r r a y ( ) ;  
  
                                         / /   L o o p   t r o u g h   e l e m e n t s  
                                         $ ( F o r m ) . c h i l d r e n ( ) . f i n d ( " : i n p u t " ,   " : s e l e c t " ,   " : t e x t a r e a " ) . e a c h ( f u n c t i o n ( )   {  
  
                                                 / /   C h e c k   i f   t h e   e l e m e n t   w i t h   t h i s   n a m e   i s   a l r e a d y   p r o c e s s e d  
                                                 i f   ( $ . i n A r r a y ( $ ( t h i s ) . a t t r ( " n a m e " ) ,   N a m e A t t r )   <   0 )   {  
                                                         / /   G e t   v a l u e s   a c c o r d i n g   t o   t y p e  
                                                         s w i t c h   ( $ ( t h i s ) . a t t r ( " t y p e " ) )   {  
                                                                 c a s e   " r a d i o " :  
                                                                         {  
                                                                                 v a r   V a l u e   =   $ ( " i n p u t : r a d i o [ n a m e = "   +   $ ( t h i s ) . a t t r ( " n a m e " )   +   " ] : c h e c k e d " ) . v a l ( ) ;  
                                                                                 b r e a k ;  
                                                                         }  
                                                                 c a s e   " c h e c k b o x " :  
                                                                         {  
                                                                                 v a r   V a l u e   =   $ ( " i n p u t : c h e c k b o x [ n a m e = "   +   $ ( t h i s ) . a t t r ( " n a m e " )   +   " ] : c h e c k e d " ) . v a l ( ) ;  
                                                                                 b r e a k ;  
                                                                         }  
                                                                 c a s e   " t e x t " :  
                                                                         {  
                                                                                 v a r   V a l u e   =   $ ( t h i s ) . v a l ( ) ;  
                                                                                 b r e a k ;  
                                                                         }  
                                                         }  
  
                                                         / /   G e t   v a l u e s   a c c o r d i n g   t o   e l e m e n t  
                                                         i f   ( $ ( t h i s ) . i s ( " s e l e c t : " ) )   {  
                                                                 v a r   V a l u e   =   $ ( " s e l e c t : [ n a m e = "   +   $ ( t h i s ) . a t t r ( " n a m e " )   +   " ] o p t i o n : s e l e c t e d " ) . v a l ( ) ;  
                                                         }  
  
                                                         i f   ( $ ( t h i s ) . i s ( " t e x t a r e a : " ) )   {  
                                                                 v a r   V a l u e   =   $ ( t h i s ) . v a l ( ) ;  
                                                         }  
  
                                                         / /   C h e c k   i f   e l e m e n t   i s   r e q u i r e d   ( c l a s s = " R e q u i r e d " )  
                                                         i f   ( $ ( t h i s ) . i s ( " . R e q u i r e d " ) )   {  
                                                                 i f   ( ! V a l u e   | |   V a l u e   = =   F a l s e T e x t )   {  
                                                                         V a l i d   =   f a l s e ;  
                                                                 }  
  
                                                                 / /   P h o n e   s p e c i f i c   v a l i d a t i o n  
                                                                 i f   ( $ ( t h i s ) . i s ( " . P h o n e " ) )   {  
                                                                         V a l i d   =   f a l s e ;  
                                                                         i f   ( $ ( t h i s ) . v a l ( ) . l e n g t h   >   9   & &   $ ( t h i s ) . v a l ( ) . l e n g t h   <   1 5 )   {  
                                                                                 v a r   R e g e x   =   n e w   R e g E x p ( / ^ [ 0 - 9 ] + $ / ) ;  
                                                                                 i f   ( R e g e x . e x e c ( V a l u e )   ! =   n u l l )   {  
                                                                                         V a l i d   =   t r u e ;  
                                                                                 }  
                                                                         }  
                                                                 }  
  
                                                                 / /   E m a i l   s p e c i f i c   v a l i d a t i o n  
                                                                 i f   ( $ ( t h i s ) . i s ( " . E m a i l " ) )   {  
                                                                         v a r   R e g e x   =   n e w   R e g E x p ( / \ w + @ [ a - z A - Z 0 - 9 _ ] + ? \ . [ a - z A - Z ] / ) ;  
                                                                         i f   ( R e g e x . e x e c ( V a l u e )   = =   n u l l )   {  
                                                                                 V a l i d   =   f a l s e ;  
                                                                         }  
                                                                         U s e r E m a i l   =   $ ( t h i s ) . v a l ( ) ;  
                                                                 }  
  
                                                                 / /   V i s u a l i z e   i f   e n t r y   i s   n o t   v a l i d  
                                                                 i f   ( ! V a l i d )   {  
                                                                         s w i t c h   ( $ ( t h i s ) . a t t r ( " t y p e " ) )   {  
                                                                                 d e f a u l t :  
                                                                                         {  
                                                                                                 $ ( t h i s ) . a n i m a t e ( {   b a c k g r o u n d C o l o r :   F a l s e F r o m H E X   } ,   2 0 0 ) . a n i m a t e ( {   b a c k g r o u n d C o l o r :   F a l s e T o H E X   } ,   3 0 0 ) . c s s ( " c o l o r " ,   " # f f f " ) ;  
                                                                                                 $ ( t h i s ) . v a l ( F a l s e T e x t ) ;  
                                                                                                 b r e a k ;  
                                                                                         }  
                                                                                 c a s e   " r a d i o " :  
                                                                                 c a s e   " c h e c k b o x " :  
                                                                                         {  
                                                                                                 b r e a k ;  
                                                                                         }  
                                                                         }  
                                                                         r e t u r n   f a l s e ;  
                                                                 }  
                                                         }  
  
                                                         / /   V i s u a l i z e   i f   e n t r y   i s   v a l i d  
                                                         s w i t c h   ( $ ( t h i s ) . a t t r ( " t y p e " ) )   {  
                                                                 d e f a u l t :  
                                                                         {  
                                                                                 $ ( t h i s ) . a n i m a t e ( {   b a c k g r o u n d C o l o r :   T r u e H E X   } ,   1 0 0 0 ) . a n i m a t e ( {   b a c k g r o u n d C o l o r :   " # f f f f f f "   } ,   3 0 0 ) . c s s ( " c o l o r " ,   " # 0 0 0 " ) ;  
                                                                                 b r e a k ;  
                                                                         }  
                                                                 c a s e   " r a d i o " :  
                                                                 c a s e   " c h e c k b o x " :  
                                                                         {  
                                                                                 b r e a k ;  
                                                                         }  
                                                         }  
  
                                                         / /   B u i l d   l a b e l   +   v a l u e   p a i r                                                          
                                                         O b j e c t   =   $ ( t h i s ) . a t t r ( " t i t l e " )   +   " :   "   +   V a l u e ;  
  
                                                         / /   A d d   t h e   n a m e   a t t r i b u t e   t o   t h e   N a m e A t t r   a r r a y                                                
                                                         N a m e A t t r [ i ]   =   $ ( t h i s ) . a t t r ( " n a m e " ) ;  
  
                                                         / /   A d d   p a i r   t o   t h e   O b j e c t s   a r r a y  
                                                         i f   ( $ . i n A r r a y ( O b j e c t ,   O b j e c t s )   <   0 )   {  
                                                                 O b j e c t s [ i ]   =   O b j e c t ;  
                                                                 i + + ;  
                                                         }  
                                                 }  
                                         } )  
  
                                         i f   ( V a l i d )   {  
                                                 / /   H i d e   f o r m   a n d   b u i l d   l o a d i n g   a n i m a t i o n 	 	 	                          
                                                 F o r m . f i n d ( " * " ) . h i d e ( ) ;  
                                                 F o r m . a p p e n d ( L o a d ) ;  
  
                                                 / /   C l e a r   f o r m          
                                                 $ ( F o r m ) . f i n d ( " : i n p u t " ,   " : s e l e c t " ,   " : t e x t a r e a " ) . e a c h ( f u n c t i o n ( )   {  
                                                         v a r   T y p e   =   $ ( t h i s ) . a t t r ( " t y p e " ) ;  
                                                         s w i t c h   ( T y p e )   {  
                                                                 d e f a u l t :  
                                                                 c a s e   " t e x t " :  
                                                                         {  
                                                                                 $ ( t h i s ) . v a l ( " " ) ;  
                                                                                 b r e a k ;  
                                                                         }  
                                                                 c a s e   " r a d i o " :  
                                                                 c a s e   " c h e c k b o x " :  
                                                                         {  
                                                                                 t h i s . c h e c k e d   =   f a l s e ;  
                                                                                 b r e a k ;  
                                                                         }  
                                                         }  
                                                 } )  
  
                                                 / /   S e n d   A j a x   r e q u e s t  
                                                 $ ( " . L o a d e r " ) . l o a d ( " / A j a x / F o r m C o n t r o l . a s p x " ,   {   a c t i o n :   F o r m A c t i o n ,   f r o m :   U s e r E m a i l ,   t o :   M a i l T o ,   U s e r E m a i l :   U s e r E m a i l ,   t i t l e :   F o r m T i t l e ,   " o b j e c t s [ ] " :   [ O b j e c t s ]   } ,   f u n c t i o n ( )   {  
                                                         / /   D e l e t e   l o a d i n g   a n i m a t i o n   a n d   s h o w   f o r m  
                                                         $ ( " . A j a x L o a d e r " ) . f a d e O u t ( 6 0 0 ,   f u n c t i o n ( )   {  
  
                                                                 v a r   L o a d e r B o d y   =   " < p > "   +   M e s s a g e   +   " < / p > " ;  
                                                                 / / L o a d e r B o d y   + =   " < s c r i p t   t y p e = ' t e x t / j a v a s c r i p t '   s r c = ' h t t p : / / w w w . g o o g l e a d s e r v i c e s . c o m / p a g e a d / c o n v e r s i o n . j s ' > < / s c r i p t > " ;  
                                                                 / / L o a d e r B o d y   + =   " < n o s c r i p t > < d i v   s t y l e = ' d i s p l a y : i n l i n e ; ' > < i m g   h e i g h t = ' 1 '   w i d t h = ' 1 '   s t y l e = ' b o r d e r - s t y l e : n o n e ; '   a l t = ' '   s r c = ' h t t p : / / w w w . g o o g l e a d s e r v i c e s . c o m / p a g e a d / c o n v e r s i o n / 1 0 7 1 3 5 8 1 3 7 / ? l a b e l = "   +   C o n v e r s i o n L a b e l   +   " & a m p ; g u i d = O N & a m p ; s c r i p t = 0 '   / > < / d i v > < / n o s c r i p t > " ;  
  
                                                                 $ ( t h i s ) . h t m l ( L o a d e r B o d y ) ;  
                                                                 $ ( t h i s ) . f a d e I n ( 1 0 0 ) ;  
  
                                                                 v a r   L o a d e r   =   $ ( t h i s ) ;  
  
                                                                 w i n d o w . s e t T i m e o u t ( f u n c t i o n ( )   {  
                                                                         $ ( L o a d e r ) . r e m o v e ( ) ;  
  
                                                                         $ ( F o r m ) . f i n d ( " * : n o t ( . B a l l o o n ,   # _ _ V I E W S T A T E ) " ) . f a d e I n ( 2 0 0 ) ;  
                                                                 } ,   7 0 0 0 ) ;  
                                                         } ) ;  
                                                 } ) ;  
                                         }  
                                 } ) ;  
                         } ) ;  
                 }  
         } ) ;  
 } ) ( j Q u e r y ) ;  
  
 / /   C o l o r   a n i m a t i o n s  
  
 / *  
 *   j Q u e r y   C o l o r   A n i m a t i o n s  
 *   C o p y r i g h t   2 0 0 7   J o h n   R e s i g  
 *   R e l e a 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 .  
 * /  
  
 ( f u n c t i o n ( j Q u e r y )   {  
  
         / /   W e   o v e r r i d e   t h e   a n i m a t i o n   f o r   a l l   o f   t h e s e   c o l o r   s t y l e s  
         j Q u e r y . e a c h ( [ ' b a c k g r o u n d C o l o r ' ,   ' b o r d e r B o t t o m C o l o r ' ,   ' b o r d e r L e f t C o l o r ' ,   ' b o r d e r R i g h t C o l o r ' ,   ' b o r d e r T o p C o l o r ' ,   ' c o l o r ' ,   ' o u t l i n e C o l o r ' ] ,   f u n c t i o n ( i ,   a t t r )   {  
                 j Q u e r y . f x . s t e p [ a t t r ]   =   f u n c t i o n ( f x )   {  
                         i f   ( f x . s t a t e   = =   0 )   {  
                                 f x . s t a r t   =   g e t C o l o r ( f x . e l e m ,   a t t r ) ;  
                                 f x . e n d   =   g e t R G B ( f x . e n d ) ;  
                         }  
  
                         f x . e l e m . s t y l e [ a t t r ]   =   " r g b ( "   +   [  
 	 	 	 	 M a t h . m a x ( M a t h . m i n ( p a r s e I n t ( ( f x . p o s   *   ( f x . e n d [ 0 ]   -   f x . s t a r t [ 0 ] ) )   +   f x . s t a r t [ 0 ] ) ,   2 5 5 ) ,   0 ) ,  
 	 	 	 	 M a t h . m a x ( M a t h . m i n ( p a r s e I n t ( ( f x . p o s   *   ( f x . e n d [ 1 ]   -   f x . s t a r t [ 1 ] ) )   +   f x . s t a r t [ 1 ] ) ,   2 5 5 ) ,   0 ) ,  
 	 	 	 	 M a t h . m a x ( M a t h . m i n ( p a r s e I n t ( ( f x . p o s   *   ( f x . e n d [ 2 ]   -   f x . s t a r t [ 2 ] ) )   +   f x . s t a r t [ 2 ] ) ,   2 5 5 ) ,   0 )  
 	 	 	 ] . j o i n ( " , " )   +   " ) " ;  
                 }  
         } ) ;  
  
         / /   C o l o r   C o n v e r s i o n   f u n c t i o n s   f r o m   h i g h l i g h t F a d e  
         / /   B y   B l a i r   M i t c h e l m o r e  
         / /   h t t p : / / j q u e r y . o f f p u t . c a / h i g h l i g h t F a d e /  
  
         / /   P a r s e   s t r i n g s   l o o k i n g   f o r   c o l o r   t u p l e s   [ 2 5 5 , 2 5 5 , 2 5 5 ]  
         f u n c t i o n   g e t R G B ( c o l o r )   {  
                 v a r   r e s u l t ;  
  
                 / /   C h e c k   i f   w e ' r e   a l r e a d y   d e a l i n g   w i t h   a n   a r r a y   o f   c o l o r s  
                 i f   ( c o l o r   & &   c o l o r . c o n s t r u c t o r   = =   A r r a y   & &   c o l o r . l e n g t h   = =   3 )  
                         r e t u r n   c o l o r ;  
  
                 / /   L o o k   f o r   r g b ( n u m , n u m , n u m )  
                 i f   ( r e s u l t   =   / r g b \ ( \ s * ( [ 0 - 9 ] { 1 , 3 } ) \ s * , \ s * ( [ 0 - 9 ] { 1 , 3 } ) \ s * , \ s * ( [ 0 - 9 ] { 1 , 3 } ) \ s * \ ) / . e x e c ( c o l o r ) )  
                         r e t u r n   [ p a r s e I n t ( r e s u l t [ 1 ] ) ,   p a r s e I n t ( r e s u l t [ 2 ] ) ,   p a r s e I n t ( r e s u l t [ 3 ] ) ] ;  
  
                 / /   L o o k   f o r   r g b ( n u m % , n u m % , n u m % )  
                 i f   ( r e s u l t   =   / r g b \ ( \ s * ( [ 0 - 9 ] + ( ? : \ . [ 0 - 9 ] + ) ? ) \ % \ s * , \ s * ( [ 0 - 9 ] + ( ? : \ . [ 0 - 9 ] + ) ? ) \ % \ s * , \ s * ( [ 0 - 9 ] + ( ? : \ . [ 0 - 9 ] + ) ? ) \ % \ s * \ ) / . e x e c ( c o l o r ) )  
                         r e t u r n   [ p a r s e F l o a t ( r e s u l t [ 1 ] )   *   2 . 5 5 ,   p a r s e F l o a t ( r e s u l t [ 2 ] )   *   2 . 5 5 ,   p a r s e F l o a t ( r e s u l t [ 3 ] )   *   2 . 5 5 ] ;  
  
                 / /   L o o k   f o r   # a 0 b 1 c 2  
                 i f   ( r e s u l t   =   / # ( [ a - f A - F 0 - 9 ] { 2 } ) ( [ a - f A - F 0 - 9 ] { 2 } ) ( [ a - f A - F 0 - 9 ] { 2 } ) / . e x e c ( c o l o r ) )  
                         r e t u r n   [ p a r s e I n t ( r e s u l t [ 1 ] ,   1 6 ) ,   p a r s e I n t ( r e s u l t [ 2 ] ,   1 6 ) ,   p a r s e I n t ( r e s u l t [ 3 ] ,   1 6 ) ] ;  
  
                 / /   L o o k   f o r   # f f f  
                 i f   ( r e s u l t   =   / # ( [ a - f A - F 0 - 9 ] ) ( [ a - f A - F 0 - 9 ] ) ( [ a - f A - F 0 - 9 ] ) / . e x e c ( c o l o r ) )  
                         r e t u r n   [ p a r s e I n t ( r e s u l t [ 1 ]   +   r e s u l t [ 1 ] ,   1 6 ) ,   p a r s e I n t ( r e s u l t [ 2 ]   +   r e s u l t [ 2 ] ,   1 6 ) ,   p a r s e I n t ( r e s u l t [ 3 ]   +   r e s u l t [ 3 ] ,   1 6 ) ] ;  
  
                 / /   O t h e r w i s e ,   w e ' r e   m o s t   l i k e l y   d e a l i n g   w i t h   a   n a m e d   c o l o r  
                 r e t u r n   c o l o r s [ j Q u e r y . t r i m ( c o l o r ) . t o L o w e r C a s e ( ) ] ;  
         }  
  
         f u n c t i o n   g e t C o l o r ( e l e m ,   a t t r )   {  
                 v a r   c o l o r ;  
  
                 d o   {  
                         c o l o r   =   j Q u e r y . c u r C S S ( e l e m ,   a t t r ) ;  
  
                         / /   K e e p   g o i n g   u n t i l   w e   f i n d   a n   e l e m e n t   t h a t   h a s   c o l o r ,   o r   w e   h i t   t h e   b o d y  
                         i f   ( c o l o r   ! =   ' '   & &   c o l o r   ! =   ' t r a n s p a r e n t '   | |   j Q u e r y . n o d e N a m e ( e l e m ,   " b o d y " ) )  
                                 b r e a k ;  
  
                         a t t r   =   " b a c k g r o u n d C o l o r " ;  
                 }   w h i l e   ( e l e m   =   e l e m . p a r e n t N o d e ) ;  
  
                 r e t u r n   g e t R G B ( c o l o r ) ;  
         } ;  
  
         / /   S o m e   n a m e d   c o l o r s   t o   w o r k   w i t h  
         / /   F r o m   I n t e r f a c e   b y   S t e f a n   P e t r e  
         / /   h t t p : / / i n t e r f a c e . e y e c o n . r o /  
  
         v a r   c o l o r s   =   {  
                 a q u a :   [ 0 ,   2 5 5 ,   2 5 5 ] ,  
                 a z u r e :   [ 2 4 0 ,   2 5 5 ,   2 5 5 ] ,  
                 b e i g e :   [ 2 4 5 ,   2 4 5 ,   2 2 0 ] ,  
                 b l a c k :   [ 0 ,   0 ,   0 ] ,  
                 b l u e :   [ 0 ,   0 ,   2 5 5 ] ,  
                 b r o w n :   [ 1 6 5 ,   4 2 ,   4 2 ] ,  
                 c y a n :   [ 0 ,   2 5 5 ,   2 5 5 ] ,  
                 d a r k b l u e :   [ 0 ,   0 ,   1 3 9 ] ,  
                 d a r k c y a n :   [ 0 ,   1 3 9 ,   1 3 9 ] ,  
                 d a r k g r e y :   [ 1 6 9 ,   1 6 9 ,   1 6 9 ] ,  
                 d a r k g r e e n :   [ 0 ,   1 0 0 ,   0 ] ,  
                 d a r k k h a k i :   [ 1 8 9 ,   1 8 3 ,   1 0 7 ] ,  
                 d a r k m a g e n t a :   [ 1 3 9 ,   0 ,   1 3 9 ] ,  
                 d a r k o l i v e g r e e n :   [ 8 5 ,   1 0 7 ,   4 7 ] ,  
                 d a r k o r a n g e :   [ 2 5 5 ,   1 4 0 ,   0 ] ,  
                 d a r k o r c h i d :   [ 1 5 3 ,   5 0 ,   2 0 4 ] ,  
                 d a r k r e d :   [ 1 3 9 ,   0 ,   0 ] ,  
                 d a r k s a l m o n :   [ 2 3 3 ,   1 5 0 ,   1 2 2 ] ,  
                 d a r k v i o l e t :   [ 1 4 8 ,   0 ,   2 1 1 ] ,  
                 f u c h s i a :   [ 2 5 5 ,   0 ,   2 5 5 ] ,  
                 g o l d :   [ 2 5 5 ,   2 1 5 ,   0 ] ,  
                 g r e e n :   [ 0 ,   1 2 8 ,   0 ] ,  
                 i n d i g o :   [ 7 5 ,   0 ,   1 3 0 ] ,  
                 k h a k i :   [ 2 4 0 ,   2 3 0 ,   1 4 0 ] ,  
                 l i g h t b l u e :   [ 1 7 3 ,   2 1 6 ,   2 3 0 ] ,  
                 l i g h t c y a n :   [ 2 2 4 ,   2 5 5 ,   2 5 5 ] ,  
                 l i g h t g r e e n :   [ 1 4 4 ,   2 3 8 ,   1 4 4 ] ,  
                 l i g h t g r e y :   [ 2 1 1 ,   2 1 1 ,   2 1 1 ] ,  
                 l i g h t p i n k :   [ 2 5 5 ,   1 8 2 ,   1 9 3 ] ,  
                 l i g h t y e l l o w :   [ 2 5 5 ,   2 5 5 ,   2 2 4 ] ,  
                 l i m e :   [ 0 ,   2 5 5 ,   0 ] ,  
                 m a g e n t a :   [ 2 5 5 ,   0 ,   2 5 5 ] ,  
                 m a r o o n :   [ 1 2 8 ,   0 ,   0 ] ,  
                 n a v y :   [ 0 ,   0 ,   1 2 8 ] ,  
                 o l i v e :   [ 1 2 8 ,   1 2 8 ,   0 ] ,  
                 o r a n g e :   [ 2 5 5 ,   1 6 5 ,   0 ] ,  
                 p i n k :   [ 2 5 5 ,   1 9 2 ,   2 0 3 ] ,  
                 p u r p l e :   [ 1 2 8 ,   0 ,   1 2 8 ] ,  
                 v i o l e t :   [ 1 2 8 ,   0 ,   1 2 8 ] ,  
                 r e d :   [ 2 5 5 ,   0 ,   0 ] ,  
                 s i l v e r :   [ 1 9 2 ,   1 9 2 ,   1 9 2 ] ,  
                 w h i t e :   [ 2 5 5 ,   2 5 5 ,   2 5 5 ] ,  
                 y e l l o w :   [ 2 5 5 ,   2 5 5 ,   0 ]  
         } ;  
  
 } ) ( j Q u e r y ) ;  
  
 / / a c c o r d i o n  
  
 ( f u n c t i o n ( $ )   {  
         $ . f n . e x t e n d ( {  
                 A c c o r d i o n :   f u n c t i o n ( S e t t i n g s )   {   / / T o D o ;   A p p l y i n g   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 ( )   {  
                                 $ ( t h i s ) . f i n d ( " u l " ) . c h i l d r e n ( " l i " ) . e a c h ( f u n c t i o n ( )   {  
                                         $ ( t h i s ) . f i n d ( " a " ) . h o v e r ( f u n c t i o n ( )   {  
                                                 $ ( t h i s ) . s t o p ( ) ;  
                                                 $ ( t h i s ) . a n i m a t e ( {   w i d t h :   " 1 5 0 p x "   } ,   7 0 0 ) ;  
                                         } ,  
                                         f u n c t i o n ( )   {  
                                                 $ ( t h i s ) . s t o p ( ) ;  
                                                 $ ( t h i s ) . a n i m a t e ( {   w i d t h :   " 1 1 0 p x "   } ,   7 0 0 ) ;  
                                         } )  
                                 } )  
                                 $ ( t h i s ) . m o u s e o u t ( f u n c t i o n ( )   {  
                                         $ ( t h i s ) . s t o p ( ) ;  
                                         $ ( t h i s ) . f i n d ( " u l " ) . c h i l d r e n ( " l i " ) . e a c h ( f u n c t i o n ( )   {  
                                                 $ ( t h i s ) . f i n d ( " a " ) . a n i m a t e ( {   w i d t h :   " 1 0 5 p x "   } ,   2 0 0 ) ;  
                                         } )  
                                 } )  
                         } ) ;  
                 }  
         } ) ;  
 } ) ( j Q u e r y ) ;  
  
 / / A j a x   s l i d e s h o w  
  
 ( f u n c t i o n ( $ )   {  
         $ . f n . e x t e n d ( {  
                 A j a x S l i d e s h o w :   f u n c t i o n ( S e t t i n g s )   {   / / T o D o ;   A p p l y i n g   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 ( )   {  
  
                                 v a r   P r e l o a d e r   =   " < i m g   c l a s s = ' P r e L o a d e r '   s r c = ' / _ i m a g e s / P r e l o a d e r s / s l i d e s h o w . g i f '   a l t = ' L o a d i n g . . . '   / > " ;  
  
                                 v a r   L o a d e r   =   " < d i v   c l a s s = ' A j a x S l i d e s ' > " ;  
                                 L o a d e r   + =   P r e l o a d e r ;  
                                 L o a d e r   + =   " < / d i v > " ;  
  
                                 $ ( t h i s ) . a p p e n d ( L o a d e r ) ;  
  
                                 $ ( " . A j a x S l i d e s " ) . l o a d ( " / A j a x E n g i n e . a s p x " ,   {   a c t i o n :   " S l i d e s h o w " ,   d i r e c t i o n :   " s t a y "   } ,   f u n c t i o n ( )   {  
                                 } ) ;  
  
                                 / / o n   r i g h t   c l i c k  
                                 $ ( t h i s ) . f i n d ( " . R i g h t " ) . c l i c k ( f u n c t i o n ( )   {  
                                         $ ( " . A j a x S l i d e s " ) . h t m l ( P r e l o a d e r ) ;  
                                         $ ( " . A j a x S l i d e s " ) . l o a d ( " / A j a x E n g i n e . a s p x " ,   {   a c t i o n :   " S l i d e s h o w " ,   d i r e c t i o n :   " n e x t "   } ,   f u n c t i o n ( )   {  
                                                 $ ( t h i s ) . f i n d ( " i m g " ) . h i d e ( ) . f a d e I n ( 4 0 0 ) ;  
                                         } ) ;  
                                 } )  
  
                                 / / o n   l e f t   c l i c k  
                                 $ ( t h i s ) . f i n d ( " . L e f t " ) . c l i c k ( f u n c t i o n ( )   {  
                                         $ ( " . A j a x S l i d e s " ) . h t m l ( P r e l o a d e r ) ;  
                                         $ ( " . A j a x S l i d e s " ) . l o a d ( " / A j a x E n g i n e . a s p x " ,   {   a c t i o n :   " S l i d e s h o w " ,   d i r e c t i o n :   " p r e v "   } ,   f u n c t i o n ( )   {  
                                                 $ ( t h i s ) . f i n d ( " i m g " ) . h i d e ( ) . f a d e I n ( 4 0 0 ) ;  
                                         } ) ;  
                                 } )  
                         } ) ;  
                 }  
         } ) ;  
 } ) ( j Q u e r y ) ;  
  
 / / g a l l e r y  
  
 ( f u n c t i o n ( $ )   {  
         $ . f n . e x t e n d ( {  
                 G a l l e r y :   f u n c t i o n ( s e t t i n g s )   {   / / T o D o ;   A p p l y i n g   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 ( )   {  
                                 v a r   l o a d i n g d i v   =   s e t t i n g s . L o a d e r ;  
  
                                 $ ( t h i s ) . f i n d ( " i m g " ) . e a c h ( f u n c t i o n ( )   {  
                                         $ ( t h i s ) . c l i c k ( f u n c t i o n ( )   {  
                                                 $ ( l o a d i n g d i v ) . f i n d ( " i m g " ) . a t t r ( {  
                                                         s r c :   $ ( t h i s ) . a t t r ( " s r c " )  
                                                 } )  
  
                                                 / / p r e p a r e   a n d   s h o w  
                                                 $ ( l o a d i n g d i v ) . f i n d ( " i m g " ) . h i d e ( ) . f a d e I n ( 1 0 0 0 ) ;  
                                         } ) ;  
                                 } ) ;  
                         } ) ;  
                 }  
         } ) ;  
 } ) ( j Q u e r y ) ;  
  
 / / s h o p p i n g c a r t  
  
 ( f u n c t i o n ( $ )   {  
         $ . f n . e x t e n d ( {  
                 S h o p p i n g C a r t :   f u n c t i o n ( S e t t i n g s )   {   / / T o D o ;   A p p l y i n g   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 ( )   {  
                                 v a r   p a r e n t   =   $ ( t h i s ) ;  
                                 v a r   l o a d e r   =   " < d i v   c l a s s = ' A n i m a t i o n ' > < / d i v > " ;  
                                 v a r   e r r o r m e s s a g e   =   " v e r p l i c h t   v e l d " ;  
                                 v a r   n o t s a m e p a s s w o r d m e s s a g e   =   " d e   w a c h t w o o r d e n   k o m e n   n i e t   o v e r e e n " ;  
                                 v a r   n o s a m e p a s s w o r d d i v   =   " < d i v   c l a s s = ' E r r o r N o S a m e P a s s w o r d ' > d e   w a c h t w o o r d e n   d i e n e n   o v e r e e n   t e   k o m e n < / d i v > " ;  
  
                                 / / a d d   s h i p p i n g c o s t s  
                                 / / $ ( p a r e n t ) . f i n d ( " s e l e c t [ n a m e = s h i p m e n t m e t h o d ] " ) . l i v e ( " c h a n g e " ,   f u n c t i o n ( )   {  
                                 / /         v a r   m e t h o d   =   $ ( p a r e n t ) . f i n d ( " s e l e c t [ n a m e = s h i p m e n t m e t h o d ] " ) . a t t r ( " v a l u e " ) ;  
                                 / /          
                                 / /         $ ( p a r e n t ) . a p p e n d ( l o a d e r ) ;  
                                 / /         $ ( p a r e n t ) . l o a d ( " / A j a x / S h o p p i n g C a r t C o n t r o l s . a s p x " ,   {   a c t i o n :   " u p d a t e l i s t " ,   u p d a t e :   " a d d s h i p p i n g " ,   m e t h o d :   m e t h o d   } ) ;  
                                 / / } ) ;  
                                 $ ( p a r e n t ) . f i n d ( " . S e l e c t S h i p m e n t " ) . l i v e ( " c l i c k " ,   f u n c t i o n ( )   {  
                                         v a r   m e t h o d   =   $ ( p a r e n t ) . f i n d ( " s e l e c t [ n a m e = s h i p m e n t m e t h o d ] " ) . a t t r ( " v a l u e " ) ;  
  
                                         $ ( p a r e n t ) . a p p e n d ( l o a d e r ) ;  
                                         $ ( p a r e n t ) . l o a d ( " / A j a x / S h o p p i n g C a r t C o n t r o l s . a s p x " ,   {   a c t i o n :   " u p d a t e l i s t " ,   u p d a t e :   " a d d s h i p p i n g " ,   m e t h o d :   m e t h o d   } ) ;  
                                 } ) ;  
  
                                 / / a d d   i t e m  
                                 $ ( p a r e n t ) . f i n d ( " . P l u s A m o u n t " ) . l i v e ( " c l i c k " ,   f u n c t i o n ( )   {  
                                         v a r   i t e m i d   =   $ ( t h i s ) . a t t r ( " i d " ) ;  
                                         v a r   s h i p m e t h o d   =   $ ( p a r e n t ) . f i n d ( " s e l e c t [ n a m e = s h i p m e n t m e t h o d ] " ) . a t t r ( " v a l u e " ) ;  
  
                                         $ ( p a r e n t ) . a p p e n d ( l o a d e r ) ;  
                                         $ ( p a r e n t ) . l o a d ( " / A j a x / S h o p p i n g C a r t C o n t r o l s . a s p x " ,   {   a c t i o n :   " u p d a t e l i s t " ,   u p d a t e :   " a m o u n t " ,   d i r e c t i o n :   " p l u s " ,   " i d " :   i t e m i d ,   m e t h o d :   s h i p m e t h o d   } ) ;  
                                 } ) ;  
  
                                 / / s u b s t r a c t   i t e m  
                                 $ ( p a r e n t ) . f i n d ( " . M i n u s A m o u n t " ) . l i v e ( " c l i c k " ,   f u n c t i o n ( )   {  
                                         v a r   i t e m i d   =   $ ( t h i s ) . a t t r ( " i d " ) ;  
                                         v a r   s h i p m e t h o d   =   $ ( p a r e n t ) . f i n d ( " s e l e c t [ n a m e = s h i p m e n t m e t h o d ] " ) . a t t r ( " v a l u e " ) ;  
  
                                         $ ( p a r e n t ) . a p p e n d ( l o a d e r ) ;  
                                         $ ( p a r e n t ) . l o a d ( " / A j a x / S h o p p i n g C a r t C o n t r o l s . a s p x " ,   {   a c t i o n :   " u p d a t e l i s t " ,   u p d a t e :   " a m o u n t " ,   d i r e c t i o n :   " m i n u s " ,   " i d " :   i t e m i d ,   m e t h o d :   s h i p m e t h o d   } ) ;  
                                 } ) ;  
  
                                 / / d e l e t e   i t e m  
                                 $ ( p a r e n t ) . f i n d ( " . D e l O r d e r I t e m " ) . l i v e ( " c l i c k " ,   f u n c t i o n ( )   {  
                                         v a r   i t e m i d   =   $ ( t h i s ) . a t t r ( " i d " ) ;  
                                         v a r   s h i p m e t h o d   =   $ ( p a r e n t ) . f i n d ( " s e l e c t [ n a m e = s h i p m e n t m e t h o d ] " ) . a t t r ( " v a l u e " ) ;  
  
                                         i f   ( c o n f i r m ( " W e e t   u   z e k e r   d a t   u   d i t   a r t i k e l   w i l t   v e r w i j d e r e n ? " ) )   {  
                                                 $ ( p a r e n t ) . a p p e n d ( l o a d e r ) ;  
                                                 $ ( p a r e n t ) . l o a d ( " / A j a x / S h o p p i n g C a r t C o n t r o l s . a s p x " ,   {   a c t i o n :   " u p d a t e l i s t " ,   u p d a t e :   " d e l e t e " ,   " i d " :   i t e m i d ,   m e t h o d :   s h i p m e t h o d   } ) ;  
                                         }  
                                 } ) ;  
  
                                 / / l o g i n   /   s i g n u p  
                                 $ ( p a r e n t ) . f i n d ( " i n p u t " ) . l i v e ( " c l i c k " ,   f u n c t i o n ( )   {  
                                         i f   ( $ ( t h i s ) . v a l ( )   = =   e r r o r m e s s a g e )   {  
                                                 $ ( t h i s ) . v a l ( " " ) ;  
                                         }  
                                 } ) ;  
  
                                 $ ( p a r e n t ) . f i n d ( " . L o g i n " ) . l i v e ( " c l i c k " ,   f u n c t i o n ( )   {  
                                         v a r   v a l i d   =   t r u e ;  
  
                                         $ ( p a r e n t ) . f i n d ( " i n p u t " ) . e a c h ( f u n c t i o n ( )   {  
                                                 i f   ( $ ( t h i s ) . v a l ( )   = =   " "   | |   $ ( t h i s ) . v a l ( )   = =   e r r o r m e s s a g e )   {  
                                                         $ ( t h i s ) . a n i m a t e ( {   b a c k g r o u n d C o l o r :   " # c b 0 b 0 b "   } ,   3 0 0 ) . a n i m a t e ( {   b a c k g r o u n d C o l o r :   " # f f f f f f "   } ,   3 0 0 ,   f u n c t i o n ( )   {  
                                                                 $ ( t h i s ) . v a l ( e r r o r m e s s a g e ) ;  
                                                         } ) ;  
  
                                                         v a l i d   =   f a l s e ;  
                                                 }  
                                         } ) ;  
  
                                         i f   ( v a l i d )   {  
                                                 v a r   e m a i l   =   $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = e m a i l ] " ) . v a l ( ) ;  
                                                 v a r   p a s s w o r d   =   $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = p a s s w o r d ] " ) . v a l ( ) ;  
  
                                                 $ ( p a r e n t ) . a p p e n d ( l o a d e r ) ;  
                                                 $ ( p a r e n t ) . l o a d ( " / A j a x / S h o p p i n g C a r t C o n t r o l s . a s p x " ,   {   a c t i o n :   " l o g i n " ,   e m a i l :   e m a i l ,   p a s s w o r d :   p a s s w o r d   } ) ;  
                                         }  
                                 } ) ;  
  
                                 / / s i g n u p  
                                 $ ( p a r e n t ) . f i n d ( " . S i g n U p " ) . l i v e ( " c l i c k " ,   f u n c t i o n ( )   {  
                                         v a r   v a l i d   =   t r u e ;  
                                         v a r   p a s s w o r d   =   $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = p a s s w o r d ] " ) . v a l ( ) ;  
                                         v a r   s a m e p a s s w o r d   =   $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = s a m e p a s s w o r d ] " ) . v a l ( ) ;  
  
                                         $ ( p a r e n t ) . f i n d ( " i n p u t " ) . e a c h ( f u n c t i o n ( )   {  
                                                 / / g e n e r a l   v a l i d a t i o n  
                                                 i f   ( $ ( t h i s ) . v a l ( )   = =   " "   | |   $ ( t h i s ) . v a l ( )   = =   e r r o r m e s s a g e )   {  
                                                         v a l i d   =   f a l s e ;  
                                                 }  
  
                                                 / / v a l i d a t e   e m a i l  
                                                 i f   ( $ ( t h i s ) . a t t r ( " n a m e " )   = =   " e m a i l " )   {  
                                                         v a r   r e g e x   =   n e w   R e g E x p ( / \ w + @ [ a - z A - Z 0 - 9 _ ] + ? \ . [ a - z A - Z ] / ) ;  
                                                         i f   ( r e g e x . e x e c ( $ ( t h i s ) . v a l ( ) )   = =   n u l l )   {  
                                                                 v a l i d   =   f a l s e ;  
                                                         }  
                                                 }  
  
                                                 / / s a m e   p a s s w o r d s ?  
                                                 i f   ( $ ( t h i s ) . a t t r ( " n a m e " )   = =   " p a s s w o r d " )   {  
                                                         i f   ( p a s s w o r d   ! =   s a m e p a s s w o r d )   {  
                                                                 $ ( p a r e n t ) . a p p e n d ( n o s a m e p a s s w o r d d i v ) ;  
  
                                                                 v a l i d   =   f a l s e ;  
                                                         }  
                                                 }  
  
                                                 i f   ( ! v a l i d )   {  
                                                         $ ( t h i s ) . a n i m a t e ( {   b a c k g r o u n d C o l o r :   " # c b 0 b 0 b "   } ,   3 0 0 ) . a n i m a t e ( {   b a c k g r o u n d C o l o r :   " # f f f f f f "   } ,   3 0 0 ,   f u n c t i o n ( )   {  
                                                                 $ ( t h i s ) . v a l ( e r r o r m e s s a g e ) ;  
                                                         } ) ;  
                                                 }  
                                         } ) ;  
  
                                         i f   ( v a l i d )   {  
                                                 v a r   o b j e c t s ;  
  
                                                 / / s e r i a l i z e  
                                                 o b j e c t s   =   $ ( p a r e n t ) . f i n d ( " i n p u t " ) . s e r i a l i z e ( ) ;  
  
                                                 $ ( p a r e n t ) . a p p e n d ( l o a d e r ) ;  
                                                 $ ( p a r e n t ) . l o a d ( " / A j a x / S h o p p i n g C a r t C o n t r o l s . a s p x ? "   +   o b j e c t s ,   {   a c t i o n :   " s i g n u p "   } ) ;  
                                         }  
                                 } ) ;  
  
                                 / / e d i t   a d d r e s s e s  
                                 $ ( p a r e n t ) . f i n d ( " . E d i t A d d r e s s B u t t o n " ) . l i v e ( " c l i c k " ,   f u n c t i o n ( )   {  
                                         $ ( p a r e n t ) . a p p e n d ( l o a d e r ) ;  
                                         $ ( p a r e n t ) . l o a d ( " / A j a x / S h o p p i n g C a r t C o n t r o l s . a s p x " ,   {   a c t i o n :   " e d i t a d d r e s s "   } ) ;  
                                 } ) ;  
  
                                 / / h a n d l e   s a m e a d d r e s s   b u t t o n  
                                 $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = s a m e d e l i v e r y ] " ) . l i v e ( " c l i c k " ,   f u n c t i o n ( )   {  
                                         v a r   s t r e e t   =   $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = s t r e e t ] " ) . v a l ( ) ;  
                                         v a r   h o u s e n u m b e r   =   $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = h o u s e n u m b e r ] " ) . v a l ( ) ;  
                                         v a r   z i p   =   $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = z i p ] " ) . v a l ( ) ;  
                                         v a r   c i t y   =   $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = c i t y ] " ) . v a l ( ) ;  
  
                                         i f   ( $ ( t h i s ) . i s ( " : c h e c k e d " ) )   {  
                                                 $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = d e l s t r e e t ] " ) . v a l ( s t r e e t ) ;  
                                                 $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = d e l h o u s e n u m b e r ] " ) . v a l ( h o u s e n u m b e r ) ;  
                                                 $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = d e l z i p ] " ) . v a l ( z i p ) ;  
                                                 $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = d e l c i t y ] " ) . v a l ( c i t y ) ;  
                                         }  
                                         e l s e   {  
                                                 $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = d e l s t r e e t ] " ) . v a l ( " " ) ;  
                                                 $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = d e l h o u s e n u m b e r ] " ) . v a l ( " " ) ;  
                                                 $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = d e l z i p ] " ) . v a l ( " " ) ;  
                                                 $ ( p a r e n t ) . f i n d ( " i n p u t [ n a m e = d e l c i t y ] " ) . v a l ( " " ) ;  
                                         }  
                                 } ) ;  
  
                                 $ ( p a r e n t ) . f i n d ( " . S a v e A d d r e s s B u t t o n " ) . l i v e ( " c l i c k " ,   f u n c t i o n ( )   {  
                                         v a r   o b j e c t s ;  
                                         v a r   v a l i d   =   t r u e ;  
  
                                         / / c h e c k   v a l u e s  
                                         $ ( p a r e n t ) . f i n d ( " i n p u t " ) . e a c h ( f u n c t i o n ( )   {  
                                                 i f   ( $ ( t h i s ) . v a l ( )   = =   " "   | |   $ ( t h i s ) . v a l ( )   = =   e r r o r m e s s a g e )   {  
                                                         $ ( t h i s ) . a n i m a t e ( {   b a c k g r o u n d C o l o r :   " # c b 0 b 0 b "   } ,   3 0 0 ) . a n i m a t e ( {   b a c k g r o u n d C o l o r :   " # f f f f f f "   } ,   3 0 0 ,   f u n c t i o n ( )   {  
                                                                 $ ( t h i s ) . v a l ( e r r o r m e s s a g e ) ;  
                                                         } ) ;  
  
                                                         v a l i d   =   f a l s e ;  
                                                 }  
                                         } ) ;  
  
                                         i f   ( v a l i d )   {  
                                                 / / s e r i a l i z e  
                                                 o b j e c t s   =   $ ( p a r e n t ) . f i n d ( " i n p u t " ) . s e r i a l i z e ( ) ;  
                                                 / / a l e r t ( o b j e c t s ) ;  
  
                                                 $ ( p a r e n t ) . a p p e n d ( l o a d e r ) ;  
                                                  
                                                 v a r   s e l e c t e d c o u n t r y   =   $ ( " # C o u n t r y S e l e c t i o n " ) . v a l ( ) ;  
  
                                                 $ ( p a r e n t ) . l o a d ( " / A j a x / S h o p p i n g C a r t C o n t r o l s . a s p x ? "   +   o b j e c t s   +   " & c o u n t r y c o d e = "   +   s e l e c t e d c o u n t r y ,   {   a c t i o n :   " s a v e a d d r e s s "   } ) ;  
                                         }  
                                 } ) ;  
  
                                 / / f i n a l i s a t i o n  
                                 $ ( p a r e n t ) . f i n d ( " . O r d e r F i n a l i z e " ) . l i v e ( " c l i c k " ,   f u n c t i o n ( )   {  
                                         v a r   p a y m e t h o d   =   $ ( p a r e n t ) . f i n d ( " s e l e c t [ n a m e = p a y m e t h o d ] " ) . v a l ( ) ;  
  
                                         $ ( p a r e n t ) . a p p e n d ( l o a d e r ) ;  
                                         $ ( p a r e n t ) . l o a d ( " / A j a x / S h o p p i n g C a r t C o n t r o l s . a s p x " ,   {   a c t i o n :   " o r d e r f i n a l i z e " ,   g a t e w a y :   p a y m e t h o d   } ) ;  
                                         $ ( p a r e n t ) . a p p e n d ( l o a d e r ) ;  
                                 } ) ;  
                         } ) ;  
                 }  
         } ) ;  
 } ) ( j Q u e r y ) ;  
  
 / / G o o g l e   m a p s  
  
 / * *  
 *   j q u e r y . g o o g l e m a p   v 1 . 0 . 0  
 *  
 *   C o p y r i g h t   D a v i d   H o n g   2 0 0 9  
 *   h t t p : / / d a v i d h o n g . i d . a u / j q u e r y / g o o g l e / m a p s /  
 *  
 *   S i m p l i f i e d   G o o g l e   M a p s   A P I   i n t e g r a t e d   i n t o   j Q u e r y  
 *  
 *   L a u n c h e d :   < T B A >  
 *   V e r s i o n :   v 1 . 0 . 0   ( 2 7 / 0 2 / 2 0 0 9   1 5 : 5 9   A E D S T )  
 *    
 *   S I M P L E   U S A G E :  
 *    
 *   $ ( " g o o g l e - m a p - c a n v a s " ) . g o o g l e m a p ( {  
 *           c o n t r o l s :   f a l s e ,  
 *           l a b e l s :   t r u e ,  
 *           a d d r e s s e s :   [  
 *                   " 1   A B C   S t ,   N S W   A u s t r a l i a " ,  
 *                   " 2   X Y Z   S t ,   N S W   A u s t r a l i a "  
 *           ]  
 *   } ) ;  
  
 S o m e   r e m a r k s :  
          
 -   f o r   c u s t o m   m a r k e r s   s e a r c h   f o r   ' c r e a t e M a r k e r '  
 -   d o e s n ' t   w o r k   w i t h o u t   a n   e l e m e n t   i d  
 -   f o r   m a p t y p e   s e a r c h   f o   ' s e t M a p T y p e '  
  
 *    
 * * /  
  
 ( f u n c t i o n ( $ )   {  
  
         / /   f i r e E v e n t ( o p t s ,   f n ,   s e l f ,   a r g )  
         / /           o p t s :         ( j s o n )   j Q u e r y   o p t i o n s   f o r   t h i s   p l u g i n  
         / /           f n :             ( f u n c t i o n )   f u n c t i o n   t o   r u n  
         / /           s e l f :         ( o b j e c t )   t h i s  
         / /           a r g :           ( o b j e c t )   a r g u m e n t   t o   f e e d   t o   f u n c t i o n   ( f n )  
         / /  
         / /   n o t e :   f n   s h o u l d   a l w a y s   r e t u r n   t r u e   o n   s u c c e s s f u l   r u n s ,   o t h e r w i s e   r e t u r n  
         / /               f a l s e  
         f u n c t i o n   f i r e E v e n t ( o p t s ,   f n ,   s e l f ,   a r g )   {  
                 i f   ( $ . i s F u n c t i o n ( f n ) )   {  
                         t r y   {  
                                 r e t u r n   f n . c a l l ( s e l f ,   a r g ) ;  
                         }   c a t c h   ( e r r o r )   {  
                                 i f   ( o p t s . d e b u g )   {  
                                         a l e r t ( " E r r o r   c a l l i n g   g o o g l e m a p s . "   +   f n   +   " :   "   +   e r r o r ) ;  
                                 }   e l s e   {  
                                         t h r o w   e r r o r ;  
                                 }  
                                 r e t u r n   f a l s e ;  
                         }  
                 }  
                 r e t u r n   t r u e ;  
         }  
  
         v a r   c u r r e n t   =   n u l l ;  
  
         f u n c t i o n   G o o g l e m a p ( r o o t ,   c o n f )   {  
                 / /   c u r r e n t   i n s t a n c e  
                 v a r   s e l f   =   t h i s ;  
                 i f   ( ! c u r r e n t )   {  
                         c u r r e n t   =   s e l f ;  
                 }  
  
                 / /   i n t e r n a l   v a r i a b l e s  
                 v a r   m a p ;  
                 v a r   g e o ;  
                 v a r   b o u n d s ;  
                 v a r   m a r k e r s ;  
                 / / v a r   i n d e x   =   0 ;  
  
                 / /   c o n f i g u r a t i o n   ( c o m m e n t s   s h o w   d e f a u l t   v a l u e s )  
                 v a r   l a t i t u d e   =   c o n f . l a t i t u d e ;         / /   - 3 5  
                 v a r   l o n g i t u d e   =   c o n f . l o n g i t u d e ;       / /   1 5 0  
                 v a r   z o o m   =   c o n f . z o o m ;                 / /   4  
                 v a r   c o n t r o l s   =   c o n f . c o n t r o l s ;         / /   t r u e  
                 v a r   l a b e l s   =   c o n f . l a b e l s ;             / /   t r u e  
                 v a r   h t m l   =   c o n f . h t m l ;                 / /   n u l l  
                 v a r   a n c h o r   =   c o n f . a n c h o r ;             / /   n u l l  
                 v a r   a d d r e s s e s   =   c o n f . a d d r e s s e s ;       / /   n u l l  
                 v a r   d e b u g   =   c o n f . d e b u g ;               / /   f a l s e  
                 v a r   m a p t y p e   =   c o n f . m a p t y p e ;   / / 1   - >   n o r m a l  
                 v a r   c o n t r o l t y p e   =   c o n f . c o n t r o l t y p e   / /   1  
                 v a r   i c o n I m a g e   =   c o n f . i c o n I m a g e   / / " " ,  
                 v a r   i c o n S h a d o w   =   c o n f . i c o n S h a d o w   / / " h t t p : / / w w w . g o o g l e . c o m / m a p f i l e s / s h a d o w 5 0 . p n g " ,  
                 v a r   i c o n S i z e X   =   c o n f . i c o n S i z e X   / / " 2 0 ,   3 4 " ,  
                 v a r   i c o n S h a d o w S i z e X   =   c o n f . i c o n S h a d o w S i z e X   / / " 3 7 ,   3 4 " ,  
                 v a r   i c o n A n c h o r X   =   c o n f . i c o n A n c h o r X   / / " 9 ,   3 4 " ,  
                 v a r   i c o n S i z e Y   =   c o n f . i c o n S i z e Y   / / " 2 0 ,   3 4 " ,  
                 v a r   i c o n S h a d o w S i z e Y   =   c o n f . i c o n S h a d o w S i z e Y   / / " 3 7 ,   3 4 " ,  
                 v a r   i c o n A n c h o r Y   =   c o n f . i c o n A n c h o r Y   / / " 9 ,   3 4 " ,                  
  
                 / /   m e t h o d s  
                 $ . e x t e n d ( s e l f ,   {  
                         / /   p l u g i n   s p e c i f i c  
                         g e t V e r s i o n :   f u n c t i o n ( )   {   r e t u r n   [ 1 ,   0 ,   0 ] ;   } ,  
                         g e t R o o t :   f u n c t i o n ( )   {   r e t u r n   r o o t ;   } ,  
                         / /   g o o g l e   m a p s   s p e c i f i c  
                         g e t M a p :   f u n c t i o n ( )   {   r e t u r n   m a p ;   } ,  
                         g e t G e o :   f u n c t i o n ( )   {   r e t u r n   g e o ;   } ,  
                         g e t A d d r e s s e s :   f u n c t i o n ( )   {   r e t u r n   a d d r e s s e s ;   } ,  
                         g e t B o u n d s :   f u n c t i o n ( )   {   r e t u r n   b o u n d s ;   } ,  
                         / / g e t I n d e x :   f u n c t i o n ( )   {   r e t u r n   i n d e x ;   } ,  
                         g e t M a r k e r s :   f u n c t i o n ( )   {   r e t u r n   m a r k e r s ;   } ,  
  
                         / /   a p i  
                         i s B r o w s e r C o m p a t i b l e :   f u n c t i o n ( )   {  
                                 i f   ( $ . i s F u n c t i o n ( G B r o w s e r I s C o m p a t i b l e ) )  
                                         r e t u r n   G B r o w s e r I s C o m p a t i b l e ( ) ;  
  
                                 r e t u r n   f a l s e ;  
                         } ,  
                         i n i t i a l i s e :   f u n c t i o n ( )   {  
                                 s e l f . t r a c e ( " i n i t i a l i s i n g :   "   +   t h i s ) ;  
                                 i f   ( s e l f . i s B r o w s e r C o m p a t i b l e ( ) )   {  
                                         m a p   =   m a p   | |   n e w   G M a p 2 ( d o c u m e n t . g e t E l e m e n t B y I d ( $ ( r o o t ) [ 0 ] . i d ) ) ;  
  
                                         s w i t c h   ( m a p t y p e )   {  
                                                 c a s e   1 :  
                                                         {  
                                                                 m a p . s e t M a p T y p e ( G _ N O R M A L _ M A P ) ;  
                                                                 b r e a k ;  
                                                         }  
                                                 c a s e   2 :  
                                                         {  
                                                                 m a p . s e t M a p T y p e ( G _ S A T E L L I T E _ M A P ) ;  
                                                                 b r e a k ;  
                                                         }  
                                                 c a s e   3 :  
                                                         {  
                                                                 m a p . s e t M a p T y p e ( G _ H Y B R I D _ M A P ) ;  
                                                                 b r e a k ;  
                                                         }  
                                                 c a s e   4 :  
                                                         {  
                                                                 m a p . s e t M a p T y p e ( G _ P H Y S I C A L _ M A P ) ;  
                                                                 b r e a k ;  
                                                         }  
                                         }  
  
                                         g e o   =   g e o   | |   n e w   G C l i e n t G e o c o d e r ( ) ;  
                                         b o u n d s   =   b o u n d s   | |   n e w   G L a t L n g B o u n d s ( ) ;  
                                         m a r k e r s   =   m a r k e r s   | |   n e w   A r r a y ( ) ;  
  
                                         G E v e n t . a d d L i s t e n e r ( m a p ,   " l o a d " ,   f u n c t i o n ( )   {  
                                                 s e l f . t r a c e ( " g o o g l e   m a p   l o a d e d ! " ) ;  
                                         } ) ;  
  
                                         / /   s e t   t h e   m a p   c e n t e r  
                                         m a p . s e t C e n t e r ( n e w   G L a t L n g ( l a t i t u d e ,   l o n g i t u d e ) ,   z o o m ) ;  
  
                                         / /   m a r k   a d d r e s s e s   o n   t h e   m a p  
                                         i f   ( a d d r e s s e s )   {  
                                                 i f   ( a d d r e s s e s . l e n g t h   >   0 )   {  
                                                         v a r   i   =   0 ;  
                                                         w h i l e   ( i   <   a d d r e s s e s . l e n g t h )   {  
                                                                 s e l f . g e o c o d e ( i + + ) ;  
                                                         }  
                                                 }  
                                         }  
  
                                         / /   a d d   c o n t r o l s  
                                         i f   ( c o n t r o l s )   {  
                                                 s w i t c h   ( c o n t r o l t y p e )   {  
                                                         c a s e   1 :  
                                                                 {  
                                                                         m a p . a d d C o n t r o l ( n e w   G L a r g e M a p C o n t r o l 3 D ( ) ) ;  
                                                                         b r e a k ;  
                                                                 }  
                                                         c a s e   2 :  
                                                                 {  
                                                                         m a p . a d d C o n t r o l ( n e w   G L a r g e M a p C o n t r o l ( ) ) ;  
                                                                         b r e a k ;  
                                                                 }  
                                                         c a s e   3 :  
                                                                 {  
                                                                         m a p . a d d C o n t r o l ( n e w   G S m a l l M a p C o n t r o l ( ) ) ;  
                                                                         b r e a k ;  
                                                                 }  
                                                         c a s e   4 :  
                                                                 {  
                                                                         m a p . a d d C o n t r o l ( n e w   G S m a l l Z o o m C o n t r o l 3 D ( ) ) ;  
                                                                         b r e a k ;  
                                                                 }  
                                                         c a s e   5 :  
                                                                 {  
                                                                         m a p . a d d C o n t r o l ( n e w   G S m a l l Z o o m C o n t r o l ( ) ) ;  
                                                                         b r e a k ;  
                                                                 }  
                                                 }  
  
                                                 m a p . a d d C o n t r o l ( n e w   G M a p T y p e C o n t r o l ( ) ) ;  
                                         }  
                                 }  
                         } ,  
  
                         / /   g e o c o d e ( i n d e x ,   a d d r e s s ,   h t m l ,   a n c h o r )   :  
                         / /           i n d e x :           ( n u m b e r )   i n d e x   o f   t h e   m a r k e r   ( o b s o l e t e   w h e n   l a b e l   = =   f a l s e )  
                         / /           a d d r e s s :       ( s t r i n g )   h u m a n   r e a d a b l e   a d d r e s s   t o   q u e r y  
                         / /           h t m l :             [ a r r a y ]   w h a t   t o   d i s p l a y   o n   m a r k e r ' s   " c l i c k "   e v e n t  
                         / /           a n c h o r :         [ a r r a y ]   s i m u l a t e   m a r k e r ' s   " c l i c k "   e v e n t   o u t s i d e   t h e   m a p   v i a   a   l i n k  
                         g e o c o d e :   f u n c t i o n ( i n d e x )   {  
                                 g e o   =   ( g e o   = =   n u l l )   ?   n e w   G C l i e n t G e o c o d e r ( )   :   g e o ;  
                                 i f   ( a d d r e s s e s   & &   i n d e x   > =   0 )   {  
                                         s e l f . t r a c e ( " p r o c e s s i n g   a d d r e s s :   [ "   +   a d d r e s s e s [ i n d e x ]   +   " ]   ( "   +   i n d e x   +   " ) " ) ;  
                                         m a r k e r s   =   m a r k e r s   | |   n e w   A r r a y ( ) ;  
  
                                         / /   s a f e r   w a y   o f   g e o c o d i n g   -   a v o i d s   G _ G E O _ T O O _ M A N Y _ Q U E R I E S  
                                         g e o . g e t L o c a t i o n s ( a d d r e s s e s [ i n d e x ] ,   f u n c t i o n ( r e s p o n s e )   {  
                                                 v a r   s t a t u s c o d e   =   r e s p o n s e . S t a t u s . c o d e ;  
  
                                                 i f   ( s t a t u s c o d e   = =   G _ G E O _ S U C C E S S )   {  
                                                         / /   s u c c e s s !  
                                                         s e l f . t r a c e ( r e s p o n s e . P l a c e m a r k ) ;  
                                                         v a r   p o i n t   =   n e w   G L a t L n g ( r e s p o n s e . P l a c e m a r k [ 0 ] . P o i n t . c o o r d i n a t e s [ 1 ] ,   r e s p o n s e . P l a c e m a r k [ 0 ] . P o i n t . c o o r d i n a t e s [ 0 ] ,   t r u e ) ;  
  
                                                         / /   e x t e n d   b o u n d s  
                                                         b o u n d s   =   b o u n d s   | |   n e w   G L a t L n g B o u n d s ( ) ;  
                                                         b o u n d s . e x t e n d ( p o i n t ) ;   s e l f . t r a c e ( " b o u n d s   e x t e n d e d " ) ;  
  
                                                         / /   m a r k e r  
                                                         v a r   m a r k e r   =   s e l f . c r e a t e M a r k e r ( i n d e x ,   p o i n t ) ;  
                                                         s e l f . t r a c e ( m a r k e r ) ;   s e l f . t r a c e ( " m a r k e r   c r e a t e d " ) ;  
  
                                                         / /   m a r k e r   e v e n t s  
                                                         G E v e n t . a d d L i s t e n e r ( m a r k e r ,   " c l i c k " ,   f u n c t i o n ( )   {  
                                                                 z o o m   =   1 5 ;  
                                                                 m a p . s e t C e n t e r ( m a r k e r . g e t L a t L n g ( ) ,   z o o m ) ;  
                                                         } ) ;  
  
                                                         / /   a d d   m a r k e r   t o   a r r a y   a n d   d i s p l a y  
                                                         m a r k e r s [ i n d e x ]   =   m a r k e r ;  
                                                         m a p . a d d O v e r l a y ( m a r k e r ) ;  
  
                                                         / /   o n M a r k e r L o a d e d  
                                                         i f   ( f i r e E v e n t ( c o n f ,   s e l f . o n M a r k e r L o a d e d ,   s e l f ,   i n d e x )   = = =   f a l s e )   {  
                                                                 r e t u r n   s e l f ;  
                                                         }  
                                                 }   e l s e   {  
                                                         i f   ( s t a t u s c o d e   = =   G _ G E O _ T O O _ M A N Y _ Q U E R I E S )   {  
                                                                 / /   r e t r y   a g a i n   a f t e r   a   s h o r t   w h i l e  
                                                                 v a r   d e l a y   =   6 0 0 ;  
                                                                 s e l f . t r a c e ( " i n d e x   "   +   i n d e x   +   "   w i l l   b e g i n   r e t r y   i n   "   +   d e l a y   +   " m s " )  
                                                                 s e t T i m e o u t ( f u n c t i o n ( )   {  
                                                                         s e l f . g e o c o d e ( i n d e x ) ;  
                                                                 } ,   d e l a y ) ;  
                                                         }   e l s e   {  
                                                                 s e l f . t r a c e ( " u n k n o w n   e r r o r   c o d e :   "   +   s t a t u s c o d e ) ;  
                                                                 m a r k e r [ i n d e x ]   =   n u l l ;  
                                                         }  
                                                 }  
                                         } ) ;  
                                 }  
                         } ,  
  
                         / /   o n M a r k e r L o a d e d ( i n d e x )  
                         / /           i n t e r n a l   f u n c t i o n   :   D O   N O T   M O D I F Y  
                         o n M a r k e r L o a d e d :   f u n c t i o n ( i n d e x )   {  
                                 / /   s e t   m a p   b o u n d s   a n d   z o o m   l e v e l   t o   o p t i m a l   l e v e l   s o   a l l   m a r k e r   c a n   f i t  
                                 r e t u r n   s e l f . o p t i m i s e Z o o m L e v e l ( ) ;  
                         } ,  
  
                         / /   o p t i m i s e Z o o m L e v e l ( )  
                         o p t i m i s e Z o o m L e v e l :   f u n c t i o n ( i n d e x )   {  
                                 i f   ( b o u n d s   & &   ( a d d r e s s e s . l e n g t h   = =   m a r k e r s . l e n g t h ) )   {  
                                         / / z o o m   =   m a p . g e t B o u n d s Z o o m L e v e l ( b o u n d s ) ;  
                                         m a p . s e t Z o o m ( z o o m ) ;  
                                         m a p . s e t C e n t e r ( b o u n d s . g e t C e n t e r ( ) ) ;  
                                 }  
  
                                 r e t u r n   t r u e ;  
                         } ,  
  
                         / /   c r e a t e M a r k e r ( i n d e x ,   p o i n t )  
                         / /           i n d e x :         ( n u m b e r )   i n d e x   o f   t h e   m a r k e r   ( a l s o   u s e d   t o   g e n e r a t e   a   l e t t e r )  
                         / /           p o i n t :         ( G L a t L n g )   l a t i t u d e   a n d   l o n g i t u d e   o f   t h e   m a r k e r  
                         c r e a t e M a r k e r :   f u n c t i o n ( i n d e x ,   p o i n t )   {  
                                 / /   c r e a t e   a   b a s e   i c o n   f o r   a l l   o f   o u r   m a r k e r s   t h a t   s p e c i f i e s   t h e  
                                 / /   s h a d o w ,   i c o n   d i m e n s i o n s ,   e t c .  
                                 v a r   b a s e I c o n   =   n e w   G I c o n ( G _ D E F A U L T _ I C O N ) ;  
                                 b a s e I c o n . i m a g e   =   i c o n I m a g e ;  
                                 b a s e I c o n . s h a d o w   =   i c o n S h a d o w ;  
                                 b a s e I c o n . i c o n S i z e   =   n e w   G S i z e ( i c o n S i z e X ,   i c o n S i z e Y ) ;  
                                 b a s e I c o n . s h a d o w S i z e   =   n e w   G S i z e ( i c o n S h a d o w S i z e X ,   i c o n S h a d o w S i z e Y ) ;  
                                 b a s e I c o n . i c o n A n c h o r   =   n e w   G P o i n t ( i c o n A n c h o r X ,   i c o n A n c h o r Y ) ;  
                                 b a s e I c o n . i n f o W i n d o w A n c h o r   =   n e w   G P o i n t ( 9 ,   2 ) ;  
  
                                 / /   l e t t e r e d   m a r k e r   w h i c h   s t a r t s   a t   " A "   a n d   w r a p s   a t   " Z "  
                                 v a r   r a n g e   =   " Z " . c h a r C o d e A t ( 0 )   -   " A " . c h a r C o d e A t ( 0 )   +   1 ;  
                                 v a r   l e t t e r   =   S t r i n g . f r o m C h a r C o d e ( " A " . c h a r C o d e A t ( 0 )   +   ( i n d e x   %   r a n g e ) ) ;  
                                 v a r   l e t t e r e d I c o n   =   n e w   G I c o n ( b a s e I c o n ) ;  
                                 l e t t e r e d I c o n . i m a g e   =   " h t t p : / / w w w . g o o g l e . c o m / m a p f i l e s / m a r k e r "   +   l e t t e r   +   " . p n g " ;  
  
                                 v a r   m a r k e r O p t i o n s   =   {  
                                         i c o n :   b a s e I c o n ,  
                                         b o u n c y :   t r u e  
                                 } ;  
  
                                 v a r   m a r k e r   =   ( l a b e l s )   ?   n e w   G M a r k e r ( p o i n t ,   m a r k e r O p t i o n s )   :   n e w   G M a r k e r ( p o i n t ) ;  
                                 r e t u r n   m a r k e r ;  
                         } ,  
  
                         / /   t r a c e ( a r g ,   [ a r g s . . . ] )   :   p r i n t   e v e r y t h i n g   i n   t h e   a r g u m e n t s   a r r a y  
                         t r a c e :   f u n c t i o n ( )   {  
                                 i f   ( ! d e b u g )   r e t u r n ;  
  
                                 v a r   c a l l e r   =   a r g u m e n t s . c a l l e r   | |   " s e l f " ;  
                                 f o r   ( i   =   0 ;   i   <   a r g u m e n t s . l e n g t h ;   i + + )   {  
                                         v a r   a r g u m e n t   =   a r g u m e n t s [ i ] ;   / /   p r i n t   o b j e c t   a s   i t   i s  
                                         v a r   l i n e   =   a r g u m e n t ;  
                                         t r y   {  
                                                 / /   F i r e f o x ,   S a f a r i ,   O p e r a  
                                                 c o n s o l e . d e b u g ( l i n e ) ;  
                                         }   c a t c h   ( e r r o r )   {  
                                                 / /   f a i l s   g r a c e f u l l y   o n   I E ,   C h r o m e  
                                                 a l e r t ( l i n e ) ;  
                                         }  
                                 }  
                         }  
                 } ) ;  
  
                 f u n c t i o n   l o a d ( )   {  
                         s e l f . i n i t i a l i s e ( ) ;  
                         r e t u r n   s e l f ;  
                 }  
  
                 l o a d ( ) ;  
         }  
  
  
         / /   j Q u e r y   p l u g i n   i m p l e m e n t a t i o n  
         j Q u e r y . p r o t o t y p e . g o o g l e m a p   =   f u n c t i o n ( c o n f )   {  
                 / /   a l r e a d y   c o n s t r u c t e d   - - >   r e t u r n   A P I  
                 v a r   a p i   =   t h i s . e q ( t y p e o f   c o n f   = =   ' n u m b e r '   ?   c o n f   :   0 ) . d a t a ( " g o o g l e m a p " ) ;  
                 i f   ( a p i )   {   r e t u r n   a p i ;   }  
  
                 v a r   o p t s   =   {  
                         l a t i t u d e :   - 2 3 ,  
                         l o n g i t u d e :   1 3 3 ,  
                         z o o m :   4 ,  
                         l a b e l s :   t r u e ,  
                         c o n t r o l s :   t r u e ,  
                         h t m l :   n u l l ,  
                         a n c h o r :   n u l l ,  
                         a d d r e s s e s :   n u l l ,  
                         d e b u g :   f a l s e ,  
                         m a p t y p e :   1 ,  
                         c o n t r o l t y p e :   1 ,  
                         i c o n I m a g e :   " " ,  
                         i c o n S h a d o w :   " h t t p : / / w w w . g o o g l e . c o m / m a p f i l e s / s h a d o w 5 0 . p n g " ,  
                         i c o n S i z e X :   2 0 ,  
                         i c o n S i z e Y :   3 4 ,  
                         i c o n S h a d o w S i z e X :   3 7 ,  
                         i c o n S h a d o w S i z e Y :   3 4 ,  
                         i c o n A n c h o r X :   9 ,  
                         i c o n A n c h o r Y :   3 4  
                 } ;  
  
                 $ . e x t e n d ( o p t s ,   c o n f ) ;  
  
                 t h i s . e a c h ( f u n c t i o n ( )   {  
                         v a r   e l   =   n e w   G o o g l e m a p ( $ ( t h i s ) ,   o p t s ) ;  
                         $ ( t h i s ) . d a t a ( " g o o g l e m a p " ,   e l ) ;  
                 } ) ;  
  
                 r e t u r n   t h i s ;  
         } ;  
  
 } ) ( j Q u e r y ) ;  
  
 / / a j a x f o r m   2   ! ! ! !   -   t a k e   g r e a t   c a r e ,   t h i s   i s   n o t   a   r e u s a b l e   p l u g i n   ( )   -   ! ! ! !    
  
 ( f u n c t i o n ( $ )   {  
         $ . f n . e x t e n d ( {  
                 A j a x f o r m 2 :   f u n c t i o n ( s e t t i n g s )   {   / / T o D o ;   A p p l y i n g   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 ( )   {  
                                 / / s e t   d e f a u l t s  
                                 v a r   o p t i o n s   =   $ . e x t e n d ( {  
                                         e n a b l e a n a l y t i c s :   f a l s e ,  
                                         t r a c k e r c o d e :   " X X - 0 0 0 0 0 0 0 0 - 0 " ,  
                                         f a l s e c o l o r :   " # f f 0 0 0 0 "  
                                 } ,   s e t t i n g s ) ;  
  
                                 / / s e t t i n g s  
                                 v a r   p a r e n t   =   $ ( t h i s ) ;  
                                 v a r   e m a i l r e g e x   =   n e w   R e g E x p ( / \ w + @ [ a - z A - Z 0 - 9 _ ] + ? \ . [ a - z A - Z ] / ) ;  
                                 v a r   v a l i d ;  
                                 v a r   f a l s e t e x t   =   $ ( t h i s ) . f i n d ( " i n p u t [ n a m e = ' f a l s e m e s s a g e ' ] " ) . v a l ( ) ;  
                                 v a r   t h n x   =   $ ( t h i s ) . f i n d ( " i n p u t [ n a m e = ' t h n x m e s s a g e ' ] " ) . v a l ( ) ;  
                                 v a r   e n a b l e a n a l y t i c s   =   o p t i o n s . e n a b l e a n a l y t i c s ;  
                                 v a r   t r a c k e r c o d e   =   o p t i o n s . t r a c k e r c o d e ;  
                                 v a r   f a l s e c o l o r   =   o p t i o n s . f a l s e c o l o r ;  
  
                                 $ ( t h i s ) . f i n d ( " . i n p u t " ) . c l i c k ( f u n c t i o n ( )   {  
                                         i f   ( $ ( t h i s ) . v a l ( )   = =   f a l s e t e x t )   {  
                                                 $ ( t h i s ) . v a l ( " " ) ;  
                                         }  
                                 } ) ;  
  
                                 $ ( t h i s ) . f i n d ( " . b u t t o n " ) . c l i c k ( f u n c t i o n ( )   {  
                                         v a r   i   =   0 ;  
                                         v a r   f a l s e f i e l d s   =   n e w   A r r a y ( ) ;  
                                         v a l i d   =   t r u e ;  
  
                                         $ ( " . t h n x m e s s a g e " ) . r e m o v e ( ) ;  
  
                                         $ ( p a r e n t ) . f i n d ( " . i n p u t " ) . e a c h ( f u n c t i o n ( )   {  
                                                 i f   ( $ ( t h i s ) . i s ( " . r e q u i r e d " ) )   {  
  
                                                         / / e m a i l   s p e c  
                                                         i f   ( $ ( t h i s ) . i s ( " . e m a i l " ) )   {  
                                                                 i f   ( e m a i l r e g e x . e x e c ( $ ( t h i s ) . v a l ( ) )   = =   n u l l )   {  
                                                                         v a l i d   =   f a l s e ;  
                                                                 }  
                                                         }  
                                                         e l s e   {   / / o t h e r   c a s e s  
                                                                 i f   ( $ ( t h i s ) . v a l ( )   = =   " "   | |   $ ( t h i s ) . v a l ( )   = =   f a l s e t e x t )   {  
                                                                         v a l i d   =   f a l s e ;  
                                                                 }  
                                                         }  
  
                                                         / / a d d   t o   f a l s e f i e l d s   a r r a y  
                                                         i f   ( ! v a l i d )   {  
                                                                 f a l s e f i e l d s [ i ]   =   $ ( t h i s ) . a t t r ( " n a m e " ) ;  
                                                                 i + + ;  
                                                         }  
                                                 }  
                                         } ) ;  
  
                                         $ . e a c h ( f a l s e f i e l d s ,   f u n c t i o n ( i n d e x )   {  
                                                 $ ( p a r e n t ) . f i n d ( " . i n p u t [ n a m e =   "   +   f a l s e f i e l d s [ i n d e x ]   +   " ] " ) . e a c h ( f u n c t i o n ( )   {  
                                                         v a r   c u r r e n t c l a s s   =   $ ( t h i s ) . a t t r ( " c l a s s " ) ;  
  
                                                         i f   ( $ ( t h i s ) . v a l ( )   = =   " " )   {  
                                                                 $ ( t h i s ) . v a l ( f a l s e t e x t ) ;  
                                                         }  
                                                         e l s e   {  
                                                                 $ ( t h i s ) . c s s ( " c o l o r " ,   f a l s e c o l o r ) ;  
                                                         }  
  
                                                         $ ( t h i s ) . a t t r ( {  
                                                                 C l a s s :   c u r r e n t c l a s s   +   "   f a l s e "  
                                                         } ) ;  
                                                 } ) ;  
                                         } ) ;  
  
                                         i f   ( v a l i d )   {  
                                                 $ ( p a r e n t ) . f a d e O u t ( 1 0 0 ) ;  
  
                                                 v a r   f o r m v a l u e s   =   $ ( p a r e n t ) . f i n d ( " . i n p u t " ) . s e r i a l i z e ( ) ;  
  
                                                 $ ( p a r e n t ) . f i n d ( " . i n p u t " ) . e a c h ( f u n c t i o n ( )   {  
                                                         v a r   c u r r e n t c l a s s   =   $ ( t h i s ) . a t t r ( " c l a s s " ) ;  
                                                         v a r   n e w c l a s s   =   c u r r e n t c l a s s . r e p l a c e ( " f a l s e " ,   " # 3 5 3 4 3 6 " ) ;  
  
                                                         $ ( t h i s ) . c s s ( " c o l o r " ,   " " ) ;  
                                                         $ ( t h i s ) . a t t r ( {  
                                                                 C l a s s :   n e w c l a s s  
                                                         } ) ;  
  
                                                         i f   ( $ ( t h i s ) . i s ( " s e l e c t " ) )   {  
                                                                 v a r   i n i t v a l   =   $ ( t h i s ) . f i n d ( " o p t i o n : f i r s t - c h i l d " ) . v a l ( ) ;  
  
                                                                 $ ( t h i s   +   " : s e l e c t e d " ) . e a c h ( f u n c t i o n ( )   {  
                                                                         $ ( t h i s ) . r e m o v e A t t r ( " s e l e c t e d " ) ;  
                                                                 } ) ;  
                                                                 $ ( t h i s ) . v a l ( i n i t v a l ) ;  
                                                         }  
                                                         e l s e   i f   ( $ ( t h i s ) . i s ( " [ t y p e = c h e c k b o x ] " )   | |   $ ( t h i s ) . i s ( " [ t y p e = r a d i o ] " ) )   {  
                                                                 $ ( t h i s ) . r e m o v e A t t r ( " c h e c k e d " ) ;  
                                                         }  
                                                         e l s e   {  
                                                                 $ ( t h i s ) . v a l ( " " ) ;  
                                                         }  
  
                                                 } ) ;  
  
                                                 $ ( p a r e n t ) . p a r e n t ( " * " ) . f i n d ( " . l o a d e r " ) . s h o w ( ) ;  
  
                                                 $ . p o s t ( " / A j a x / s i g n u p . a s p x ? "   +   f o r m v a l u e s ,   f u n c t i o n ( )   {  
                                                         w i n d o w . s e t T i m e o u t ( f u n c t i o n ( )   {  
  
                                                                 i f   ( e n a b l e a n a l y t i c s )   {  
                                                                         $ ( " . g o o g l e c o d e " ) . r e m o v e ( ) ;  
  
                                                                         / / g o o g l e   s t u f f  
                                                                         v a r   a n a l y t i c s   =   " < s p a n   c l a s s = ' g o o g l e c o d e ' > " ;  
                                                                         a n a l y t i c s   + =   " < s c r i p t   t y p e = \ " t e x t / j a v a s c r i p t \ " > " ;  
                                                                         a n a l y t i c s   + =   " v a r   g a J s H o s t   =   ( ( \ " h t t p s : \ "   = =   d o c u m e n t . l o c a t i o n . p r o t o c o l )   ?   \ " h t t p s : / / s s l . \ "   :   \ " h t t p : / / w w w . \ " ) ; " ;  
                                                                         a n a l y t i c s   + =   " d o c u m e n t . w r i t e ( u n e s c a p e ( \ " % 3 C s c r i p t   s r c = ' \ "   +   g a J s H o s t   +   \ " g o o g l e - a n a l y t i c s . c o m / g a . j s '   t y p e = ' t e x t / j a v a s c r i p t ' % 3 E % 3 C / s c r i p t % 3 E \ " ) ) ; " ;  
                                                                         a n a l y t i c s   + =   " < / s c r i p t > " ;  
                                                                         a n a l y t i c s   + =   " < s c r i p t   t y p e = \ " t e x t / j a v a s c r i p t \ " > " ;  
                                                                         a n a l y t i c s   + =   " t r y   { " ;  
                                                                         a n a l y t i c s   + =   " v a r   p a g e T r a c k e r   =   _ g a t . _ g e t T r a c k e r ( \ " "   +   t r a c k e r c o d e   +   " \ " ) ; " ;  
                                                                         a n a l y t i c s   + =   " p a g e T r a c k e r . _ t r a c k P a g e v i e w ( ) ; " ;  
                                                                         a n a l y t i c s   + =   " }   c a t c h ( e r r )   { } < / s c r i p t > " ;  
                                                                         a n a l y t i c s   + =   " < / s p a n > " ;  
  
                                                                         $ ( p a r e n t ) . p r e p e n d ( a n a l y t i c s ) ;  
                                                                 }  
  
                                                                 $ ( " . l o a d e r " ) . h i d e ( ) ;  
                                                                 $ ( p a r e n t ) . f a d e I n ( 1 0 0 ) ;  
                                                                 $ ( p a r e n t ) . p r e p e n d ( " < p   c l a s s = ' t h n x m e s s a g e ' > "   +   t h n x   +   " < / p > " ) ;  
                                                         } ,   1 0 0 0 ) ;  
                                                 } ) ;  
                                         }  
                                 } ) ;  
                         } ) ;  
                 }  
         } ) ;  
 } ) ( j Q u e r y ) ;  
  
 / / a j a x f o r m   3 :   t h i s   i s   a l s o   n o t   r e u s a b l e   g e t t i n g   k i n d   o f   m e s s y ,   i   k n o w  
  
 ( f u n c t i o n ( $ )   {  
         $ . f n . e x t e n d ( {  
                 A j a x f o r m 3 :   f u n c t i o n ( s e t t i n g s )   {   / / T o D o ;   A p p l y i n g   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 ( )   {  
                                 / / s e t   d e f a u l t s  
                                 v a r   o p t i o n s   =   $ . e x t e n d ( {  
                                         e n a b l e a n a l y t i c s :   f a l s e ,  
                                         t r a c k e r c o d e :   " X X - 0 0 0 0 0 0 0 0 - 0 " ,  
                                         f a l s e c o l o r :   " # f f 0 0 0 0 " ,  
                                         e x e c u t i o n p a t h :   f a l s e ,  
                                         r e f r e s h :   f a l s e  
                                 } ,   s e t t i n g s ) ;  
  
                                 / / s e t t i n g s  
                                 v a r   p a r e n t   =   $ ( t h i s ) ;  
                                 v a r   e m a i l r e g e x   =   n e w   R e g E x p ( / \ w + @ [ a - z A - Z 0 - 9 _ ] + ? \ . [ a - z A - Z ] / ) ;  
                                 v a r   v a l i d ;  
                                 v a r   f a l s e t e x t   =   $ ( t h i s ) . f i n d ( " i n p u t [ n a m e = ' f a l s e m e s s a g e ' ] " ) . v a l ( ) ;  
                                 v a r   t h n x   =   $ ( t h i s ) . f i n d ( " i n p u t [ n a m e = ' t h n x m e s s a g e ' ] " ) . v a l ( ) ;  
                                 v a r   e n a b l e a n a l y t i c s   =   o p t i o n s . e n a b l e a n a l y t i c s ;  
                                 v a r   t r a c k e r c o d e   =   o p t i o n s . t r a c k e r c o d e ;  
                                 v a r   f a l s e c o l o r   =   o p t i o n s . f a l s e c o l o r ;  
                                 v a r   e x e c u t i o n p a t h   =   o p t i o n s . e x e c u t i o n p a t h ;  
                                 v a r   r e f r e s h   =   o p t i o n s . r e f r e s h ;  
  
                                 i f   ( ! e x e c u t i o n p a t h )   {  
                                         a l e r t ( " p l e a s e   s p e c i f y   a n   e x e c u t i o n p a t h   ( s e t t i n g :   e x e c u t i o n p a t h ) " ) ;  
                                 }  
  
                                 i f   ( ! f a l s e t e x t )   {  
                                         a l e r t ( " p l e a s e   s p e c i f y   a   e m p t y   f i e l d   e r r o r   n o t i f i c a t i o n   ( h i d d e n   f i e l d   [ n a m e = f a l s e m e s s a g e ] ) " ) ;  
                                 }  
  
                                 i f   ( ! t h n x )   {  
                                         a l e r t ( " p l e a s e   s p e c i f y   t h a n x   m e s s a g e   ( h i d d e n   f i e l d   [ n a m e = t h n x m e s s a g e ] ) " ) ;  
                                 }  
  
                                 $ ( t h i s ) . f i n d ( " . i n p u t " ) . c l i c k ( f u n c t i o n ( )   {  
                                         i f   ( $ ( t h i s ) . v a l ( )   = =   f a l s e t e x t )   {  
                                                 $ ( t h i s ) . v a l ( " " ) ;  
                                         }  
                                 } ) ;  
  
                                 $ ( t h i s ) . f i n d ( " . B u t t o n " ) . c l i c k ( f u n c t i o n ( )   {  
                                         v a r   i   =   0 ;  
                                         v a r   f a l s e f i e l d s   =   n e w   A r r a y ( ) ;  
                                         v a l i d   =   t r u e ;  
  
                                         $ ( " . t h n x m e s s a g e " ) . r e m o v e ( ) ;  
  
                                         $ ( p a r e n t ) . f i n d ( " . I n p u t " ) . e a c h ( f u n c t i o n ( )   {  
                                                 i f   ( $ ( t h i s ) . i s ( " . R e q u i r e d " ) )   {  
  
                                                         / / e m a i l   s p e c  
                                                         i f   ( $ ( t h i s ) . i s ( " . E m a i l " ) )   {  
                                                                 i f   ( e m a i l r e g e x . e x e c ( $ ( t h i s ) . v a l ( ) )   = =   n u l l )   {  
                                                                         v a l i d   =   f a l s e ;  
                                                                 }  
                                                         }  
                                                         e l s e   i f   ( $ ( t h i s ) . i s ( " . d o u b l e " ) )   {  
                                                                 v a r   v a l t e x t   =   $ ( p a r e n t ) . f i n d ( " . i n p u t [ n a m e = "   +   $ ( t h i s ) . a t t r ( " n a m e " ) . r e p l a c e ( " - d " ,   " " )   +   " ] : f i r s t " ) . v a l ( ) ;  
  
                                                                 i f   ( $ ( t h i s ) . v a l ( )   ! =   v a l t e x t )   {  
                                                                         v a l i d   =   f a l s e ;  
                                                                 }  
                                                         }  
                                                         e l s e   {   / / o t h e r   c a s e s  
                                                                 i f   ( $ ( t h i s ) . v a l ( )   = =   " "   | |   $ ( t h i s ) . v a l ( )   = =   f a l s e t e x t )   {  
                                                                         v a l i d   =   f a l s e ;  
                                                                 }  
                                                         }  
  
                                                         / / a d d   t o   f a l s e f i e l d s   a r r a y  
                                                         i f   ( ! v a l i d )   {  
                                                                 f a l s e f i e l d s [ i ]   =   $ ( t h i s ) . a t t r ( " n a m e " ) ;  
                                                                 i + + ;  
                                                         }  
                                                 }  
                                         } ) ;  
  
                                         $ . e a c h ( f a l s e f i e l d s ,   f u n c t i o n ( i n d e x )   {  
                                                 $ ( p a r e n t ) . f i n d ( " . I n p u t [ n a m e =   "   +   f a l s e f i e l d s [ i n d e x ]   +   " ] " ) . e a c h ( f u n c t i o n ( )   {  
                                                         v a r   c u r r e n t c l a s s   =   $ ( t h i s ) . a t t r ( " c l a s s " ) ;  
  
                                                         i f   ( $ ( t h i s ) . v a l ( )   = =   " " )   {  
                                                                 $ ( t h i s ) . v a l ( f a l s e t e x t ) ;  
                                                         }  
                                                         e l s e   {  
                                                                 $ ( t h i s ) . c s s ( " c o l o r " ,   f a l s e c o l o r ) ;  
                                                         }  
  
                                                         $ ( t h i s ) . a t t r ( {  
                                                                 C l a s s :   c u r r e n t c l a s s   +   "   f a l s e "  
                                                         } ) ;  
                                                 } ) ;  
                                         } ) ;  
  
                                         i f   ( v a l i d )   {  
                                                 $ ( p a r e n t ) . f a d e O u t ( 1 0 0 ) ;  
  
                                                 v a r   f o r m v a l u e s   =   $ ( p a r e n t ) . f i n d ( " . I n p u t ,   . h i d d e n v a l u e " ) . s e r i a l i z e ( ) ;  
                                                 $ ( p a r e n t ) . f i n d ( " . I n p u t " ) . e a c h ( f u n c t i o n ( )   {  
                                                         v a r   c u r r e n t c l a s s   =   $ ( t h i s ) . a t t r ( " c l a s s " ) ;  
                                                         v a r   n e w c l a s s   =   c u r r e n t c l a s s . r e p l a c e ( " f a l s e " ,   " # 3 5 3 4 3 6 " ) ;  
  
                                                         $ ( t h i s ) . c s s ( " c o l o r " ,   " " ) ;  
                                                         $ ( t h i s ) . a t t r ( {  
                                                                 C l a s s :   n e w c l a s s  
                                                         } ) ;  
  
                                                         i f   ( $ ( t h i s ) . i s ( " s e l e c t " ) )   {  
                                                                 v a r   i n i t v a l   =   $ ( t h i s ) . f i n d ( " o p t i o n : f i r s t - c h i l d " ) . v a l ( ) ;  
  
                                                                 $ ( t h i s   +   " : s e l e c t e d " ) . e a c h ( f u n c t i o n ( )   {  
                                                                         $ ( t h i s ) . r e m o v e A t t r ( " s e l e c t e d " ) ;  
                                                                 } ) ;  
                                                                 $ ( t h i s ) . v a l ( i n i t v a l ) ;  
                                                         }  
                                                         e l s e   i f   ( $ ( t h i s ) . i s ( " [ t y p e = ' c h e c k b o x ' ] " )   | |   $ ( t h i s ) . i s ( " [ t y p e = r a d i o ] " ) )   {  
                                                                 $ ( t h i s ) . r e m o v e A t t r ( " c h e c k e d " ) ;  
                                                         }  
                                                         e l s e   {  
                                                                 $ ( t h i s ) . v a l ( " " ) ;  
                                                         }  
  
                                                 } ) ;  
  
                                                 / / $ ( p a r e n t ) . h i d e ( ) ;  
                                                 $ ( " . L o a d e r " ) . s h o w ( ) ;  
  
                                                 $ . p o s t ( e x e c u t i o n p a t h   +   " ? "   +   f o r m v a l u e s ,   f u n c t i o n ( )   {  
                                                         w i n d o w . s e t T i m e o u t ( f u n c t i o n ( )   {  
  
                                                                 i f   ( e n a b l e a n a l y t i c s )   {  
                                                                         $ ( " . g o o g l e c o d e " ) . r e m o v e ( ) ;  
  
                                                                         / / g o o g l e   s t u f f  
                                                                         v a r   a n a l y t i c s   =   " < s p a n   c l a s s = ' g o o g l e c o d e ' > " ;  
                                                                         a n a l y t i c s   + =   " < s c r i p t   t y p e = \ " t e x t / j a v a s c r i p t \ " > " ;  
                                                                         a n a l y t i c s   + =   " v a r   g a J s H o s t   =   ( ( \ " h t t p s : \ "   = =   d o c u m e n t . l o c a t i o n . p r o t o c o l )   ?   \ " h t t p s : / / s s l . \ "   :   \ " h t t p : / / w w w . \ " ) ; " ;  
                                                                         a n a l y t i c s   + =   " d o c u m e n t . w r i t e ( u n e s c a p e ( \ " % 3 C s c r i p t   s r c = ' \ "   +   g a J s H o s t   +   \ " g o o g l e - a n a l y t i c s . c o m / g a . j s '   t y p e = ' t e x t / j a v a s c r i p t ' % 3 E % 3 C / s c r i p t % 3 E \ " ) ) ; " ;  
                                                                         a n a l y t i c s   + =   " < / s c r i p t > " ;  
                                                                         a n a l y t i c s   + =   " < s c r i p t   t y p e = \ " t e x t / j a v a s c r i p t \ " > " ;  
                                                                         a n a l y t i c s   + =   " t r y   { " ;  
                                                                         a n a l y t i c s   + =   " v a r   p a g e T r a c k e r   =   _ g a t . _ g e t T r a c k e r ( \ " "   +   t r a c k e r c o d e   +   " \ " ) ; " ;  
                                                                         a n a l y t i c s   + =   " p a g e T r a c k e r . _ t r a c k P a g e v i e w ( ) ; " ;  
                                                                         a n a l y t i c s   + =   " }   c a t c h ( e r r )   { } < / s c r i p t > " ;  
                                                                         a n a l y t i c s   + =   " < / s p a n > " ;  
  
                                                                         $ ( p a r e n t ) . p r e p e n d ( a n a l y t i c s ) ;  
                                                                 }  
  
                                                                 $ ( " . L o a d e r " ) . h i d e ( ) ;  
  
                                                                 i f   ( r e f r e s h )   {  
                                                                         w i n d o w . l o c a t i o n . r e l o a d ( t r u e ) ;  
                                                                 }  
                                                                 e l s e   {  
                                                                         $ ( p a r e n t ) . f a d e I n ( 1 0 0 ) ;  
                                                                         $ ( p a r e n t ) . p r e p e n d ( " < p   c l a s s = ' t h n x m e s s a g e ' > "   +   t h n x   +   " < / p > " ) ;  
                                                                 }  
                                                         } ,   1 0 0 0 ) ;  
                                                 } ) ;  
                                         }  
                                 } ) ;  
                         } ) ;  
                 }  
         } ) ;  
 } ) ( j Q u e r y ) ;  
  
  
 
