ÿþ 
 f u n c t i o n   i n i t ( )   {  
         a c t i v F i e l d ( ' C a r P r i c e ' ) ;  
         i n i t E l e m e n t s ( )  
 }  
  
 f u n c t i o n   n e x t ( )   {  
 	 i f   ( ! n e x t C o m m o n ( ) )   {  
 	 	 r e t u r n ;  
 	 }  
 	  
         v a r   l e a d   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' l e a d ' ) ;  
 	 l e a d . M o n t h l y C o n f i r m e d C u r r e n c y . v a l u e   =   l e a d . C a r P r i c e C u r r e n c y . v a l u e ; 	  
 	 l e a d . M o n t h l y U n c o n f i r m e d C u r r e n c y . v a l u e   =   l e a d . C a r P r i c e C u r r e n c y . v a l u e ;  
 	  
 	 v a r   f i e l d ; 	  
         s t e p   =   ' s t e p 2 ' ;  
         f i e l d   =   ' C a r M a k e S e l e c t ' ;  
 	  
 	 d o c u m e n t . g e t E l e m e n t B y I d ( s t e p ) . s t y l e . d i s p l a y   =   ' i n l i n e ' ;  
 	 a c t i v F i e l d ( f i e l d ) ;  
 }  
  
 f u n c t i o n   c h a n g e C a r M a k e ( f i e l d )   {  
 i f   ( 1   = =   f i e l d . s e l e c t e d I n d e x )   {  
                 d o c u m e n t . g e t E l e m e n t B y I d ( ' C a r M a k e _ t d ' ) . s t y l e . v i s i b i l i t y   =   ' v i s i b l e ' ;  
                 d o c u m e n t . g e t E l e m e n t B y I d ( ' C a r M a k e ' ) . v a l u e   =   ' ' ;    
         }  
         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 a r M a k e _ t d ' ) . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
                  
                 i f   ( 0   = =   f i e l d . s e l e c t e d I n d e x )    
                         d o c u m e n t . g e t E l e m e n t B y I d ( ' C a r M a k e ' ) . v a l u e   =   ' ' ;    
                 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 a r M a k e ' ) . v a l u e   =   f i e l d [ f i e l d . s e l e c t e d I n d e x ] . t e x t ;  
         }  
 }  
  
 f u n c t i o n   c h e c k _ o n b l u r ( f i e l d )   {  
         v a r   v   =   v a l i d a t e ( f i e l d ) ;  
         i f   ( v   ! =   n u l l   & &   g e t H i g h l i g h t E r r o r ( f i e l d ) )   {  
                 c a l l S e r v e r ( f i e l d . i d   +   ' | '   +   f i e l d . v a l u e ,   n u l l )  
         }  
         s e t R e d E r r o r ( f i e l d , v ) ;  
 }  
  
 f u n c t i o n   v a l i d a t e ( f i e l d )   {  
 	 v a r   v a r t y p e   =   f i e l d . g e t A t t r i b u t e ( ' v a r t y p e ' ) ;  
 	 v a r   m i n   =   f i e l d . g e t A t t r i b u t e ( ' m i n ' ) ;  
 	 v a r   m a x   =   f i e l d . g e t A t t r i b u t e ( ' m a x ' ) ; 	  
  
 	 i f   ( v a r t y p e   = =   u n d e f i n e d )   r e t u r n   n u l l ;  
  
 	 v a r   v a l u e   =   f i e l d . v a l u e . r e p l a c e ( / ^ \ s + / ,   ' ' ) . r e p l a c e ( / \ s + $ / ,   ' ' ) ;  
 	 v a r   a l l o w e m p t y   =   f i e l d . g e t A t t r i b u t e ( ' a l l o w e m p t y ' ) ;  
 	  
 	 i f   ( v a l u e   = =   ' ' )   {  
 	         i f   ( a l l o w e m p t y   = =   ' T r u e ' )   r e t u r n   n u l l ;  
 	         e l s e   i f   ( v a r t y p e   = =   ' i n t '   & &   m i n   = =   ' 0 ' )   v a l u e   =   ' 0 ' ;  
 	         e l s e   r e t u r n   c _ e m p t y ;  
 	 }  
 	  
 	 i f   ( f i e l d . i d   = =   ' M o n t h l y C o n f i r m e d I n c o m e '   | |   f i e l d . i d   = =   ' M o n t h l y U n c o n f i r m e d I n c o m e ' )  
 	 {  
 	         v a r   r e s u l t   =   c h e c k I n t ( v a l u e ,   m i n ,   m a x ) ;  
 	         i f   ( n u l l   = =   r e s u l t )      
 	                 r e t u r n   i n c o m e S u m C h e c k ( ) ;  
 	         e l s e   r e t u r n   r e s u l t ;  
 	 }  
 	  
 	 r e t u r n   v a l i d a t e C o m m o n ( v a r t y p e ,   m i n ,   m a x ,   v a l u e ) ;  
 }  
  
 f u n c t i o n   i n c o m e S u m C h e c k ( )  
 {  
         v a r   l e a d   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' l e a d ' ) ;  
          
         v a r   i n c 1   =   l e a d . M o n t h l y C o n f i r m e d I n c o m e . v a l u e . r e p l a c e ( / [ . , '   ] / g ,   ' ' )   *   1 ;  
         v a r   i n c 2   =   l e a d . M o n t h l y U n c o n f i r m e d I n c o m e . v a l u e . r e p l a c e ( / [ . , '   ] / g ,   ' ' )   *   1 ;  
         v a r   r e s u l t   =   n u l l ;  
          
         i f   ( i n c 1   +   i n c 2   <   1 0 0 )  
         {  
                 r e s u l t   =   c _ i n c o r r e c t ;  
         }  
          
         i f   ( n u l l = = r e s u l t )  
         {  
  
                 v a r   m i n I n c   =   l e a d . M o n t h l y C o n f i r m e d I n c o m e . g e t A t t r i b u t e ( ' m i n ' ) ;  
         	 v a r   m a x I n c   =   l e a d . M o n t h l y C o n f i r m e d I n c o m e . g e t A t t r i b u t e ( ' m a x ' ) ;  
         	 v a r   v a l u e I n c   =   p r e V a l i d a t e ( l e a d . M o n t h l y C o n f i r m e d I n c o m e ) ;  
  
                 v a r   m i n I n c U n c   =   l e a d . M o n t h l y U n c o n f i r m e d I n c o m e . g e t A t t r i b u t e ( ' m i n ' ) ;  
         	 v a r   m a x I n c U n c   =   l e a d . M o n t h l y U n c o n f i r m e d I n c o m e . g e t A t t r i b u t e ( ' m a x ' ) ;  
         	 v a r   v a l u e I n c U n c   =   p r e V a l i d a t e ( l e a d . M o n t h l y U n c o n f i r m e d I n c o m e ) ;  
  
                 i f   ( v a l u e I n c U n c   = =   n u l l   & &   i n c 1   > =   1 0 0 )  
         	 {  
         	         s e t R e d E r r o r ( l e a d . M o n t h l y U n c o n f i r m e d I n c o m e , n u l l ) ;  
         	         s e t R e d E r r o r ( l e a d . M o n t h l y C o n f i r m e d I n c o m e , c h e c k I n t ( v a l u e I n c , m i n I n c , m a x I n c ) ) ;    
         	         r e t u r n   n u l l ;  
         	 }  
         	 i f   ( v a l u e I n c   = =   n u l l   & &   i n c 2   > =   1 0 0 )  
         	 {  
         	         s e t R e d E r r o r ( l e a d . M o n t h l y C o n f i r m e d I n c o m e , n u l l ) ;    
         	         s e t R e d E r r o r ( l e a d . M o n t h l y U n c o n f i r m e d I n c o m e , c h e c k I n t ( v a l u e I n c U n c , m i n I n c U n c , m a x I n c U n c ) ) ;  
         	         r e t u r n   n u l l ;  
         	 }  
         	  
         	 s e t R e d E r r o r ( l e a d . M o n t h l y C o n f i r m e d I n c o m e , c h e c k I n t ( v a l u e I n c , m i n I n c , m a x I n c ) ) ;  
                 s e t R e d E r r o r ( l e a d . M o n t h l y U n c o n f i r m e d I n c o m e , c h e c k I n t ( v a l u e I n c U n c , m i n I n c U n c , m a x I n c U n c ) ) ;          
         }  
         e l s e  
         {  
                 s e t R e d E r r o r ( l e a d . M o n t h l y C o n f i r m e d I n c o m e , r e s u l t ) ;  
                 s e t R e d E r r o r ( l e a d . M o n t h l y U n c o n f i r m e d I n c o m e , r e s u l t ) ;  
         }  
          
         r e t u r n   r e s u l t ;  
 }  
  
 
