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