ÿþ 
 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 = 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   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 = " < b r > < i m g   s r c = ' l a y o u t / l o a d i n g . g i f ' / > "    
  
  
  
 / / / / 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 u r r e n t T a b I n d e x = 0   / / I n d e x   o f   c u r r e n t l y   s e l e c t e d   h o t   t a b   ( t a b   w i t h   s u b   c o n t e n t )   w i t h i n   h o t t a b s p o s i t i o n s [ ]   a r r a y  
 	 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 : a u t o ;   m i n - h e i g h t :   1 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 . 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   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  
 	 } ,  
  
 	 c y c l e i t : f u n c t i o n ( d i r ,   a u t o r u n ) {   / / P U B L I C   f u n c t i o n   t o   m o v e   f o w a r d   o r   b a c k w a r d s   t h r o u g h   e a c h   h o t   t a b   ( t a b i n s t a n c e . c y c l e i t ( ' f o w a r d / b a c k ' )   )  
 	 	 i f   ( d i r = = " n e x t " ) {  
 	 	 	 v a r   c u r r e n t T a b I n d e x = ( t h i s . c u r r e n t T a b I n d e x < 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 . c u r r e n t T a b I n d e x + 1   :   0  
 	 	 }  
 	 	 e l s e   i f   ( d i r = = " p r e v " ) {  
 	 	 	 v a r   c u r r e n t T a b I n d e x = ( t h i s . c u r r e n t T a b I n d e x > 0 ) ?   t h i s . c u r r e n t T a b I n d e x - 1   :   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  
 	 	 }  
 	 	 i f   ( t y p e o f   a u t o r u n = = " u n d e f i n e d " )   / / i f   c y c l e i t ( )   i s   b e i n g   c a l l e d   b y   u s e r ,   v e r s u s   a u t o r u n ( )   f u n c t i o n  
 	 	 	 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 )  
 	 	 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 [ c u r r e n t T a b I n d e x ] ] )  
 	 } ,  
  
 	 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  
 	 } ,  
  
 	 u r l p a r a m s e l e c t : f u n c t i o n ( t a b i n t e r f a c e 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 ( t a b i n t e r f a c e i d + " = ( \ \ d + ) " ,   " i " ) )   / / c h e c k   f o r   " ? t a b i n t e r f a c e 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  
 	 } ,  
  
 	 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 )  
 	 	 t h i s . s e t c u r r e n t t a b i n d e x ( t a b r e f . t a b p o s i t i o n )   / / r e m e m b e r   p o s i t i o n   o f   s e l e c t e d   t a b   w i t h i n   h o t t a b s p o s i t i o n s [ ]   a r r a y  
 	 } ,  
  
 	 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 "  
 	 	 }  
 	 } ,  
  
 	 s e t c u r r e n t t a b i n d e x : f u n c t i o n ( t a b p o s i t i o n ) {   / / s t o r e   c u r r e n t   p o s i t i o n   o f   t a b   ( w i t h i n   h o t t a b s p o s i t i o n s [ ]   a r r a y )  
 	 	 f o r   ( v a r   i = 0 ;   i < 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 + + ) {  
 	 	 	 i f   ( t a b p o s i t i o n = = t h i s . h o t t a b s p o s i t i o n s [ i ] ) {  
 	 	 	 	 t h i s . c u r r e n t T a b I n d e x = i  
 	 	 	 	 b r e a k  
 	 	 	 }  
 	 	 }  
 	 } ,  
  
 	 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  
 	 	 t h i s . c y c l e i t ( ' n e x t ' ,   t r u e )  
 	 } ,  
  
 	 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   s e l e c t e d t a b = - 1   / / C u r r e n t l y   s e l e c t e d   t a b   i n d e x   ( - 1   m e a n i n g   n o n e )  
 	 	 v a r   s e l e c t e d t a b f r o m u r l = t h i s . u r l p a r a m s e l e c t ( t h i s . t a b i n t e r f a c e i d )   / / r e t u r n s   n u l l   o r   i n d e x   f r o m :   t a b c o n t e n t . h t m ? t a b i n t e r f a c e i d = i n d e x  
 	 	 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   ( s e l e c t e d t a b f r o m u r l = = 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   & &   s e l e c t e d t a b = = - 1   & &   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   & &   s e l e c t e d t a b = = - 1   & &   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 " ) {  
 	 	 	 	 	 s e l e c t e d t a b = i   / / S e l e c t e d   t a b   i n d e x ,   i f   f o u n d  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }   / / E N D   f o r   l o o p  
 	 	 i f   ( s e l e c t e d t a b ! = - 1 )   / / i f   a   v a l i d   d e f a u l t   s e l e c t e d   t a b   i n d e x   i s   f o u n d  
 	 	 	 t h i s . e x p a n d t a b ( t h i s . t a b s [ s e l e c t e d t a b ] )   / / e x p a n d   s e l e c t e d   t a b   ( e i t h e r   f r o m   U R L   p a r a m e t e r ,   p e r s i s t e n t   f e a t u r e ,   o r   c l a s s = " s e l e c t e d "   c l a s s )  
 	 	 e l s e   / / i f   n o   v a l i d   d e f a u l t   s e l e c t e d   i n d e x   f o u n d  
 	 	 	 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 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 
