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