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