ÿþd o c u m e n t . w r i t e ( ' < s t y l e   t y p e = " t e x t / c s s " > # t o p - s l i d e r   u l   { d i s p l a y :   n o n e ; } < / s t y l e > ' ) ;  
 	 / / < ! [ C D A T A [  
 $ ( d o c u m e n t ) . r e a d y ( f u n c t i o n ( )   {  
 	 / / $ ( ' s t y l e ' ) . r e m o v e ( ) ;  
 	 $ ( ' # t o p - s l i d e r   u l ' ) . c s s ( ' d i s p l a y ' ,   ' b l o c k ' ) ;  
 	 $ ( ' i n p u t # D o m a i n N a m e ' ) . f o c u s ( ) ;      
 	  
 	 $ ( ' # t o p - s l i d e r ' ) . w r a p I n n e r ( ' < d i v   i d = " u l _ i n n e r " > < / d i v > ' ) ;  
 	 $ ( ' # t o p - s l i d e r ' ) . p r e p e n d ( ' < a   h r e f = " j a v a s c r i p t : s l i d e ( \ ' l e f t \ ' ) "   c l a s s = " l e f t " > < / a > < a   h r e f = " j a v a s c r i p t : s l i d e ( \ ' r i g h t \ ' ) "   c l a s s = " r i g h t " > < / a > ' ) ;  
 	 i f   (   $ . b r o w s e r . m s i e   & &   $ . b r o w s e r . v e r s i o n   = =   ' 7 . 0 '   )   {  
 	 	 $ ( ' # t o p - s l i d e r   a . l e f t ' ) . c s s ( ' m a r g i n - l e f t ' ,   ' - 0 p x ' ) ;  
 	 	 $ ( ' # t o p - s l i d e r   a . r i g h t ' ) . c s s ( ' m a r g i n - l e f t ' ,   ' 9 5 5 p x ' ) ;  
 	 }  
 	  
 	 i f   (   $ . b r o w s e r . m s i e   & &   $ . b r o w s e r . v e r s i o n   = =   ' 8 . 0 '   )   {  
 	 	 $ ( ' # t o p - s l i d e r   a . l e f t ' ) . c s s ( ' m a r g i n - l e f t ' ,   ' 1 0 p x ' ) ;  
 	 	 $ ( ' # t o p - s l i d e r   a . r i g h t ' ) . c s s ( ' m a r g i n - l e f t ' ,   ' 9 5 5 p x ' ) ;  
 	 }  
 	  
 	  
 	 i f   (   $ . b r o w s e r . m s i e   ! =   t r u e   )   {    
 	  
 	 	 $ ( ' # t o p - s l i d e r   a . l e f t ' ) . f a d e O u t ( ' f a s t ' ) ;  
 	 	 $ ( ' # t o p - s l i d e r   a . r i g h t ' ) . f a d e O u t ( ' f a s t ' ) ;  
  
 	 }  
 	  
 	  
 	 $ ( ' # t o p - s l i d e r ' ) . h o v e r (   f u n c t i o n ( )   {  
 	 	 i f   (   $ . b r o w s e r . m s i e   ! =   t r u e   )   {  
 	 	 	 $ ( ' # t o p - s l i d e r   a . l e f t ' ) . f a d e I n ( ' f a s t ' ) ;  
 	 	 	 $ ( ' # t o p - s l i d e r   a . r i g h t ' ) . f a d e I n ( ' f a s t ' ) ;  
 	 	 }  
 	 } ,   f u n c t i o n ( )   {  
 	 	 i f   (   $ . b r o w s e r . m s i e   ! =   t r u e   )   {  
 	 	 	 $ ( ' # t o p - s l i d e r   a . l e f t ' ) . f a d e O u t ( ' f a s t ' ) ;  
 	 	 	 $ ( ' # t o p - s l i d e r   a . r i g h t ' ) . f a d e O u t ( ' f a s t ' ) ; 	  
 	 	 }  
 	 } ) ;  
 	  
  
 	 / / o p t i o n s (   1   -   O N   ,   0   -   O F F )  
 	 v a r   a u t o _ s l i d e   =   1 ;  
 	 v a r   h o v e r _ p a u s e   =   1 ;  
 	 v a r   k e y _ s l i d e   =   1 ;  
  
 	 / / s p e e d   o f   a u t o   s l i d e (  
 	 v a r   a u t o _ s l i d e _ s e c o n d s   =   7 0 0 0 ;  
  
 	 / * m o v e   t h e   l a s t   l i s t   i t e m   b e f o r e   t h e   f i r s t   i t e m .   T h e   p u r p o s e   o f   t h i s   i s  
 	 i f   t h e   u s e r   c l i c k s   t o   s l i d e   l e f t   h e   w i l l   b e   a b l e   t o   s e e   t h e   l a s t   i t e m . * /  
 	 $ ( ' # t o p - s l i d e r   u l   l i : f i r s t ' ) . b e f o r e ( $ ( ' # t o p - s l i d e r   u l   l i : l a s t ' ) ) ;  
  
 	 / / c h e c k   i f   a u t o   s l i d i n g   i s   e n a b l e d  
 	 i f ( a u t o _ s l i d e   = =   1 ) {  
 	 	 / * s e t   t h e   i n t e r v a l   ( l o o p )   t o   c a l l   f u n c t i o n   s l i d e   w i t h   o p t i o n   ' r i g h t '  
 	 	 a n d   s e t   t h e   i n t e r v a l   t i m e   t o   t h e   v a r i a b l e   w e   d e c l a r e d   p r e v i o u s l y   * /  
 	 	 v a r   t i m e r   =   s e t I n t e r v a l ( ' s l i d e ( " r i g h t " ) ' ,   a u t o _ s l i d e _ s e c o n d s ) ;  
  
 	 	 / * a n d   c h a n g e   t h e   v a l u e   o f   o u r   h i d d e n   f i e l d   t h a t   h o l d   i n f o   a b o u t  
 	 	 t h e   i n t e r v a l ,   s e t t i n g   i t   t o   t h e   n u m b e r   o f   m i l l i s e c o n d s   w e   d e c l a r e d   p r e v i o u s l y * /  
 	 	 $ ( ' # h i d d e n _ a u t o _ s l i d e _ s e c o n d s ' ) . v a l ( a u t o _ s l i d e _ s e c o n d s ) ;  
 	 }  
  
 	 / / c h e c k   i f   h o v e r   p a u s e   i s   e n a b l e d  
 	 i f ( h o v e r _ p a u s e   = =   1 ) {  
 	 	 / / w h e n   h o v e r e d   o v e r   t h e   l i s t  
 	 	 $ ( ' # t o p - s l i d e r   u l ' ) . h o v e r ( f u n c t i o n ( ) {  
 	 	 	 / / s t o p   t h e   i n t e r v a l  
 	 	 	 c l e a r I n t e r v a l ( t i m e r )  
 	 	 } , f u n c t i o n ( ) {  
 	 	 	 / / a n d   w h e n   m o u s e o u t   s t a r t   i t   a g a i n  
 	 	 	 t i m e r   =   s e t I n t e r v a l ( ' s l i d e ( " r i g h t " ) ' ,   a u t o _ s l i d e _ s e c o n d s ) ;  
 	 	 } ) ;  
  
 	 }  
  
 	 / / c h e c k   i f   k e y   s l i d i n g   i s   e n a b l e d  
 	 i f ( k e y _ s l i d e   = =   1 ) {  
  
 	 	 / / b i n d i n g   k e y p r e s s   f u n c t i o n  
 	 	 $ ( d o c u m e n t ) . b i n d ( ' k e y p r e s s ' ,   f u n c t i o n ( e )   {  
 	 	 	 / / k e y C o d e   f o r   l e f t   a r r o w   i s   3 7   a n d   f o r   r i g h t   i t ' s   3 9   '  
 	 	 	 i f ( e . k e y C o d e = = 3 7 ) {  
 	 	 	 	 	 / / i n i t i a l i z e   t h e   s l i d e   t o   l e f t   f u n c t i o n  
 	 	 	 	 	 s l i d e ( ' l e f t ' ) ;  
 	 	 	 } e l s e   i f ( e . k e y C o d e = = 3 9 ) {  
 	 	 	 	 	 / / i n i t i a l i z e   t h e   s l i d e   t o   r i g h t   f u n c t i o n  
 	 	 	 	 	 s l i d e ( ' r i g h t ' ) ;  
 	 	 	 }  
 	 	 } ) ;  
  
 	 }  
 } ) ;  
  
 / / s l i d e   f u n c t i o n  
 f u n c t i o n   s l i d e ( w h e r e ) {  
  
 	 / / g e t   t h e   i t e m   w i d t h  
 	 v a r   i t e m _ w i d t h   =   $ ( ' # t o p - s l i d e r   u l   l i ' ) . o u t e r W i d t h ( ) ;  
  
 	 / *   u s i n g   a   i f   s t a t e m e n t   a n d   t h e   w h e r e   v a r i a b l e   c h e c k  
 	 w e   w i l l   c h e c k   w h e r e   t h e   u s e r   w a n t s   t o   s l i d e   ( l e f t   o r   r i g h t ) * /  
 	 i f ( w h e r e   = =   ' l e f t ' ) {  
 	 	 / / . . . c a l c u l a t i n g   t h e   n e w   l e f t   i n d e n t   o f   t h e   u n o r d e r e d   l i s t   ( u l )   f o r   l e f t   s l i d i n g  
 	 	 v a r   l e f t _ i n d e n t   =   p a r s e I n t ( $ ( ' # t o p - s l i d e r   u l ' ) . c s s ( ' l e f t ' ) )   +   i t e m _ w i d t h ;  
 	 } e l s e {  
 	 	 / / . . . c a l c u l a t i n g   t h e   n e w   l e f t   i n d e n t   o f   t h e   u n o r d e r e d   l i s t   ( u l )   f o r   r i g h t   s l i d i n g  
 	 	 v a r   l e f t _ i n d e n t   =   p a r s e I n t ( $ ( ' # t o p - s l i d e r   u l ' ) . c s s ( ' l e f t ' ) )   -   i t e m _ w i d t h ;  
  
 	 }  
  
 	 / / m a k e   t h e   s l i d i n g   e f f e c t   u s i n g   j Q u e r y ' s   a n i m a t e   f u n c t i o n . . .   '  
 	 $ ( ' # t o p - s l i d e r   u l : n o t ( : a n i m a t e d ) ' ) . a n i m a t e ( { ' l e f t '   :   l e f t _ i n d e n t } , 5 0 0 , f u n c t i o n ( ) {  
  
 	 	 / *   w h e n   t h e   a n i m a t i o n   f i n i s h e s   u s e   t h e   i f   s t a t e m e n t   a g a i n ,   a n d   m a k e   a n   i l u s s i o n  
 	 	 o f   i n f i n i t y   b y   c h a n g i n g   p l a c e   o f   l a s t   o r   f i r s t   i t e m * /  
 	 	 i f ( w h e r e   = =   ' l e f t ' ) {  
 	 	 	 / / . . . a n d   i f   i t   s l i d e d   t o   l e f t   w e   p u t   t h e   l a s t   i t e m   b e f o r e   t h e   f i r s t   i t e m  
 	 	 	 $ ( ' # t o p - s l i d e r   u l   l i : f i r s t ' ) . b e f o r e ( $ ( ' # t o p - s l i d e r   u l   l i : l a s t ' ) ) ;  
 	 	 } e l s e {  
 	 	 	 / / . . . a n d   i f   i t   s l i d e d   t o   r i g h t   w e   p u t   t h e   f i r s t   i t e m   a f t e r   t h e   l a s t   i t e m  
 	 	 	 $ ( ' # t o p - s l i d e r   u l   l i : l a s t ' ) . a f t e r ( $ ( ' # t o p - s l i d e r   u l   l i : f i r s t ' ) ) ;  
 	 	 }  
  
 	 	 / / . . . a n d   t h e n   j u s t   g e t   b a c k   t h e   d e f a u l t   l e f t   i n d e n t  
 	 	 $ ( ' # t o p - s l i d e r   u l ' ) . c s s ( { ' l e f t '   :   ' - 9 9 0 p x ' } ) ;  
 	 } ) ;  
  
 }  
 / / ] ] > 
