ÿþ/ / s h o w   m e n u  
 f u n c t i o n   s h o w S u b ( g r o u p I d ) {  
 	 v a r   c h e c k   =   d o c u m e n t . g e t E l e m e n t B y I d ( g r o u p I d ) . s t y l e . d i s p l a y ; 	  
 	 i f ( c h e c k   = = " n o n e " ) {  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( " i c o n _ " + g r o u p I d ) . s r c   =   " / I m a g e s / C o m m o n / e x p a n d _ o n . g i f " ;  
 	 	 $ ( " # " + g r o u p I d ) . s l i d e D o w n ( " s l o w " ) ;  
 	 } 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 ( " i c o n _ " + g r o u p I d ) . s r c   =   " / I m a g e s / C o m m o n / e x p a n d _ o f f . g i f " ;  
 	 	 $ ( " # " + g r o u p I d ) . s l i d e U p ( " s l o w " ) ;  
 	 }  
 }  
  
 f u n c t i o n   s h o w M o r e C a t ( g r o u p I d ) {  
 	 v a r   c h e c k   =   d o c u m e n t . g e t E l e m e n t B y I d ( g r o u p I d ) . s t y l e . d i s p l a y ; 	  
 	 i f ( c h e c k   = = " n o n e " ) {  
 	         d o c u m e n t . g e t E l e m e n t B y I d ( g r o u p I d + " _ o p t " ) . i n n e r H T M L   =   " < a   h r e f = \ " j a v a s c r i p t : s h o w M o r e C a t ( ' "   +   g r o u p I d   +   " ' ) \ " > < <   R ú t   g Ín < / a > " ;  
 	 	 $ ( " # " + g r o u p I d ) . s l i d e D o w n ( " s l o w " ) ;  
 	 } 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 ( g r o u p I d + " _ o p t " ) . i n n e r H T M L   =   " < a   h r e f = \ " j a v a s c r i p t : s h o w M o r e C a t ( ' "   +   g r o u p I d   +   " ' ) \ " > X e m   t h ê m   > > < / a > " ;  
 	 	 $ ( " # " + g r o u p I d ) . s l i d e U p ( " s l o w " ) ;  
 	 }  
 }  
  
 f u n c t i o n   a d d C o m p a r e L i s t ( p r o d u c t I d ) {  
         v a r   c h e c k e d   =   d o c u m e n t . g e t E l e m e n t B y I d ( " c o m p a r e I t e m _ " + p r o d u c t I d ) . c h e c k e d ;  
         v a r   c u r r e n t L i s t   =   d o c u m e n t . g e t E l e m e n t B y I d ( " p r o d u c t C o m p a r e L i s t " ) . v a l u e ;  
         v a r   c u r r e n t N u m I t e m   =   c u r r e n t L i s t . s p l i t ( " ; " ) . l e n g t h   -   2 ;  
         v a r   p r o d u c t I m a g e U r l   =   d o c u m e n t . g e t E l e m e n t B y I d ( " p r o d u c t H i d d e n I m a g e _ " + p r o d u c t I d ) . v a l u e ;  
         v a r   i c o n H t m l   =   " < d i v   c l a s s = \ " i m g _ c o m p a r e _ i c o n \ " > < i m g   s r c = \ " " +   p r o d u c t I m a g e U r l + " \ "   w i d t h = 3 0 > < / d i v > " ;  
         i f ( c h e c k e d ) {  
                 i f ( c u r r e n t N u m I t e m   >   1 0 ) {  
                         / / C h o   p h e p   s o   s á n h   t Ñi   a   1 0   s £n   p h ©m  
                         d o c u m e n t . g e t E l e m e n t B y I d ( " c o m p a r e I t e m _ " + p r o d u c t I d ) . c h e c k e d   =   " " ;  
                         a l e r t ( " B ¡n   c h É  c ó   t h Ã  s o   s á n h   t Ñi   a   1 0   s £n   p h ©m \ n D a n h   s á c h   ã   c ó   ç  1 0 " ) ;  
                 } 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 ( " p r o d u c t C o m p a r e L i s t " ) . v a l u e   =   c u r r e n t L i s t   +   p r o d u c t I d   +   " ; " ;  
                         / / T h ê m   t i ¿p   £n h  
                         n e x t C o n t a i n e r   =   c u r r e n t N u m I t e m   +   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 m p a r e I t e m C o n t a i n _ " +   n e x t C o n t a i n e r ) . i n n e r H T M L   =   i c o n 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 ( " p r o d u c t I t e m C o n t a i n _ " +   n e x t C o n t a i n e r ) . v a l u e   =   p r o d u c t I d ;  
                 }        
         } 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 ( " p r o d u c t C o m p a r e L i s t " ) . v a l u e   =   c u r r e n t L i s t . r e p l a c e ( " ; "   +   p r o d u c t I d   +   " ; " , " ; " ) ;  
                 / / X ó a   b Ï  £n h  
                 v a r   c o n t a i n I d   =   0 ;  
                 f o r ( v a r   i = 1 ; i < = c u r r e n t N u m I t e m ; i + + ) {  
                         v a r   p r o d u c t C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( " p r o d u c t I t e m C o n t a i n _ " +   i ) . v a l u e ;  
                         i f ( p r o d u c t C o n t a i n e r   ! =   " " ) {  
                                 i f ( p r o d u c t I d   = =   p r o d u c t C o n t a i n e 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 m p a r e I t e m C o n t a i n _ " +   i ) . i n n e r 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 ( " p r o d u c t I t e m C o n t a i n _ " +   i ) . v a l u e   =   " " ;  
                                         c o n t a i n I d   =   i ;  
                                         b r e a k ;  
                                 }  
                         }  
                 }  
                 / / S ¯p   x ¿p   l ¡i   £n h  
                 i f ( c o n t a i n I d   ! =   0 ) {  
                         a r r a n g e I m a g e C o n t a i n e r ( c o n t a i n I d , 4 ) ;  
                 }  
         }  
 }  
  
 / / S ¯p   x ¿p   l ¡i   £n h   t r o n g   c á c   c o n t a i n e r   £m   b £o   c á c   £n h   t ë  1   - >   n  
 / / s t a r t I d   l à   I D   c ça   c o n t a i n e r   c ó   £n h   b Ë  r e m o v e ,   d o   ó   c §n   °ãc   b ù   b ±n g   £n h   k h á c   n ±m   ß  c o n t a i n e r   l Ûn   h ¡n   g §n   n h ¥t   n ¿u   c ó  
 / / r Ói   l ·p   l ¡i   q u á   t r ì n h   n à y   c h o   c o n t a i n e r   v ëa   b Ë  l ¥y   £n h  
  
 f u n c t i o n   a r r a n g e I m a g e C o n t a i n e r ( s t a r t I d , m a x N u m ) {  
         v a r   n e x t S t a r t I d   =   0 ;  
         f o r ( v a r   i = s t a r t I d + 1 ; i < = m a x N u m ; i + + ) {  
                 v a r   c o n t e n 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 ( " c o m p a r e I t e m C o n t a i n _ " +   i ) . i n n e r H T M L ;  
                 v a r   p r o d u c t C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( " p r o d u c t I t e m C o n t a i n _ " +   i ) . v a l u e ;  
                 i f ( c o n t e n t H t m l . l e n g t h   >   2 )  
                 {  
                         d o c u m e n t . g e t E l e m e n t B y I d ( " c o m p a r e I t e m C o n t a i n _ " +   s t a r t I d ) . i n n e r H T M L   =   c o n t e n 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 ( " p r o d u c t I t e m C o n t a i n _ " +   s t a r t I d ) . v a l u e   =   p r o d u c t C o n t a i n e 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 m p a r e I t e m C o n t a i n _ " +   i ) . i n n e r 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 ( " p r o d u c t I t e m C o n t a i n _ " +   i ) . v a l u e   =   " " ;  
                         n e x t S t a r t I d   =   i ;  
                         a r r a n g e I m a g e C o n t a i n e r ( n e x t S t a r t I d , m a x N u m ) ;  
                         b r e a k ;  
                 }  
         }  
 }  
  
 f u n c t i o n   g o C o m p a r e P a g e ( c a t e g o r y I d ) {  
         v a r   c o m p a r e L i s t   =   d o c u m e n t . g e t E l e m e n t B y I d ( " p r o d u c t C o m p a r e L i s t " ) . v a l u e ;  
         v a r   n u m b e r P r o d u c t   =   c o m p a r e L i s t . s p l i t ( ' ; ' ) . l e n g t h ;  
         i f ( n u m b e r P r o d u c t   >   3 ) {  
                 w i n d o w . l o c a t i o n . h r e f   =   " P r o d u c t C o m p a r e . a s p x ? L i s t = "   +   c o m p a r e L i s t   +   " & C a t e g o r y I d = "   +   c a t e g o r y I d ;  
               / /   a l e r t ( n u m b e r P r o d u c t ) ;  
         } e l s e {  
                 a l e r t ( " B ¡n   c §n   c h Ín   í t   n h ¥t   2   s £n   p h ©m   Ã  s o   s á n h \ n C h Ín   s £n   p h ©m   b ±n g   t í c h   ô   d °Ûi   £n h   s £n   p h ©m " ) ;  
         }  
 }  
  
 f u n c t i o n   s h o w P r o d u c t I m a g e ( i m a g e N a m e )  
 {  
         d o c u m e n t . g e t E l e m e n t B y I d ( " p r o _ b i g " ) . i n n e r H T M L   =   " < i m g   s r c = \ " I m a g e s / P r o d u c t / " +   i m a g e N a m e + " \ " > " ;  
 }  
  
 f u n c t i o n   s a v e P r o d u c t ( p r o d u c t I d )  
 {  
         $ ( " # s a v e _ "   +   p r o d u c t I d ) . l o a d ( " P r o d u c t S a v e . a s p x ? P r o d u c t I d = "   +   p r o d u c t I d ) ;  
 }  
  
 f u n c t i o n   l o a d R e v i e w F o r m ( i d ) {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' p r o _ c o n t e n t _ r e v i e w ' ) . 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 _ i c o n _ s m a l l . g i f >   . . .   a n g   t £i   f o r m " ;  
         $ ( " # p r o _ c o n t e n t _ r e v i e w " ) . l o a d ( " / P r o d u c t R e v i e w F o r m . a s p x ? P r o d u c t I D = " + i d ) ;  
 }  
  
 f u n c t i o n   S e n d P r o d u c t R e v i e w ( i d ) {  
         $ . p o s t ( " P r o d u c t R e v i e w F o r m . a s p x " , {  
                                         P r o d u c t I D : i d  
                                         ,   r e v i e w _ r a t e   :   d o c u m e n t . g e t E l e m e n t B y I d ( " r e v i e w _ r a t e _ s e l e c t " ) . v a l u e  
                                         ,   R a t i n g T i t l e T e x t B o x   :   d o c u m e n t . g e t E l e m e n t B y I d ( " R a t i n g T i t l e T e x t B o x " ) . v a l u e  
                                         ,   R a t i n g C o n t e n t T e x t A r e a   :   d o c u m e n t . g e t E l e m e n t B y I d ( " R a t i n g C o n t e n t T e x t A r e a " ) . v a l u e  
                                     } , f u n c t i o n ( d a t a ) {  
                         d o c u m e n t . g e t E l e m e n t B y I d ( ' p r o _ c o n t e n t _ r e v i e w ' ) . i n n e r H T M L   =   " < p > C £m   ¡n   b ¡n   ã   g íi   ý   k i ¿n   v Á  s £n   p h ©m .   C h ú n g   t ô i   s ½  k i Ãm   d u y Çt   v à   c h o   n Ùi   d u n g   h i Ãn   t h Ë  t r o n g   t h Ýi   g i a n   s Ûm   n h ¥t . < / p > " ;  
                 } ) ;  
 }  
  
 f u n c t i o n   p o p U p P r o d u c t G a l l e r y ( u r l )    
 {  
           v a r   w i d t h     =   6 0 0 ;  
           v a r   h e i g h t   =   5 5 0 ;  
           v a r   l e f t       =   ( s c r e e n . w i d t h     -   w i d t h ) / 2 ;  
           v a r   t o p         =   ( s c r e e n . h e i g h t   -   h e i g h t ) / 2 ;  
           v a r   p a r a m s   =   ' w i d t h = ' + w i d t h + ' ,   h e i g h t = ' + h e i g h t ;  
           p a r a m s   + =   ' ,   t o p = ' + t o p + ' ,   l e f t = ' + l e f t ;  
           p a r a m s   + =   ' ,   d i r e c t o r i e s = n o ' ;  
           p a r a m s   + =   ' ,   l o c a t i o n = n o ' ;  
           p a r a m s   + =   ' ,   m e n u b a r = n o ' ;  
           p a r a m s   + =   ' ,   r e s i z a b l e = y e s ' ;  
           p a r a m s   + =   ' ,   s c r o l l b a r s = y e s ' ;  
           p a r a m s   + =   ' ,   s t a t u s = n o ' ;  
           p a r a m s   + =   ' ,   t o o l b a r = n o ' ;  
           n e w w i n = w i n d o w . o p e n ( u r l , ' p r o d u c t G a l l e r y W i n d o w ' ,   p a r a m s ) ;  
           i f   ( w i n d o w . f o c u s )   { n e w w i n . f o c u s ( ) }  
           r e t u r n   f a l s e ;  
   }  
  
   / / 0 8 - 1 2 - 2 0 0 8  
   f u n c t i o n   s h o w ( e l i d )   {  
           v a r   c h e c k v i s i b l e   =   d o c u m e n t . g e t E l e m e n t B y I d ( e l i d ) . s t y l e . d i s p l a y ;  
           i f   ( c h e c k v i s i b l e   = =   " n o n e " )   {  
                   d o c u m e n t . g e t E l e m e n t B y I d ( e l i d ) . s t y l e . d i s p l a y   =   " b l o c k " ;  
           }   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 ( e l i d ) . s t y l e . d i s p l a y   =   " n o n e " ;  
           }  
   }  
  
   f u n c t i o n   c h o o s e P a y m e n t O p t i o n ( o p t i o n )   {  
           v a r   c h e c k e d   =   d o c u m e n t . g e t E l e m e n t B y I d ( o p t i o n ) . c h e c k e d ;  
           v a r   i n s t I d   =   d o c u m e n t . g e t E l e m e n t B y I d ( o p t i o n ) . v a l u e ;  
           i f   ( c h e c k e d )   {  
                   d o c u m e n t . g e t E l e m e n t B y I d ( " s e l e c t P a y m e n t M e t h o d " ) . v a l u e   =   i n s t I d ;  
                    
                 / / H i d e   o t h e r   o p t i o n s  
                   f o r   ( v a r   i   i n   p a y m e n t O p t i o n L i s t )   {  
                           i f   ( o p t i o n   ! =   p a y m e n t O p t i o n L i s t [ i ] )   {  
                                   d o c u m e n t . g e t E l e m e n t B y I d ( " p a y _ "   +   p a y m e n t O p t i o n L i s t [ i ] ) . s t y l e . d i s p l a y   =   " n o n e " ;  
                                   d o c u m e n t . g e t E l e m e n t B y I d ( p a y m e n t O p t i o n L i s t [ i ] ) . c h e c k e d   =   f a l s e ;  
                           }  
                   }  
                   / / s h o w   t h e   i n s t r u c t i o n  
                   d o c u m e n t . g e t E l e m e n t B y I d ( " b l o c k _ "   +   i n s t I d ) . s t y l e . d i s p l a y   =   " b l o c k " ;  
           }   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 ( " s e l e c t P a y m e n t M e t h o d " ) . v a l u e   =   " " ;  
                 / / U n c h e c k ,   s h o w   o t h e r   o p t i o n s   a g a i n  
                 f o r   ( v a r   i   i n   p a y m e n t O p t i o n L i s t )   {  
                           d o c u m e n t . g e t E l e m e n t B y I d ( " p a y _ "   +   p a y m e n t O p t i o n L i s t [ i ] ) . s t y l e . d i s p l a y   =   " b 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 ( p a y m e n t O p t i o n L i s t [ i ] ) . c h e c k e d   =   f a l s e ;  
                           v a r   e l t   =   d o c u m e n t . g e t E l e m e n t B y I d ( p a y m e n t O p t i o n L i s t [ i ] ) . v a l u e ;  
                           d o c u m e n t . g e t E l e m e n t B y I d ( " b l o c k _ " + e l t ) . s t y l e . d i s p l a y   =   " n o n e " ;  
                   }  
           }  
   }  
    
   f u n c t i o n   t r a c k P r o d u c t ( p r o d u c t I d ,   o p t i o n ) {  
         i f ( o p t i o n   = =   " c l i c k " ) {  
                 $ . g e t ( " P r o d u c t T r a c k . a s p x " ,   {   a c t i o n :   " c l i c k " ,   p r o d u c t I d :   p r o d u c t I d   }   ) ;  
         } e l s e {  
                 $ . g e t ( " P r o d u c t T r a c k . a s p x " ,   {   a c t i o n :   " v i s i t " ,   p r o d u c t I d :   p r o d u c t I d   }   ) ;  
         }  
   }  
    
   f u n c t i o n   t r a c k C a t e g o r y ( c a t e g o r y I d ) {  
         $ . g e t ( " P r o d u c t T r a c k . a s p x " ,   {   a c t i o n :   " c a t e g o r y " ,   c a t e g o r y I d :   c a t e g o r y I d   }   ) ;  
   }  
    
   f u n c t i o n   s h o w P r o d u c t T a p ( i d , t a p I d ) {  
         v a r   c h e c k d i s p l 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 ) . s t y l e . d i s p l a y ;  
         v a r   l a s t O p e n   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' l a s t O p e n T a p ' ) . v a l u e ;  
         v a r   l a s t O p e n I d   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' l a s t O p e n T a p I d ' ) . v a l u e ;  
         / / a l e r t ( l a s t O p e n   +   "   =   "   +   l a s t O p e n I d ) ;  
         i f ( c h e c k d i s p l a y   = = " n o n e " ) {  
                 / / C l o s e   l a s t   o p e n   t a p   i f   e x i s t                
                 d o c u m e n t . g e t E l e m e n t B y I d ( l a s t O p e n ) . s t y l e . d i s p l a y   =   " n o n e " ;  
                 d o c u m e n t . g e t E l e m e n t B y I d ( l a s t O p e n I d ) . c l a s s N a m e   =   " p r o d u c t T a p U n s e l e c t " ;  
                 / / O p e n   n e w  
                 d o c u m e n t . g e t E l e m e n t B y I d ( i d ) . s t y l e . d i s p l a y   =   " b 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 ( t a p I d ) . c l a s s N a m e   =   " p r o d u c t T a p s e l e c t " ;  
                 d o c u m e n t . g e t E l e m e n t B y I d ( ' l a s t O p e n T a p ' ) . v a l u e   =   i d ;  
                 d o c u m e n t . g e t E l e m e n t B y I d ( ' l a s t O p e n T a p I d ' ) . v a l u e   =   t a p I d ;  
         }  
 }  
  
 f u n c t i o n   s h o w P r o d u c t H i s t o r y ( ) {  
         $ ( " # s h o w H i s t o r y P r o d u c t V i e w " ) . l o a d ( " P r o d u c t V i e w H i s t o r y . a s p x " ) ;          
 }  
  
 f u n c t i o n   c h o o s e S h i p p i n g O p t i o n ( m e t h o d _ i d ) {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' s e l e c t S h i p p i n g M e t h o d ' ) . v a l u e   =   m e t h o d _ i d ;  
 }  
  
 f u n c t i o n   s e l e c t D i s t r i c t ( p r o v i n c e _ i d ) {  
         v a r   l a s t   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' l a s t _ p r o v i n c e ' ) . v a l u e ;  
         / / i f ( l a s t   >   0 ) {  
                 d o c u m e n t . g e t E l e m e n t B y I d ( ' d i s t r i c t _ s e l e c t _ ' + l a s t ) . s t y l e . d i s p l a y   =   " n o n e " ;  
         / / }  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' d i s t r i c t _ s e l e c t _ ' + p r o v i n c e _ i d ) . s t y l e . d i s p l a y   =   " b 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 ( ' l a s t _ p r o v i n c e ' ) . v a l u e   =   p r o v i n c e _ i d ;  
 }  
  
 f u n c t i o n   c h o o s e T h i s D i s t r i c t ( d i s _ i d )   {  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' s e l e c t _ d i s t r i c t ' ) . v a l u e   =   d i s _ i d ;  
 }  
  
 / / p o p - u p  
 f u n c t i o n   o p e n P o p U p ( u r l )   {  
         v a r   w i n W   =   d o c u m e n t . d o c u m e n t E l e m e n t . c l i e n t W i d t h ;  
         v a r   w i n H   =   d o c u m e n t . d o c u m e n t E l e m e n t . c l i e n t H e i g h t ;  
         v a r   t o p H   =   3 0 ;  
         v a r   l e f t   =   w i n W   /   2   -   3 5 0 ;  
         w i n d o w . o p e n ( u r l ,   " n e w _ w i n d o w " ,   " w i d t h = 7 0 0 , h e i g h t = 6 0 0 , s t a t u s = n o , s c r o l l b a r s = y e s , l e f t = " + l e f t + " , t o p = " + t o p H + " " ) ;  
 }  
  
 f u n c t i o n   c l o s e P o p U p ( )   {  
         w i n d o w . c l o s e ( ) ;  
 }  
  
 f u n c t i o n   s h o w M a p ( m a p _ n a m e )   {  
         i f   ( m a p _ n a m e . l e n g t h   >   1 )   {  
                 v a r   u r l   =   " M e d i a / M a p "   +   m a p _ n a m e   +   " . h t m l " ;  
                 o p e n P o p U p ( u r l ) ;  
         }  
 }  
  
 f u n c t i o n   v e r i f y E m a i l ( e m a i l ) {  
         i f ( e m a i l . i n d e x O f ( " @ " )   <   0 ) {  
                 a l e r t ( " V u i   l ò n g   n h ­p   Ëa   c h É  e m a i l " ) ;  
                 r e t u r n   f a l s e ;  
         } e l s e {  
                 r e t u r n   t r u e ;  
         }  
 }  
 / / D a n g   k y   e m a i l   b a n   t i n  
 f u n c t i o n   s u b c r i b e N e w s l e t t e r ( )   {  
         v a r   e m a i l   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' e m a i l _ s u b c r i b e ' ) . v a l u e ;  
         / / t e s t   v a l u e  
         i f   ( e m a i l . l e n g t h   <   6 )   {  
                 a l e r t ( ' V u i   l ò n g   i Án   Ëa   c h É  e m a i l ' ) ;  
         }   e l s e   {  
                 i f ( v e r i f y E m a i l ( e m a i l ) ) {  
                         d o c u m e n t . g e t E l e m e n t B y I d ( ' s u b c r i b i n g _ s t a t u s ' ) . i n n e r H T M L   =   '   . . .   a n g   x í  l ý < b r > ' ;  
                         $ . p o s t ( " S u b c r i b e N e w s l e t t e r . a s p x " ,   {   e m a i l :   e m a i l   } ,  
                               f u n c t i o n ( d a t a )   {  
                                       i f   ( d a t a   = =   1 )   {  
                                               d o c u m e n t . g e t E l e m e n t B y I d ( ' s u b c r i b i n g _ s t a t u s ' ) . i n n e r H T M L   =   " < b   s t y l e = ' c o l o r : r e d ; ' > E m a i l   ã   °ãc   g h i   n h ­n .   C £m   ¡n   q u ý   k h á c h . < / b > < b r > " ;  
                                       }   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 ( ' s u b c r i b i n g _ s t a t u s ' ) . i n n e r H T M L   =   ' ' ;  
                                               a l e r t ( ' X i n   l ×i .   E m a i l   n à y   ã   °ãc   n g   k ý   t ë  t r °Ûc ' ) ;  
                                       }  
                               } ) ;  
                 }  
         }  
 }  
  
 f u n c t i o n   l o a d P r o d u c t F e a t u r e d ( t y p e )   {  
         v a r   a r r a y _ t a p   =   [   ' b e s t s e l l e r ' ,   ' n e w ' ] ;  
         f o r   ( v a r   i   =   0 ;   i   <   a r r a y _ t a p . l e n g t h ;   i + + )   {  
         e l e v a l u e   =   a r r a y _ t a p [ i ]  
         i f   ( t y p e   ! =   e l e v a l u e )   {  
                 d o c u m e n t . g e t E l e m e n t B y I d ( e l e v a l u e   +   " _ p r o d u c t " ) . c l a s s N a m e   =   ' ' ;  
         }  
         }  
         d o c u m e n t . g e t E l e m e n t B y I d ( t y p e   +   " _ p r o d u c t " ) . c l a s s N a m e   =   ' h o m e _ p r o _ b a r _ m e n u _ s e l e c t ' ;  
         / / g e t   p r o d u c t  
         / *  
         $ . g e t ( " F e a t u r e d P r o A j a x . a s p x " ,   {   t y p e :   t y p e   } ,   f u n c t i o n ( d a t a )   {  
                 d o c u m e n t . g e t E l e m e n t B y I d ( ' h o m e L o a d P r o d u c t ' ) . i n n e r H T M L   =   d a t a ;  
         } ) ;  
         * /  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' h o m e L o a d P r o d u c t ' ) . 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 - s m a l l . g i f \ "   / >   N Ùi   d u n g   a n g   t £i   v Á  . . . "  
         v a r   c o n t e n t   =   " < i f r a m e   f r a m e b o r d e r = 0   w i d t h = 9 5 0 p x   h e i g h t = 1 8 0 p x   a l i g n = m i d d l e   " ;  
         c o n t e n t   + =   "   s r c = \ " F e a t u r e d P r o A j a x . a s p x ? t y p e = " + t y p e + " \ " > < / i f r a m e > " ;  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' h o m e L o a d P r o d u c t ' ) . i n n e r H T M L   =   c o n t e n t ;  
 }  
  
 / / c h u y e n   d o i   c a c   c u m   t r o n g   f e a t u r e d   P r o  
 f u n c t i o n   t o p P r o d u c t N e x t ( )   {  
         v a r   m a x _ v a l u e   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' m a x _ t o p _ p r o d u c t _ r o w ' ) . v a l u e ;  
         v a r   c u r r e n t _ v a l u e   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' c u r r e n t _ t o p _ p r o d u c t _ r o w ' ) . v a l u e ;  
         v a r   n e x t _ v a l u e   =   p a r s e I n t ( c u r r e n t _ v a l u e )   +   1 ;  
         i f   ( m a x _ v a l u e   <   n e x t _ v a l u e )   n e x t _ v a l u e   =   1 ;   / / b a c k   t o   t h e   f i r s t   r o w  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' t o p _ g r o u p _ '   +   n e x t _ v a l u e ) . s t y l e . d i s p l a y   =   ' b 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 ( ' t o p _ g r o u p _ '   +   c u r r e n t _ v a l u e ) . s t y l e . d i s p l a y   =   ' n o n e ' ;  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' c u r r e n t _ t o p _ p r o d u c t _ r o w ' ) . v a l u e   =   n e x t _ v a l u e ;  
 }  
  
 f u n c t i o n   t o p P r o d u c t B a c k ( )   {  
         v a r   m a x _ v a l u e   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' m a x _ t o p _ p r o d u c t _ r o w ' ) . v a l u e ;  
         v a r   c u r r e n t _ v a l u e   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' c u r r e n t _ t o p _ p r o d u c t _ r o w ' ) . v a l u e ;  
         v a r   n e x t _ v a l u e   =   p a r s e I n t ( c u r r e n t _ v a l u e )   -   1 ;  
         i f   ( n e x t _ v a l u e   <   1 )   n e x t _ v a l u e   =   m a x _ v a l u e ;   / / b a c k   t o   t h e   f i r s t   r o w  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' t o p _ g r o u p _ '   +   n e x t _ v a l u e ) . s t y l e . d i s p l a y   =   ' b 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 ( ' t o p _ g r o u p _ '   +   c u r r e n t _ v a l u e ) . s t y l e . d i s p l a y   =   ' n o n e ' ;  
         d o c u m e n t . g e t E l e m e n t B y I d ( ' c u r r e n t _ t o p _ p r o d u c t _ r o w ' ) . v a l u e   =   n e x t _ v a l u e ;  
 }  
  
 / / L o g i n   h o m e   p a g e  
 f u n c t i o n   l o g i n A c c o u n t ( )   {  
         v a r   p a s s   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' p a s s _ l o g i n ' ) . v a l u e ;  
         v a r   e m a i l   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' e m a i l _ l o g i n ' ) . v a l u e ;  
         / / t e s t   v a l u e  
         i f   ( p a s s . l e n g t h   <   3   | |   e m a i l . l e n g t h   <   4 )   {  
                 a l e r t ( ' V u i   l ò n g   i Án   t h ô n g   t i n   n g   n h ­p ' ) ;  
         }   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 ( ' s e n d i n g _ l o g i n ' ) . i n n e r H T M L   =   '   . . .   a n g   n g   n h ­p < b r > ' ;  
                 $ . p o s t ( " L o g i n 2 . a s p x " ,   {   p a s s w o r d :   p a s s ,   e m a i l :   e m a i l   } ,  
               f u n c t i o n ( d a t a )   {  
                       d o c u m e n t . g e t E l e m e n t B y I d ( ' s e n d i n g _ l o g i n ' ) . i n n e r H T M L   =   ' ' ;  
                       i f   ( d a t a   ! =   2 )   {  
                               d o c u m e n t . g e t E l e m e n t B y I d ( ' l o g i n _ s u c c e s s ' ) . s t y l e . d i s p l a y   =   ' b 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 ( ' f o r m _ h o m e _ l o g i n ' ) . s t y l e . d i s p l a y   =   ' n o n e ' ;  
                               d o c u m e n t . g e t E l e m e n t B y I d ( ' l o g i n _ n a m e ' ) . i n n e r H T M L   =   " < b > "   +   d a t a   +   " < / b > " ;  
                                
                       }   e l s e   {  
                               a l e r t ( ' S a i   m ­t   k h ©u   h o ·c   e m a i l ' ) ;  
                       }  
               } ) ;  
         }  
 } 
