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