ÿþ/ / * *   T a b   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 ) 
 
 
 
         f u n c t i o n   K e t Q u a B o P h i e u ( d e s ) 
         { 
                 v a r   n a   =   ' p o l l ' ; 
                 v a r   G i a T r i C h o n   =   g e t R a d i o V a l u e ( n a ) ; 
                 v a r   M a C h o n   =   d o c u m e n t . g e t E l e m e n t B y I d ( " M a B Q " ) . v a l u e ; 
 
                 i f   ( G i a T r i C h o n   ! =   n u l l ) { 
                         d o c u m e n t . g e t E l e m e n t B y I d ( " f G i a T r i C h o n " ) . v a l u e   =   G i a T r i C h o n ; 
                         d o c u m e n t . g e t E l e m e n t B y I d ( " G T B Q " ) . v a l u e   =   G i a T r i C h o n ; 
                         v a r   m y W i n d o w = w i n d o w . o p e n ( d e s   +   " & c h o i c e = "   +   G i a T r i C h o n   +   " & i d = "   +   M a C h o n   + " & s u b m i t = V o t e " , ' w i n d o w R e f ' , ' w i d t h = 5 4 0 , h e i g h t = 3 0 0 , s t a t u s = y e s , r e s i z a b l e = n o ,   x = 4 0 0 , y = 3 0 0 ,   t o p = 2 0 ,   l e f t = 3 3 0 , t o o l b a r = n o , d i r e c t o r i e s = n o , s t a t u s = n o , m e n u b a r = n o , s c r o l l b a r s = y e s , m o d a l = y e s ' ) ; 
                         i f   ( ! m y W i n d o w . o p e n e r )   m y W i n d o w . o p e n e r   =   s e l f ; 
                 } 
                 e l s e 
                 { 
                         a l e r t ( " B ¡n   c h °a   c h Ín   ý   k i ¿n ! " ) ; 
                 } 
                 r e t u r n   f a l s e ; 
         } 
         f u n c t i o n   H i e n T h i K e t Q u a ( d e s ) 
         { 
                 v a r   n a   =   ' p o l l ' ; 
                 v a r   G i a T r i C h o n   =   0 ; / / g e t R a d i o V a l u e ( n a ) ; 
                 v a r   M a C h o n   =   d o c u m e n t . g e t E l e m e n t B y I d ( " M a B Q " ) . v a l u e ; 
 
                 i f   ( G i a T r i C h o n   = =   n u l l )   G i a T r i C h o n   =   0 ; 
                 d o c u m e n t . g e t E l e m e n t B y I d ( " f G i a T r i C h o n " ) . v a l u e   =   G i a T r i C h o n ; 
                 v a r   m y W i n d o w = w i n d o w . o p e n ( d e s   + " & i d = "   +   M a C h o n , ' w i n d o w R e f ' , ' w i d t h = 5 4 0 , h e i g h t = 3 0 0 , s t a t u s = y e s , r e s i z a b l e = n o ,   x = 4 0 0 , y = 3 0 0 ,   t o p = 2 2 0 ,   l e f t = 3 3 0 , t o o l b a r = n o , d i r e c t o r i e s = n o , s t a t u s = n o , m e n u b a r = n o , s c r o l l b a r s = y e s , m o d a l = y e s ' ) ; 
                 i f   ( ! m y W i n d o w . o p e n e r )   m y W i n d o w . o p e n e r   =   s e l f ; 
 
                 r e t u r n   f a l s e ; 
         } 
         f u n c t i o n   g e t R a d i o V a l u e ( i d ) 
         { 
                 v a r   r a d i o L i s t O b j   =   d o c u m e n t . g e t E l e m e n t B y I d ( i d ) ; 
                 v a r   r a d L i s t   =   r a d i o L i s t O b j . g e t E l e m e n t s B y T a g N a m e ( ' i n p u t ' ) ; 
                 i f   ( r a d L i s t   ! =   n u l l   & &   r a d L i s t . l e n g t h   > 0 ) 
                 { 
                         f o r ( v a r   i = 0 ;   i < r a d L i s t . l e n g t h ;   i + + ) 
                         { 
                                 i f   ( r a d L i s t [ i ] . t y p e   = =   " c h e c k b o x "   & &   r a d L i s t [ i ] . c h e c k e d   = =   t r u e ) 
                                 { 
                                         v a r   o i d   =   r a d L i s t [ i ] . i d ; 
                                         v a r   a r r   =   o i d . s p l i t ( " _ " ) ; 
                                         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 ( " V L _ "   +   a r r [ a r r . l e n g t h - 1 ] ) . v a l u e ; 
                                 } 
                         } 
                 } 
                 r e t u r n   n u l l ; 
         } 
 
 f u n c t i o n   d i n a m o d s ( t a b i n t e r f a c e 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 ; 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 " ) ; 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 = [ ] ; t h i s . c u r r e n t T a b I n d e x = 0 ;   t h i s . s u b 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 = [ ] ; 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 " ; } 
 d i n a m o d 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 " ) ; 
 	 i f   ( d o c u m e n t . c o o k i e . m a t c h ( r e ) ) 
 	 	 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   " " ; 
 } 
 d i n a m o d 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 = / " ; 
 } 
 d i n a m o d s . p r o t o t y p e = { 
 	 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 ) { 
 	 	 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 " ) 
 	 	 	 t h i s . c a n c e l a u t o r u n ( ) ; 
 	 	 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 ) { 
 	 	 	 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 ; 
 	 } , 
 	 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 ) { 
 	 	 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   ( 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 ; 
 	 } , 
 	 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   s u b c o n t e n t i d = t a b r e f . g e t A t t r i b u t e ( " r e l " ) ; 
 	 	 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 + / ,   " " ) + " , "   :   " " ; 
 	 	 t h i s . e x p a n d s u b c o n t e n t ( s u b c o n t e n t i d ) ; 
 	 	 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 + + ) { 
 	 	 	 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 ( " r e l " ) = = s u b c o n t e n t i d ) ?   " d m _ 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 ) 
 	 	 	 d i n a m o d 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 ) ; 
 	 } , 
 	 e x p a n d s u b c o n t e n t : f u n c t i o n ( s u b c o n t e n t i d ) { 
 	 	 f o r   ( v a r   i = 0 ;   i < t h i s . s u b c o n t e n t i d s . l e n g t h ;   i + + ) { 
 	 	 	 v a r   s u b c o n t e n 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 . s u b c o n t e n t i d s [ i ] ) ; 
 	 	 	 s u b c o n t e n t . s t y l e . d i s p l a y = ( s u b c o n t e n t . i d = = s u b c o n t e n t i d ) ?   " b l o c k "   :   " n o n 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 + + ) { 
 	 	 	 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 ) { 
 	 	 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 ( ) { 
 	 	 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 , c h a n g e ) { 
 	 	 v a r   p e r s i s t e d t a b = d i n a m o d 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 ) ; 
 	 	 v a r   p e r s i s t e r r o r = t r u 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 ; 
 	 	 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 ; 
 	 	 	 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 ; 
 	 	 	 	 t h i s . s u b c o n t e n t i d s [ t h i s . s u b c o n t e n t i d s . l e n g t h ] = t h i s . t a b s [ i ] . g e t A t t r i b u t e ( " r e l " ) ; 
 	 	 	 	 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 ( ) ; 
 	 	 	 	 	   r e t u r n   f a l s e ; 
 	 	 	 	 } 
 	 	 	 	 i f   ( c h a n g e = = 1 ) { 
 	 	 	 	 	 t h i s . t a b s [ i ] . o n m o u s e o v e r = t h i s . t a b s [ i ] . o n c l i c k 
 	 	 	 	 } 
 	 	 	 	 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 " ) ) { 
 	 	 	 	 	 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 = = " d m _ 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 ] ) ; 
 	 	 	 	 	 p e r s i s t e r r o r = f a l s e ; 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 	 	 i f   ( p e r s i s t e r r o r ) 
 	 	 	 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 ] ] ) ; 
 	 	 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 ) ; 
 	 	 } 
 	 } 
 } 
 
