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