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