ÿþ	 / / / / / / / / / / / / / / / / / / / /  
 v a r   a S t y l e s   =   n e w   A r r a y ( " d e f a u l t " , " a v - x u a n " , " a v - h a " , " a v - t h u " , " a v - d o n g " ) ;  
 v a r   t e m p S t y l e ;  
 v a r   a C o l o r s ;  
 v a r   r e d C o l o r , g r e e n C o l o r , d o w n C o l o r , u p C o l o r , r e f C o l o r , c e C o l o r , f l C o l o r , r e d C o l o r 2 , g r e e n C o l o r 2 , d o w n C o l o r 2 , u p C o l o r 2 , r e f C o l o r 2 , c e C o l o r 2 , f l C o l o r 2 , r e f C o l o r v n , u p C o l o r v n , d o w n C o l o r v n , a t C o l o r ;  
 a C o l o r s   =   n e w   A r r a y ( 5 ) ;  
 a C o l o r s [ 0 ]   =   n e w   A r r a y ( " # f 8 b 8 7 a " , " l i g h t g r e e n " , " r e d " , " # 0 0 F F 0 0 " , " # F F F F 0 0 " , " F F 0 0 F F " , " 0 F F 9 F 9 " , " # f 8 b 8 7 a " , " l i g h t g r e e n " , " r e d " , " b l u e " , " b l a c k " , " b l u e " , " r e d " , " b l a c k " , " g r e e n " , " r e d " , " b l a c k " ) ;  
 a C o l o r s [ 1 ]   =   n e w   A r r a y ( " # f 8 b 8 7 a " , " l i g h t g r e e n " , " r e d " , " b l u e " , " # F F F F 0 0 " , " b l u e " , " r e d " , " # f 8 b 8 7 a " , " l i g h t g r e e n " , " r e d " , " b l u e " , " b l a c k " , " b l u e " , " r e d " , " b l a c k " , " g r e e n " , " r e d " , " b l a c k " ) ;  
 a C o l o r s [ 2 ]   =   n e w   A r r a y ( " # f 8 b 8 7 a " , " l i g h t g r e e n " , " r e d " , " b l u e " , " b l a c k " , " b l u e " , " r e d " , " # f 8 b 8 7 a " , " l i g h t g r e e n " , " r e d " , " b l u e " , " b l a c k " , " b l u e " , " r e d " , " b l a c k " , " g r e e n " , " r e d " , " b l a c k " ) ;  
 a C o l o r s [ 3 ]   =   n e w   A r r a y ( " # f 8 b 8 7 a " , " l i g h t g r e e n " , " r e d " , " # 0 0 F F 0 0 " , " # F F F F 0 0 " , " # F F 0 0 F F " , " # 0 F F 9 F 9 " , " # f 8 b 8 7 a " , " l i g h t g r e e n " , " r e d " , " # 0 0 F F 0 0 " , " # F F F F 0 0 " , " # F F 0 0 F F " , " # 0 F F 9 F 9 " , " b l a c k " , " g r e e n " , " r e d " , " w h i t e " ) ;  
 a C o l o r s [ 4 ]   =   n e w   A r r a y ( " # f 8 b 8 7 a " , " l i g h t g r e e n " , " r e d " , " # 0 0 F F 0 0 " , " # F F F F 0 0 " , " # F F 0 0 F F " , " # 0 F F 9 F 9 " , " # f 8 b 8 7 a " , " l i g h t g r e e n " , " r e d " , " # 0 0 F F 0 0 " , " # F F F F 0 0 " , " # F F 0 0 F F " , " # 0 F F 9 F 9 " , " # F F F F 0 0 " , " # 0 0 F F 0 0 " , " r e d " , " w h i t e " ) ;  
 v a r   s o r t H o t s = 1 ;  
 f u n c t i o n   b u i l d C o l o r s ( )  
 {  
 	 v a r   s   =   g e t C o o k i e ( " m y s h e e t " ) ;  
 	 i f   ( s   = =   n u l l )   s   =   0 ;  
 	 r e d C o l o r   =   a C o l o r s [ s ] [ 0 ] ;  
 	 g r e e n C o l o r   =   a C o l o r s [ s ] [ 1 ] ;  
 	 d o w n C o l o r   =   a C o l o r s [ s ] [ 2 ] ;  
 	 u p C o l o r   =   a C o l o r s [ s ] [ 3 ] ;  
 	 r e f C o l o r   =   a C o l o r s [ s ] [ 4 ] ;  
 	 c e C o l o r   =   a C o l o r s [ s ] [ 5 ] ;  
 	 f l C o l o r   =   a C o l o r s [ s ] [ 6 ] ;  
 	 r e d C o l o r 2   =   a C o l o r s [ s ] [ 7 ] ;  
 	 g r e e n C o l o r 2   =   a C o l o r s [ s ] [ 8 ] ;  
 	 d o w n C o l o r 2   =   a C o l o r s [ s ] [ 9 ] ;  
 	 u p C o l o r 2   =   a C o l o r s [ s ] [ 1 0 ] ;  
 	 r e f C o l o r 2   =   a C o l o r s [ s ] [ 1 1 ] ;  
 	 c e C o l o r 2   =   a C o l o r s [ s ] [ 1 2 ] ;  
 	 f l C o l o r 2   =   a C o l o r s [ s ] [ 1 3 ] ;  
 	 r e f C o l o r v n   =   a C o l o r s [ s ] [ 1 4 ] ;  
 	 u p C o l o r v n   =   a C o l o r s [ s ] [ 1 5 ] ;  
 	 d o w n C o l o r v n   =   a C o l o r s [ s ] [ 1 6 ] ;  
 	 a t C o l o r   =   a C o l o r s [ s ] [ 1 7 ] ;  
 	 t e m p S t y l e   =   s ;  
 	 s e t S t y l e s h e e t ( ) ;  
 }  
 b u i l d C o l o r s ( ) ;  
 f u n c t i o n   c h o o s e S t y l e I m a g e ( s t y l e t i t l e )   {  
 	 t e m p S t y l e   =   s t y l e t i t l e ;  
 	 i f   ( d o c u m e n t . g e t E l e m e n t B y I d ) {  
 	 	 v a r   o   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' s t y l e i m a g e ' ) ;  
 	 	 o . s e t A t t r i b u t e ( " s r c " ,   ' . / i m a g e s / ' + a S t y l e s [ s t y l e t i t l e ] + ' . j p g ' ) ;  
 	 }  
 }  
 f u n c t i o n   c h a n g e R o w S t y l e I ( r o w )   {  
 	 i f   ( r o w . i d = = " b a r " )   r e t u r n ;  
 	 v a r   s u f f ;  
 	 i f   ( r o w . r o w I n d e x   >   a H o t s . l e n g t h )  
 	 	 s u f f   =   ( r o w . r o w I n d e x   %   2   = =   1 )   ?   " A "   :   " B " ;  
 	 e l s e  
 	 	 s u f f   =   ( r o w . r o w I n d e x   %   2   = =   0 )   ?   " A "   :   " B " ;  
 	 c h a n g e R o w S t y l e ( r o w ,   s u f f )  
 }  
 f u n c t i o n   c h a n g e R o w S t y l e ( r o w ,   c )   {  
 	 i f   ( e x I E )   r e t u r n ;  
 	 v a r   i   =   0 ;  
 	 w h i l e   ( r o w . c h i l d N o d e s [ i ] )   {  
 	 	 r o w . c h i l d N o d e s [ i ] . c l a s s N a m e   =   r o w . c h i l d N o d e s [ i ] . c l a s s N a m e . s u b s t r i n g ( 0 ,   r o w . c h i l d N o d e s [ i ] . c l a s s N a m e . l e n g t h - 1 )   +   c ;  
 	 	 i   =   i   +   1 ;  
 	 }  
 }  
 f u n c t i o n   s h o w D i a l o g ( d i v i d )   {  
 	 v a r   o   =   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 f   ( ! o )   r e t u r n ;  
 	 v a r   c o n t e n t   =   " " ;  
 	 v a r   c h k   =   " " ;  
 	 c o n t e n t   =   " < t a b l e   b o r d e r = 0   w i d t h = 1 0 0 % > < t r > < t d   w i d t h = 3 3 % > < / t d > < t d   w i d t h = 3 4 % > < d i v   i d = ' c o n t r o l '   s t y l e = ' t o p : 0 p x ; l e f t : 0 p x ; w i d t h : 6 6 0 p x ; h e i g h t : 4 4 0 p x ' > " ;  
 	 c o n t e n t   + =   " < d i v   o n C l i c k = ' a l e r t ( \ " T o i   d a y   =   \ " ) '   i d = ' m a i n t a b '   s t y l e = ' t o p : 0 p x ; l e f t : 0 p x ; w i d t h : 6 6 0 p x ; h e i g h t : 4 4 0 p x ' > < d i v > " ;  
 	 c o n t e n t   + =   " < / d i v > < / t d > < t d   w i d t h = 3 3 % > < / t d > < / t r > < / t a b l e > " ;  
 	 o . i n n e r H T M L   =   c o n t e n t ;  
 	 / /   B u i l d   t a b s  
 	 t a b b a r = n e w   d h t m l X T a b B a r ( " m a i n t a b " , " t o p " ) ;  
 	 t a b b a r . s e t I m a g e P a t h ( " i m a g e s / t a b / " ) ;  
 	 t a b b a r . s e t S t y l e ( " M o d e r n " ) ;  
 	 t a b b a r . s e t S k i n C o l o r s ( " # F F F F 0 0 " , " # F F F A C D " ) ;  
 	 t a b b a r . a d d T a b ( " a 1 " , " D a n h   m åc   c h én g   k h o á n " , " 1 5 0 p x " ) ;  
 	 / /   l i s t i n g   s t o c k s  
 	 c o n t e n t   =   " < d i v   s t y l e = ' p a d d i n g : 5 p x ; ' > < i n p u t   t y p e = ' b u t t o n '   o n c l i c k = ' c h e c k A l l F ( \ " f r m T i c k e r s \ " , t r u e ) ; '   v a l u e = ' C h Ín   t ¥t   c £' >   < i n p u t   t y p e = ' b u t t o n '   o n c l i c k = ' c h e c k A l l F ( \ " f r m T i c k e r s \ " , f a l s e ) ; '   v a l u e = ' X ó a   t ¥t   c £' >   < i n p u t   t y p e = ' b u t t o n '   o n c l i c k = ' t h i s . b l u r ( ) ;   r e t u r n   u p d a t e P a g e ( ) ; '   v a l u e = ' Ón g   ý ' >   < i n p u t   t y p e = ' b u t t o n '   o n c l i c k = ' h i d e C o n t r o l ( \ " p a n n e l \ " ) '   v a l u e = ' ó n g ' > " ;  
 	 c o n t e n t   + =   " < b r > < b r > < f o r m   i d = ' f r m T i c k e r s '   n a m e = ' f r m T i c k e r s '   s t y l e = ' f o n t - s i z e : 1 0 p t ; c o l o r :   # 0 0 3 3 9 9 ;   f o n t - f a m i l y : C o u r i e r   N e w ' > " ;  
 	 c o n t e n t   + =   l i s t i n g T i c k e r s ( )   +   " < / f o r m > < / d i v > " ;  
 	 t a b b a r . s e t C o n t e n t H T M L ( " a 1 " , c o n t e n t ) ;  
 	 / /   l o v e  
 	 i f   ( s t o c k t y p e   = =   0 )   {   / /   c h i   d u n g   c h o   b a n g   p r o  
 	 	 t a b b a r . a d d T a b ( " a 2 " , " D a n h   m åc   q u a n   t â m " , " 1 5 0 p x " ) ;  
 	 	 c o n t e n t   =   " < d i v   s t y l e = ' p a d d i n g : 5 p x ; ' > < i n p u t   t y p e = ' b u t t o n '   o n c l i c k = ' c h e c k A l l L ( \ " f r m L o v e \ " , t r u e ) ; '   v a l u e = ' C h Ín   t ¥t   c £' >   < i n p u t   t y p e = ' b u t t o n '   o n c l i c k = ' c h e c k A l l L ( \ " f r m L o v e \ " , f a l s e ) ; '   v a l u e = ' X ó a   t ¥t   c £' >   < i n p u t   t y p e = ' b u t t o n '   o n c l i c k = ' t h i s . b l u r ( ) ;   r e t u r n   u p d a t e P a g e ( ) ; '   v a l u e = ' Ón g   ý ' >   < i n p u t   t y p e = ' b u t t o n '   o n c l i c k = ' h i d e C o n t r o l ( \ " p a n n e l \ " ) '   v a l u e = ' ó n g ' > " ;  
 	 	 c o n t e n t   + =   " < b r > < b r > < f o r m   i d = ' f r m L o v e '   n a m e = ' f r m L o v e '   s t y l e = ' f o n t - s i z e : 1 0 p t ; c o l o r :   # 0 0 3 3 9 9 ;   f o n t - f a m i l y : C o u r i e r   N e w ' > " ;  
 	 	 c o n t e n t   + =   l o v e T i c k e r s ( )   +   " < / f o r m > < / d i v > " ;  
 	 	 t a b b a r . s e t C o n t e n t H T M L ( " a 2 " , c o n t e n t ) ;  
 	 }  
 	 / /   s t y l e s   t a b  
 	 t a b b a r . a d d T a b ( " a 3 " , " B £n g   m à u " , " 1 5 0 p x " ) ;  
 	 v a r   s t y l e t i t l e   =   g e t C o o k i e ( " m y s h e e t " ) ;  
 	 i f   ( s t y l e t i t l e   = =   n u l l )   s t y l e t i t l e   =   0 ;  
 	 c o n t e n t s   =   " < d i v   s t y l e = ' b a c k g r o u n d - c o l o r : # F F F F 0 0 ; f o n t - f a m i l y : V e r d a n a ; f o n t - s i z e : 1 0 p x ; c o l o r : # 0 0 0 0 6 6 ; ' > < t a b l e   b o r d e r = 0   w i d t h = 1 0 0 % > < t r > < t d > < d i v   s t y l e = ' w i d t h : 6 3 0 p x ; h e i g h t : 2 0 p x ; f o n t - f a m i l y : V e r d a n a ; f o n t - s i z e : 1 0 p x ; ' > " ;  
 	 s t r c h e c k   =   ( s t y l e t i t l e = = 0 ) ? " c h e c k e d " : " " ;  
 	 c o n t e n t s   + =   " < i n p u t   " + s t r c h e c k + "   t y p e = ' r a d i o '   n a m e = ' c h o i c e '   v a l u e = ' 0 '   o n C l i c k = ' c h o o s e S t y l e I m a g e ( t h i s . v a l u e ) ; ' > " + e v a l ( ' a S t r i n g . D e f a u l t ' ) ;  
 	 s t r c h e c k   =   ( s t y l e t i t l e = = 1 ) ? " c h e c k e d " : " " ;  
 	 c o n t e n t s   + =   " & n b s p ; < i n p u t   " + s t r c h e c k + "   t y p e = ' r a d i o '   n a m e = ' c h o i c e '   v a l u e = ' 1 '   o n C l i c k = ' c h o o s e S t y l e I m a g e ( t h i s . v a l u e ) ; ' > " + e v a l ( ' a S t r i n g . X u a n ' ) ;  
 	 s t r c h e c k   =   ( s t y l e t i t l e = = 2 ) ? " c h e c k e d " : " " ;  
 	 c o n t e n t s   + =   " & n b s p ; < i n p u t   " + s t r c h e c k + "   t y p e = ' r a d i o '   n a m e = ' c h o i c e '   v a l u e = ' 2 '   o n C l i c k = ' c h o o s e S t y l e I m a g e ( t h i s . v a l u e ) ; ' > " + e v a l ( ' a S t r i n g . H a ' ) ;  
 	 s t r c h e c k   =   ( s t y l e t i t l e = = 3 ) ? " c h e c k e d " : " " ;  
 	 c o n t e n t s   + =   " & n b s p ; < i n p u t   " + s t r c h e c k + "   t y p e = ' r a d i o '   n a m e = ' c h o i c e '   v a l u e = ' 3 '   o n C l i c k = ' c h o o s e S t y l e I m a g e ( t h i s . v a l u e ) ; ' > " + e v a l ( ' a S t r i n g . T h u ' ) ;  
 	 s t r c h e c k   =   ( s t y l e t i t l e = = 4 ) ? " c h e c k e d " : " " ;  
 	 c o n t e n t s   + =   " & n b s p ; < i n p u t   " + s t r c h e c k + "   t y p e = ' r a d i o '   n a m e = ' c h o i c e '   v a l u e = ' 4 '   o n C l i c k = ' c h o o s e S t y l e I m a g e ( t h i s . v a l u e ) ; ' > " + e v a l ( ' a S t r i n g . D o n g ' ) ;  
 	 c o n t e n t s   + =   " & n b s p ; & n b s p ; < i n p u t   t y p e = ' b u t t o n '   o n c l i c k = ' t h i s . b l u r ( ) ;   r e t u r n   u p d a t e S t y l e s h e e t ( ) ; '   v a l u e = ' Ón g   ý ' > & n b s p ; < i n p u t   t y p e = ' b u t t o n '   o n c l i c k = ' h i d e C o n t r o l ( \ " p a n n e l \ " ) '   v a l u e = ' ó n g ' > < / d i v > < / t d > < / t r > < t r > < t d > < d i v   s t y l e = ' w i d t h : 6 3 0 p x ; h e i g h t : 3 8 0 p x ' > < I M G   s t y l e = ' w i d t h : 6 3 0 p x ; h e i g h t : 3 8 0 p x '   s r c = ' '   i d = ' s t y l e i m a g e '   n a m e = ' s t y l e i m a g e '   B O R D E R = ' 0 ' > < / d i v > < / t d > < / t r > " ;  
 	 c o n t e n t s   + =   " < / t a b l e > < / d i v > " ;  
 	 t a b b a r . s e t C o n t e n t H T M L ( " a 3 " , c o n t e n t s ) ;  
 	 / /   H e l p  
 	 t a b b a r . a d d T a b ( " a 4 " , " H °Ûn g   d «n " , " 1 5 0 p x " ) ;  
 	 c o n t e n t   =   " < d i v   s t y l e = ' p a d d i n g : 5 p x ; ' > < i n p u t   t y p e = ' b u t t o n '   o n c l i c k = ' h i d e C o n t r o l ( \ " p a n n e l \ " ) '   v a l u e = ' ó n g ' > " ;  
 	 c o n t e n t   + =   " < b r > < d i v   s t y l e = ' p a d d i n g : 1 0 p x ; t e x t - a l i g n : j u s t i f y ; f o n t - s i z e : 1 0 p t ; c o l o r : # 0 0 3 3 9 9 ; f o n t - f a m i l y : C o u r i e r   N e w ' > " ;  
 	 c o n t e n t   + =   s t r H e l p   +   " < / d i v > < / d i v > " ;  
 	 t a b b a r . s e t C o n t e n t H T M L ( " a 4 " , c o n t e n t ) ;  
  
 	 c h o o s e S t y l e I m a g e ( s t y l e t i t l e ) ;  
 	 t a b b a r . s e t T a b A c t i v e ( " a 1 " ) ;  
 	 o . s t y l e . v i s i b i l i t y   =   ' v i s i b l e ' ;  
 }  
 f u n c t i o n   l i s t i n g T i c k e r s ( )   {  
 	 v a r   c h k = " " ;  
 	 v a r   c o n t e n t = " " ;  
 	 v a r   s = " " ;  
 	 v a r   c = " " ;  
 	 v a r   j = 2 ;  
 	 f o r   ( v a r   i   i n   a T i c k e r s . h a s h t a b l e )   {  
 	 	 i f   ( ( a l l t i c k e r s )   | |   ( a T i c k e r s . h a s h t a b l e [ i ] . s e l e c t e d ) )   { c h k = " c h e c k e d   " ; c = " s B " }  
 	 	 e l s e   { c h k = " " ; c = " s N " }  
 	 	 s   =   i . s u b s t r ( 0 , 2 )   +   i . s u b s t r ( i . l e n g t h - 1 , 1 ) ;  
 	 	 c o n t e n t   + =   " < s p a n   o n c l i c k = ' m c f ( \ " " + i + " \ " ) '   o n m o u s e o u t = ' h i d e t o o l t i p ( ) ; t h i s . c l a s s N a m e = \ " s t o c k N \ " ; '   o n m o u s e o v e r = ' t o o l t i p ( e v e n t , \ " " + i + " \ " , 2 ) ; t h i s . c l a s s N a m e = \ " s t o c k H \ " ; ' > < i n p u t   o n c l i c k = ' m c f ( \ " " + i + " \ " ) '   " + c h k + " t y p e = ' c h e c k b o x '   v a l u e = ' " + i + " '   i d = ' i f " + i + " ' > < s p a n   i d = ' s f " + i + " '   c l a s s = ' " + c + " ' > " + s + " < / s p a n > < / s p a n > & n b s p ; " ;  
 	 	 i f   ( j   %   1 2   = =   1 )   c o n t e n t   + =   " < b r > " ;  
 	 	 j + + ;  
 	 }  
 	 r e t u r n   c o n t e n t ;  
 }  
 f u n c t i o n   l o v e T i c k e r s ( )   {  
 	 v a r   c h k = " " ;  
 	 v a r   c o n t e n t = " " ;  
 	 v a r   s = " " ;  
 	 v a r   c = " " ;  
 	 v a r   j = 2 ;  
 	 f o r   ( v a r   i   i n   a T i c k e r s . h a s h t a b l e )   {  
 	 	 i f   ( a T i c k e r s . h a s h t a b l e [ i ] . h o t )   { c h k = " c h e c k e d   " ; c = " s B " }  
 	 	 e l s e   { c h k = " " ; c = " s N " ; }  
 	 	 i f   ( ! ( a l l t i c k e r s   | |   a T i c k e r s . h a s h t a b l e [ i ] . s e l e c t e d ) )   { c h k   + =   " d i s a b l e d   " ; c = " s D " }  
 	 	 s   =   i . s u b s t r ( 0 , 2 )   +   i . s u b s t r ( i . l e n g t h - 1 , 1 ) ;  
 	 	 c o n t e n t   + =   " < s p a n   o n c l i c k = ' m c l ( \ " " + i + " \ " ) '   o n m o u s e o u t = ' h i d e t o o l t i p ( ) ; t h i s . c l a s s N a m e = \ " s t o c k N \ " ; '   o n m o u s e o v e r = ' t o o l t i p ( e v e n t , \ " " + i + " \ " , 2 ) ; t h i s . c l a s s N a m e = \ " s t o c k H \ " ; ' > < i n p u t   o n c l i c k = ' m c l ( \ " " + i + " \ " ) '   " + c h k + " t y p e = ' c h e c k b o x '   v a l u e = ' " + i + " '   i d = ' i l " + i + " ' > < s p a n   i d = ' s l " + i + " '   c l a s s = ' " + c + " ' > " + s + " < / s p a n > < / s p a n > & n b s p ; " ;  
 	 	 i f   ( j   %   1 2   = =   1 )   c o n t e n t   + =   " < b r > " ;  
 	 	 j + + ;  
 	 }  
 	 r e t u r n   c o n t e n t ;  
 }  
 f u n c t i o n   s h o w C o n t r o l ( d i v i d )   {  
 	 v a r   o   =   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 f   ( o )   o . s t y l e . v i s i b i l i t y   =   ' v i s i b l e ' ;  
 }  
 f u n c t i o n   h i d e C o n t r o l ( d i v i d )   {  
 	 v a r   o   =   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 f   ( o )   o . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 }  
 f u n c t i o n   s e t S o r t H o t ( i )   {  
 	 v a r   o   =   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 f   ( o )   o . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 s o r t H o t s   =   i . c h e c k e d ;  
 }  
 f u n c t i o n   m c l ( i , c )   {  
 	 v a r   i p   =   d o c u m e n t . g e t E l e m e n t B y I d ( " i l " + i ) ;  
 	 v a r   s p   =   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 ) ;  
 	 i f   ( i p . d i s a b l e d )   {  
 	 	 s p . c l a s s N a m e = ' s D ' ;  
 	 }   e l s e   {  
 	 	 i f   ( c = = n u l l )   i p . c h e c k e d = ! i p . c h e c k e d ;  
 	 	 e l s e   i p . c h e c k e d = c ;  
 	 	 s p . c l a s s N a m e = i p . c h e c k e d ? ' s B ' : ' s N ' ;  
 	 }  
 }  
 f u n c t i o n   s e t m c l ( i , d )   {  
 	 v a r   o i p   =   d o c u m e n t . g e t E l e m e n t B y I d ( " i l " + i ) ;  
 	 o i p . d i s a b l e d = d ;  
 	 m c l ( i , o i p . c h e c k e d ) ;  
 }  
 f u n c t i o n   m c f ( i , c )   {  
 	 v a r   i p   =   d o c u m e n t . g e t E l e m e n t B y I d ( " i f " + i ) ;  
 	 v a r   s p   =   d o c u m e n t . g e t E l e m e n t B y I d ( " s f " + i ) ;  
 	 i f   ( c = = n u l l )   i p . c h e c k e d = ! i p . c h e c k e d ;  
 	 e l s e   i p . c h e c k e d = c ;  
 	 s p . c l a s s N a m e = i p . c h e c k e d ? ' s B ' : ' s N ' ;  
 	 i f   ( s t o c k t y p e   = =   0 )   / /   c h i   d u n g   c h o   b a n g   p r o  
 	 	 s e t m c l ( i , ! i p . c h e c k e d ) ;  
 }  
 f u n c t i o n   c h e c k A l l F ( i d , v )  
 {  
 	 v a r   f   =   d o c u m e n t . g e t E l e m e n t B y I d ( i d ) ;  
 	 i f   ( f )   {  
 	 	 f o r   ( v a r   i = 0 ;   i   <   f . e l e m e n t s . l e n g t h ;   i + + )  
 	 	 	 i f   ( f . e l e m e n t s [ i ] . t y p e = = ' c h e c k b o x ' )  
 	 	 	 	 m c f ( f . e l e m e n t s [ i ] . v a l u e , v )  
 	 }  
 }  
 f u n c t i o n   c h e c k A l l L ( i d , v )  
 {  
 	 v a r   f   =   d o c u m e n t . g e t E l e m e n t B y I d ( i d ) ;  
 	 i f   ( f )   {  
 	 	 f o r   ( v a r   i = 0 ;   i   <   f . e l e m e n t s . l e n g t h ;   i + + )  
 	 	 	 i f   ( f . e l e m e n t s [ i ] . t y p e = = ' c h e c k b o x ' )  
 	 	 	 	 m c l ( f . e l e m e n t s [ i ] . v a l u e , v ) ;  
 	 }  
 }  
 f u n c t i o n   u p d a t e P a g e ( )  
 {  
 	 h i d e C o n t r o l ( " p a n n e l " ) ;  
 	 v a r   s t r c h e c k   =   " " ;  
 	 v a r   a l l   =   t r u e ;  
 	 v a r   f   =   d o c u m e n t . g e t E l e m e n t B y I d ( " f r m T i c k e r s " ) ;  
 	 i f   ( f )   {  
 	 	 f o r   ( v a r   i = 0 , j = 0 ;   i   <   f . e l e m e n t s . l e n g t h ;   i + + )  
 	 	 	 i f   ( f . e l e m e n t s [ i ] . t y p e = = ' c h e c k b o x ' )   {  
 	 	 	 	 i f   ( ( f . e l e m e n t s [ i ] . c h e c k e d ) & & ( f . e l e m e n t s [ i ] . i d . s u b s t r ( 0 , 1 ) = = ' i ' ) )   {  
 	 	 	 	 	 i f   ( j   = =   0 )   {  
 	 	 	 	 	 	 s t r c h e c k   =   f . e l e m e n t s [ i ] . v a l u e ;  
 	 	 	 	 	 	 j   =   1 ;  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 s t r c h e c k   =   s t r c h e c k   +   " | "   +   f . e l e m e n t s [ i ] . v a l u e ;  
 	 	 	 	 }   e l s e  
 	 	 	 	 	 a l l   =   f a l s e ;  
 	 	 	 }  
 	 	 i f   ( a l l )   s t r c h e c k   =   " * " ;  
 	 	 s e t C o o k i e ( b o a r d ,   s t r c h e c k ,   1 0 0 0 0 ) ;  
 	 }  
 	 v a r   f   =   d o c u m e n t . g e t E l e m e n t B y I d ( " f r m L o v e " ) ;  
 	 i f   ( f )   {  
 	 	 s t r c h e c k   =   " " ;  
 	 	 f o r   ( i = 0 , j = 0 ;   i   <   f . e l e m e n t s . l e n g t h ;   i + + )  
 	 	 	 i f   ( f . e l e m e n t s [ i ] . t y p e = = ' c h e c k b o x ' )   {  
 	 	 	 	 i f   ( ( f . e l e m e n t s [ i ] . c h e c k e d ) & & ( f . e l e m e n t s [ i ] . i d . s u b s t r ( 0 , 1 ) = = ' i ' ) )   {  
 	 	 	 	 	 i f   ( j   = =   0 )   {  
 	 	 	 	 	 	 s t r c h e c k   =   f . e l e m e n t s [ i ] . v a l u e ;  
 	 	 	 	 	 	 j   =   1 ;  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 s t r c h e c k   =   s t r c h e c k   +   " | "   +   f . e l e m e n t s [ i ] . v a l u e ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 s e t C o o k i e ( b o a r d + ' - h o t ' ,   s t r c h e c k ,   1 0 0 0 0 ) ;  
 	 }  
 	 h i s t o r y . g o ( ) ;  
 }  
 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 " ) ;  
 	 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   n u l l ;  
 }  
 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 a y s )   {  
 	 v a r   e x p i r e D a t e   =   n e w   D a t e ( ) ;  
 	 v a r   e x p s t r i n g = ( t y p e o f   d a y s ! = " u n d e f i n e d " ) ?   e x p i r e D a t e . s e t D a t e ( e x p i r e D a t e . g e t D a t e ( ) + p a r s e I n t ( d a y s ) )   :   e x p i r e D a t e . s e t D a t e ( e x p i r e D a t e . g e t D a t e ( ) - 5 ) ;  
 	 d o c u m e n t . c o o k i e   =   n a m e + " = " + v a l u e + " ;   e x p i r e s = " + e x p i r e D a t e . t o G M T S t r i n g ( ) + " ;   p a t h = / " ;  
 }  
 f u n c t i o n   d e l e t e C o o k i e ( n a m e ) {  
 	 s e t C o o k i e ( n a m e ,   " m o o t " ) ;  
 }  
 f u n c t i o n   s e t S t y l e s h e e t ( ) {  
 	 v a r   t i t l e   =   a S t y l e s [ t e m p S t y l e ] ;  
 	 v a r   i ,   c a c h e o b j ,   a l t s h e e t s = [ " " ] ;  
 	 f o r ( i = 0 ;   ( c a c h e o b j = 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 ( " l i n k " ) [ i ] ) ;   i + + )   {  
 	 	 i f ( c a c h e o b j . g e t A t t r i b u t e ( " r e l " ) . t o L o w e r C a s e ( ) = = " a l t e r n a t e   s t y l e s h e e t "   & &   c a c h e o b j . g e t A t t r i b u t e ( " t i t l e " ) )   {  
 	 	 	 c a c h e o b j . d i s a b l e d   =   t r u e ;  
 	 	 	 a l t s h e e t s . p u s h ( c a c h e o b j ) ;  
 	 	 	 i f ( c a c h e o b j . g e t A t t r i b u t e ( " t i t l e " )   = =   t i t l e )  
 	 	 	 	 c a c h e o b j . d i s a b l e d   =   f a l s e ;  
 	 	 }  
 	 }  
 	 s e t C o o k i e ( " m y s h e e t " ,   t e m p S t y l e ,   1 0 0 0 0 ) ;  
 }  
 f u n c t i o n   u p d a t e S t y l e s h e e t ( ) {  
 	 h i d e C o n t r o l ( " p a n n e l " ) ;  
 	 s e t S t y l e s h e e t ( ) ;  
 	 b u i l d C o l o r s ( ) ;  
 	 c h a n g e P a g e ( ) ;  
 	 r e l o a d C h a r t ( ) ;  
 }  
  
 f u n c t i o n   r e l o a d C h a r t ( m a r k e t )   {  
 	 t r y   {  
 	 	 v a r   d a t e   =   n e w   D a t e ( ) ;  
 	 	 v a r   o   =   d o c u m e n t . g e t E l e m e n t B y I d ( " C h a r t I m a g e 1 " ) ;  
 	 	 v a r   c o l o r   =   " w h i t e " ;  
 	 	 i f   ( t e m p S t y l e   = =   4   | |   t e m p S t y l e   = =   ' 4 ' )   {  
 	 	 	 c o l o r   =   " b l a c k " ;  
 	 	 }  
 	 	 i f (   o   ! =   n u l l )   {  
 	 	 	 i f   ( m a r k e t   ! =   n u l l )   {  
 	 	 	 	 o . s e t A t t r i b u t e ( " s r c " ,   ' h t t p : / / q u o t e s . a v s c . c o m . v n / R e a l T i m e / c h a r t / '   +   m a r k e t   +   ' _ '   +   c o l o r   +   ' . p n g ? t i m e = '   +   d a t e . v a l u e O f ( ) ) ;  
 	 	 	 }   e l s e   {  
 	 	 	 	 v a r   o l d U r l   =   o . s r c ;  
 	 	 	 	 v a r   p o s i t i o n   =   o l d U r l . i n d e x O f ( " _ " ) ;  
 	 	 	 	 o l d U r l   =   o l d U r l . s u b s t r i n g ( 0 ,   p o s i t i o n   +   1 ) ;  
 	 	 	 	 o . s e t A t t r i b u t e ( " s r c " ,   o l d U r l   +   c o l o r   +   " . p n g ? t i m e = "   +   d a t e . v a l u e O f ( ) ) ;  
 	 	 	 }  
 	 	 }  
 	 }   c a t c h ( e r r )   {  
  
 	 }  
 }  
 f u n c t i o n   H D f l o a 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 ( " s l i d i n g _ h e a d e r _ d i v " ) )   r e t u r n   f a l s e ;  
 	 i f   ( ! 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 i n g _ h e a d e r _ t a b l e " ) )   r e t u r n   f a l s e ;  
 	 v a r   e Y   =   0 ;  
 	 v a r   s t a r t X ,   s t a r t Y ;  
 	 i f   ( d o c u m e n t . b o d y . c l i e n t W i d t h   <   1 0 0 0 )  
 	 	 s t a r t X   =   - 1 ;  
 	 e l s e  
 	 	 s t a r t X   =   ( d o c u m e n t . b o d y . c l i e n t W i d t h   -   1 0 0 0 )   /   2   -   1 ;  
 	 s t a r t Y   =   0 ;  
 	 w i n d o w . s t a y H D   =   f u n c t i o n   ( o b j )   {  
 	 	 i T o p   =   p a r s e I n t ( i f G e t X Y ( d o c u m e n t . g e t E l e m e n t B y I d ( " h e a d e r _ t a b l e " ) ) [ 1 ] ) ;  
 	 	 v a r   s t a r t X ,   s t a r t Y ;  
 	 	 v a r   n s   =   n a v i g a t o r . a p p N a m e . i n d e x O f ( " N e t s c a p e " )   ! =   - 1 ;  
 	 	 s t a r t X   =   1 ;  
 	 	 i f   ( d o c u m e n t . b o d y . s c r o l l T o p   <   i T o p )   { o b j . s t y l e . d i s p l a y   =   " n o n e " ; }  
 	 	 e l s e   { o b j . s t y l e . d i s p l a y   =   " " ;  
 	 	 i f   ( d o c u m e n t . d o c u m e n t E l e m e n t   & &   d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p )   { v a r   p Y   =   n s   ?   p a g e Y O f f s e t   :   d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p ; }  
 	 	 e l s e   i f   ( d o c u m e n t . b o d y )   { v a r   p Y   =   n s   ?   p a g e Y O f f s e t   :   d o c u m e n t . b o d y . s c r o l l T o p ; }  
 	 	 s t a r t Y   =   0 ;  
 	 	 o b j . y   + =   ( p Y   +   s t a r t Y   -   o b j . y )   /   8 ;  
 	 	 o b j . s t y l e . l e f t   =   s t a r t X ;  
 	 	 o b j . s t y l e . t o p   =   o b j . y   +   e Y ;  
 	 }  
 	 s e t T i m e o u t ( f u n c t i o n   ( )   { s t a y H D ( o b j ,   e Y ) ; } ,   5 0 ) ; } ;  
 	 v a r   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   ?   d o c u m e n t . g e t E l e m e n t B y I d ( i d )   :   d o c u m e n t . a l l   ?   d o c u m e n t . a l l [ i d ]   :   d o c u m e n t . l a y e r s [ i d ] ;  
 	 i f   ( ! o b j )   r e t u r n ;  
 	 o b j . x   =   s t a r t X ;  
 	 o b j . y   =   s t a r t Y ;  
 	 s t a y H D ( o b j ) ;  
 	 r e t u r n   t r u e ;  
 }  
 f u n c t i o n   i f G e t X Y ( o b j ,   o f f s e t )   {  
 	 v a r   v a l u e   =   o f f s e t   ?   o f f s e t . s l i c e ( 0 )   :   [ 0 ,   0 ] ;  
 	 w h i l e   ( o b j )   {  
 	 	 v a l u e [ 0 ]   + =   o b j . o f f s e t L e f t ;  
 	 	 v a l u e [ 1 ]   + =   o b j . o f f s e t T o p ;  
 	 	 i f   ( o b j . t a g N a m e . t o U p p e r C a s e ( )   = =   " B O D Y " )  
 	 	 	 b r e a k ;  
 	 	 o b j   =   o b j . o f f s e t P a r e n t ;  
 	 }  
 	 r e t u r n   v a l u e ;  
 }  
 f u n c t i o n   s h o w H D ( )   {  
 	 i f   ( t y p e o f   i T o p   = =   " u n d e f i n e d " )   r e t u r n ;  
 	 i f   ( d o c u m e n t . b o d y . s c r o l l T o p   >   i T o p )  
 	 	 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 i n g _ h e a d e r _ d i v " ) . s t y l e . d i s p l a y   =   " " ;  
 }  
 f u n c t i o n   s h o w c l o c k ( i d ) {  
 	 v a r   D i g i t a l = n e w   D a t e ( )  
 	 v a r   h o u r s = D i g i t a l . g e t H o u r s ( )  
 	 v a r   m i n u t e s = D i g i t a l . g e t M i n u t e s ( )  
 	 v a r   s e c o n d s = D i g i t a l . g e t S e c o n d s ( )  
 	 i f ( h o u r s = = 0 )   h o u r s = 2 3 ;  
 	 i f ( h o u r s < 1 0 )   h o u r s = " 0 "   +   h o u r s ;  
 	 i f   ( m i n u t e s < = 9 )   m i n u t e s = " 0 " + m i n u t e s ;  
 	 i f   ( s e c o n d s < = 9 )   s e c o n d s = " 0 " + s e c o n d s ;  
 	 v a r   c l o c k   =   d o c u m e n t . g e t E l e m e n t B y I d ( i d ) ;  
 	 i f   ( c l o c k )  
 	 	 c l o c k . i n n e r H T M L   =   h o u r s + " : " + m i n u t e s + " : " + s e c o n d s ;  
 	 s e t T i m e o u t ( " s h o w c l o c k ( ' " + i d + " ' ) " , 1 0 0 0 ) ;  
 }  
 f u n c t i o n   s h o w t o d a y ( i d ) {  
 	 v a r   D i g i t a l = n e w   D a t e ( )  
 	 v a r   d a y = D i g i t a l . g e t D a t e ( )  
 	 v a r   m o n t h = D i g i t a l . g e t M o n t h ( )  
 	 v a r   y e a r = D i g i t a l . g e t F u l l Y e a r ( )  
 	 i f   ( d a y < 1 0 )   d a y = " 0 "   +   d a y ;  
 	 m o n t h = m o n t h + 1 ;  
 	 i f ( m o n t h < 1 0 )   m o n t h = " 0 "   +   m o n t h ;  
 	 v a r   t o d a y   =   d o c u m e n t . g e t E l e m e n t B y I d ( i d ) ;  
 	 i f   ( t o d a y )  
 	 	 t o d a y . i n n e r H T M L   =   d a y + " / " + m o n t h + " / " + y e a r ;  
 }  
 s h o w c l o c k ( " l i v e c l o c k " ) ;  
 i f   ( ! d o c u m e n t . a l l )   s e t T i m e o u t ( f u n c t i o n ( ) { H D f l o a t ( ' s l i d i n g _ h e a d e r _ d i v ' ) ; s h o w H D ( ) ; } ,   1 0 0 0 ) ;  
 v a r   p r e v T o o l t i p ;  
 f u n c t i o n   g e t W i n d o w W i d t h ( )   {  
 	 i f ( w i n d o w . i n n e r W i d t h )  
 	 	 r e t u r n   w i n d o w . i n n e r W i d t h ;  
 	 r e t u r n   d o c u m e n t . b o d y . c l i e n t W i d t h ;  
 }  
 f u n c t i o n   m o u s e X ( e )   {  
 	 i f ( e . p a g e X )  
 	 	 r e t u r n   e . p a g e X ;  
 	 r e t u r n   e . c l i e n t X   +   ( d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l L e f t   ?   d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l L e f t   :   d o c u m e n t . b o d y . s c r o l l L e f t ) ;  
 }  
 f u n c t i o n   m o u s e Y ( e )   {  
 	 i f ( e . p a g e Y )  
 	 	 r e t u r n   e . p a g e Y ;  
 	 r e t u r n   e . c l i e n t Y   +   ( d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p   ?   d o c u m e n t . d o c u m e n t E l e m e n t . s c r o l l T o p   :   d o c u m e n t . b o d y . s c r o l l T o p ) ;  
 }  
 f u n c t i o n   t o o l t i p ( e ,   i ,   p )   {  
 	 v a r   w i n d o w W i d t h   =   g e t W i n d o w W i d t h ( ) ;  
 	 v a r   o   =   d o c u m e n t . g e t E l e m e n t B y I d ( " t i p " ) ;  
 	 i f   ( ! o )   r e t u r n ;  
  
 	 v a r   b S h o w   =   f a l s e ;  
 	 s w i t c h   ( p )  
 	 {  
 	 c a s e   0 : / / r o o m  
 	 	 o . c l a s s N a m e   =   " t o o l t i p " ;  
 	 	 i f   ( a T i c k e r s . h a s h t a b l e [ i ] . r o o m )   {  
 	 	 	 o . i n n e r H T M L   =   i + "   -   " +   a S t r i n g . O l d R o o m   +   a T i c k e r s . h a s h t a b l e [ i ] . r o o m ;  
 	 	 	 b S h o w   =   t r u e ;  
 	 	 }  
 	 	 b r e a k ;  
 	 c a s e   1 : / / o l d   p r i c e  
 	 	 o . c l a s s N a m e   =   " t o o l t i p " ;  
 	 	 o . i n n e r H T M L   =   i + "   -   " + a T i c k e r s . h a s h t a b l e [ i ] . n a m e ;  
 	 	 i f   ( a T i c k e r s . h a s h t a b l e [ i ] . p r i c e   & &   a T i c k e r s . h a s h t a b l e [ i ] . p r i c e > 0 )   {  
 	 	 	 o . i n n e r H T M L   + =   " < b r > " + a S t r i n g . O l d P r i c e   +   a T i c k e r s . h a s h t a b l e [ i ] . p r i c e ;  
 	 	 }  
 	 	 b S h o w   =   t r u e ;  
 	 	 b r e a k ;  
 	 c a s e   2 : / / n a m e  
 	 	 o . c l a s s N a m e   =   " t o o l t i p " ;  
 	 	 o . i n n e r H T M L   =   i + "   -   " + a T i c k e r s . h a s h t a b l e [ i ] . n a m e ;  
 	 	 i f   ( a B e n e f i t [ a T i c k e r s . h a s h t a b l e [ i ] . s t a t u s ] )   {  
 	 	 	 o . i n n e r H T M L   + =   " < b r > *   < i > " + a B e n e f i t [ a T i c k e r s . h a s h t a b l e [ i ] . s t a t u s ] + " < / i > " ;  
 	 	 }  
 	 	 b S h o w   =   t r u e ;  
 	 	 b r e a k ;  
 	 d e f a u l t : / / t i p s  
 	 	 o . c l a s s N a m e   =   " t i p H e l p " ;  
 	 	 o . i n n e r H T M L   =   i ;  
 	 	 b S h o w   =   t r u e ;  
 	 	 b r e a k ;  
 	 }  
   	 i f   ( ! b S h o w )   r e t u r n ;  
 	 i f ( o . o f f s e t W i d t h )  
 	 	 e w   =   o . o f f s e t W i d t h ;  
 	 e l s e   i f ( o . c l i p . w i d t h )  
 	 	 e w   =   o . c l i p . w i d t h ;  
 	 y   =   m o u s e Y ( e )   +   1 6 ;  
 	 x   =   m o u s e X ( e )   -   ( e w   /   4 ) ;  
 	 i f   ( x   <   2 )  
 	 	 x   =   2 ;  
 	 e l s e   i f ( x   +   e w   >   w i n d o w W i d t h )  
 	 	 x   =   w i n d o w W i d t h   -   e w   -   4 ;  
 	 o . s t y l e . l e f t   =   x   +   ' p x ' ;  
 	 o . s t y l e . t o p   =   y   +   ' p x ' ;  
 	 o . s t y l e . v i s i b i l i t y   =   ' v i s i b l e ' ;  
 	 p r e v T o o l t i p   =   o ;  
 }  
 f u n c t i o n   h i d e t o o l t i p ( )   {  
 	 o   =   d o c u m e n t . g e t E l e m e n t B y I d ( " t i p " ) ;  
 	 i f   ( ! o )   r e t u r n ;  
 	 i f   ( o . s t y l e . v i s i b i l i t y   = =   ' v i s i b l e ' )  
 	 	 o . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 }  
  
 f u n c t i o n   r o l l R o w ( t a b l e i d )   {  
 	 v a r   t a b l e b o d y   =   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 l e i d ) ;  
 	 i f   ( ! t a b l e b o d y )   r e t u r n ;  
 	 / / i f ( t a b l e b o d y . n o d e N a m e ! =   " t b o d y " )   r e t u r n   f a l s e ;  
 	 t a b l e r o w s   =   d o c u m e n t . g e t E l e m e n t s B y N a m e ( " a v r e c o r d " ) ;  
 	 v a r   c u r r _ i d   =   t a b l e r o w s [ 0 ] . g e t A t t r i b u t e ( ' i d ' ) ;  
 	 v a r   n e x t _ i d   =   t a b l e r o w s [ t a b l e r o w s . l e n g t h - 1 ] . g e t A t t r i b u t e ( ' i d ' ) ;  
 	 t a b l e r o w s [ 0 ] . s e t A t t r i b u t e ( ' i d ' , n e x t _ i d ) ;  
 	 t a b l e r o w s [ t a b l e r o w s . l e n g t h - 1 ] . s e t A t t r i b u t e ( ' i d ' , c u r r _ i d ) ;  
 	 t a b l e b o d y . a p p e n d C h i l d ( t a b l e r o w s [ 0 ] ,   n u l l ) ;  
 }  
  
 f u n c t i o n   a u t o R o l l ( d i v i d )   {  
 	 i f   ( ! s c r o l l a b l e )   r e t u r n ;  
 	 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 ( d i v i d ) ;  
 	 i f   ( o b j )   {  
 	 	 c u r r e n t p o s = c u r r e n t p o s + s c r o l l s t e p ;  
 	 	 i f   ( c u r r e n t p o s   = =   0 )   {  
 	 	 	 o b j . s c r o l l T o p   =   c u r r e n t p o s ;  
 	 	 	 s e t T i m e o u t ( " a u t o R o l l ( ' " + d i v i d + " ' ) " , 3 0 ) ;  
 	 	 	 r e t u r n ;  
 	 	 }  
 	 	 i f   ( c u r r e n t p o s   > =   2 3 ) {  
 	 	 	 r o l l R o w ( ' t b l d a t a ' ) ;  
 	 	 	 o b j . s c r o l l T o p   =   0 ;  
 	 	 	 c u r r e n t p o s   =   - s c r o l l s t e p ;  
 	 	 	 s e t T i m e o u t ( " a u t o R o l l ( ' " + d i v i d + " ' ) " , 3 0 ) ;  
 	 	 	 r e t u r n ;  
 	 	 }  
 	 	 o b j . s c r o l l T o p   =   c u r r e n t p o s ;  
 	 }  
 	 s e t T i m e o u t ( " a u t o R o l l ( ' " + d i v i d + " ' ) " , 3 0 ) ;  
 }  
  
 / /   S t a r t   s c r o l l  
 v a r   c u r r e n t p o s = - s c r o l l s t e p ;  
 v a r   D H   =   0 ; v a r   a n   =   0 ; v a r   a l   =   0 ; v a r   a i   =   0 ;  
 i f   ( d o c u m e n t . g e t E l e m e n t B y I d )   { a i   =   1 ;   D H   =   1 ; }  
 e l s e   {  
 	 i f   ( d o c u m e n t . a l l )   { a l   =   1 ;   D H   =   1 ; }  
 	 e l s e   {  
 	 	 b r o w s e r V e r s i o n   =   p a r s e I n t ( n a v i g a t o r . a p p V e r s i o n ) ;  
 	 	 i f   ( ( n a v i g a t o r . a p p N a m e . i n d e x O f ( ' N e t s c a p e ' )   ! =   - 1 )   & &   ( b r o w s e r V e r s i o n   = =   4 ) )   { a n   =   1 ;   D H   =   1 ; }  
 	 }  
 }  
  
 f u n c t i o n   s t a r t s c r o l l ( d i v i d ) {  
 	 i f   ( ( s c r o l l a b l e ) & & ( ( s t o c k t y p e   = =   2 ) | | ( s t o c k t y p e   = =   3 ) | | ( s t o c k t y p e   = =   6 ) ) )  
 	 	 s e t T i m e o u t ( " a u t o R o l l ( ' " + d i v i d + " ' ) " , 7 0 0 0 ) ;  
 }  
  
 v a r   m y t i m e 1 = n e w   D a t e ( ) ;  
 v a r   o f f s e t T i m e = ( 7 * 6 0 + m y t i m e 1 . g e t T i m e z o n e O f f s e t ( ) ) * 6 0 * 1 0 0 0 ;  
 f u n c t i o n   t e s t T i m e O u t ( )   {  
 	 v a r   m y t i m e = n e w   D a t e ( ) ;  
 	 v a r   t i m e V N = n e w   D a t e ( m y t i m e . g e t T i m e ( ) + o f f s e t T i m e ) ;  
 	 v a r   e x p i r e t i m e = n e w   D a t e ( t i m e V N ) ;  
 	 e x p i r e t i m e . s e t H o u r s ( 1 1 ,   1 0 ,   0 ,   0 ) ;  
 	 r e t u r n   ( t i m e V N   < =   e x p i r e t i m e ) ;  
 }  
 f u n c t i o n   o p e n S t o c k ( c )   {  
 	 w d t = w i n d o w . o p e n ( " h t t p : / / w w w . a v s c . c o m . v n / p o r t a l / v i e w I n v C o r p o r a t e . d o ? s y m b o l = "   +   c ,   " P o p u p "   +   c ) ;  
 	 w d t . f o c u s ( ) ;  
 	 r e t u r n   f a l s e ;  
 } 
