ÿþf u n c t i o n   s l i d e ( s r c , l i n k , t e x t , t a r g e t , a t t r ) { t h i s . s r c = s r c ; t h i s . l i n k = l i n k ; t h i s . t e x t = t e x t ; t h i s . t a r g e t = t a r g e t ; t h i s . a t t r = a t t r ; i f ( d o c u m e n t . i m a g e s ) { t h i s . i m a g e = n e w   I m a g e ( ) ; }  
 t h i s . l o a d e d = f a l s e ; t h i s . l o a d = f u n c t i o n ( ) { i f ( ! d o c u m e n t . i m a g e s ) { r e t u r n ; }  
 i f ( ! t h i s . l o a d e d ) { t h i s . i m a g e . s r c = t h i s . s r c ; t h i s . l o a d e d = t r u e ; } }  
 t h i s . h o t l i n k = f u n c t i o n ( ) { v a r   m y w i n d o w ; i f ( ! t h i s . l i n k ) r e t u r n ; i f ( t h i s . t a r g e t ) { i f ( t h i s . a t t r ) { m y w i n d o w = w i n d o w . o p e n ( t h i s . l i n k , t h i s . t a r g e t , t h i s . a t t r ) ; } e l s e { m y w i n d o w = w i n d o w . o p e n ( t h i s . l i n k , t h i s . t a r g e t ) ; }  
 i f ( m y w i n d o w & & m y w i n d o w . f o c u s ) m y w i n d o w . f o c u s ( ) ; } e l s e { l o c a t i o n . h r e f = t h i s . l i n k ; } } }  
 f u n c t i o n   s l i d e s h o w ( s l i d e s h o w n a m e ) { t h i s . n a m e = s l i d e s h o w n a m e ; t h i s . r e p e a t = t r u e ; t h i s . p r e f e t c h = - 1 ; t h i s . i m a g e ; t h i s . t e x t i d ; t h i s . t e x t a r e a ; t h i s . t i m e o u t = 3 0 0 0 ; t h i s . s l i d e s = n e w   A r r a y ( ) ; t h i s . c u r r e n t = 0 ; t h i s . t i m e o u t i d = 0 ; t h i s . a d d _ s l i d e = f u n c t i o n ( s l i d e ) { v a r   i = t h i s . s l i d e s . l e n g t h ; i f ( t h i s . p r e f e t c h = = - 1 ) { s l i d e . l o a d ( ) ; }  
 t h i s . s l i d e s [ i ] = s l i d e ; }  
 t h i s . p l a y = f u n c t i o n ( t i m e o u t ) { t h i s . p a u s e ( ) ; i f ( t i m e o u t ) { t h i s . t i m e o u t = t i m e o u t ; }  
 i f ( t y p e o f   t h i s . s l i d e s [ t h i s . c u r r e n t ] . t i m e o u t ! = ' u n d e f i n e d ' ) { t i m e o u t = t h i s . s l i d e s [ t h i s . c u r r e n t ] . t i m e o u t ; } e l s e { t i m e o u t = t h i s . t i m e o u t ; }  
 t h i s . t i m e o u t i d = s e t T i m e o u t ( t h i s . n a m e + " . l o o p ( ) " , t i m e o u t ) ; }  
 t h i s . p a u s e = f u n c t i o n ( ) { i f ( t h i s . t i m e o u t i d ! = 0 ) { c l e a r T i m e o u t ( t h i s . t i m e o u t i d ) ; t h i s . t i m e o u t i d = 0 ; } }  
 t h i s . u p d a t e = f u n c t i o n ( ) { i f ( ! t h i s . v a l i d _ i m a g e ( ) ) { r e t u r n ; }  
 i f ( t y p e o f   t h i s . p r e _ u p d a t e _ h o o k = = ' f u n c t i o n ' ) { t h i s . p r e _ u p d a t e _ h o o k ( ) ; }  
 v a r   s l i d e = t h i s . s l i d e s [ t h i s . c u r r e n t ] ; v a r   d o f i l t e r = f a l s e ; i f ( t h i s . i m a g e & & t y p e o f   t h i s . i m a g e . f i l t e r s ! = ' u n d e f i n e d ' & & t y p e o f   t h i s . i m a g e . f i l t e r s [ 0 ] ! = ' u n d e f i n e d ' ) { d o f i l t e r = t r u e ; }  
 s l i d e . l o a d ( ) ; i f ( d o f i l t e r ) { i f ( s l i d e . f i l t e r & & t h i s . i m a g e . s t y l e & & t h i s . i m a g e . s t y l e . f i l t e r ) { t h i s . i m a g e . s t y l e . f i l t e r = s l i d e . f i l t e r ; }  
 t h i s . i m a g e . f i l t e r s [ 0 ] . A p p l y ( ) ; }  
 t h i s . i m a g e . s r c = s l i d e . i m a g e . s r c ; i f ( d o f i l t e r ) { t h i s . i m a g e . f i l t e r s [ 0 ] . P l a y ( ) ; }  
 t h i s . d i s p l a y _ t e x t ( ) ; i f ( t y p e o f   t h i s . p o s t _ u p d a t e _ h o o k = = ' f u n c t i o n ' ) { t h i s . p o s t _ u p d a t e _ h o o k ( ) ; }  
 i f ( t h i s . p r e f e t c h > 0 ) { v a r   n e x t , p r e v , c o u n t ; n e x t = t h i s . c u r r e n t ; p r e v = t h i s . c u r r e n t ; c o u n t = 0 ; d o { i f ( + + n e x t > = t h i s . s l i d e s . l e n g t h ) n e x t = 0 ; i f ( - - p r e v < 0 ) p r e v = t h i s . s l i d e s . l e n g t h - 1 ; t h i s . s l i d e s [ n e x t ] . l o a d ( ) ; t h i s . s l i d e s [ p r e v ] . l o a d ( ) ; } w h i l e ( + + c o u n t < t h i s . p r e f e t c h ) ; } }  
 t h i s . g o t o _ s l i d e = f u n c t i o n ( n ) { i f ( n = = - 1 ) { n = t h i s . s l i d e s . l e n g t h - 1 ; }  
 i f ( n < t h i s . s l i d e s . l e n g t h & & n > = 0 ) { t h i s . c u r r e n t = n ; }  
 t h i s . u p d a t e ( ) ; }  
 t h i s . g o t o _ r a n d o m _ s l i d e = f u n c t i o n ( i n c l u d e _ c u r r e n t ) { v a r   i ; i f ( t h i s . s l i d e s . l e n g t h > 1 ) { d o { i = M a t h . f l o o r ( M a t h . r a n d o m ( ) * t h i s . s l i d e s . l e n g t h ) ; } w h i l e ( i = = t h i s . c u r r e n t ) ; t h i s . g o t o _ s l i d e ( i ) ; } }  
 t h i s . n e x t = f u n c t i o n ( ) { i f ( t h i s . c u r r e n t < t h i s . s l i d e s . l e n g t h - 1 ) { t h i s . c u r r e n t + + ; } e l s e   i f ( t h i s . r e p e a t ) { t h i s . c u r r e n t = 0 ; }  
 t h i s . u p d a t e ( ) ; }  
 t h i s . p r e v i o u s = f u n c t i o n ( ) { i f ( t h i s . c u r r e n t > 0 ) { t h i s . c u r r e n t - - ; } e l s e   i f ( t h i s . r e p e a t ) { t h i s . c u r r e n t = t h i s . s l i d e s . l e n g t h - 1 ; }  
 t h i s . u p d a t e ( ) ; }  
 t h i s . s h u f f l e = f u n c t i o n ( ) { v a r   i , i 2 , s l i d e s _ c o p y , s l i d e s _ r a n d o m i z e d ; s l i d e s _ c o p y = n e w   A r r a y ( ) ; f o r ( i = 0 ; i < t h i s . s l i d e s . l e n g t h ; i + + ) { s l i d e s _ c o p y [ i ] = t h i s . s l i d e s [ i ] ; }  
 s l i d e s _ r a n d o m i z e d = n e w   A r r a y ( ) ; d o { i = M a t h . f l o o r ( M a t h . r a n d o m ( ) * s l i d e s _ c o p y . l e n g t h ) ; s l i d e s _ r a n d o m i z e d [ s l i d e s _ r a n d o m i z e d . l e n g t h ] = s l i d e s _ c o p y [ i ] ; f o r ( i 2 = i + 1 ; i 2 < s l i d e s _ c o p y . l e n g t h ; i 2 + + ) { s l i d e s _ c o p y [ i 2 - 1 ] = s l i d e s _ c o p y [ i 2 ] ; }  
 s l i d e s _ c o p y . l e n g t h - - ; } w h i l e ( s l i d e s _ c o p y . l e n g t h ) ; t h i s . s l i d e s = s l i d e s _ r a n d o m i z e d ; }  
 t h i s . g e t _ t e x t = f u n c t i o n ( ) { r e t u r n ( t h i s . s l i d e s [ t h i s . c u r r e n t ] . t e x t ) ; }  
 t h i s . g e t _ a l l _ t e x t = f u n c t i o n ( b e f o r e _ s l i d e , a f t e r _ s l i d e ) { a l l _ t e x t = " " ; f o r ( i = 0 ; i < t h i s . s l i d e s . l e n g t h ; i + + ) { s l i d e = t h i s . s l i d e s [ i ] ; i f ( s l i d e . t e x t ) { a l l _ t e x t + = b e f o r e _ s l i d e + s l i d e . t e x t + a f t e r _ s l i d e ; } }  
 r e t u r n ( a l l _ t e x t ) ; }  
 t h i s . d i s p l a y _ t e x t = f u n c t i o n ( t e x t ) { i f ( ! t e x t ) { t e x t = t h i s . s l i d e s [ t h i s . c u r r e n t ] . t e x t ; }  
 i f ( t h i s . t e x t a r e a & & t y p e o f   t h i s . t e x t a r e a . v a l u e ! = ' u n d e f i n e d ' ) { t h i s . t e x t a r e a . v a l u e = t e x t ; }  
 i f ( t h i s . t e x t i d ) { r = t h i s . g e t E l e m e n t B y I d ( t h i s . t e x t i d ) ; i f ( ! r ) { r e t u r n   f a l s e ; }  
 i f ( t y p e o f   r . i n n e r H T M L = = ' u n d e f i n e d ' ) { r e t u r n   f a l s e ; }  
 r . i n n e r H T M L = t e x t ; } }  
 t h i s . h o t l i n k = f u n c t i o n ( ) { t h i s . s l i d e s [ t h i s . c u r r e n t ] . h o t l i n k ( ) ; }  
 t h i s . s a v e _ p o s i t i o n = f u n c t i o n ( c o o k i e n a m e ) { i f ( ! c o o k i e n a m e ) { c o o k i e n a m e = t h i s . n a m e + ' _ s l i d e s h o w ' ; }  
 d o c u m e n t . c o o k i e = c o o k i e n a m e + ' = ' + t h i s . c u r r e n t ; }  
 t h i s . r e s t o r e _ p o s i t i o n = f u n c t i o n ( c o o k i e n a m e ) { i f ( ! c o o k i e n a m e ) { c o o k i e n a m e = t h i s . n a m e + ' _ s l i d e s h o w ' ; }  
 v a r   s e a r c h = c o o k i e n a m e + " = " ; i f ( d o c u m e n t . c o o k i e . l e n g t h > 0 ) { o f f s e t = d o c u m e n t . c o o k i e . i n d e x O f ( s e a r c h ) ; i f ( o f f s e t ! = - 1 ) { o f f s e t + = s e a r c h . l e n g t h ; e n d = d o c u m e n t . c o o k i e . i n d e x O f ( " ; " , o f f s e t ) ; i f ( e n d = = - 1 ) e n d = d o c u m e n t . c o o k i e . l e n g t h ; t h i s . c u r r e n t = p a r s e I n t ( u n e s c a p e ( d o c u m e n t . c o o k i e . s u b s t r i n g ( o f f s e t , e n d ) ) ) ; } } }  
 t h i s . n o s c r i p t = f u n c t i o n ( ) { $ h t m l = " \ n " ; f o r ( i = 0 ; i < t h i s . s l i d e s . l e n g t h ; i + + ) { s l i d e = t h i s . s l i d e s [ i ] ; $ h t m l + = ' < P > ' ; i f ( s l i d e . l i n k ) { $ h t m l + = ' < a   h r e f = " ' + s l i d e . l i n k + ' " > ' ; }  
 $ h t m l + = ' < i m g   s r c = " ' + s l i d e . s r c + ' "   A L T = " s l i d e s h o w   i m a g e " > ' ; i f ( s l i d e . l i n k ) { $ h t m l + = " < \ / a > " ; }  
 i f ( s l i d e . t e x t ) { $ h t m l + = " < B R > \ n " + s l i d e . t e x t ; }  
 $ h t m l + = " < \ / P > " + " \ n \ n " ; }  
 $ h t m l = $ h t m l . r e p l a c e ( / \ & / g , " & " ) ; $ h t m l = $ h t m l . r e p l a c e ( / < / g , " < " ) ; $ h t m l = $ h t m l . r e p l a c e ( / > / g , " > " ) ; r e t u r n ( ' < p r e > ' + $ h t m l + ' < / p r e > ' ) ; }  
 t h i s . l o o p = f u n c t i o n ( ) { i f ( t h i s . c u r r e n t < t h i s . s l i d e s . l e n g t h - 1 ) { n e x t _ s l i d e = t h i s . s l i d e s [ t h i s . c u r r e n t + 1 ] ; i f ( n e x t _ s l i d e . i m a g e . c o m p l e t e = = n u l l | | n e x t _ s l i d e . i m a g e . c o m p l e t e ) { t h i s . n e x t ( ) ; } } e l s e { t h i s . n e x t ( ) ; }  
 t h i s . p l a y ( ) ; }  
 t h i s . v a l i d _ i m a g e = f u n c t i o n ( ) { i f ( ! t h i s . i m a g e )  
 { r e t u r n   f a l s e ; }  
 e l s e { r e t u r n   t r u e ; } }  
 t h i s . g e t E l e m e n t B y I d = f u n c t i o n ( e l e m e n t _ i d ) { i f ( d o c u m e n t . g e t E l e m e n t B y I d ) { r e t u r n   d o c u m e n t . g e t E l e m e n t B y I d ( e l e m e n t _ i d ) ; }  
 e l s e   i f ( d o c u m e n t . a l l ) { r e t u r n   d o c u m e n t . a l l [ e l e m e n t _ i d ] ; }  
 e l s e   i f ( d o c u m e n t . l a y e r s ) { r e t u r n   d o c u m e n t . l a y e r s [ e l e m e n t _ i d ] ; } e l s e { r e t u r n   u n d e f i n e d ; } }  
 t h i s . s e t _ i m a g e = f u n c t i o n ( i m a g e o b j e c t ) { i f ( ! d o c u m e n t . i m a g e s )  
 r e t u r n ; t h i s . i m a g e = i m a g e o b j e c t ; }  
 t h i s . s e t _ t e x t a r e a = f u n c t i o n ( t e x t a r e a o b j e c t ) { t h i s . t e x t a r e a = t e x t a r e a o b j e c t ; t h i s . d i s p l a y _ t e x t ( ) ; }  
 t h i s . s e t _ t e x t i d = f u n c t i o n ( t e x t i d s t r ) { t h i s . t e x t i d = t e x t i d s t r ; t h i s . d i s p l a y _ t e x t ( ) ; } } 
