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