ÿþf u n c t i o n   r e c o u n t ( )    
 	 {    
 	 p r i c e = 0 ;    
 	 v a r   c p r i c e   =   o r d e r . p r i c e . v a l u e  
 	 v a r   t p r i c e = 0 ;  
 	 i f   ( o r d e r . d u r a t i o n . v a l u e = = 1 )   t p r i c e = c p r i c e   ;    
 	 e l s e   i f   ( o r d e r . d u r a t i o n . v a l u e = = 5 )   t p r i c e = c p r i c e   *   2 . 8 ;    
 	 t p r i c e = o r d e r . q u a n t i t y . v a l u e   *   t p r i c e ;  
 	 t p r i c e =   M a t h . r o u n d ( t p r i c e ) ;  
 	 t o t a l p r i c e . i n n e r H T M L = t p r i c e ;  
 	 }    
 f u n c t i o n   v a l i d a t i o n ( )  
 	 {  
 	 w i t h   ( o r d e r )  
 	 	 {  
 	 	 i f   ( c u s t o m e r [ ' 0 ' ] . c h e c k e d )  
 	 	 	 {  
 	 	 	 i f   ( l e g a l _ b i t [ ' 0 ' ] . c h e c k e d )  
 	 	 	 	 {  
 	 	 	 	 i f   ( ! f i r s t n a m e . v a l u e )  
 	 	 	 	 r e t u r n   s h o w m s g ( ' f i r s t n a m e ' )  
 	 	 	 	 e l s e   i f   ( ! l a s t n a m e . v a l u e )  
 	 	 	 	 r e t u r n   s h o w m s g ( ' l a s t n a m e ' )  
 	 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 i f   ( ! l e g a l _ n a m e . v a l u e )  
 	 	 	 	 r e t u r n   s h o w m s g ( ' l e g a l _ n a m e ' ) 	  
 	 	 	 	 }  
 	 	 	 i f   ( ! e m a i l . v a l u e )  
 	 	 	 s h o w m s g ( ' e m a i l ' ) 	 	 	 	 	 	  
 	 	 	 e l s e   i f   ( ! p a s s w o r d 1 . v a l u e )  
 	 	 	 s h o w m s g ( ' p a s s w o r d 1 ' )  
 	 	 	 e l s e   i f   ( ! p a s s w o r d 2 . v a l u e )  
 	 	 	 s h o w m s g ( ' p a s s w o r d 2 ' )  
 	 	 	 e l s e   i f   ( ! c i t y . v a l u e )  
 	 	 	 s h o w m s g ( ' c i t y ' )  
 	 	 	 e l s e   i f   ( ! p h o n e . v a l u e )  
 	 	 	 s h o w m s g ( ' p h o n e ' ) 	  
 	 	 	 e l s e   i f   ( ! s t a t e . v a l u e )  
 	 	 	 s h o w m s g ( ' s t a t e ' )  
 	 	 	 e l s e   i f   ( ! p o s t c o d e . v a l u e )  
 	 	 	 s h o w m s g ( ' p o s t c o d e ' )  
 	 	 	 e l s e   i f   ( ! a d d r e s s . v a l u e )  
 	 	 	 s h o w m s g ( ' a d d r e s s ' ) 	 	  
 	 	 	 e l s e   i f   ( ! s e c r e t _ q u e s t i o n . v a l u e )  
 	 	 	 s h o w m s g ( ' s e c r e t _ q u e s t i o n ' ) 	 	  
 	 	 	 e l s e   i f   ( ! s e c r e t _ a n s w e r . v a l u e )  
 	 	 	 s h o w m s g ( ' s e c r e t _ a n s w e r ' ) 	  
 	 	 	 e l s e   i f   ( ! c a p t c h a . v a l u e )  
 	 	 	 s h o w m s g ( ' c a p t c h a ' ) 	  
 	 	 	 e l s e   i f   ( p a s s w o r d 2 . v a l u e   ! =   p a s s w o r d 1 . v a l u e )  
 	 	 	 	 {  
 	 	 	 	 a l e r t ( " P a s s w o r d s   d o   n o t   m a t c h " ) ;  
 	 	 	 	 o r d e r [ p a s s w o r d 1 ] . f o c u s ( ) ;  
 	 	 	 	 / / r e t u r n   f a l s e ;  
 	 	 	 	 }  
 	 	 	 e l s e   i f   ( p a s s w o r d 2 . v a l u e . l e n g t h   <   8   )  
 	 	 	 	 {  
 	 	 	 	 a l e r t ( " P a s s w o r d ' s   l e n g t h   i s   l e s s   t h a n   8   c h a r a c t e r s ! " ) ;  
 	 	 	 	 o r d e r [ p a s s w o r d 1 ] . f o c u s ( ) ;  
 	 	 	 	 / / r e t u r n   f a l s e ;  
 	 	 	 	 } 	 	 	 	 	 	 	 	  
 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 c n f O r d e r . h r e f = " # " ;  
 	 	 	 	 s u b m i t ( ) ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 e l s e  
 	 	 	 {  
 	 	 	 i f   ( ! l o g i n h a n d l e . v a l u e )  
 	 	 	 s h o w m s g ( ' l o g i n h a n d l e ' ) 	  
 	 	 	 e l s e   i f   ( ! l o g i n p a s s . v a l u e )  
 	 	 	 s h o w m s g ( ' l o g i n p a s s ' )  
 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 c n f O r d e r . h r e f = " # " ;  
 	 	 	 	 s u b m i t ( ) ;  
 	 	 	 	 } 	 	  
 	 	 	 }  
 	 	 } 	  
 	 	 	 	 	 	 	 	 	  
 	 }  
  
 f u n c t i o n   s h o w m s g ( f i e l d )  
 	 { 	  
 	 a l e r t ( " P l e a s e   f i l l   o u t   f o r m   c o m p l e t e l y ! " ) ;  
 	 o r d e r [ f i e l d ] . f o c u s ( ) ;  
 	 / / r e t u r n   f a l s e ;  
 	 }  
 f u n c t i o n   c h e c k _ o r d e r _ f o r m ( )  
 	 {  
 	 i f   ( o r d e r . c u s t o m e r [ ' 1 ' ] . c h e c k e d )  
 	 s h o w f o r m ( ' o l d ' )  
 	 i f   ( o r d e r . l e g a l _ b i t [ ' 1 ' ] . c h e c k e d )  
 	 s h o w f o r m ( ' l e g a l ' ) 	  
 	 }  
 f u n c t i o n   s h o w f o r m ( t y p e )  
 	 { 	  
 	 i f   ( t y p e = = ' o l d ' )  
 	 	 {  
 	 	 t b l r e g i s t e r . s t y l e . d i s p l a y = ' n o n e ' ;  
 	 	 t b l l o g i n . s t y l e . d i s p l a y = ' ' ;  
 	 	 }  
 	 e l s e   i f   ( t y p e = = ' n e w ' )  
 	 	 {  
 	 	 t b l l o g i n . s t y l e . d i s p l a y = ' n o n e ' ;  
 	 	 t b l r e g i s t e r . s t y l e . d i s p l a y = ' ' ;  
 	 	 }  
 	 e l s e   i f   ( t y p e = = ' p e r s o n ' )  
 	 	 {  
 	 	 t b l _ l e g a l . s t y l e . d i s p l a y = ' n o n e ' ;  
 	 	 t b l _ p e r s o n . s t y l e . d i s p l a y = ' ' ;  
 	 	 }  
 	 e l s e   i f   ( t y p e = = ' l e g a l ' )  
 	 	 {  
 	 	 t b l _ p e r s o n . s t y l e . d i s p l a y = ' n o n e ' ;  
 	 	 t b l _ l e g a l . s t y l e . d i s p l a y = ' ' ;  
 	 	 }  
 	 e l s e   i f   ( t y p e = = ' c c ' )  
 	 	 {  
 	 	 t b l c c . s t y l e . d i s p l a y = ' ' ;  
 	 	 t b l b a n k . s t y l e . d i s p l a y = ' n o n e ' ;  
 	 	 } 	  
 	 e l s e   i f   ( t y p e = = ' b a n k ' )  
 	 	 {  
 	 	 t b l c c . s t y l e . d i s p l a y = ' n o n e ' ;  
 	 	 t b l b a n k . s t y l e . d i s p l a y = ' ' ;  
 	 	 } 	 	 	 	 	 	 	  
 	 }  
 f u n c t i o n   f o r m a t C u r r e n c y ( n u m )    
 	 {  
 	 n u m   =   n u m . t o S t r i n g ( ) . r e p l a c e ( / \ $ | \ , / g , ' ' ) ;  
 	 i f ( i s N a N ( n u m ) )  
 	 n u m   =   " 0 " ;  
 	 s i g n   =   ( n u m   = =   ( n u m   =   M a t h . a b s ( n u m ) ) ) ;  
 	 n u m   =   M a t h . f l o o r ( n u m * 1 0 0 + 0 . 5 0 0 0 0 0 0 0 0 0 1 ) ;  
 	 c e n t s   =   n u m % 1 0 0 ;  
 	 n u m   =   M a t h . f l o o r ( n u m / 1 0 0 ) . t o S t r i n g ( ) ;  
 	 i f ( c e n t s < 1 0 )  
 	 c e n t s   =   " 0 "   +   c e n t s ;  
 	 f o r   ( v a r   i   =   0 ;   i   <   M a t h . f l o o r ( ( n u m . l e n g t h - ( 1 + i ) ) / 3 ) ;   i + + )  
 	 n u m   =   n u m . s u b s t r i n g ( 0 , n u m . l e n g t h - ( 4 * i + 3 ) ) + ' . ' +  
 	 n u m . s u b s t r i n g ( n u m . l e n g t h - ( 4 * i + 3 ) ) ;  
 	 r e t u r n   ( ( ( s i g n ) ? ' ' : ' - ' )   +   n u m ) ;  
 }  
 
