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