ÿþ$ ( d o c u m e n t ) . r e a d y ( f u n c t i o n ( )   {  
 r e p l a c e C h e c k s ( ) ;  
 v a r   $ t a b l e   =   $ ( ' # p r i c e l i s t , # V e r s i o n s T a b l e ' ) ;  
         / / $ ( $ t a b l e ) . a d d C l a s s ( ' t a b l e ' ) ;  
       / /   $ ( ' t h e a d   t r ' ,   $ t a b l e ) . a d d C l a s s ( ' h e a d ' ) ;  
       / /   $ ( ' t b o d y   t r : o d d ' ,   $ t a b l e ) . a d d C l a s s ( ' t d ' ) ;  
         $ ( ' t b o d y   t r : e v e n   t d ' ,   $ t a b l e ) . r e m o v e C l a s s ( ) . a d d C l a s s ( ' t d a l t ' ) ;  
         / / $ ( ' c a p t i o n ' ,   $ t a b l e ) . a d d C l a s s ( ' c a p t i o n ' ) ;  
  
 } ) ;  
  
 v a r   i n p u t s ;  
 v a r   i m g F a l s e   =   " / c m s f i l e s / p r i c e / f a l s e . g i f " ;  
 v a r   i m g T r u e   =   " / c m s f i l e s / p r i c e / t r u e . g i f " ;  
 f u n c t i o n   r e p l a c e C h e c k s ( )   {  
         i n p u t s   =   $ ( ' i n p u t ' ,   ' # p r i c e b o x ' ) ;  
         f o r   ( v a r   i   =   0 ;   i   <   i n p u t s . l e n g t h ;   i + + )   {  
                 i f   ( i n p u t s [ i ] . g e t A t t r i b u t e ( ' t y p e ' )   = =   ' c h e c k b o x ' )   {  
                         v a r   i m g   =   d o c u m e n t . c r e a t e E l e m e n t ( ' i m g ' ) ;  
                         i f   ( i n p u t s [ i ] . c h e c k e d )   {  
                                 i m g . s r c   =   i m g T r u e ;  
                         }   e l s e   {  
                                 i m g . s r c   =   i m g F a l s e ;  
                         }  
                         i m g . i d   =   ' c h e c k I m a g e '   +   i ;  
                         i m g . o n c l i c k   =   n e w   F u n c t i o n ( ' c h e c k C h a n g e ( '   +   i   +   ' ) ' ) ;  
                         i m g . s t y l e . c u r s o r   =   ' p o i n t e r ' ;  
                         v a r   b   =   e v a l ( " ( "   +   i n p u t s [ i ] . v a l u e   +   " ) " ) ;  
                         i m g . a l t   =   b . p r i c e   +   '     *HE'F    ' ;  
                         i m g . t i t l e   =   b . p r i c e   +   '     *HE'F    ' ;  
                         i n p u t s [ i ] . p a r e n t N o d e . i n s e r t B e f o r e ( i m g ,   i n p u t s [ i ] ) ;  
                         i n p u t s [ i ] . s t y l e . d i s p l a y   =   ' n o n e ' ;  
                 }  
         }  
 }  
 f u n c t i o n   c h e c k C h a n g e ( i )   {  
         v a r   b   =   e v a l ( " ( "   +   i n p u t s [ i ] . v a l u e   +   " ) " ) ;  
         i f   ( i n p u t s [ i ] . c h e c k e d )   {  
                 i n p u t s [ i ] . 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 ( ' c h e c k I m a g e '   +   i ) . s r c   =   i m g F a l s e ;  
                 u p d a t e p r i c e ( - 1   *   p a r s e I n t ( b . p r i c e ) ,   b . t y p e ) ;  
  
         }   e l s e   {  
                 i n p u t s [ i ] . c h e c k e 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 ( ' c h e c k I m a g e '   +   i ) . s r c   =   i m g T r u e ;  
                 u p d a t e p r i c e ( p a r s e I n t ( b . p r i c e ) ,   b . t y p e ) ;  
         }  
 }  
 f u n c t i o n   u p d a t e p r i c e ( p r i c e ,   t y p e )   {  
         i f   ( t y p e   = =   1 )   {  
                 $ ( ' # p _ p e r s o n a l ' ) . v a l ( p a r s e I n t ( $ ( ' # p _ p e r s o n a l ' ) . v a l ( ) )   +   p r i c e ) ;  
                 $ ( ' # p _ p e r s o n a l 1 ' ) . v a l ( p a r s e I n t ( $ ( ' # p _ p e r s o n a l 1 ' ) . v a l ( ) )   +   p r i c e ) ;  
         }  
         i f   ( t y p e   = =   2 )   {  
                 $ ( ' # p _ c o r p ' ) . v a l ( p a r s e I n t ( $ ( ' # p _ c o r p ' ) . v a l ( ) )   +   p r i c e ) ;  
                 $ ( ' # p _ c o r p 1 ' ) . v a l ( p a r s e I n t ( $ ( ' # p _ c o r p 1 ' ) . v a l ( ) )   +   p r i c e ) ;  
         }  
         i f   ( t y p e   = =   3 )   {  
                 $ ( ' # p _ o r g ' ) . v a l ( p a r s e I n t ( $ ( ' # p _ o r g ' ) . v a l ( ) )   +   p r i c e ) ;  
                 $ ( ' # p _ o r g 1 ' ) . v a l ( p a r s e I n t ( $ ( ' # p _ o r g 1 ' ) . v a l ( ) )   +   p r i c e ) ;  
         }  
         i f   ( t y p e   = =   4 )   {  
                 $ ( ' # p _ p l a t i n u m ' ) . v a l ( p a r s e I n t ( $ ( ' # p _ p l a t i n u m ' ) . v a l ( ) )   +   p r i c e ) ;  
                 $ ( ' # p _ p l a t i n u m 1 ' ) . v a l ( p a r s e I n t ( $ ( ' # p _ p l a t i n u m 1 ' ) . v a l ( ) )   +   p r i c e ) ;  
         }  
 }  
 
