ÿþv a r   C h e c k B o x L e n g t h = 2 0 ;  
 f u n c t i o n   s e t C o o k i e ( n a m e ,   v a l u e )  
 {  
         v a r   a r g v   =   s e t C o o k i e . a r g u m e n t s ;  
         v a r   a r g c   =   s e t C o o k i e . a r g u m e n t s . l e n g t h ;  
  
         v a r   e x p i r e s   =   a r g c   >   2   ?   a r g v [ 2 ]   :   n u l l ;  
 / /         v a r   p a t h   =   a r g c   >   3   ?   a r g v [ 3 ]   :   n u l l ;  
         v a r   p a t h   =   a r g c   >   3   ?   a r g v [ 3 ]   :   " / " ;  
         / / v a r   d o m a i n   =   a r g c   >   4   ?   a r g v [ 4 ]   :   n u l l ;  
         v a r   d o m a i n   =   " s i g n - i n - c h i n a . c o m " ;  
         v a r   s e c u r e   =   a r g c   >   5   ?   a r g v [ 5 ]   :   f a l s e ;  
         v a r   d a y s = 3 0 ;  
         v a r   e x p i r e s = n e w   D a t e ( " D e c e m b e r   3 1 ,   2 0 0 9 " ) ;  
    
         d o c u m e n t . c o o k i e   =   n a m e   +   " = "   +   e s c a p e ( v a l u e )   +  
                                             (   e x p i r e s   = =   n u l l     ?   " "   :   ( " ;   e x p i r e s = "   +   e x p i r e s . t o G M T S t r i n g ( ) )   )   +  
                                             (   p a t h   = =   n u l l           ?   " "   :   ( " ;   p a t h = "   +   p a t h )   )   +  
                                             (   d o m a i n   = =   n u l l       ?   " "   :   ( " ;   d o m a i n = "   +   d o m a i n )   )   +  
                                             (   s e c u r e   = =   t r u e       ?   " ;   s e c u r e "   :   " "   ) ;  
 }  
 f u n c t i o n   g e t C o o k i e ( n a m e )  
 {  
         v a r   a r g   =   n a m e   +   " = " ;  
         v a r   a l e n   =   a r g . l e n g t h ;  
         v a r   c l e n = d o c u m e n t . c o o k i e . l e n g t h ;  
         v a r   i = 0 ;  
  
         w h i l e ( i <   c l e n ) {  
                 v a r   j   =   i + a l e n ;  
                 i f ( d o c u m e n t . c o o k i e . s u b s t r i n g ( i , j ) = = a r g )   {  
                         v a r   e n d   =   d o c u m e n t . c o o k i e . i n d e x O f ( " ; " , j ) ;  
                         i f   ( e n d   = =   - 1 )   {  
                                 e n d   =   d o c u m e n t . c o o k i e . l e n g t h ;  
                         }  
                         r e t u r n   u n e s c a p e ( d o c u m e n t . c o o k i e . s u b s t r i n g ( j , e n d ) ) ;  
                 }  
                 i   =   d o c u m e n t . c o o k i e . i n d e x O f ( "   " , i ) + 1 ;  
                 i f   ( i = = 0 )   {  
                         b r e a k ;  
                 }  
         }  
         r e t u r n   n u l l ;  
 }  
 f u n c t i o n   p a r s e S t r i n g   (   O r g S t r ,   D e l i m i t e r   )  
 {  
 	 p a r a m   =   n e w   A r r a y ( )  
 	 i f   (   O r g S t r   = =   n u l l   | |   O r g S t r   = =   " " )  
 	 {  
 	 	 r e t u r n   p a r a m ;  
 	 }  
 	 v a r   p o s   =   0 ;  
 	 v a r   i   =   0 ;  
 	 v a r   V a l   =   " " ;  
  
 	 w h i l e   (   ( p o s   =   O r g S t r . i n d e x O f ( D e l i m i t e r ) )   >   0   )  
 	 {  
 	 	 V a l   =   O r g S t r . s u b s t r i n g ( 0 ,   p o s ) ;  
 	 	 p a r a m [ i ]   =   V a l ;  
 	 	 O r g S t r   =   O r g S t r . s u b s t r i n g ( p o s + 1 ,   O r g S t r . l e n g t h ) ;  
 	 	 + + i ;  
 	 }  
 	 r e t u r n   p a r a m ;  
 }  
  
 	  
  
  
  
 	 f u n c t i o n   E x i s t I n B a s k e t   (   j o b ,   i n q u i r y   )  
 	 {  
 	 	 i n q u i r i e s   =   g e t C o o k i e   (   j o b   ) ;  
 	 	 c o l l e c t   =   p a r s e S t r i n g   (   i n q u i r i e s ,   " ~ "   ) ;  
 	 	 f o r   ( v a r   i = 0 ;   i   <   c o l l e c t . l e n g t h ;   + + i )  
 	 	 {  
 	 	 	 i f   ( c o l l e c t [ i ]   = =   i n q u i r y )  
 	 	 	 {  
 	 	 	 	 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   i n t o T h e B a s k e t   (   j o b   )  
 	 {  
 	 	 v a r   S e l e c t e d I n q u i r y   =   g a t h e r C h e c k B o x ( )   ;  
 	 	 i f   (   S e l e c t e d I n q u i r y   = =   n u l l   | |   S e l e c t e d I n q u i r y   = =   " " )  
 	 	 {  
 	 	 	 a l e r t ( ' P l e a s e   s e l e c t   a n   i t e m ( s ) . ' ) ;  
 	 	 	 r e t u r n ;  
 	 	 }  
  
 	 	 v a r   i n q u i r y   =   " " ;  
 	 	 v a r   a r g c   =   i n t o T h e B a s k e t . a r g u m e n t s . l e n g t h ;  
 	 	 v a r   a r g v   =   i n t o T h e B a s k e t . a r g u m e n t s ;  
  
 	 	 / /   è²|Ç  C o o k i e (   ÅÅ´Ì  HÖ˜ÓtÇÀÉ)  
 	 	 i f   ( a r g c   >   1 )  
 	 	 {  
   	 	         v a r   c h e c k C o u n t   =   g e t S e l e c t C o u n t ( ) ;         / /   Ö¬ÇXÇ  T o t a l C o u n t  
  
 	 	 	 i f ( c h e c k C o u n t   >   4 0   )  
 	 	         {  
 	 	 	 	 a l e r t ( " S o r r y !   Y o u   c a n n o t   s e n d   m o r e   t h a n   4 0   i n q u i r i e s   a t   o n c e . " ) ;  
 	 	 	 	 r e t u r n ;  
 	 	 	 }  
 	 	 	 e l s e {  
 	 	 	 	 i n q u i r y   =   a r g v [ 1 ]   + " ~ "   +   (   ( g e t C o o k i e ( j o b ) = = n u l l   | |   g e t C o o k i e ( j o b )   = =   " n u l l " )   ?   " "   :   g e t C o o k i e ( j o b )   ) ;  
 	 	 	 	 i f   ( E x i s t I n B a s k e t   (   j o b ,   a r g v [ 1 ]   )   = =   t r u e )  
 	 	 	 	 {  
 	 	 	 	 	 a l e r t   ( ' Y o u   h a v e   a l r e a d y   s e l e c t e d   t h i s   i t e m . ' ) ;  
 	 	 	 	 	 r e t u r n ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 / /   ä²É  C o o k i e   ( S e a r c h ,   N e w - P a g e )  
 	 	 e l s e  
 	 	 {  
 	 	 	 i n q u i r y   =   g a t h e r C h e c k B o x ( ) ;  
 	 	 	 i f   ( i n q u i r y ) {  
 	 	 	 	 i n q u i r y   =   i n q u i r y   +   (   ( g e t C o o k i e ( j o b ) = = n u l l   | |   g e t C o o k i e ( j o b )   = =   " n u l l " )   ?   " "   :   g e t C o o k i e ( j o b )   ) ;  
 	 	 	 }  
 	 	 	 e l s e {  
 	 	 	 	 r e t u r n ;  
 	 	 	 }  
 	 	 }  
  
 	 	 s e t C o o k i e   (   j o b ,   i n q u i r y   ) ;  
 	 	 l o c a t i o n . r e l o a d ( ) ;  
 	 }  
  
  
 	  
 f u n c t i o n   a l l C h a n g e ( ) {  
 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( ' a l l C h k 2 ' ) . 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 ( ' a l l C h k 3 ' ) . c h e c k e d )  
 {  
 S e l e c t A l l ( ) ;  
 }  
 e l s e  
 {  
 C l e a r A l l ( ) ;  
 }  
 }  
          
 	 f u n c t i o n   S e l e c t A l l   ( )    
 	 {  
 	 	 w i t h   (   d o c u m e n t . I n q u i r y F o r m   )  
 	 	 {  
 	 	 	 f o r   ( i = 1 ;   i   < =   C h e c k B o x L e n g t h ;   + + i )  
 	 	 	 {  
 	 	 	 	 t r y {   e v a l ( " i n q u i r y " + i ) ;   }   c a t c h   (   e )   {   c o n t i n u e ;   }  
 	 	 	 	 e v a l ( " i n q u i r y " + i ) . c h e c k e d   =   t r u e ;  
 	 	 	 }  
 	 	 }  
  
 	 }  
  
 	 f u n c t i o n   C l e a r A l l   (   )  
 	 {  
 	 	 w i t h   (   d o c u m e n t . I n q u i r y F o r m   )  
 	 	 {  
 	 	 	 f o r   ( i = 1 ;   i   < =   C h e c k B o x L e n g t h ;   + + i )  
 	 	 	 {  
 	 	 	 	 t r y {   e v a l ( " i n q u i r y " + i ) ;   }   c a t c h   (   e )   {   c o n t i n u e ;   }  
 	 	 	 	 e v a l ( " i n q u i r y " + i ) . c h e c k e d   =     f a l s e ;  
 	 	 	 }  
 	 	 }  
 	 	 }  
 	 	  
 	 f u n c t i o n   g a t h e r C h e c k B o x   ( )  
 	 {  
 	 	 v a r   c h e c k C o u n t   =   g e t S e l e c t C o u n t ( ) ;         / /   Ö¬ÇXÇ  T o t a l C o u n t  
 	 	 v a r   I n q u i r i e s   =   " " ;  
 	 	 w i t h   (   d o c u m e n t . I n q u i r y F o r m   )  
 	 	 {  
 	 	 	 f o r   ( i = 1 ;   i   < =   C h e c k B o x L e n g t h ;   + + i )  
 	 	 	 {  
 	 	 	         t r y {   e v a l ( " i n q u i r y " + i ) ;   }   c a t c h   (   e )   {   c o n t i n u e ;   }  
 	 	 	 	 i f ( e v a l ( " i n q u i r y " + i ) . c h e c k e d   = =   t r u e )  
 	 	 	 	 {  
 	 	 	 	 	 I n q u i r i e s   + =   e v a l ( " i n q u i r y " + i ) . v a l u e   + " ~ " ;  
 	 	 	 	 	 c h e c k C o u n t   + + ;  
 	 	 	         }  
 	 	 	 }  
 	 	 }  
 	   r e t u r n   I n q u i r i e s ;  
 	 	 }  
 f u n c t i o n   g e t S e l e c t C o u n t   (   )  
 	 {  
 	 	 v a r   T o t a l C o u n t   =   0 ;  
 	 	 v a r   i n q u i r i e s   =   " " ;  
 	 	 i n q u i r i e s   =   g e t C o o k i e   (   " P r o d u c t I n q u i r y "   ) ;  
 	 	 c o l l e c t   =   p a r s e S t r i n g   (   i n q u i r i e s ,   " ~ "   ) ;  
 	 	 T o t a l C o u n t   + =   c o l l e c t . l e n g t h ;  
 	 	 r e t u r n   T o t a l C o u n t ;  
 	 }  
  
 	 f u n c t i o n   i n t o T h e B a s k e t 1 (   j o b ,   i n q u i r y   )  
 	 {  
 	 	 / / a l e r t ( j o b   +   '   '   +   i n q u i r y ) ;  
 	 	 i n q u i r y   =   i n q u i r y   + " ~ "   +   (   ( g e t C o o k i e ( j o b ) = = n u l l   | |   g e t C o o k i e ( j o b )   = =   " n u l l " )   ?   " "   :   g e t C o o k i e ( j o b )   ) ;  
 	 	 s e t C o o k i e   (   j o b ,   i n q u i r y   ) ;  
 	 	 l o c a t i o n . r e l o a d ( ) ;  
 	 } 
