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