ÿþ/ /   z o o m i   -   A   z o o m   f o r   i m a g e s   ~   S e a n   C a t c h p o l e   -   V e r s i o n   0 . 9  
 ( f u n c t i o n ( $ ) {  
  
 $ . f n . z o o m i   =   f u n c t i o n ( )   {  
     $ ( t h i s ) . f i l t e r ( " i m g " ) . e a c h ( f u n c t i o n ( ) {  
         i f ( ! t h i s . z )   {  
             $ ( t h i s ) . z o o m 1 ( ) . m o u s e o v e r ( f u n c t i o n ( ) { $ ( t h i s ) . z o o m 2 ( ) . s h o w ( ) ; } ) ;  
             $ ( t h i s . z ) . m o u s e o u t ( f u n c t i o n ( ) { $ ( t h i s ) . h i d e ( ) ; } ) ;   }  
     } ) ;  
   r e t u r n   t h i s ;  
 }  
  
 $ . f n . z o o m 1   =   f u n c t i o n ( )   {  
     $ ( t h i s ) . e a c h ( f u n c t i o n ( ) {  
         v a r   e   =   t h i s ;  
         $ ( e ) . c s s ( { ' p o s i t i o n ' : ' r e l a t i v e ' , ' z - i n d e x ' : ' 8 ' } ) . a f t e r ( ' < i m g   c l a s s = " ' + e . c l a s s N a m e + ' " > ' ) ;  
         e . z   =   e . n e x t S i b l i n g ;  
         $ ( e . z ) . r e m o v e C l a s s ( " z o o m i " ) . a d d C l a s s ( " z o o m 2 " ) . a t t r ( " s r c " , e . a l t   | |   e . s r c )  
         . c s s ( { ' p o s i t i o n ' : ' a b s o l u t e ' , ' z - i n d e x ' : ' 1 0 ' } ) ;  
         $ ( e . z ) . h i d e ( ) ;  
     } ) ;  
     r e t u r n   t h i s ;  
 }  
  
 $ . f n . z o o m 2   =   f u n c t i o n ( )   {  
     v a r   s   =   [ ] ;  
     t h i s . e a c h ( f u n c t i o n ( ) {  
         v a r   e   =   t h i s ;  
         i f ( ! e . z )   e   =   $ ( e ) . z o o m 1 ( ) [ 0 ] ;   s . p u s h ( e . z ) ;  
         i f ( ! e . z . c o m p l e t e )   r e t u r n ;  
         i f ( ! e . z . w i d t h )   {   $ ( e . z ) . s h o w ( ) ;   e . z . w i d t h = e . z . w i d t h ;   $ ( e . z ) . h i d e ( ) ;   }  
         $ ( e . z ) . c s s ( { l e f t : $ ( e ) . o f f s e t L e f t ( ) - ( e . z . w i d t h - e . s c r o l l W i d t h ) / 2 + ' p x ' ,  
         t o p : $ ( e ) . o f f s e t T o p ( ) - ( e . z . h e i g h t - e . s c r o l l H e i g h t ) / 2 + ' p x ' } ) ;  
     } ) ;  
     r e t u r n   t h i s . p u s h S t a c k ( s ) ;  
 }  
  
 $ . f n . o f f s e t L e f t   =   f u n c t i o n ( )   {  
     v a r   e   =   t h i s [ 0 ] ;  
     i f ( ! e . o f f s e t P a r e n t )   r e t u r n   e . o f f s e t L e f t ;  
     r e t u r n   e . o f f s e t L e f t   +   $ ( e . o f f s e t P a r e n t ) . o f f s e t L e f t ( ) ;   }  
  
 $ . f n . o f f s e t T o p   =   f u n c t i o n ( )   {  
     v a r   e   =   t h i s [ 0 ] ;  
     i f ( ! e . o f f s e t P a r e n t )   r e t u r n   e . o f f s e t T o p ;  
     r e t u r n   e . o f f s e t T o p   +   $ ( e . o f f s e t P a r e n t ) . o f f s e t T o p ( ) ;   }  
  
 $ ( f u n c t i o n ( ) {   $ ( ' i m g . z o o m i ' ) . z o o m i ( ) ;   } ) ;  
  
 } ) ( j Q u e r y ) ;  
 
