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