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