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