ÿþ/ /   a l e r t ( ' d e f a u l t 1 ' ) ;  
  
 S e t A u t o F o c 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 ( ' m y B o o k i n g ' )   ! =   n u l l ) {  
 	 H i d e G r o u p ( ' m y B o o k i n g ' , ' n o n 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 ( ' w e b C h e c k I n ' )   ! =   n u l l ) {  
 	 H i d e G r o u p ( ' w e b C h e c k I n ' , ' n o n 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 ( ' A d d i t i o n a l C o s t ' )   ! =   n u l l ) {  
 	 H i d e G r o u p ( ' A d d i t i o n a l C o s t ' , ' n o n 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 ( g o T o R o w )   ! =   n u l l ) {  
 	 d o c u m e n t . g e t E l e m e n t B y I d ( g o T o R o w ) . s c r o l l I n t o V i e w ( t r u 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 ( ' t r I n s u r a n c e ' )   ! =   n u l l ) {  
 	 H i d e G r o u p ( ' t r T o t a l I n s u r a n c e ' , ' n o n e ' ) ;  
 	 H i d e G r o u p ( ' t r I n s u r a n c e ' , ' n o n 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 v v F o r m ' )   = =   ' [ o b j e c t ] ' ) {  
 	 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 t r B o o k i n g _ c t r P a s s e n g e r I n f o s B a s e _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d ' )   ! =   n u l l ) {  
 	 	 S h o w C v v C o d e ( ' c t r B o o k i n g _ c t r P a s s e n g e r I n f o s B a s e _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d ' )  
 	 }  
 	 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 t r B o o k i n g _ c t r B o o k i n g S u m m e r y _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d ' )   ! =   n u l l ) {  
 	 	 S h o w C v v C o d e ( ' c t r B o o k i n g _ c t r B o o k i n g S u m m e r y _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d ' )  
 	 }  
 }  
  
  
 / / 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 t r H o m e _ c t r F l i g h t S e a r c h B a s e _ c m b O r i g i n ' )     ! =   n u l l   ) {  
 / / 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' c t r H o m e _ c t r F l i g h t S e a r c h B a s e _ c m b O r i g i n ' ) . s e l e c t e d I n d e x   =   g e t S u b C o o k i e ( ' O r i g i n C o o k i e ' , g e t C o o k i e ( ' t i k A e r o ' )   +   ' & ' ) ;  
 / / 	 A n t h e m _ F i r e E v e n t ( ' c t r H o m e _ c t r F l i g h t S e a r c h B a s e _ c m b O r i g i n ' , ' ' , f u n c t i o n ( ) { } , n u l l , t r u e , t r u 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 t r H o m e _ c t r F l i g h t A v a i l a b i l i t y B a s e _ c t r F l i g h t S e a r c h B a s e _ t b o P r o m o t i o n C o d e ' )   ! =   n u l l   ) {  
 	 S h o w H i d e B u t t o n ( ' c t r H o m e _ c t r F l i g h t A v a i l a b i l i t y B a s e _ c t r F l i g h t S e a r c h B a 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 t r H o m e _ c t r F l i g h t S e a r c h B a s e _ r d o O n e w a y ' )   ! =   n u l l   )   {  
 	 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 t r H o m e _ c t r F l i g h t S e a r c h B a s e _ r d o O n e w a y ' ) . c h e c k e d   = =   t r u e )   {  
 	 	 H i d e G r o u p ( ' F l i g h t S e a r c h ' , ' n o n 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 t r H o m e _ c t r F l i g h t S e a r c h L e f t _ r d o O n e w a y ' )   ! =   n u l l   )   {  
 	 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 t r H o m e _ c t r F l i g h t S e a r c h L e f t _ r d o O n e w a y ' ) . c h e c k e d   = =   t r u e )   {  
 	 	 H i d e G r o u p ( ' F l i g h t S e a r c h H o m e ' , ' n o n 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 t r H o m e _ c t r F l i g h t A v a i l a b i l i t y B a s e _ c t r F l i g h t S e a r c h B a s e _ r d o O n e w a y ' )   ! =   n u l l   )   {  
 	 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 t r H o m e _ c t r F l i g h t A v a i l a b i l i t y B a s e _ c t r F l i g h t S e a r c h B a s e _ r d o O n e w a y ' ) . c h e c k e d   = =   t r u e )   {  
 	 	 H i d e G r o u p ( ' F l i g h t S e a r c h ' , ' n o n e ' )  
 	 }  
 }  
  
 i f   ( C c P r e s e l e c t . l e n g t h   >   0 ) {  
 	 S h o w C v v C o d e ( C c P r e s e l e c t )  
 }  
  
 f u n c t i o n   H i d e G r o u p ( N a m e , A c t i o n ) {  
 	 v a r   N N 4   =   d o c u m e n t . l a y e r s ?   t r u e   :   f a l s e ;  
 	 v a r   I E 4   =   d o c u m e n t . a l l ?   t r u e   :   f a l s e ;  
 	 v a r   F F   	 =   d o c u m e n t . g e t E l e m e n t B y I d ?   t r u e   :   f a l s e ;  
 	 i f   ( I E 4 ) {  
 	 	 i f ( n a v i g a t o r . a p p N a m e   = =   ' O p e r a ' )   I E 4   =   f a l s e ;  
 	 }  
 	 i f ( A c t i o n   = =   ' n o n e ' )   {  
 	 	 i f   ( N a m e   = =   ' F l i g h t S e a r c h ' )   S i n g l e F l i g h t   =   t r u e ;  
 	 	 i f   ( I E 4 )   {  
 	 	 	 d o c u m e n t . a l l [ N a m e ] . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 	 / /   s o m m   i f   ( N a m e   = =   ' F l i g h t S e a r c h ' )   d o c u m e n t . a l l [ ' L o w e s t O u t ' ] . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 }   e l s e   i f ( N N 4 )   {  
 	 	 	 d o c u m e n t . l a y e r s [ N a m e ] . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 	 / /   s o m m   i f   ( N a m e   = =   ' F l i g h t S e a r c h ' )   d o c u m e n t . l a y e r s [ ' L o w e s t O u t ' ] . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 }   e l s e   i f ( F 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 ) . 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 ( N a m e ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 	 / /   s o m m i f   ( N a m e   = =   ' F l i g h t S e a r c h ' )   d o c u m e n t . g e t E l e m e n t B y I d ( ' L o w e s t O u t ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 }   e l s e   {  
 	 	 	 a l e r t ( ' U n k n o w n   b r o w s e r   c a t e g o r y . ' ) ;  
 	 	 }  
 	 }   e l s e   {  
 	 	 i f   ( N a m e   = =   ' F l i g h t S e a r c h ' )   S i n g l e F l i g h t   =   f a l s e ;  
 	 	 i f   ( I E 4 )   {  
 	 	 	 d o c u m e n t . a l l [ N a m e ] . s t y l e . v i s i b i l i t y   =   " v i s i b l e " ;  
 	 	 	 / /   s o m m   i f   ( N a m e   = =   ' F l i g h t S e a r c h ' )   d o c u m e n t . a l l [ ' L o w e s t O u t ' ] . s t y l e . v i s i b i l i t y   =   " v i s i b l e " ;  
 	 	 }   e l s e   i f ( N N 4 )   {  
 	 	 	 d o c u m e n t . l a y e r s [ N a m e ] . v i s i b i l i t y   =   " s h o w " ;  
 	 	 	 / /   s o m m   i f   ( N a m e   = =   ' F l i g h t S e a r c h ' )   d o c u m e n t . l a y e r s [ ' L o w e s t O u t ' ] . v i s i b i l i t y   =   " s h o w " ;  
 	 	 }   e l s e   i f ( F 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 ) . s t y l e . d i s p l a y   =   " " ;  
 / / 	 	 	 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 ) . s t y l e . v i s i b i l i t y   =   " v i s i b l e " ;  
 	 	 	 / /   s o m m i f   ( N a m e   = =   ' F l i g h t S e a r c h ' )   d o c u m e n t . g e t E l e m e n t B y I d ( ' L o w e s t O u t ' ) . s t y l e . v i s i b i l i t y   =   " v i s i b l e " ;  
 	 	 }   e l s e   {  
 	 	 	 a l e r t ( ' U n k n o w n   b r o w s e r   c a t e g o r y . ' ) ;  
 	 	 }  
 	 }  
 / * 	  
 	 v a r   c o l   =   d o c u m e n t . g e t E l e m e n t s B y N a m e ( N a m e )  
 	 f o r   ( v a r   i = 0 ; i   < =   c o l . l e n g t h   -   1 ; i + + ) {  
 	 	 c o l [ i ] . s t y l e . v i s i b i l i t y   =   ( A c t i o n   = =   ' n o n e ' )   ?   ' h i d d e n '   :   ' v i s i b l e ' ;  
 	 	 S i n g l e F l i g h t   =   ( A c t i o n   = =   ' n o n e ' )   ?   t r u e   :   f a l s e ;  
 	 }  
 * /  
 }  
  
 f u n c t i o n   C h e c k A d u l t I n f a n t ( o ) {  
 	 v a r   i A   =   d o c u m e n t . g e t E l e m e n t B y I d ( o   +   ' _ c m b A d u l t ' ) . 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   +   ' _ c m b A d u l t ' ) . s e l e c t e d I n d e x ] . v a l u e  
 	 v a r   i I   =   d o c u m e n t . g e t E l e m e n t B y I d ( o   +   ' _ c m b I n f a n t ' ) . 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   +   ' _ c m b I n f a n t ' ) . s e l e c t e d I n d e x ] . v a l u e  
 	 i f   ( i A < i I ) {  
 	 	 a l e r t ( ' i l   n u m e r o   d e i   n e o n a t i   n o n   p u ?   e s s e r e   s u p e r i o r e   a l   n u m e r o   d e g l i   a d u l t i ! ' )  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o   +   ' _ c m b I n f a n t ' ) . s e l e c t e d I n d e x   =   0  
 	 }  
 }  
  
 f u n c t i o n   V a l i d S D a t e ( o ) {  
 	 S t a t u s   =     t r u 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 ( o   +   ' _ r d o O n e w a y ' ) . c h e c k e d   ! =   t r u e )   {  
 	 	 i f   ( L i b D a y s D i f f ( G e t C a l e n d e r D a t e ( o   +   ' _ c t l R e t u r n D a t e ' ) , G e t C a l e n d e r D a t e ( o   +   ' _ c t l D e p a t u r e D a t e ' ) )   <   0 ) {  
 	 	 	 a l e r t ( ' A t t e n z i o n e !   L a   d a t a   d i   r i e n t r o   n o n   p u ?   e s s e r e   a n t e c e d e n t e   a l l a   d a t a   d i   p a r t e n z a . ' )  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 }  
 	 }  
 }  
  
 f u n c t i o n   G e t C a l e n d e r D a t e ( o ) {  
 	 v a r   o d   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c m b D a y ' )  
 	 v a r   o t   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c m b M o n t h Y e a r ' )  
 	 v a r   y   =   o t . o p t i o n s [ o t . s e l e c t e d I n d e x ] . v a l u e . s l i c e ( 0 , 4 )  
 	 v a r   m   =   o t . o p t i o n s [ o t . s e l e c t e d I n d e x ] . v a l u e . s l i c e ( 4 , 6 )  
 	 v a r   d   =   o d . o p t i o n s [ o d . s e l e c t e d I n d e x ] . v a l u e    
 	 r e t u r n   n e w   D a t e ( y , m - 1 , d , 0 , 0 , 0 )  
 }  
  
 f u n c t i o n   D e f a u l t S e l e c t V a l u e ( o b j , v a l u e )   {  
 	 f o r ( v a r   i = 0 ; i < o b j . o p t i o n s . l e n g t h ; i + + ) {  
 	 	 i f ( v a l u e . t o S t r i n g ( ) . t o L o w e r C a s e ( ) = = o b j . o p t i o n s [ i ] . v a l u e . t o S t r i n g ( ) . t o L o w e r C a s e ( ) ) {  
 	 	 	 o b j . o p t i o n s [ i ] . s e l e c t e d = t r u e ;  
 	 	 	 b r e a k ;    
 	 	 }  
 	 }  
 }  
    
 f u n c t i o n   C o p y F i r s t P a s s e n g e r ( t , o , m ) {  
 	 v a r   p t   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l 1 _ P a s s e n g e r T i t e l ' ) ;    
 	 i f   ( t . c h e c k e d ) {  
 	 	 v a r   i   =   1  
 	 	 v a r   o s   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c m b T i t e l s R c d ' ) ; 	 	  
 	 	 v a r   f n   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ f i r s t n a m e ' ) . v a l u e  
 	 	 v a r   l n   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ l a s t n a m e ' ) . v a l u e  
 	 	 v a r   f   =   t r i m ( f n )  
 	 	 v a r   l   =   t r i m ( l n )  
 	 	 i f   ( l   >   2   | |   f   >   1 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l 1 _ L a s t n a m e ' ) . v a l u e   =   l n  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l 1 _ F i r s t n a m e ' ) . v a l u e   =   f n  
 	 	 	 p t . s e l e c t e d I n d e x   =   o s . s e l e c t e d I n d e x  
 	 	 }  
 	 	 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 ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l 1 _ L a s t n a m 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 ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l 1 _ F i r s t n a m 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 ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l 1 _ P a s s e n g e r T i t e l ' ) . s e l e c t e d I n d e x   =   7  
 	 	 	 D e f a u l t S e l e c t V a l u e ( p t , " M R | M " ) ;  
 	 	 	 t . c h e c k e d   =   f a l s 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 ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l 1 _ L a s t n a m 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 ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l 1 _ F i r s t n a m 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 ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l 1 _ P a s s e n g e r T i t e l ' ) . s e l e c t e d I n d e x   =   7 	 	 	  
 	 	 	 D e f a u l t S e l e c t V a l u e ( p t , " M R | M " ) ;  
 	 }  
 }  
 f u n c t i o n   I n s u r a n c e ( t , o ) {  
 	 i f   ( t . c h e c k e d ) {  
 	 	 	 H i d e G r o u p ( ' t r I n s u r a n c e ' , ' ' ) ;  
 	 	 	 H i d e G r o u p ( ' t r T o t a l I n s u r a n c e ' , ' ' ) ;  
 	 	         H i d e G r o u p ( ' t r T o t a l ' , ' n o n e ' ) ;  
 	 }  
 	 e l s e   {  
                 H i d e G r o u p ( ' t r I n s u r a n c e ' , ' n o n e ' ) ;  
                 H i d e G r o u p ( ' t r T o t a l I n s u r a n c e ' , ' n o n e ' ) ;  
                         H i d e G r o u p ( ' t r T o t a l ' , ' ' ) ;  
 	 }  
 }  
 f u n c t i o n   C o p y F i r s t P a s s e n g e r O l d ( o , m ) {  
 	 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   +   ' _ c b o F i r s t P a s s e n g e r ' ) . c h e c k e d ) {  
 	 	 v a r   i   =   1  
 	 	 v a r   l   =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ L a s t N a m e ' ) . v a l u e )  
 	 	 v a r   f   =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ F i r s t N a m e ' ) . v a l u e )  
 	 	 i f   ( l   >   2   | |   f   >   1 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( m   +   ' _ t b o N a m e O n C a r d ' ) . v a l u e   =   s t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ F i r s t N a m e ' ) . v a l u e )   +   '   '   +     s t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ L a s t N a m 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 ( m   +   ' _ c b o F i r s t P a s s e n g e r ' ) . c h e c k e d   =   f a l s 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 ( m   +   ' _ t b o N a m e O n C a r d ' ) . v a l u e   =   ' '  
 	 }  
 }  
  
 f u n c t i o n   S e t F i r s t P a s s e n g e r ( m , 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 ( m   +   ' _ c b o F i r s t P a s s e n g e r ' ) . c h e c k e d ) {  
 	 	 v a r   m s   =   s . s p l i t ( ' | ' )  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( m   +   ' _ t b o N a m e O n C a r d ' ) . v a l u e   =   m s [ 0 ]  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( m   +   ' _ t b o S t r e e t ' ) . v a l u e   =   m s [ 1 ]  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( m   +   ' _ t b o S t r e e t 2 ' ) . v a l u e =   m s [ 2 ]  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( m   +   ' _ t b o C i t y ' ) . v a l u e =   m s [ 3 ]  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( m   +   ' _ t b o S t a t e ' ) . v a l u e   =   m s [ 4 ]  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( m   +   ' _ t b o Z i p C o d e ' ) . v a l u e   =   m s [ 5 ]  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( m   +   ' _ c m b C o u n t r y R c d ' ) . s e l e c t e d I n d e x   =   m s [ 6 ]  
 	 }  
 	 e l s e {  
 	 	 v a r   m s   =   s . s p l i t ( ' | ' )  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( m   +   ' _ t b o N a m e O n C a r d ' ) . 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 ( m   +   ' _ t b o S t r e e t ' ) . 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 ( m   +   ' _ t b o S t r e e t 2 ' ) . 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 ( m   +   ' _ t b o C i t y ' ) . 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 ( m   +   ' _ t b o S t a t 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 ( m   +   ' _ t b o Z i p C o d 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 ( m   +   ' _ c m b C o u n t r y R c d ' ) . s e l e c t e d I n d e x   =   m s [ 6 ]  
 	 }  
 }  
  
 f u n c t i o n   V a l i d P a s s e n g e r G r i d ( o ) {  
 	 S t a t u s   =     t r u e  
 	 v a r   e   =   ' '  
 	 v a r   l   =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o   +   ' _ L a s t N a m e ' ) . v a l u e )  
 	 v a r   f   =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o   +   ' _ F i r s t N a m e ' ) . v a l u e )  
 	 v a r   d   =   d o c u m e n t . g e t E l e m e n t B y I d ( o   +   ' _ D a t e O f B i r t h ' ) . v a l u e  
 	 i f   ( l   <   2   | |   f   <   1 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   ' P l e a s e   s u p p l y   a   v a l i d   P a s s e n g e r   N a m e   ; \ r '  
 	 }  
 	 / /   i f   ( t r i m ( d )   >   0   & &   D a t e . i s V a l i d ( d , D a t e V a l i d )   = =   f a l s e ) {  
 	 i f   ( t r i m ( d )   >   0   & &   i s D a t e E x i s t ( d )   = =   f a l s e ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   ' P l e a s e   s u p p l y   a   v a l i d   d a t e   o f   b i r t h   '   +   D a t e V a l i d T e x t   +   '   \ r ' 	  
 	 }  
 	 i f   ( e . l e n g t h   >   0 )   {  
 	 	 a l e r t ( e )  
 	 }  
 }  
  
 f u n c t i o n   I f A l p h a O n l y ( s ) {  
 	 v a r   i  
 	 v a r   b   =   f a l s e    
 	 i f   ( s . l e n g t h   ! =   0 ) {  
 	 	 f o r   ( i = 0 ; i   <   s . l e n g t h ; i + + ) {  
 	 	 	 v a r   c   =   s . c h a r C o d e A t ( i ) ;  
 	 	 	 i f   ( c   = =   4 5 | |   c   = =   3 9   | |   c   = =   4 6   | |   c   = =   3 2 ) {  
 	 	 	 	 b   =   t r u e ;  
 	 	 	 }  
 	 	 	 e l s e   i f   ( ( c   >   4 7   & &   c   <   5 8 ) ) {  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 }  
 	 	 	 e l s e   i f   ( ( ( c   >   9 6   & &   c   <   1 2 3 )   | |   ( c   >   6 4   & &   c   <   9 1 ) )     = =   f a l s e ) {  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 }  
 	 	 }  
 	 	 b   =   t r u e  
 	 }  
 	 e l s e {  
 	 	 b   =   f a l s e ;  
 	 }  
 	 r e t u r n   b  
 }  
  
 f u n c t i o n   V a l i d a t e R e g i s t e r ( o ) {  
 	 S t a t u s   	 =   t r u e ;  
 	 v a r   e   	 =   ' '  
 	 v a r   t t   	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c m b T i t e l s R c d ' )  
 	 v a r   f n   	 =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ f i r s t n a m e ' ) . v a l u e )  
 	 v a r   l n   	 =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ l a s t n a m e ' ) . v a l u e )  
 	 v a r   p m   	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p h o n e _ m o b i l e ' )  
 	 v a r   p h   	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p h o n e _ h o m e ' )  
 	 v a r   p b   	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p h o n e _ b u s i n e s s ' )  
 	 / /   v a r   p   =   t r i m ( p m . v a l u e )   +   t r i m ( p h . v a l u e )   +   t r i m ( p b . v a l u e )  
 	 v a r   p m o b i l e   =   t r i m ( p m . v a l u e ) ;  
 	 v a r   p b u s i n e s s   =     t r i m ( p b . v a l u e ) ;  
 	 v a r   e m   	 =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c o n t a c t _ e m a i l ' ) . v a l u e )  
 	 v a r   a d 1   =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ a d d r e s s _ l i n e 1 ' ) . v a l u e )  
 	 v a r   c t y   =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c i t y ' ) . v a l u e )  
 	 v a r   d t   	 =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p r o v i n c e ' ) . v a l u e )  
 	 v a r   p c   	 =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ z i p _ c o d e ' ) . v a l u e )  
 	 v a r   c t r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c m b C o u n t r y R c d ' )  
 	 / / - - - >     T i t l e  
 	 i f   ( t r i m ( t t . o p t i o n s [ t t . s e l e c t e d I n d e x ] . v a l u e ) = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   i n s e r i r e   u n   t i t o l o   v a l i d o < / l i > "  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c m b T i t e l s R c d ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 } 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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c m b T i t e l s R c d ' ) . c l a s s N a m e   =   ' ' ;  
 	 }  
 	 / / - - - >     H o m e   N o .   ( n e w )  
 	 / * i f   ( p h . v a l u e = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   n u m e r o   d i   t e l e f o n o < / l i > "  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p h o n e _ h o m e ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 } 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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p h o n e _ h o m e ' ) . c l a s s N a m e   =   ' ' ;  
 	 } * /  
 	 / / - - - >     F i r s t   N a m e  
 	 i f   ( f n = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   n o m e   d i   b a t t e s i m o < / l i > "  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ f i r s t n a m e ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 } 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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ f i r s t n a m e ' ) . c l a s s N a m e   =   ' ' ;  
 	 }  
 	 / / - - - >     S u r n a m e  
 	 i f   ( l n = = 0 ) {    
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i     c o n t r o l l a r e   i l   c o g n o m e < / l i > "  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ l a s t n a m e ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 } 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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ l a s t n a m e ' ) . c l a s s N a m e   =   ' ' ;  
 	 }  
 	 / / - - - >     M o b i l e   T e l e p h o n e   N u m b e r  
 	 i f   ( p m o b i l e = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   n u m e r o   d i   t e l e f o n o   c e l l u l a r e < / l i > "  
 	 	 p m . c l a s s N a m e   =   ' e r r o r ' ;  
 	 }  
 	 e l s e {  
 	 	 p m . c l a s s N a m e   =   ' ' ;  
 	 }  
 	 / / - - - >     B u s i n e s s   T e l e p h o n e   N u m b e r  
 	 i f   ( p b u s i n e s s = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   n u m e r o   d i   t e l e f o n o   U f f i c i o < / l i > " ;  
 	 	 p b . c l a s s N a m e   =   ' e r r o r ' ;  
 	 }  
 	 e l s e {  
 	 	 p b . c l a s s N a m e   =   ' ' ;  
 	 }  
 	 / / - - - >     E m a i l  
 	 i f   ( e m = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   l ' i n d i r i z z o   e - m a i l < / l i > "  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c o n t a c t _ e m a i l ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 }  
 	 e l s e {  
 	 	 v a r   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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c o n t a c t _ e m a i l ' ) . v a l u e ;  
 	 	 i f   ( V a l i d E m a i l ( 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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c o n t a c t _ e m a i l ' ) . c l a s s N a m e   =   ' ' ;  
 	 	 }   e l s e   {  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   l ' i n d i r i z z o   e - m a i l < / l i > " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c o n t a c t _ e m a i l ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 	 }  
 	 } 	  
 	  
 	 / / - - - >     A d d r e s s   1  
 	 i f   ( a d 1 = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   l  I n d i r i z z o   P r i n c i p a l e < / l i > "  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ a d d r e s s _ l i n e 1 ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 } 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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ a d d r e s s _ l i n e 1 ' ) . c l a s s N a m e   =   ' ' ;  
 	 }  
 	 / / - - - >     T o w n / C i t y  
 	 i f   ( c t y = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   C o m u n e / C i t t à < / l i > "  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c i t y ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 } 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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c i t y ' ) . c l a s s N a m e   =   ' ' ;  
 	 }  
 	 / / - - - >     C o u n t y  
 	 i f   ( d t = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   l a   P r o v i n c i a < / l i > "  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p r o v i n c e ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 } 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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p r o v i n c e ' ) . c l a s s N a m e   =   ' ' ;  
 	 }  
 	 / / - - - >     P o s t a l   C o d e  
 	 i f   ( p c = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   C o d i c e   d i   a v v i a m e n t o   p o s t a l e < / l i > "  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ z i p _ c o d e ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 } 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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ z i p _ c o d e ' ) . c l a s s N a m e   =   ' ' ;  
 	 }  
 	 / / - - - >     C o u n t r y  
 	 i f   ( t r i m ( c t r . o p t i o n s [ c t r . s e l e c t e d I n d e x ] . v a l u e ) = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   P a e s e < / l i > "  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c m b C o u n t r y R c d ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 } 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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c m b C o u n t r y R c d ' ) . c l a s s N a m e   =   ' ' ;  
 	 }  
  
 	 v a r   i l   =   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' P a s s e n g e r L i s t ' ) . r o w s . l e n g t h   -   2 ) ;  
 	 f o r   ( i = 1 ; i < = i l   ; i + + ) {  
 	 	 v a r   l n   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ L a s t n a m e ' ) ; 	 	  
 	 	 v a r   f n   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ F i r s t n a m e ' ) ;  
 	 	 v a r   d n   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ D a t e O f B i r t h ' ) ;  
                 v a r   d n _ t y p e   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ L a b e l 2 ' ) ;  
  
 	 	 i f   ( ( l n   ! =   n u l l )   & &   ( f n   ! =   n u l l ) )   {  
 	 	 	 v a r   l   =   t r i m ( l n . v a l u e ) ;  
 	 	 	 v a r   f   =   t r i m ( f n . v a l u e ) ;  
 	 	 	 i f   ( l   <   2   | |   f   <   1 ) {  
 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 e   + =   ' < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   n o m e   d e l   p a s s e g g e r o   n r .   '   +   i   +   ' < / l i > ' ;  
 	 	 	 	 l n . c l a s s N a m e   =   ( l   <   2 )   ?   ' e r r o r '   :   ' ' ;  
 	 	 	 	 f n . c l a s s N a m e   =   ( f   <   2 )   ?   ' e r r o r '   :   ' ' ;  
 	 	 	 }  
 	 	 	 e l s e   i f ( I f A l p h a O n l y ( l n . v a l u e )   = =   f a l s e   | |   I f A l p h a O n l y ( f n . v a l u e )   = =   f a l s e ) {  
 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 e   + =   ' < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   n o m e   d e l   p a s s e g g e r o   n r .   '   +   i   +   ' < / l i > ' ;  
 	 	 	 	 l n . c l a s s N a m e   =   ( I f A l p h a O n l y ( l n . v a l u e ) )   ?   ' '   :   ' e r r o r ' ;  
 	 	 	 	 f n . c l a s s N a m e   =   ( I f A l p h a O n l y ( f n . v a l u e ) )   ?   ' '   :   ' e r r o r ' ;  
 	 	 	 }  
 	 	 	 e l s e {  
 	 	 	 	 l n . c l a s s N a m e   =   ' ' ;  
 	 	 	 	 f n . c l a s s N a m e   =   ' ' ;  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 i f   ( d n   ! =   n u l l )   { 	 / /   D a t e   o f   B i r t h  
                         v a r   d   =   d n . v a l u e ;  
                         v a r   d t   =   d n _ t y p e . i n n e r H T M L ;  
                         / /   i f   ( t r i m ( d )   >   0   & &   D a t e . i s V a l i d ( d , D a t e V a l i d )   = =   f a l s e ) {  
                         i f   ( t r i m ( d )   >   0   & &   i s D a t e E x i s t ( d )   = =   f a l s e ) {  
                                 S t a t u s   =     f a l s e ;  
                                 e   + =   ' < l i > '   +   e M s g [ 5 ]   +   i   +   '   '   +   D a t e V a l i d T e x t   +   ' < / l i > ' ;  
                                 d n . c l a s s N a m e   =   ' e r r o r ' ;  
                         }  
                         e l s e {  
                                 i f   ( L i b D a y s D i f f ( c h a n g e T o D a t e ( d ) , n e w   D a t e ( ) )   >   0 ) {  
                                         S t a t u s   =     f a l s e ;  
                                         e   + =   ' < l i > '   +   e M s g [ 1 7 ]   +   i   +   ' < / l i > ' ;  
                                         d n . c l a s s N a m e   =   ' e r r o r ' ;  
                                 }  
                                 e l s e {  
                                         i f   ( d t   = =   " C H D "   | |   d t   = =   " I N F " ) {  
                                                 d o c u m e n t . g e t E l e m e n t B y I d ( ' s t a r '   +   i ) . s t y l e . v i s i b i l i t y   =   " v i s i b l e " ;  
                                                 / /   i f ( D a t e . i s V a l i d ( d , D a t e V a l i d )   = =   f a l s e ) {  
                                                 i f ( i s D a t e E x i s t ( d )   = =   f a l s e ) {  
                                                         S t a t u s   =     f a l s e ;  
                                                         e   + =   ' < l i > '   +   e M s g [ 5 ]   +   i   +   '   '   +   D a t e V a l i d T e x t   +   ' < / l i > '  
                                                         d n . c l a s s N a m e   =   ' e r r o r '  
                                                 } e l s e {  
                                                         / / C h i l d     2 - 1 1   y e a r  
                                                         / / I n f a n t   1 - 2 3   m o n t h  
                                                         v a r   M I N _ C H D _ A G E   =   ( 2 * 1 2 ) ;  
                                                         v a r   M A X _ C H D _ A G E   =   ( 1 1 * 1 2 ) ;  
  
                                                         v a r   M I N _ I N F _ A G E   =   ( 1 ) ;  
                                                         v a r   M A X _ I N F _ A G E   =   ( 2 3 ) ;  
                                                                  
                                                         v a r   d d   =   N u m b e r ( d . s u b s t r i n g ( 0 , 2 ) ) ;  
                                                         v a r   m m   =   N u m b e r ( d . s u b s t r i n g ( 3 , 5 ) ) ;  
                                                         v a r   y y   =   N u m b e r ( d . s u b s t r i n g ( 6 , 1 0 ) ) ;  
                                                         m m   =   m m   -   1 ;  
                                                         v a r   i D a t e   =   n e w   D a t e ( y y , m m , d d ) ;  
                                                         v a r   c D a t e   =   n e w   D a t e ( ) ;  
                                                         v a r   m m A g e   =   d a t e D i f f ( " m " , i D a t e , c D a t e , 1 , 1 ) ;   	 	 	 	                  
         	 	 	 	                          
                                                         / / v a r   f D a t e   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' c t r B o o k i n g _ c t r I t i n e r a r y B a s e _ c t r I t i n e r a r y G r i d _ g r d I t i n e r a r y G r i d _ _ c t l 0 _ T d 4 6 ' ) ;  
                                                         v a r   f D a t e   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' c t r B o o k i n g _ c t r P a s s e n g e r I n f o s B a s e _ c t l B o o k i n g I n f o _ L a b D e p a r t u r e D a t e ' ) ;  
                                                         i f ( d t   = =   " C H D " ) {  
                                                                 i f ( ! ( ( M I N _ C H D _ A G E < = m m A g e ) & & ( m m A g e < = M A X _ C H D _ A G E ) ) ) {  
                                                                         e   + =   ' < l i > '   +   ' L \ ' e t ?   d e i   b a m b i n i   ?   c o m p r e s a   t r a   i   0 2   a n n i   c o m p i u t i   e   i   1 2   n o n   c o m p i u t i   d e l   p a s s e g g e r o   n r .   '   +   i   +   ' < / l i > ' ;  
                                                                         S t a t u s   =     f a l s e ;  
                                                                         d n . c l a s s N a m e   =   ' e r r o r ' ;                                                          
                                                                 } e l s e {  
                                                                         d n . c l a s s N a m e   =   ' ' ;  
                                                                 }  
                                                         } e l s e   i f ( d t   = =   " I N F " ) {  
                                                                 i f ( ! ( ( M I N _ I N F _ A G E < = m m A g e ) & & ( m m A g e < = M A X _ I N F _ A G E ) ) ) {  
                                                                         e   + =   ' < l i > '   +   ' L \ ' e t ?   d e i   n e o n a t i   ?   c o m p r e s a   d a   0 0   m e s i   a   2 3   m e s i   d e l   p a s s e g g e r o   n r .   '   +   i   +   ' < / l i > ' ;  
                                                                         S t a t u s   =     f a l s e ;  
                                                                         d n . c l a s s N a m e   =   ' e r r o r ' ;  
                                                                 } e l s e {  
                                                                         d n . c l a s s N a m e   =   ' ' ;  
                                                                 }  
                                                         }  
                                                 }  
                                         } e l s e {  
                                                 d n . c l a s s N a m e   =   ' ' ;  
                                         }  
                                 }  
                         }  
                 }  
 	 }  
  
 	 i f   ( e . l e n g t h   >   0 )   {  
 	 	 C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   ( i l + 1 )   +   ' _ L a b E r r o r ' )  
 	 	 C o n t a i n e r . i n n e r H T M L   =   	 ' < u l > '   +   e   +   ' < / u l > '  
 	 }  
 	 e l s e {  
 	 	 / / C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l 2 _ L a b E r r o r ' )  
 	 	 / / C o n t a i n e r . i n n e r H T M L   =   	 ' '  
 	 	 / / C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' P a y m e n t C o m m e n t C o n t a i n e r ' )  
 	 	 / / v a r   b   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ b t m S u b m i t B o o k i n g ' )  
 	 	 / / b . s t y l e . v i s i b i l i t y   =   ' h i d d e n '  
 	 	 / / C o n t a i n e r . 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   V a l i d U p d a t e P a y m e n t ( o ) { 	  
 	 S t a t u s   	 =   t r u e  
 	 v a r   e   	 =   ' ' 	  
 	 v a r   n o c   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o N a m e O n C a r d ' ) ;  
 	 v a r   c d n 	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o D o c u m e n t N u m b e r ' ) ;  
 	 v a r   c v v 	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o C v v C o d e ' ) ;  
 	 v a r   a d 1 	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o S t r e e t ' ) ;  
 	 v a r   c t y 	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o C i t y ' ) ;  
 	 v a r   p c   	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o Z i p C o d e ' ) ;  
 	 v a r   s t   	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o S t a t e ' ) ;  
 	 v a r   c t r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c m b C o u n t r y R c d ' ) ;  
 	 v a r   r c v v   =   d o c u m e n t . g e t E l e m e n t B y I d ( C c P r e s e l e c t   +   ' _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . 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 ( C c P r e s e l e c t   +   ' _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . s e l e c t e d I n d e x ] . v a l u e . s p l i t ( ' | ' )  
  
 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m C C ' ) . s t y l e . d i s p l a y   ! =   ' n o n e ' ) { 	  
 	 	 / / - - - >     N a m e   O n   C a r d  
 	 	 i f   ( t r i m ( n o c . v a l u e )   = =   0 ) {  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   l ' i n t e s t a t a r i o   d e l l a   C a r t a < / l i > "  
 	 	 	 n o c . c l a s s N a m e   =   ' e r r o r ' ;  
 	 	 } e l s e {  
 	 	 	 n o c . c l a s s N a m e   =   ' ' ;  
 	 	 }  
 	 	 / / - - - >     C r e d i t   C a r d   N u m b e r  
 	 	 i f   ( t r i m ( c d n . v a l u e )   = =   0 ) {  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   n u m e r o   d e l l a   c a r t a   d i   c r e d i t o < / l i > "  
 	 	 	 c d n . c l a s s N a m e   =   ' e r r o r ' ;  
 	 	 } e l s e {  
 	 	 	 c d n . c l a s s N a m e   =   ' ' ;  
 	 	 	 v a r   v c c n   =   V a l i d C r e d i t C a r d N u m b e r ( o ,   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o D o c u m e n t N u m b e r ' ) . v a l u e ) ;  
 	 	 	 i f   ( v c c n . l e n g t h   >   0 ) {  
 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 e   + =   v c c n  
 	 	 	 	 c d n . c l a s s N a m e   =   ' e r r o r ' ; 	 	 	  
 	 	 	 } e l s e {  
 	 	 	 	 c d n . c l a s s N a m e   =   ' ' ;  
 	 	 	 }  
 	 	 }  
 	 	 / / - - - >     C V V  
 	 	 i f   ( t r i m ( c v v . v a l u e )   = =   0   & &   r c v v [ 2 ] = = 1 ) {  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   c v v < / l i > "  
 	 	 	 c v v . c l a s s N a m e   =   ' e r r o r ' ;  
 	 	 } e l s e {  
 	 	 	 c v v . c l a s s N a m e   =   ' ' ;  
 	 	 }  
 	 	 / / - - - >     A d d r e s s   1  
 	 	 / * i f   ( t r i m ( a d 1 . v a l u e )   = =   0 ) {  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 e   + =   " < l i > P l e a s e   s u p p l y   a   v a l i d   S t r e e t   1 < / l i > "  
 	 	 	 a d 1 . c l a s s N a m e   =   ' e r r o r ' ;  
 	 	 } e l s e {  
 	 	 	 a d 1 . c l a s s N a m e   =   ' ' ;  
 	 	 } * /  
 	 	 / / - - - >     T o w n / C i t y  
 	 	 / * i f   ( t r i m ( c t y . v a l u e )   = =   0 ) {  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   c o m u n e / c i t t ? < / l i > "  
 	 	 	 c t y . c l a s s N a m e   =   ' e r r o r ' ;  
 	 	 } e l s e {  
 	 	 	 c t y . c l a s s N a m e   =   ' ' ;  
 	 	 } * /  
 	 	 / / - - - >     P o s t a l   C o d e  
 	 	 / * i f   ( t r i m ( p c . v a l u e )   = =   0 ) {  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   C A P < / l i > "  
 	 	 	 p c . c l a s s N a m e   =   ' e r r o r ' ;  
 	 	 } e l s e {  
 	 	 	 p c . c l a s s N a m e   =   ' ' ;  
 	 	 } * /  
 	 	 / / - - - >     C o u n t y  
 	 	 / / i f   ( t r i m ( s t . v a l u e )   = =   0 ) {  
 	 	 / / 	 S t a t u s   =     f a l s e ;  
 	 	 / / 	 e   + =   " < l i > P l e a s e   s u p p l y   a   v a l i d   C o u n t y < / l i > "  
 	 	 / / 	 s t . c l a s s N a m e   =   ' e r r o r ' ;  
 	 	 / / } e l s e {  
 	 	 / / 	 s t . c l a s s N a m e   =   ' ' ;  
 	 	 / / }  
 	 	 / / - - - >     C o u n t r y  
 	 	 / * i f   ( t r i m ( c t r . o p t i o n s [ c t r . s e l e c t e d I n d e x ] . v a l u e ) = = 0 ) {  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   P a e s e < / l i > "  
 	 	 	 c t r . c l a s s N a m e   =   ' e r r o r ' ;  
 	 	 } e l s e {  
 	 	 	 c t r . c l a s s N a m e   =   ' ' ;  
 	 	 } * /  
 	  
 	 	 i f   ( e . l e n g t h   >   0 )   { 	 	  
 	 	 	 C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l E r r o r C o n t a i n e r _ E r r o r C o n t a i n e r ' ) ;  
 	 	 	 C o n t a i n e r . i n n e r H T M L   =   	 ' < u l > '   +   e   +   ' < / u l > ' ;  
 	 	 }  
 	 	 e l s e {  
 	 	 	 C o n t a i n e r B a 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 o n t a i n e r P a y m e n t ' ) ;  
 	 	 	 i f ( C o n t a i n e r B a s e   ! =   n u l l ) {  
 	 	 	 	 C o n t a i n e r B a s e . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 	 }  
 	 	 	 C o n t a i n e r P a g e H e a d e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' P a g e H e a d e r ' ) ;  
 	 	 	 i f ( C o n t a i n e r P a g e H e a d e r   ! =   n u l l )  
 	 	 	 	 C o n t a i n e r P a g e H e a d e r . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 	 C v v F o r m s   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' C v v F o r m ' ) ;  
 	 	 	 C v v F o r m s . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 	 C v v L a b e l s   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' C v v L a b e l ' ) ;  
 	 	 	 C v v L a b e l s . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ; 	 	 	  
 	 	 	 v a r   I s s u e N u m b e r 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 ( ' I s s u e N u m b e r L a b e l ' ) ;  
 	 	 	 I s s u e N u m b e r L a b e l . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 	 v a r   I s s u e N u m b e r F o r m   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' I s s u e N u m b e r F o r m ' ) ;  
 	 	 	 I s s u e N u m b e r F o r m . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 	 v a r   I s s u e D a t 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 ( ' I s s u e D a t e L a b e l ' ) ;  
 	 	 	 I s s u e D a t e L a b e l . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 	 v a r   I s s u e D a t e F o r m   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' I s s u e D a t e F o r m ' ) ;  
 	 	 	 I s s u e D a t e F o r m . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 	 C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l E r r o r C o n t a i n e r _ E r r o r C o n t a i n e r ' ) ;  
 	 	 	 C o n t a i n e r . i n n e r H T M L   =   ' ' ;  
 	 	 	 C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' P a y m e n t C o m m e n t C o n t a i n e r ' ) ;  
 	 	 	 i f ( C o n t a i n e r   ! =   n u l l )  
 	 	 	 	 C o n t a i n e r . s t y l e . d i s p l a y   =   ' b l o c k ' ;  
 	 	 	 v a r   b S t e p B a c k P a y m e n 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 B a c k P a y m e n t ' ) ;  
 	 	 	 i f   ( b S t e p B a c k P a y m e n t   ! =   n u l l )  
 	 	 	 {  
 	 	 	 	 b S t e p B a c k P a y m e n t . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 	 }  
 	 	 	 v a r   b C a n c e l P a y m e 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 a n c e l P a y m e n t ' ) ;  
 	 	 	 i f   ( b C a n c e l P a y m e n t   ! =   n u l l )  
 	 	 	 {  
 	 	 	 	 b C a n c e l P a y m e n t . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 	 } 	 	 	  
 	 	 }  
 	 }  
 }  
  
 f u n c t i o n   V a l i d C r e d i t C a r d N u m b e r ( o ,   C c N u m b e r ) {  
 	 v a r   S t a t u s   	 =   t r u e   ;  
 	 v a r   e   	 =   ' '   ;  
 	 v a r   d o c N u m b e r   ;  
 	 v a r   e r r o r M s g 1   =   ' < l i > T i p o l o g i a   d i   c a r t a   o   n u m e r o   n o n   v a l i d i < / l i > ' ;  
 	 v a r   e r r o r M s g 2   =   ' < l i > N u m e r o   c a r t a   d i   c r e d i t o   n o n   v a l i d o   o   i n c o m p l e t o < / l i > ' ;  
 	 v a r   c a r d T y p e   =   C h e c k C a r d T y p e ( C c N u m b e r . s l i c e ( 0 , 6 ) ) ;  
 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c b m F o r m O f P a y m e n t S u b t y p e ' )   ! =   n u l l ) {  
 	 	 i A   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . 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 + ' _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . s e l e c t e d I n d e x ] . v a l u e . s p l i t ( ' | ' )  
 	 	 d o c N u m b e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o D o c u m e n t N u m b e r ' ) ;  
 	 } e l s e {  
 	 	 i A   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . 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 + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . s e l e c t e d I n d e x ] . v a l u e . s p l i t ( ' | ' )  
 	 	 d o c N u m b e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o D o c u m e n t N u m b e r ' ) ;  
 	 }  
 	 v a r   m i   =   1 5 ;  
 	 v a r   m a   =   1 9 ;  
 	 i f   ( i A . l e n g t h   >   0   ) {  
 	 	 i f ( i A [ 0 ]   = =   ' A M E X ' ) {  
 	 	 	 i f ( c a r d T y p e   = = ' A M E X ' ) {  
 	 	 	 	 i f ( d o c N u m b e r . v a l u e . l e n g t h   ! =   1 5 ) {  
 	 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 	 e   + =   e r r o r M s g 2 ;  
 	 	 	 	 } 	 	 	 	  
 	 	 	 }  
 	 	 	 e l s e {  
 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 e   + =   e r r o r M s g 1 ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   	 i f ( i A [ 0 ]   = =   ' E L E C T R O N ' ) { 	 	 	  
 	 	 	 i f ( c a r d T y p e   = = ' V I S A D R U K '   | |   c a r d T y p e   = = ' V I S A E L U K ' ) {  
 	 	 	 	 i f ( d o c N u m b e r . v a l u e . l e n g t h   <   1 6   | |   d o c N u m b e r . v a l u e . l e n g t h   >   1 9 ) {  
 	 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 	 e   + =   e r r o r M s g 2 ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 e l s e {  
 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 e   + =   e r r o r M s g 1 ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   	 i f ( i A [ 0 ]   = =   ' M A E S T R O ' ) {  
 	 	 	 i f ( c a r d T y p e   = = ' M A E S T R O '   | |   c a r d T y p e   = = ' M A E S T R O U K '   | |   c a r d T y p e   = = ' S O L O ' ) {  
 	 	 	 	 i f ( d o c N u m b e r . v a l u e . l e n g t h   ! =   1 6   & &   d o c N u m b e r . v a l u e . l e n g t h   ! =   1 8   & &   d o c N u m b e r . v a l u e . l e n g t h   ! =   1 9 ) {  
 	 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 	 e   + =   e r r o r M s g 2 ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 e l s e {  
 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 e   + =   e r r o r M s g 1 ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   	 i f ( i A [ 0 ]   = =   ' M C ' ) {  
 	 	 	 i f ( c a r d T y p e   = = ' M C '   | |   c a r d T y p e   = = ' M C D R ' ) {  
 	 	 	 	 i f ( d o c N u m b e r . v a l u e . l e n g t h   ! =   1 6 ) {  
 	 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 	 e   + =   e r r o r M s g 2 ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 e l s e {  
 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 e   + =   e r r o r M s g 1 ;  
 	 	 	 }  
 	 	 }  
 	 	 e l s e   i f ( i A [ 0 ]   = =   ' V I S A ' ) {  
 	 	 	 i f ( c a r d T y p e   = = ' V I S A '   | |   c a r d T y p e   = = ' V I S A D R U K '   | |   c a r d T y p e   = = ' V I S A E L U K '   | |   c a r d T y p e   = = ' V I S A P U '   | |   c a r d T y p e   = = ' V I S A P U ' ) {  
 	 	 	 	 i f ( d o c N u m b e r . v a l u e . l e n g t h   <   1 6   | |   d o c N u m b e r . v a l u e . l e n g t h   >   1 9 ) {  
 	 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 	 e   + =   e r r o r M s g 2 ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	 e l s e {  
 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 e   + =   e r r o r M s g 1 ;  
 	 	 	 }  
 	 	 }  
 	 }  
 	 r e t u r n   e ;  
 }  
  
 f u n c t i o n   V a l i d P a y m e n t ( o , b ) {  
 	 S t a t u s   	 =   t r u e ;  
 	 v a 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 ( ' f o r m C C ' )   ! =   n u l l )   {  
 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m C C ' ) . s t y l e . d i s p l a y   ! =   ' n o n e ' ) {  
 	                 v a r   n o c   =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o N a m e O n C a r d ' ) . v a l u e ) ;  
 	                 v a r   c d n 	 =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o D o c u m e n t N u m b e r ' ) . v a l u e ) ;  
 	                 v a r   c v v 	 =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o C v v C o d e ' ) . v a l u e ) ;  
 	                 v a r   a d 1 	 =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o S t r e e t ' ) . v a l u e ) ;  
 	                 v a r   c t y 	 =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o C i t y ' ) . v a l u e ) ;  
 	                 v a r   p c   	 =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o Z i p C o d e ' ) . v a l u e ) ;  
 	                 v a r   s t   	 =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o S t a t e ' ) . v a l u e ) ;  
 	                 v a r   c t r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c m b C o u n t r y R c d ' ) ;  
 	                 v a r   r c v v   =   d o c u m e n t . g e t E l e m e n t B y I d ( C c P r e s e l e c t   +   ' _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . 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 ( C c P r e s e l e c t   +   ' _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . s e l e c t e d I n d e x ] . v a l u e . s p l i t ( ' | ' ) ;  
  
 	                 / / - - - >     N a m e   O n   C a r d  
 	                 i f   ( n o c = = 0 ) {  
 	 	                 S t a t u s   =     f a l s e ;  
 	 	                 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   l ' i n t e s t a t a r i o   d e l l a   C a r t a < / l i > " ;  
 	 	                 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o N a m e O n C a r d ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	                 } 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 ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o N a m e O n C a r d ' ) . c l a s s N a m e   =   ' ' ;  
 	                 }  
 	                 / / - - - >     C r e d i t   C a r d   N u m b e r  
 	                 i f   ( c d n = = 0 ) {  
 	 	                 S t a t u s   =     f a l s e ;  
 	 	                 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   n u m e r o   d e l l a   c a r t a   d i   c r e d i t o < / l i > " ;  
 	 	                 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o D o c u m e n t N u m b e r ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	                 } e l s e { 	 	  
 	 	                 v a r   v c c n   =   V a l i d C r e d i t C a r d N u m b e r ( o ,   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o D o c u m e n t N u m b e r ' ) . v a l u e ) ;  
 	 	                 i f   ( v c c n . l e n g t h   >   0 ) {  
 	 	 	                 S t a t u s   =     f a l s e ;  
 	 	 	                 e   + =   v c c n ;  
 	 	 	                 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o D o c u m e n t N u m b e r ' ) . c l a s s N a m e   =   ' e r r o r ' ; 	 	 	  
 	 	                 } 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 ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o D o c u m e n t N u m b e r ' ) . c l a s s N a m e   =   ' ' ;  
 	 	                 }  
 	                 }  
                 	 / / - - - >     C V V  
 	                 i f   ( c v v = = 0   & &   r c v v [ 2 ] = = 1 ) {  
 	 	                 S t a t u s   =     f a l s e ;  
 	 	                 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   c v v < / l i > " ;  
 	 	                 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o C v v C o d e ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	                 } 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 ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o C v v C o d e ' ) . c l a s s N a m e   =   ' ' ;  
 	                 }  
 	                 / / - - - >     A d d r e s s   1  
 	                 / *  
 	                 i f   ( a d 1 = = 0 ) {  
 	 	                 S t a t u s   =     f a l s e ;  
 	 	                 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   l ' i n d i r i z z o     1 < / l i > "  
 	 	                 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o S t r e e t ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	                 } 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 ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o S t r e e t ' ) . c l a s s N a m e   =   ' ' ;  
 	                 }  
 	                 * /  
                 	 / / - - - >     T o w n / C i t y  
 	                 / *  
 	                 i f   ( c t y = = 0 ) {  
 	 	                 S t a t u s   =     f a l s e ;  
 	 	                 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   c o m u n e / c i t t ? < / l i > "  
 	 	                 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o C i t y ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	                 } 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 ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o C i t y ' ) . c l a s s N a m e   =   ' ' ;  
 	                 }  
 	                 * /       	  
                 	 / / - - - >     P o s t a l   C o d e  
 	                 / *  
 	                 i f   ( p c = = 0 ) {  
 	 	                 S t a t u s   =     f a l s e ;  
 	 	                 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   C A P < / l i > "  
 	 	                 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o Z i p C o d e ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	                 } 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 ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o Z i p C o d e ' ) . c l a s s N a m e   =   ' ' ;  
 	                 }  
 	                 * /  
                 	 / / - - - >     C o u n t y  
 	                 / / i f   ( s t = = 0 ) {  
 	                 / / 	 S t a t u s   =     f a l s e ;  
 	                 / / 	 e   + =   " < l i > P l e a s e   s u p p l y   a   v a l i d   C o u n t y < / l i > "  
 	                 / / 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o S t a t e ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	                 / / } 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 ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ t b o S t a t e ' ) . c l a s s N a m e   =   ' ' ;  
 	                 / / }  
 	                 / / - - - >     C o u n t r y  
                 	  
                 	  
 	                 i f   ( t r i m ( c t r . o p t i o n s [ c t r . s e l e c t e d I n d e x ] . v a l u e ) = = 0 ) {  
 	 	                 S t a t u s   =     f a l s e ;  
 	 	                 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   P a e s e < / l i > "  
 	 	                 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c m b C o u n t r y R c d ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	                 } 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 ( o + ' _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c m b C o u n t r y R c d ' ) . c l a s s N a m e   =   ' ' ;  
 	                 }  
 	         }  
 	 }  
 	 / / - - - >     T e r m s   a n d   C o n d i t i o n 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 ( o + ' _ c b o C o n f i r m ' ) . c h e c k e d   = =   f a l s e ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > P e r   p r o c e d e r e   s i   p r e g a   d i   a c c e t t a r e   l e   C o n d i z i o n i   G e n e r a l i   d i   T r a s p o r t o < / l i > " ;  
 	 }  
  
 	 i f   ( e . l e n g t h   >   0 )   {  
 	 	 C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l E r r o r C o n t a i n e r _ E r r o r C o n t a i n e r ' ) ;  
 	 	 C o n t a i n e r . i n n e r H T M L   =   	 ' < u l > '   +   e   +   ' < / u l > ' ;  
 	 }  
 	 e l s e {  
 	 	 C o n t a i n e r B a 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 o n t a i n e r P a y m e n t ' ) ;  
 	 	 C o n t a i n e r B a s e . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 C o n t a i n e r P a g e H e a d e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' P a g e H e a d e r ' ) ;  
 	 	 i f ( C o n t a i n e r P a g e H e a d e r   ! =   n u l l )  
 	 	 	 C o n t a i n e r P a g e H e a d e r . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 C v v F o r m s   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' C v v F o r m ' ) ;  
 	 	 C v v F o r m s . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 C v v L a b e l s   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' C v v L a b e l ' ) ;  
 	 	 C v v L a b e l s . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 v a r   I s s u e N u m b e r 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 ( ' I s s u e N u m b e r L a b e l ' ) ;  
 	 	 I s s u e N u m b e r L a b e l . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 v a r   I s s u e N u m b e r F o r m   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' I s s u e N u m b e r F o r m ' ) ;  
 	 	 I s s u e N u m b e r F o r m . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 v a r   I s s u e D a t 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 ( ' I s s u e D a t e L a b e l ' ) ;  
 	 	 I s s u e D a t e L a b e l . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 v a r   I s s u e D a t e F o r m   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' I s s u e D a t e F o r m ' ) ;  
 	 	 I s s u e D a t e F o r m . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l E r r o r C o n t a i n e r _ E r r o r C o n t a i n e r ' ) ;  
 	 	 C o n t a i n e r . i n n e r H T M L   =   ' ' ;  
 	 	 C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' P a y m e n t C o m m e n t C o n t a i n e r ' ) ;  
 	 	 b . s t y l e . v i s i b i l i t y   =   ' h i d d e n ' ;  
 	 	 i f ( C o n t a i n e r   ! =   n u l l )  
 	 	 	 C o n t a i n e r . s t y l e . d i s p l a y   =   ' b l o c k ' ;  
 	 	 v a r   b S t e p B a c k P a y m e n 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 B a c k P a y m e n t ' ) ;  
 	 	 v a r   b C a n c e l P a y m e 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 a n c e l P a y m e n t ' ) ;  
 	 	 b S t e p B a c k P a y m e n t . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 	 b C a n c e l P a y m e n t . s t y l e . d i s p l a y   =   ' n o n e ' ;  
 	 }  
 	 r e t u r n   S t a t u s ;  
 }  
  
 f u n c t i o n   V a l i d R e g i s t r a t i o n ( o ) {  
 	 S t a t u s   =     t r u e  
 	 v a r   e   =   ' '  
 	 v a r   p t y 	 =   d o c u m e n t . g e t E l e m e n t s B y N a m e ( ' c t r B o o k i n g : c t r P a s s e n g e r I n f o s B a s e : C t l P a y m e n t s B a s e : C t r P a y m e n t s T a b _ V a l u e ' ) . v a l u e  
 	 v a r   p m   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p h o n e _ m o b i l e ' )  
 	 v a r   p h   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p h o n e _ h o m e ' )  
 	 v a r   p b   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p h o n e _ b u s i n e s s ' )  
 	 v a r   p   =   t r i m ( p m . v a l u e )   +   t r i m ( p h . v a l u e )   +   t r i m ( p b . v a l u e )  
 	 v a r   m   =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c o n t a c t _ e m a i l ' ) . v a l u e )  
 	 v a r   c   =   t r i m ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c o n t a c t _ n a m e ' ) . v a l u e ) 	  
 	 v a r   i l   =   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' P a s s e n g e r L i s t ' ) . r o w s . l e n g t h   -   p l )   /   2  
 	 f o r   ( i = 1 ; i < = i l   ; i + + ) {  
 	 	 v a r   l n   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ L a s t n a m e ' ) ; 	 	  
 	 	 v a r   f n   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ F i r s t n a m e ' ) ; 	 	  
 	 	 v a r   w t   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ P a s s e n g e r W e i g h t ' ) ;  
  
 	 	 / / v a r   d n   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ D a t e O f B i r t h ' )  
 	 	 / / v a r   d   =   d n . v a l u e  
 	 	 i f   ( ( l n   ! =   n u l l )   & &   ( f n   ! =   n u l l ) )   {  
 	 	 	 v a r   l   =   t r i m ( l n . v a l u e ) ;  
 	 	 	 v a r   f   =   t r i m ( f n . v a l u e ) ;  
 	 	 	 i f   ( l   <   2   | |   f   <   1 ) {  
 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 e   + =   ' < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   n o m e   d e l   p a s s e g g e r o   n r .   '   +   ( i ) +   ' < / l i > '  
 	 	 	 	 l n . c l a s s N a m e   =   ( l   <   2 )   ?   ' e r r o r '   :   ' ' ;  
 	 	 	 	 f n . c l a s s N a m e   =   ( f   <   2 )   ?   ' e r r o r '   :   ' ' ;  
 	 	 	 }  
 	 	 	 e l s e   i f ( I f A l p h a O n l y ( l n . v a l u e )   = =   f a l s e   | |   I f A l p h a O n l y ( f n . v a l u e )   = =   f a l s e ) {  
 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 e   + =   ' < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   n o m e   d e l   p a s s e g g e r o   n r .   '   +   ( i ) +   ' < / l i > '  
 	 	 	 	 l n . c l a s s N a m e   =   ( I f A l p h a O n l y ( l n . v a l u e ) )   ?   ' '   :   ' e r r o r ' ;  
 	 	 	 	 f n . c l a s s N a m e   =   ( I f A l p h a O n l y ( f n . v a l u e ) )   ?   ' '   :   ' e r r o r ' ;  
 	 	 	 }  
 	 	 	 e l s e {  
 	 	 	 	 l n . c l a s s N a m e   =   ' '  
 	 	 	 	 f n . c l a s s N a m e   =   ' '  
 	 	 	 }  
 	 	 }  
 	 	  
 	 	 i f   ( w t   ! =   n u l l )   {  
 	 	 	 v a r   w   =   t r i m ( w t . v a l u e ) ;  
 	 	 	 i f   ( w   <   1 )   {  
 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 e   + =   ' < l i > P l e a s e   s u p p l y   a   v a l i d   P a s s e n g e r   W e i g h t   a t   l i n e   '   +   ( i ) +   ' < / l i > ' ;  
 	 	 	 	 w t . c l a s s N a m e   =   ' e r r o r ' ;  
 	 	 	 }  
 	 	 	 e l s e { 	  
 	 	 	 	 i f   ( i s I n t e g e r ( s t r i m ( w t . v a l u e ) )   <   1 ) {  
 	 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 	 e   + =   ' < l i > P l e a s e   s u p p l y   a   v a l i d   P a s s e n g e r   W e i g h t   a t   l i n e   '   +   ( i ) +   ' < / l i > ' ;  
 	 	 	 	 	 w t . c l a s s N a m e   =   ' e r r o r ' ;  
 	 	 	 	 }  
 	 	 	 	 e l s e {  
 	 	 	 	 	 w t . c l a s s N a m e   =   ' ' ;  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 / / i f   ( t r i m ( d )   >   0   & &   D a t e . i s V a l i d ( d , D a t e V a l i d )   = =   f a l s e ) {  
 	 	 / / 	 S t a t u s   =     f a l s e ;  
 	 	 / / 	 e   + =   ' < l i > P l e a s e   s u p p l y   a   v a l i d   d a t e   o f   b i r t h   a t   l i n e   '   +   ( i ) +   '   '   +   D a t e V a l i d T e x t   +   ' < / l i > '  
 	 	 / / 	 d n . c l a s s N a m e   =   ' e r r o r '  
 	 	 / / }  
 	 	 / / e l s e {  
 	 	 / / 	 d n . c l a s s N a m e   =   ' '  
 	 	 / / }  
 	 } 	 	  
  
  
 	 i f   ( p t   = =   t r u e ) {  
 	 	 f o r   ( i = 1 ; i < = i l   ; i + + ) {  
 	 	 	 v a r   p 0 	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ p a s s p o r t _ n u m b e r ' ) 	 	  
 	 	 	 v a r   p 1 	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ p a s s p o r t _ i s s u e _ p l a c e ' ) 	 	 	  
 	 	 	 v a r   p 2 	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ p a s s p o r t _ e x p i r y _ d a t e ' ) 	 	 	  
 	 	 	 v a r   p 3 	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r L i s t _ P a s s e n g e r L i s t _ _ c t l '   +   i   +   ' _ p a s s p o r t _ i s s u e _ d a t e ' ) 	 	 	  
 	 	 	  
 	 	 	 i f   ( p 0   ! =   n u l l )   {  
 	 	 	 	 v a r   p 0 i   =   t r i m ( p 0 . v a l u e ) ;  
 	 	 	 	 i f   ( p t v   = =   t r u e   & &   p 0 i   <   1 ) {  
 	 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 	 e   + =   ' < l i > P l e a s e   s u p p l y   a   v a l i d   P a s s p o r t   N u m b e r   a t   l i n e   '   +   ( i ) +   ' < / l i > '  
 	 	 	 	 	 p 0 . c l a s s N a m e   =   ( p 0 i   <   1 )   ?   ' e r r o r '   :   ' ' ;  
 	 	 	 	 }  
 	 	 	 	 e l s e {  
 	 	 	 	 	 p 0 . c l a s s N a m e   =   ' '  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	  
 	 	 	 i f   ( p 1   ! =   n u l l )   {  
 	 	 	 	 v a r   p 1 i   =   t r i m ( p 1 . v a l u e )  
 	 	 	 	 i f   ( p t v   = =   t r u e   & &   p 1 i   <   1 ) {  
 	 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 	 e   + =   ' < l i > P l e a s e   s u p p l y   a   v a l i d   I s s u e   P l a c e   a t   l i n e   '   +   ( i ) +   ' < / l i > '  
 	 	 	 	 	 p 1 . c l a s s N a m e   =   ( p 1 i   <   1 )   ?   ' e r r o r '   :   ' ' ;  
 	 	 	 	 }  
 	 	 	 	 e l s e {  
 	 	 	 	 	 p 1 . c l a s s N a m e   =   ' '  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	  
 	 	 	 i f   ( p 2   ! =   n u l l )   {  
 	 	 	 	 v a r 	 p 2 v 	 =   p 2 . v a l u e  
 	 	 	 	 / /   i f   ( ( p t v   = =   t r u e   | |   t r i m ( p 2 v )   >   0 )   & &   D a t e . i s V a l i d ( p 2 v , D a t e V a l i d )   = =   f a l s e ) {  
 	 	 	 	 i f   ( ( p t v   = =   t r u e   | |   t r i m ( p 2 v )   >   0 )   & &   i s D a t e E x i s t ( p 2 v )   = =   f a l s e ) {  
 	 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 	 e   + =   ' < l i > '   +   e M s g [ 1 2 ]   +   ( i   - 1 ) +   '   '   +   D a t e V a l i d T e x t   +   ' < / l i > '  
 	 	 	 	 	 p 2 . c l a s s N a m e   =   ' e r r o r '  
 	 	 	 	 }  
 	 	 	 	 e l s e {  
 	 	 	 	 	 p 2 . c l a s s N a m e   =   ' '  
 	 	 	 	 }  
 	 	 	 }  
 	 	 	  
 	 	 	 i f   ( p 3   ! =   n u l l )   {  
 	 	 	 	 v a r 	 p 3 v 	 =   p 3 . v a l u e  
 	 	 	 	 / /   i f   ( ( p t v   = =   t r u e   | |   t r i m ( p 3 v )   >   0 )   & &   D a t e . i s V a l i d ( p 3 v , D a t e V a l i d )   = =   f a l s e ) {  
 	 	 	 	 i f   ( ( p t v   = =   t r u e   | |   t r i m ( p 3 v )   >   0 )   & &   i s D a t e E x i s t ( p 3 v )   = =   f a l s e ) {  
 	 	 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 	 	 e   + =   ' < l i > '   +   e M s g [ 1 3 ]   +   ( i   - 1 ) +   '   '   +   D a t e V a l i d T e x t   +   ' < / l i > '  
 	 	 	 	 	 p 3 . c l a s s N a m e   =   ' e r r o r '  
 	 	 	 	 }  
 	 	 	 	 e l s e {  
 	 	 	 	 	 p 3 . c l a s s N a m e   =   ' '  
 	 	 	 	 }  
 	 	 	 }  
  
 	 	 }  
 	 }  
  
 	 i f   ( c = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   c o n t a t t o   f o r n i t o < / l i > "  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c o n t a c t _ n a m e ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 }  
 	 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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c o n t a c t _ n a m e ' ) . c l a s s N a m e   =   ' ' ;  
 	 }  
 	  
 	 i f   ( p = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   n u m e r o   d i   t e l e f o n o < / l i > "  
 	 	 p m . c l a s s N a m e   =   ' e r r o r '  
 	 	 p h . c l a s s N a m e   =   ' e r r o r '  
 	 	 p b . c l a s s N a m e   =   ' e r r o r '  
 	 }  
 	 e l s e {  
 	 	 p m . c l a s s N a m e   =   ' '  
 	 	 p h . c l a s s N a m e   =   ' '  
 	 	 p b . c l a s s N a m e   =   ' '  
 	 }  
  
 	 i f   ( m = = 0 ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   l ' i n d i r i z z o   e - m a i l < / l i > "  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c o n t a c t _ e m a i l ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 }  
 	 e l s e {  
 	 	 v a r   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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c o n t a c t _ e m a i l ' ) . v a l u e ;  
 	 	 i f   ( V a l i d E m a i l ( 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 ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c o n t a c t _ e m a i l ' ) . c l a s s N a m e   =   ' ' ;  
 	 	 }   e l s e   {  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   l ' i n d i r i z z o   e - m a i l < / l i > " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ c o n t a c t _ e m a i l ' ) . c l a s s N a m e   =   ' e r r o r ' ;  
 	 	 }  
 	 }  
 	  
 	 / *  
 	 i f   ( C c V a l i d a t i o n . l e n g t h   >   0   & &   p t y   = =   ' C C ' )   {  
 	 	 v a r   C c S t a t u s   =     t r u e ;  
 	 	 v a r   s t   =   d o c u m e n t . g e t E l e m e n t B y I d ( C c V a l i d a t i o n   +   ' _ t b o S t r e e t ' )  
 	 	 v a r   c y   =   d o c u m e n t . g e t E l e m e n t B y I d ( C c V a l i d a t i o n   +   ' _ t b o C i t y ' )  
 	 	 v a r   s a   =   d o c u m e n t . g e t E l e m e n t B y I d ( C c V a l i d a t i o n   +   ' _ t b o S t a t e ' )  
 	 	 v a r   z i   =   d o c u m e n t . g e t E l e m e n t B y I d ( C c V a l i d a t i o n   +   ' _ t b o Z i p C o d e ' )  
 	 	 i f   ( t r i m ( s t . v a l u e )   = =   0 ) {  
 	 	 	 C c S t a t u s   =     f a l s e ;  
 	 	 	 s t . c l a s s N a m e   =   ' e r r o r '  
 	 	 }  
 	 	 e l s e {  
 	 	 	 s t . c l a s s N a m e   =   ' '  
 	 	 }  
 	 	 i f   ( t r i m ( c y . v a l u e )   = =   0 ) {  
 	 	 	 C c S t a t u s   =     f a l s e ;  
 	 	 	 c y . c l a s s N a m e   =   ' e r r o r ' 	  
 	 	 }  
 	 	 e l s e {  
 	 	 	 c y . c l a s s N a m e   =   ' ' 	 	  
 	 	 }  
 	 	 i f   ( t r i m ( s a . v a l u e )   = =   0 ) {  
 	 	 	 C c S t a t u s   =     f a l s e ;  
 	 	 	 s a . c l a s s N a m e   =   ' e r r o r '  
 	 	 }  
 	 	 e l s e {  
 	 	 	 s a . c l a s s N a m e   =   ' ' 	  
 	 	 }  
 	 	 i f   ( t r i m ( z i . v a l u e )   = =   0 ) {  
 	 	 	 C c S t a t u s   =     f a l s e ;  
 	 	 	 z i . c l a s s N a m e   =   ' e r r o r '  
 	 	 }  
 	 	 e l s e {  
 	 	 	 z i . c l a s s N a m e   =   ' ' 	  
 	 	 }  
 	 	 i f   ( ! C c S t a t u s ) {  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 e   + =   " < l i > S i   p r e g a   d i   c o n t r o l l a r e   l ' i n d i r i z z o   < / l i > "  
 	 	 }  
 	 } 	 * /  
 	 i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c b o C o n f i r m ' ) . c h e c k e d   = =   f a l s e ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   " < l i > P e r   p r o c e d e r e   s i   p r e g a   d i   a c c e t t a r e   l e   C o n d i z i o n i   G e n e r a l i   d i   T r a s p o r t o < / l i > "  
 	 }  
 	 i f   ( e . l e n g t h   >   0 )   {  
 	 	 C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l E r r o r C o n t a i n e r _ E r r o r C o n t a i n e r ' )  
 	 	 C o n t a i n e r . i n n e r H T M L   =   	 ' < u l > '   +   e   +   ' < / u l > '  
 	 }  
 	 e l s e {  
 	 	 C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l E r r o r C o n t a i n e r _ E r r o r C o n t a i n e r ' )  
 	 	 C o n t a i n e r . i n n e r H T M L   =   	 ' '  
 	 	 C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' P a y m e n t C o m m e n t C o n t a i n e r ' )  
 	 	 / / v a r   b   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ b t m S u b m i t B o o k i n g ' )  
 	 	 / / b . s t y l e . v i s i b i l i t y   =   ' h i d d e n '  
 	 	 C o n t a i n e r . 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   C h e c k P h o n e s ( o ) {  
 	 v a r   p m   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p h o n e _ m o b i l e ' )  
 	 v a r   p h   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p h o n e _ h o m e ' )  
 	 v a r   p b   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ c t l P a s s e n g e r C o n t a c t I n f o _ p h o n e _ b u s i n e s s ' )  
 	 i f   ( g o T o R o w   ! =   n u l l ) {  
 	 	 v a r   p   =   t r i m ( p m . v a l u e )   +   t r i m ( p h . v a l u e )   +   t r i m ( p b . v a l u e )  
 	 	 	 i f   ( p = = 0 ) {  
 	 	 	 p m . c l a s s N a m e   =   ' e r r o r '  
 	 	 	 p h . c l a s s N a m e   =   ' e r r o r '  
 	 	 	 p b . c l a s s N a m e   =   ' e r r o r '  
 	 	 }  
 	 	 e l s e {  
 	 	 	 p m . c l a s s N a m e   =   ' '  
 	 	 	 p h . c l a s s N a m e   =   ' '  
 	 	 	 p b . c l a s s N a m e   =   ' '  
 	 	 }  
 	 }  
 }  
  
  
 f u n c t i o n   V a l i d E d i t P a s s e n g e r s ( o ) {  
 	 S t a t u s   	 =     t r u e ;  
 	 v a r   e   	 =   ' ' ;  
 	 v a r   l n   	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ P a s s e n g e r L i s t _ _ c t l 1 _ L a s t n a m e ' ) ;  
 	 v a r   f n   	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ P a s s e n g e r L i s t _ _ c t l 1 _ F i r s t n a m e ' ) ;  
 	 v a r   p w   	 =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ P a s s e n g e r L i s t _ _ c t l 1 _ P a s s e n g e r W e i g h t ' ) ;  
  
 	 i f   ( t r i m ( f n . v a l u e )   <   1     | |   I f A l p h a O n l y ( f n . v a l u e )   = =   f a l s e ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   ' < l i > S i   p r e g a   d i   c o n t r o l l a r e   i l   n o m e   d i   b a t t e s i m o < / l i > '  
 	 	 f n . c l a s s N a m e   =   ' e r r o r ' ;  
 	 } e l s e {  
 	 	 f n . c l a s s N a m e   =   ' '  
 	 }  
 	 i f   ( t r i m ( l n . v a l u e )   <   2   | |   I f A l p h a O n l y ( l n . v a l u e )   = =   f a l s e ) {  
 	 	 S t a t u s   =     f a l s e ;  
 	 	 e   + =   ' < l i > T i p o   d i   c a r t a   d i   c r e d i t o < / l i > '  
 	 	 l n . c l a s s N a m e   =   ' e r r o r ' ;  
 	 } e l s e {  
 	 	 l n . c l a s s N a m e   =   ' '  
 	 }  
 	 i f   ( p w   ! =   n u l l ) {  
 	 	 i f   ( t r i m ( p w . v a l u e ) = = 0 ) {  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 	 e   + =   " < l i > P l e a s e   s u p p l y   a   v a l i d   P a s s e n g e r   W e i g h t < / l i > "  
 	 	 	 p w . c l a s s N a m e   =   ' e r r o r ' ;  
 	 	 } e l s e {  
 	 	 	 p w . c l a s s N a m e   =   ' ' ;  
 	 	 }  
 	 }  
 	 C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( o + ' _ P a s s e n g e r L i s t _ _ c t l 2 _ L a b E r r o r ' ) ;  
 	 i f   ( e . l e n g t h   >   0 )   {  
 	 	 C o n t a i n e r . i n n e r H T M L   =   ' < u l > '   +   e   +   ' < / u l > ' ;  
 	 } e l s e {  
 	 	 C o n t a i n e r . i n n e r H T M L   =   ' ' ;  
 	 	 S t a t u s   =   c o n f i r m ( ' A   f e e   w i l l   b e   c h a r g e d   i f   y o u   p r o c e e d \ n   w i t h   t h e   n a m e   c h a n g e ? ' ) ;  
 	 } 	 	  
 }  
  
 f u n c t i o n   t r i m ( s ) {  
 	 r e t u r n   s . r e p l a c e ( / ^ \ s * | \ s * $ / g , " " ) . l e n g t h ;  
 } 	  
  
 f u n c t i o n   s t r i m ( s ) {  
 	 r e t u r n   s . r e p l a c e ( / ^ \ s * | \ s * $ / g , " " ) ;  
 } 	  
  
 f u n c t i o n   O n S u b m i t ( ) {  
 	 i f   ( S t a t u s ) {  
 	 	 r e t u r n   t r u e ;  
 	 }  
 	 e l s e  
 	 {  
 	 	 S t a t u s   =   t r u e  
 	 	 r e t u r n   f a l s e ;  
 	 }  
  
 }  
  
 f u n c t i o n   G e t S e l e c t F l i g h t ( s , j ) {  
 	 o   =   d o c u m e n t . g e t E l e m e n t B y I d ( s )  
 	 i f   ( o   ! =   n u l l ) {  
 	 	 f o r   ( i = 1 ; i < = o . r o w s . l e n g t h - 1 ; i + + ) {  
 	 	 	 i f   ( o . r o w s [ i ] . i d . l e n g t h   >   0 )   {  
 	 	 	 	 v a r   o b j 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( o . r o w s [ i ] . i d   +   ' _ r b ' )  
 	 	 	 	 v a r   o b j 2   =   d o c u m e n t . g e t E l e m e n t B y I d ( o . r o w s [ i ] . i d   +   ' _ l a b e l ' )  
 	 	 	 	 i f   ( o b j 1   ! =   n u l l )   {  
 	 	 	 	 	 i f   ( o b j 1 . c h e c k e d )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 	 v a r   s   =     o b j 2 . g e t A t t r i b u t e ( " n a m e " ) . s p l i t ( ' | ' )     / / o b j 2 . n a m e . s p l i t ( ' | ' ) ;  
 	 	 	 	 	 	 	 v a r   d   =   s [ j ] . s p l i t ( ' , ' )  
 	 	 	 	 	 	 	 / / 	 d [ 0 ]   i s   Y e a r   ( v a l u e   i s   y y y y )  
 	 	 	 	 	 	 	 / / 	 d [ 1 ]   i s   M o n t h   ( v a l u e   i s   0 - 1 1 )   * *   T h a t ' s   w h y   m u s t   b e   m i n u s   1  
 	 	 	 	 	 	 	 / / 	 d [ 2 ]   i s   D a y   ( v a l u e   i s   1 - 3 1 )  
 	 	 	 	 	 	 	 r e t u r n   n e w   D a t e ( d [ 0 ] , d [ 1 ] - 1 , d [ 2 ] , d [ 3 ] , d [ 4 ] , 0 ) 	 	 	 	 	 	 	  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 }  
 }  
  
 f u n c t i o n   L i b D a y s D i f f ( d 1 , d 2 )   {  
 	 v a r   z   =   D a t e . U T C ( L i b y 2 k ( d 1 . g e t Y e a r ( ) ) , d 1 . g e t M o n t h ( ) , d 1 . g e t D a t e ( ) , d 1 . g e t H o u r s ( ) , d 1 . g e t M i n u t e s ( ) , 0 )   -   D a t e . U T C ( L i b y 2 k ( d 2 . g e t Y e a r ( ) ) , d 2 . g e t M o n t h ( ) , d 2 . g e t D a t e ( ) , d 2 . g e t H o u r s ( ) , d 2 . g e t M i n u t e s ( ) , 0 ) ;  
 	 r e t u r n   z / 1 0 0 0 / 6 0 / 6 0 / 2 4 ;  
 }  
  
 f u n c t i o n   L i b y 2 k ( n u m b e r )   {   r e t u r n   ( n u m b e r   <   1 0 0 0 )   ?   n u m b e r   +   1 9 0 0   :   n u m b e 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 ( ' c t r H o m e _ c t r F l i g h t S e a r c h B a s e _ c t l D e p a t u r e D a t e _ c m b D a y ' ) ! = n u l l )   {  
 / / 	 	 C h a n g e C a l e n d e r ( ' c t r H o m e _ c t r F l i g h t S e a r c h B a s e _ c t l D e p a t u r e D a t e ' )  
 / / 	 	 C h a n g e C a l e n d e r ( ' c t r H o m e _ c t r F l i g h t S e a r c h B a s e _ c t l R e t u r n D a t e ' )  
 	 	 C h a n g e C a l e n d e r ( ' c t r H o m e _ c t r F l i g h t S e a r c h B a s e _ c t l D e p a t u r e D a t e ' , ' ' )  
 	 	 C h a n g e C a l e n d e r ( ' c t r H o m e _ c t r F l i g h t S e a r c h B a s e _ c t l R e t u r n D a t e ' , ' ' )  
  
 }  
  
 f u n c t i o n   S e t A u t o F o c u s ( ) {  
 	 i f   ( A u t o F o c u s   ! =   u n d e f i n e d   & &   A u t o F o c 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 ( A u t o F o c u s )   ! =   n u l l ) {  
 	 	 	 t r y { 	 	  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( A u t o F o c u s ) . f o c u s ( ) ;  
 	 	 	 / / d o c u m e n t . g e t E l e m e n t B y I d ( A u t o F o c u s ) . s t y l e . d i s p l a y   =   ' b l o c k '  
 	 	 	 } c a t c h ( e r r ) { 	  
 	 	 	 c h a n g e P a y m e n t T a b ( ' V o u c h e r ' , ' c t r B o o k i n g _ c t r B o o k i n g S u m m e r y _ C t r P a y m e n t s B a s e ' ) ;  
 	 	 	 }  
 	 	 }  
 	 }  
  
 }  
  
 f u n c t i o n   i s V a l i d E m a i l ( s t r ) {  
 	 s t r   =   s t r i m ( s t r ) ;  
 	 r e t u r n   	 ( s t r . i n d e x O f ( " . " )   >   0 )   & & 	 	 	 	 	 	 / /   n o t   s t a r t e d   w i t h   " . "  
 	 	 	 ( s t r . i n d e x O f ( " @ " )   >   0 )   & &   	 	 	 	 	 	 / /   m u s t   c o n s i s t   o f   " @ "   a n d   n o t   s t a r t e d   w i t h   i t  
 	 	 	 ( s t r . l a s t I n d e x O f ( " . " )   >   s t r . i n d e x O f ( " @ " ) )   & &   	 / /   m u s t   h a v e   " . "   a f t e r   " @ "  
 	 	 	 ( s t r . l a s t I n d e x O f ( " . " )   <     s t r . l e n g t h   -   1 ) ; 	 	 / /   n o t   e n d e d   w i t h   " . "  
 }  
  
 f u n c t i o n   V a l i d E m a i l ( s ) {  
 	 v a r   a   =   f a l s e ;  
 	 v a r   r e s   =   f a l s e ;  
 	 i f ( t y p e o f ( R e g E x p )   = =   ' f u n c t i o n ' ) {  
 	 	 v a r   b   =   n e w   R e g E x p ( ' a b c ' ) ;  
 	 	 i f ( b . t e s t ( ' a b c ' )   = =   t r u e ) {  
 	 	 	 a   =   t r u e ;  
 	 	 }  
 	 }  
 	 i f ( a   = =   t r u e ) {  
 	 	 / / r e g   =   n e w   R e g E x p ( ' ^ ( [ a - z A - Z 0 - 9 \ \ - \ \ . \ \ _ ] + ) ' + ' ( \ \ @ ) ( [ a - z A - Z 0 - 9 \ \ - \ \ . ] + ) ' + ' ( \ \ . ) ( [ a - z A - Z ] { 2 , 4 } ) $ ' ) ;  
 	 	 r e g   =   n e w   R e g E x p ( " ^ ( [ a - z A - Z 0 - 9 \ \ - \ \ . \ \ _ \ \ ' ] + ) "   +   " ( \ \ @ ) ( [ a - z A - Z 0 - 9 \ \ - \ \ . ] + ) "   +   " ( \ \ . ) ( [ a - z A - Z ] { 2 , 4 } ) $ " ) ;  
 	 	 r e s   =   ( r e g . t e s t ( s ) ) ;  
 	 }  
 	 e l s e {  
 	 	 r e s   =   ( s . s e a r c h ( ' @ ' )   > =   1   & &  
 	 	 s . l a s t I n d e x O f ( ' . ' )   >   s . s e a r c h ( ' @ ' )   & &  
 	 	 s . l a s t I n d e x O f ( ' . ' )   > =   s . l e n g t h - 5 )  
 	 }  
 	 r e t u r n ( r e s ) ;  
 }  
  
 f u n c t i o n   g e t C o o k i e ( n a m e )   {  
     v a r   d c   =   d o c u m e n t . c o o k i e ;  
     v a r   p r e f i x   =   n a m e   +   " = " ;  
     v a r   b e g i n   =   d c . i n d e x O f ( " ;   "   +   p r e f i x ) ;  
     i f   ( b e g i n   = =   - 1 )   {  
         b e g i n   =   d c . i n d e x O f ( p r e f i x ) ;  
         i f   ( b e g i n   ! =   0 )   r e t u r n   n u l l ;  
     }   e l s e  
         b e g i n   + =   2 ;  
     v a r   e n d   =   d o c u m e n t . c o o k i e . i n d e x O f ( " ; " ,   b e g i n ) ;  
     i f   ( e n d   = =   - 1 )  
         e n d   =   d c . l e n g t h ;  
     r e t u r n   u n e s c a p e ( d c . s u b s t r i n g ( b e g i n   +   p r e f i x . l e n g t h ,   e n d ) ) ;  
 }  
  
 f u n c t i o n   g e t S u b C o o k i e ( n a m e , p a r e n t )   {  
     v a r   d c   =   p a r e n t ;  
     v a r   p r e f i x   =   n a m e   +   " = " ;  
     v a r   b e g i n   =   d c . i n d e x O f ( " & "   +   p r e f i x ) ;  
     i f   ( b e g i n   = =   - 1 )   {  
         b e g i n   =   d c . i n d e x O f ( p r e f i x ) ;  
         i f   ( b e g i n   ! =   0 )   r e t u r n   n u l l ;  
     }   e l s e  
         b e g i n   + =   1 ;  
     v a r   e n d   =   p a r e n t . i n d e x O f ( " & " ,   b e g i n ) ;  
     i f   ( e n d   = =   - 1 )  
         e n d   =   d c . l e n g t h ;  
     r e t u r n   u n e s c a p e ( d c . s u b s t r i n g ( b e g i n   +   p r e f i x . l e n g t h ,   e n d ) ) ;  
 }  
  
 f u n c t i o n   C r e a t e P o p u p ( l , p ) {  
 	 i f   ( p   = =   ' f ' ) {  
 	 	 C r e a t e W n d ( ' h t m l / F a r e C o d e / '   +   l   +   ' . h t m l ' ,   3 0 0 ,   4 0 0 ,   t r u e ) ;  
 	 	 d g I t e m L o c k   =   t r u e  
 	 }  
 }  
  
 f u n c t i o n   I s N u m e r i c ( v a l u e )   {  
 	 v a l u e   =   v a l u e  
 	 r e t u r n   ( ! i s N a N ( v a l u e * 1 )   & &   ! I s S p a c e ( v a l u e ) ) ;  
 }  
  
 f u n c t i o n   I s S p a c e ( v a l u e )   {  
 	 r e t u r n   ( v a l u e = = '   ' ) ;  
 }  
  
 f u n c t i o n   G e t C a r d S u b T y p e ( C c N u m b e r ) {  
 	 v a r   l   =   n e w   N u m b e r ( C c N u m b e r . s l i c e ( 0 , 6 ) )  
 	 v a r   i A   =   d o c u m e n t . g e t E l e m e n t B y I d ( C c P r e s e l e c t   +   ' _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . 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 ( C c P r e s e l e c t   +   ' _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . s e l e c t e d I n d e x ] . v a l u e . s p l i t ( ' | ' )  
 	 S e l e c t e d C a r d T y p e   =   i A [ 0 ]  
 	 i f   	 (  
 	 	 	 ( l   > =   4 1 3 7 3 3   & &   l   < =   4 1 3 7 3 7   )   | |    
 	 	 	 ( l   > =   4 4 6 2 0 0   & &   l   < =   4 4 6 2 9 9   )   | |    
 	 	 	 ( l   > =   4 5 3 9 7 8   & &   l   < =   4 5 3 9 7 9 )   | |    
 	 	 	 ( l   = =   4 5 4 3 1 3   )   | |  
 	 	 	 ( l   > =   4 5 4 4 3 2   & &   l   < =   4 4 6 2 9 9   )   | |    
 	 	 	 ( l   = =   4 5 4 7 4 2 )   | |  
 	 	 	 ( l   > =   4 5 6 7 2 5   & &   l   < =   4 5 6 7 4 5   )   | |    
 	 	 	 ( l   > =   4 6 5 8 3 0   & &   l   < =   4 6 5 8 7 9   )   | |  
 	 	 	 ( l   > =   4 6 5 9 0 1   & &   l   < =   4 6 5 9 5 0   )   | |  
 	 	 	 ( l   > =   4 7 5 1 1 0   & &   l   < =   4 7 5 1 5 9   )   | |  
 	 	 	 ( l   > =   4 7 5 7 1 0   & &   l   < =   4 7 5 7 5 9   )   | |  
 	 	 	 ( l   > =   4 7 6 2 2 0   & &   l   < =   4 7 6 2 6 9   )   | |  
 	 	 	 ( l   > =   4 7 6 3 4 0   & &   l   < =   4 7 6 3 8 9   )   | |  
 	 	 	 ( l   > =   4 8 4 4 0 9   & &   l   < =   4 8 4 4 1 0   )   | |  
 	 	 	 ( l   > =   4 9 0 9 6 0   & &   l   < =   4 9 0 9 7 9   )   | |  
 	 	 	 ( l   > =   4 9 2 1 8 1   & &   l   < =   4 9 2 1 8 2   )   | |  
 	 	 	 ( l   = =   4 9 8 8 2 4 )  
 	 	 )  
 	 {  
 	 	 C a r d T y p e   =   " V I S A D R U K "  
 	 }  
 	 e l s e   i f  
 	 	 (  
 	 	 	 ( l     = =   4 2 4 5 1 9 )   | |  
 	 	 	 ( l   > =   4 2 4 9 6 2   & &   l   < =   4 2 4 9 6 3   )   | |  
 	 	 	 ( l   = =   4 5 0 8 7 5 )   | |  
 	 	 	 ( l   > =   4 8 4 4 0 6   & &   l   < =   4 8 4 4 0 8   )   | |  
 	 	 	 ( l   > =   4 8 4 4 1 1   & &   l   < =   4 8 4 4 5 5   )   | |  
 	 	 	 ( l   > =   4 9 1 7 3 0   & &   l   < =   4 9 1 7 5 9   )   | |  
 	 	 	 ( l   = =   4 9 1 8 8 0 )  
 	 	 )  
 	 {  
 	 	 C a r d T y p e   =   " V I S A E L U K "  
 	 }  
 	 e l s e   i f  
 	 	 (  
 	 	 	 ( l   > =   4 4 8 4 0 0   & &   l   < =   4 4 8 6 9 9   )   | |  
 	 	 	 ( l   > =   4 7 1 5 0 0   & &   l   < =   4 7 1 5 9 9   )  
 	 	 )  
 	 {  
 	 	 C a r d T y p e   =   " V I S A P U "  
 	 }  
 	 e l s e   i f  
 	 	 (  
 	 	 	 ( l   = =   4 9 0 3 0 3 )   | |  
 	 	 	 ( l   = =   4 9 3 6 9 8 )   | |  
 	 	 	 ( l   = =   6 3 3 3 1 1 )   | |  
 	 	 	 ( l   > =   6 7 5 9 0 0   & &   l   < =   6 7 5 9 9 9 )  
 	 	 )  
 	 {  
 	 	 C a r d T y p e   =   " M A E S T R O U K "  
 	 }  
 	 e l s e   i f  
 	 	 (  
 	 	 	 ( l   > =   5 1 0 0 0 0   & &   l   < =   5 5 9 9 9 9 )  
 	 	 )  
 	 {  
 	 	 C a r d T y p e   =   " M C "  
 	 }  
 	 e l s e   i f  
 	 	 (  
 	 	 	 ( l   > =   6 7 6 7 0 0   & &   l   < =   6 7 6 7 9 9 )  
 	 	 )  
 	 {  
 	 	 C a r d T y p e   =   " S O L O "  
 	 }  
 	 e l s e   i f  
 	 	 (  
 	 	 	 ( l   > =   6 1 8 0 0 0 0   & &   l   < =   1 8 0 0 9 9 )   | |  
 	 	 	 ( l   > =   6 2 1 3 1 0 0   & &   l   < =   2 1 3 1 9 9 )  
 	 	 )  
 	 {  
 	 	 C a r d T y p e   =   " J C B "  
 	 }  
 	 e l s e   i f  
 	 	 (  
 	 	 	 ( l   > =   3 5 2 8 0 0   & &   l   < =   3 5 8 9 9 9 )  
 	 	 )  
 	 {  
 	 	 i f   ( S e l e c t e d C a r d T y p e   = =   " D C " ) {  
 	 	 	 C a r d T y p e   =   " D C " }  
 	 	 e l s e   i f   ( S e l e c t e d C a r d T y p e   = =   " A M E X " ) {  
 	 	 	 C a r d T y p e   =   " A M E X " }  
 	 	 e l s e {  
 	 	 	 C a r d T y p e   =   " J C B "  
 	 	 }  
 	 }  
 	 e l s e   i f  
 	 	 (  
 	 	 	 ( l   > =   3 0 0 0 0 0   & &   l   < =   3 6 9 9 9 9 )  
 	 	 )  
 	 {  
 	 	 i f   ( S e l e c t e d C a r d T y p e   = =   " A M E X " ) {  
 	 	 	 C a r d T y p e   =     " A M E X " }  
 	 	 e l s e {  
 	 	 	 C a r d T y p e   =   " D C "  
 	 	 }  
 	 }  
 	 e l s e   i f  
 	 	 (  
 	 	 	 ( l   > =   3 4 0 0 0 0   & &   l   < =   3 7 9 9 9 9 )  
 	 	 )  
 	 {  
 	 	 i f   ( S e l e c t e d C a r d T y p e   = =   " A M E X " ) {  
 	 	 	 C a r d T y p e   =     " A M E X " }  
 	 	 e l s e {  
 	 	 	 C a r d T y p e   =   " J C B "  
 	 	 }  
 	 }  
 	 e l s e   i f  
 	 	 (  
 	 	 	 ( l   > =   3 0 0 0 0 0   & &   l   < =   3 9 9 9 9 9 )  
 	 	 )  
 	 {  
 	 	 C a r d T y p e   =     " J C B "  
 	 }  
 	 e l s e   i f  
 	 	 (  
 	 	 	 ( l   > =   5 0 0 0 0 0   & &   l   < =   5 0 9 9 9 9 )   | |  
 	 	 	 ( l   > =   5 6 0 0 0 0   & &   l   < =   5 8 9 9 9 9 )   | |  
 	 	 	 ( l   > =   6 0 0 0 0 0   & &   l   < =   6 9 9 9 9 9 )  
 	 	 )  
 	 {  
 	 	 C a r d T y p e   =   " M A E S T R O "  
 	 }  
 	 e l s e   i f  
 	 	 (  
 	 	 	 ( l   > =   4 0 0 0 0 0   & &   l   < =   4 9 9 9 9 9 )    
 	 	 )  
 	 {  
 	 	 C a r d T y p e   =   " V I S A "  
 	 }  
 	 e l s e  
 	 {  
 	 	 C a r d T y p e   =   " "  
 	 }  
 	  
 	 v a r   F e e A m m o u n t   =   n e w   N u m b e r ( 0 )  
 	 f o r   ( i = 0 ; i   <   F e e s R c d . l e n g t h   ; i + + ) {  
 	 	 i f   ( C a r d T y p e . t o U p p e r C a s e ( )   = =   F e e s R c d [ i ] . t o U p p e r C a s e ( ) ) {  
 	 	 	 F e e A m m o u n t   =   F e e s A m m o u n t [ i ]  
 	 	 }  
 	 }  
  
 	 v a r   c u r r e n c y   =   g e t D y n a m i c C u r r e n c y ( ) ;  
 	 i f   ( c u r r e n c y   ! =   " " )  
 	 {  
 	 	 c u r r e n c y   =   c u r r e n c y   +   "   " ;  
 	 }  
  
 	 i f   ( C a r d T y p e   ! =   " "   & &   F e e A m m o u n t   >   0 ) {  
 	 	 v a r   T o t a l   =   ( C c T o t a l V a l u e   +   F e e A m m o u 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 c M e s s a g e ' ) . i n n e r H T M L   =   ' D i r i t t i   A m m i n i s t r a t i v i   s u l l a   C a r t a   d i   C r e d i t o   :   '   +   c u r r e n c y   +   p a r s e C u r r e n c y ( F e e A m m o u n t . t o F i x e d ( 2 ) + ' ' )   / / +   '   S e r v i c e   & p o u n d ; '   +   p a r s e C u r r e n c y ( T o t a l . 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 ( ' b h C c C a r g e s ' ) ! =   n u l l )  
 	 	 {  
                         d o c u m e n t . g e t E l e m e n t B y I d ( ' b h C c C a r g e s ' ) . i n n e r H T M L   =   c u r r e n c y   +   p a r s e C u r r e n c y ( F e e A m m o u n t . 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 ( ' b h S u m m a r y ' )   ! =   n u l l ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' b h S u m m a r y ' ) . i n n e r H T M L   =   c u r r e n c y   +   p a r s e C u r r e n c y ( T o t a l . t o F i x e d ( 2 ) + ' ' ) ;  
 	 	 }  
 	 }  
 	 e l s e  
 	 {  
 	 	 / / v a r   T o t a l   =   ( C c T o t a l V a l u e   +   F e e A m m o u 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 c M e s s a g e ' ) . i n n e r H T M L   =   ' Y o u r   c r e d i t   c a r d   w i l l   b e   d e b i t e d   c a r d   c h a r g e s   o f   & p o u n d ; '   +   p a r s e C u r r e n c y ( T o t a l . t o F i x e d ( 2 ) + ' ' )  
 	  
 	 }  
 	 r e t u r n   C a r d T y p e  
 }  
  
 f u n c t i o n   i s C r e d i t C a r d ( s t ) {  
     i f   ( s t . l e n g t h   >   1 9 )  
         r e t u r n   ( f a l s e ) ;  
  
     s u m   =   0 ;   m u l   =   1 ;   l   =   s t . l e n g t h ;  
     f o r   ( i   =   0 ;   i   <   l ;   i + + )   {  
         d i g i t   =   s t . s u b s t r i n g ( l - i - 1 , l - i ) ;  
         t p r o d u c t   =   p a r s e I n t ( d i g i t   , 1 0 ) * m u l ;  
         i f   ( t p r o d u c t   > =   1 0 )  
             s u m   + =   ( t p r o d u c t   %   1 0 )   +   1 ;  
         e l s e  
             s u m   + =   t p r o d u c t ;  
         i f   ( m u l   = =   1 )  
             m u l + + ;  
         e l s e  
             m u l - - ;  
     }  
  
     i f   ( ( s u m   %   1 0 )   = =   0 )  
         r e t u r n   ( t r u e ) ;  
     e l s e  
         r e t u r n   ( f a l s e ) ;  
 }  
  
 f u n c t i o n   i s V i s a ( c c ) {  
     i f   ( ( ( c c . l e n g t h   = =   1 6 )   | |   ( c c . l e n g t h   = =   1 3 ) )   & &  
             ( c c . s u b s t r i n g ( 0 , 1 )   = =   4 ) )  
         r e t u r n   i s C r e d i t C a r d ( c c ) ;  
     r e t u r n   f a l s e ;  
 }  
  
 f u n c t i o n   i s M a s t e r C a r d ( c c ) {  
     f i r s t d i g   =   c c . s u b s t r i n g ( 0 , 1 ) ;  
     s e c o n d d i g   =   c c . s u b s t r i n g ( 1 , 2 ) ;  
     i f   ( ( c c . l e n g t h   = =   1 6 )   & &   ( f i r s t d i g   = =   5 )   & &  
             ( ( s e c o n d d i g   > =   1 )   & &   ( s e c o n d d i g   < =   5 ) ) )  
         r e t u r n   i s C r e d i t C a r d ( c c ) ;  
     r e t u r n   f a l s e ;  
  
 }  
  
 f u n c t i o n   i s A m e r i c a n E x p r e s s ( c c ) {  
     f i r s t d i g   =   c c . s u b s t r i n g ( 0 , 1 ) ;  
     s e c o n d d i g   =   c c . s u b s t r i n g ( 1 , 2 ) ;  
     i f   ( ( c c . l e n g t h   = =   1 5 )   & &   ( f i r s t d i g   = =   3 )   & &  
             ( ( s e c o n d d i g   = =   4 )   | |   ( s e c o n d d i g   = =   7 ) ) )  
         r e t u r n   i s C r e d i t C a r d ( c c ) ;  
     r e t u r n   f a l s e ;  
  
 }  
  
 f u n c t i o n   i s D i n e r s C l u b ( c c ) {  
     f i r s t d i g   =   c c . s u b s t r i n g ( 0 , 1 ) ;  
     s e c o n d d i g   =   c c . s u b s t r i n g ( 1 , 2 ) ;  
     i f   ( ( c c . l e n g t h   = =   1 4 )   & &   ( f i r s t d i g   = =   3 )   & &  
             ( ( s e c o n d d i g   = =   0 )   | |   ( s e c o n d d i g   = =   6 )   | |   ( s e c o n d d i g   = =   8 ) ) )  
         r e t u r n   i s C r e d i t C a r d ( c c ) ;  
     r e t u r n   f a l s e ;  
 }  
  
 f u n c t i o n   i s C a r t e B l a n c h e ( c c ) {  
     r e t u r n   i s D i n e r s C l u b ( c c ) ;  
 }  
  
 f u n c t i o n   i s D i s c o v e r ( c c ) {  
     f i r s t 4 d i g s   =   c c . s u b s t r i n g ( 0 , 4 ) ;  
     i f   ( ( c c . l e n g t h   = =   1 6 )   & &   ( f i r s t 4 d i g s   = =   " 6 0 1 1 " ) )  
         r e t u r n   i s C r e d i t C a r d ( c c ) ;  
     r e t u r n   f a l s e ;  
  
 }    
  
 f u n c t i o n   i s E n R o u t e ( c c ) {  
     f i r s t 4 d i g s   =   c c . s u b s t r i n g ( 0 , 4 ) ;  
     i f   ( ( c c . l e n g t h   = =   1 5 )   & &  
             ( ( f i r s t 4 d i g s   = =   " 2 0 1 4 " )   | |  
               ( f i r s t 4 d i g s   = =   " 2 1 4 9 " ) ) )  
         r e t u r n   i s C r e d i t C a r d ( c c ) ;  
     r e t u r n   f a l s e ;  
 }  
  
 f u n c t i o n   i s J C B ( c c ) {  
     f i r s t 4 d i g s   =   c c . s u b s t r i n g ( 0 , 4 ) ;  
     i f   ( ( c c . l e n g t h   = =   1 6 )   & &  
             ( ( f i r s t 4 d i g s   = =   " 3 0 8 8 " )   | |  
               ( f i r s t 4 d i g s   = =   " 3 0 9 6 " )   | |  
               ( f i r s t 4 d i g s   = =   " 3 1 1 2 " )   | |  
               ( f i r s t 4 d i g s   = =   " 3 1 5 8 " )   | |  
               ( f i r s t 4 d i g s   = =   " 3 3 3 7 " )   | |  
               ( f i r s t 4 d i g s   = =   " 3 5 2 8 " ) ) )  
         r e t u r n   i s C r e d i t C a r d ( c c ) ;  
     r e t u r n   f a l s e ;  
 }    
  
 f u n c t i o n   i s A n y C a r d ( c c ) {  
     i f   ( ! i s C r e d i t C a r d ( c c ) )  
         r e t u r n   f a l s e ;  
     i f   ( ! i s M a s t e r C a r d ( c c )   & &   ! i s V i s a ( c c )   & &   ! i s A m e r i c a n E x p r e s s ( c c )   & &   ! i s D i n e r s C l u b ( c c )   & &  
             ! i s D i s c o v e r ( c c )   & &   ! i s E n R o u t e ( c c )   & &   ! i s J C B ( c c ) )   {  
         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   i s C a r d M a t c h   ( c a r d T y p e ,   c a r d N u m b e r ) {  
 	 c a r d T y p e   =   c a r d T y p e . t o U p p e r C a s e ( ) ;  
 	 v a r   d o e s M a t c h   =   t r u e ;  
  
 	 i f   ( ( c a r d T y p e   = =   " V I S A " )   & &   ( ! i s V i s a ( c a r d N u m b e r ) ) )  
 	 	 d o e s M a t c h   =   f a l s e ;  
 	 i f   ( ( c a r d T y p e   = =   " M A S T E R C A R D " )   & &   ( ! i s M a s t e r C a r d ( c a r d N u m b e r ) ) )  
 	 	 d o e s M a t c h   =   f a l s e ;  
 	 i f   (   (   ( c a r d T y p e   = =   " A M E R I C A N E X P R E S S " )   | |   ( c a r d T y p e   = =   " A M E X " )   )  
                                 & &   ( ! i s A m e r i c a n E x p r e s s ( c a r d N u m b e r ) ) )   d o e s M a t c h   =   f a l s e ;  
 	 i f   ( ( c a r d T y p e   = =   " D I S C O V E R " )   & &   ( ! i s D i s c o v e r ( c a r d N u m b e r ) ) )  
 	 	 d o e s M a t c h   =   f a l s e ;  
 	 i f   ( ( c a r d T y p e   = =   " J C B " )   & &   ( ! i s J C B ( c a r d N u m b e r ) ) )  
 	 	 d o e s M a t c h   =   f a l s e ;  
 	 i f   ( ( c a r d T y p e   = =   " D I N E R S " )   & &   ( ! i s D i n e r s C l u b ( c a r d N u m b e r ) ) )  
 	 	 d o e s M a t c h   =   f a l s e ;  
 	 i f   ( ( c a r d T y p e   = =   " C A R T E B L A N C H E " )   & &   ( ! i s C a r t e B l a n c h e ( c a r d N u m b e r ) ) )  
 	 	 d o e s M a t c h   =   f a l s e ;  
 	 i f   ( ( c a r d T y p e   = =   " E N R O U T E " )   & &   ( ! i s E n R o u t e ( c a r d N u m b e r ) ) )  
 	 	 d o e s M a t c h   =   f a l s e ;  
 	 r e t u r n   d o e s M a t c h ;  
 }    
  
 D a t e . $ V E R S I O N   =   1 . 0 1 ;  
 D a t e . L Z   =   f u n c t i o n ( x ) { r e t u r n ( x < 0 | | x > 9 ? " " : " 0 " ) + x } ; D a t e . m o n t h N a m e s   =   n e w   A r r a y ( ' G e n n a i o ' , ' F e b b r a i o ' , ' M a r z o ' , ' A p r i l e ' , ' M a g g i o ' , ' G i u g n o ' , ' L u g l i o ' , ' A g o s t o ' , ' S e t t e m b r e ' , ' O t t o b r e ' , ' N o v e m b r e ' , ' D i c e m b r e ' ) ; D a t e . m o n t h A b b r e v i a t i o n s   =   n e w   A r r a y ( ' G e n ' , ' F e b ' , ' M a r ' , ' A p r ' , ' M a g ' , ' G i u ' , ' L u g ' , ' A g o ' , ' S e t ' , ' O t t ' , ' N o v ' , ' D i c ' ) ; D a t e . d a y N a m e s   =   n e w   A r r a y ( ' D o m ' , ' L u n ' , ' M a r ' , ' M e r ' , ' G i o ' , ' V e n ' , ' S a b ' ) ; D a t e . d a y A b b r e v i a t i o n s   =   n e w   A r r a y ( ' D o m ' , ' L u n ' , ' M a r ' , ' M e r ' , ' G i o ' , ' V e n ' , ' S a b ' ) ; D a t e . p r e f e r A m e r i c a n F o r m a t   =   t r u e ; i f ( ! D a t e . p r o t o t y p e . g e t F u l l Y e a r ) { D a t e . p r o t o t y p e . g e t F u l l Y e a r   =   f u n c t i o n ( ) { v a r   y y = t h i s . g e t Y e a r ( ) ; r e t u r n ( y y < 1 9 0 0 ? y y + 1 9 0 0 : y y ) ; } }  
 D a t e . p a r s e S t r i n g   =   f u n c t i o n ( v a l ,   f o r m a t ) { i f ( t y p e o f ( f o r m a t ) = = " u n d e f i n e d "   | |   f o r m a t = = n u l l   | |   f o r m a t = = " " ) { v a r   g e n e r a l F o r m a t s = n e w   A r r a y ( ' y - M - d ' , ' M M M   d ,   y ' , ' M M M   d , y ' , ' y - M M M - d ' , ' d - M M M - y ' , ' M M M   d ' , ' M M M - d ' , ' d - M M M ' ) ; v a r   m o n t h F i r s t = n e w   A r r a y ( ' M / d / y ' , ' M - d - y ' , ' M . d . y ' , ' M / d ' , ' M - d ' ) ; v a r   d a t e F i r s t   = n e w   A r r a y ( ' d / M / y ' , ' d - M - y ' , ' d . M . y ' , ' d / M ' , ' d - M ' ) ; v a r   c h e c k L i s t = n e w   A r r a y ( g e n e r a l F o r m a t s , D a t e . p r e f e r A m e r i c a n F o r m a t ? m o n t h F i r s t : d a t e F i r s t , D a t e . p r e f e r A m e r i c a n F o r m a t ? d a t e F i r s t : m o n t h F i r s t ) ; f o r ( v a r   i = 0 ; i < c h e c k L i s t . l e n g t h ; i + + ) { v a r   l = c h e c k L i s t [ i ] ; f o r ( v a r   j = 0 ; j < l . l e n g t h ; j + + ) { v a r   d = D a t e . p a r s e S t r i n g ( v a l , l [ j ] ) ; i f ( d ! = n u l l ) { r e t u r n   d ; } } } r e t u r n   n u l l ; }  
 t h i s . i s I n t e g e r   =   f u n c t i o n ( v a l ) { f o r ( v a r   i = 0 ; i   <   v a l . l e n g t h ; i + + ) { i f ( " 1 2 3 4 5 6 7 8 9 0 " . i n d e x O f ( v a l . c h a r A t ( i ) ) = = - 1 ) { r e t u r n   f a l s e ; } } r e t u r n   t r u e ; } ;  
 t h i s . g e t I n t   =   f u n c t i o n ( s t r , i , m i n l e n g t h , m a x l e n g t h ) { f o r ( v a r   x = m a x l e n g t h ; x > = m i n l e n g t h ; x - - ) { v a r   t o k e n = s t r . s u b s t r i n g ( i , i + x ) ; i f ( t o k e n . l e n g t h   <   m i n l e n g t h ) { r e t u r n   n u l l ; } i f ( t h i s . i s I n t e g e r ( t o k e n ) ) { r e t u r n   t o k e n ; } } r e t u r n   n u l l ; } ; v a l = v a l + " " ; f o r m a t = f o r m a t + " " ; v a r   i _ v a l = 0 ; v a r   i _ f o r m a t = 0 ; v a r   c = " " ; v a r   t o k e n = " " ; v a r   t o k e n 2 = " " ; v a r   x , y ; v a r   y e a r = n e w   D a t e ( ) . g e t F u l l Y e a r ( ) ; v a r   m o n t h = 1 ; v a r   d a t e = 1 ; v a r   h h = 0 ; v a r   m m = 0 ; v a r   s s = 0 ; v a r   a m p m = " " ; w h i l e ( i _ f o r m a t   <   f o r m a t . l e n g t h ) { c = f o r m a t . c h a r A t ( i _ f o r m a t ) ; t o k e n = " " ; w h i l e ( ( f o r m a t . c h a r A t ( i _ f o r m a t ) = = c )   & & ( i _ f o r m a t   <   f o r m a t . l e n g t h ) ) { t o k e n   + =   f o r m a t . c h a r A t ( i _ f o r m a t + + ) ; } i f ( t o k e n = = " y y y y "   | |   t o k e n = = " y y "   | |   t o k e n = = " y " ) { i f ( t o k e n = = " y y y y " ) { x = 4 ; y = 4 ; } i f ( t o k e n = = " y y " ) { x = 2 ; y = 2 ; } i f ( t o k e n = = " y " ) { x = 2 ; y = 4 ; } y e a r = t h i s . g e t I n t ( v a l , i _ v a l , x , y ) ; i f ( y e a r = = n u l l ) { r e t u r n   n u l l ; } i _ v a l   + =   y e a r . l e n g t h ; i f ( y e a r . l e n g t h = = 2 ) { i f ( y e a r   >   7 0 ) { y e a r = 1 9 0 0 + ( y e a r - 0 ) ; } e l s e { y e a r = 2 0 0 0 + ( y e a r - 0 ) ; } } } e l s e   i f ( t o k e n = = " M M M "   | |   t o k e n = = " N N N " ) { m o n t h = 0 ; v a r   n a m e s   = ( t o k e n = = " M M M " ? ( D a t e . m o n t h N a m e s . c o n c a t ( D a t e . m o n t h A b b r e v i a t i o n s ) ) : D a t e . m o n t h A b b r e v i a t i o n s ) ; f o r ( v a r   i = 0 ; i < n a m e s . l e n g t h ; i + + ) { v a r   m o n t h _ n a m e = n a m e s [ i ] ; i f ( v a l . s u b s t r i n g ( i _ v a l , i _ v a l + m o n t h _ n a m e . l e n g t h ) . t o L o w e r C a s e ( ) = = m o n t h _ n a m e . t o L o w e r C a s e ( ) ) { m o n t h = ( i % 1 2 ) + 1 ; i _ v a l   + =   m o n t h _ n a m e . l e n g t h ; b r e a k ; } } i f ( ( m o n t h   <   1 ) | | ( m o n t h > 1 2 ) ) { r e t u r n   n u l l ; } } e l s e   i f ( t o k e n = = " E E " | | t o k e n = = " E " ) { v a r   n a m e s   = ( t o k e n = = " E E " ? D a t e . d a y N a m e s : D a t e . d a y A b b r e v i a t i o n s ) ; f o r ( v a r   i = 0 ; i < n a m e s . l e n g t h ; i + + ) { v a r   d a y _ n a m e = n a m e s [ i ] ; i f ( v a l . s u b s t r i n g ( i _ v a l , i _ v a l + d a y _ n a m e . l e n g t h ) . t o L o w e r C a s e ( ) = = d a y _ n a m e . t o L o w e r C a s e ( ) ) { i _ v a l   + =   d a y _ n a m e . l e n g t h ; b r e a k ; } } } e l s e   i f ( t o k e n = = " M M " | | t o k e n = = " M " ) { m o n t h = t h i s . g e t I n t ( v a l , i _ v a l , t o k e n . l e n g t h , 2 ) ; i f ( m o n t h = = n u l l | | ( m o n t h < 1 ) | | ( m o n t h > 1 2 ) ) { r e t u r n   n u l l ; } i _ v a l + = m o n t h . l e n g t h ; } e l s e   i f ( t o k e n = = " d d " | | t o k e n = = " d " ) { d a t e = t h i s . g e t I n t ( v a l , i _ v a l , t o k e n . l e n g t h , 2 ) ; i f ( d a t e = = n u l l | | ( d a t e < 1 ) | | ( d a t e > 3 1 ) ) { r e t u r n   n u l l ; } i _ v a l + = d a t e . l e n g t h ; } e l s e   i f ( t o k e n = = " h h " | | t o k e n = = " h " ) { h h = t h i s . g e t I n t ( v a l , i _ v a l , t o k e n . l e n g t h , 2 ) ; i f ( h h = = n u l l | | ( h h < 1 ) | | ( h h > 1 2 ) ) { r e t u r n   n u l l ; } i _ v a l + = h h . l e n g t h ; } e l s e   i f ( t o k e n = = " H H " | | t o k e n = = " H " ) { h h = t h i s . g e t I n t ( v a l , i _ v a l , t o k e n . l e n g t h , 2 ) ; i f ( h h = = n u l l | | ( h h < 0 ) | | ( h h > 2 3 ) ) { r e t u r n   n u l l ; } i _ v a l + = h h . l e n g t h ; } e l s e   i f ( t o k e n = = " K K " | | t o k e n = = " K " ) { h h = t h i s . g e t I n t ( v a l , i _ v a l , t o k e n . l e n g t h , 2 ) ; i f ( h h = = n u l l | | ( h h < 0 ) | | ( h h > 1 1 ) ) { r e t u r n   n u l l ; } i _ v a l + = h h . l e n g t h ; h h + + ; } e l s e   i f ( t o k e n = = " k k " | | t o k e n = = " k " ) { h h = t h i s . g e t I n t ( v a l , i _ v a l , t o k e n . l e n g t h , 2 ) ; i f ( h h = = n u l l | | ( h h < 1 ) | | ( h h > 2 4 ) ) { r e t u r n   n u l l ; } i _ v a l + = h h . l e n g t h ; h h - - ; } e l s e   i f ( t o k e n = = " m m " | | t o k e n = = " m " ) { m m = t h i s . g e t I n t ( v a l , i _ v a l , t o k e n . l e n g t h , 2 ) ; i f ( m m = = n u l l | | ( m m < 0 ) | | ( m m > 5 9 ) ) { r e t u r n   n u l l ; } i _ v a l + = m m . l e n g t h ; } e l s e   i f ( t o k e n = = " s s " | | t o k e n = = " s " ) { s s = t h i s . g e t I n t ( v a l , i _ v a l , t o k e n . l e n g t h , 2 ) ; i f ( s s = = n u l l | | ( s s < 0 ) | | ( s s > 5 9 ) ) { r e t u r n   n u l l ; } i _ v a l + = s s . l e n g t h ; } e l s e   i f ( t o k e n = = " a " ) { i f ( v a l . s u b s t r i n g ( i _ v a l , i _ v a l + 2 ) . t o L o w e r C a s e ( ) = = " a m " ) { a m p m = " A M " ; } e l s e   i f ( v a l . s u b s t r i n g ( i _ v a l , i _ v a l + 2 ) . t o L o w e r C a s e ( ) = = " p m " ) { a m p m = " P M " ; } e l s e { r e t u r n   n u l l ; } i _ v a l + = 2 ; } e l s e { i f ( v a l . s u b s t r i n g ( i _ v a l , i _ v a l + t o k e n . l e n g t h ) ! = t o k e n ) { r e t u r n   n u l l ; } e l s e { i _ v a l + = t o k e n . l e n g t h ; } } } i f ( i _ v a l   ! =   v a l . l e n g t h ) { r e t u r n   n u l l ; } i f ( m o n t h = = 2 ) { i f (   ( ( y e a r % 4 = = 0 ) & & ( y e a r % 1 0 0   ! =   0 )   )   | | ( y e a r % 4 0 0 = = 0 )   ) { i f ( d a t e   >   2 9 ) { r e t u r n   n u l l ; } } e l s e { i f ( d a t e   >   2 8 ) { r e t u r n   n u l l ; } } } i f ( ( m o n t h = = 4 ) | | ( m o n t h = = 6 ) | | ( m o n t h = = 9 ) | | ( m o n t h = = 1 1 ) ) { i f ( d a t e   >   3 0 ) { r e t u r n   n u l l ; } } i f ( h h < 1 2   & &   a m p m = = " P M " ) { h h = h h - 0 + 1 2 ; } e l s e   i f ( h h > 1 1   & &   a m p m = = " A M " ) { h h - = 1 2 ; } r e t u r n   n e w   D a t e ( y e a r , m o n t h - 1 , d a t e , h h , m m , s s ) ; }  
 D a t e . i s V a l i d   =   f u n c t i o n ( v a l , f o r m a t ) { r e t u r n ( D a t e . p a r s e S t r i n g ( v a l , f o r m a t )   ! =   n u l l ) ; }  
 D a t e . p r o t o t y p e . i s B e f o r e   =   f u n c t i o n ( d a t e 2 ) { i f ( d a t e 2 = = n u l l ) { r e t u r n   f a l s e ; } r e t u r n ( t h i s . g e t T i m e ( ) < d a t e 2 . g e t T i m e ( ) ) ; }  
 D a t e . p r o t o t y p e . i s A f t e r   =   f u n c t i o n ( d a t e 2 ) { i f ( d a t e 2 = = n u l l ) { r e t u r n   f a l s e ; } r e t u r n ( t h i s . g e t T i m e ( ) > d a t e 2 . g e t T i m e ( ) ) ; }  
 D a t e . p r o t o t y p e . e q u a l s   =   f u n c t i o n ( d a t e 2 ) { i f ( d a t e 2 = = n u l l ) { r e t u r n   f a l s e ; } r e t u r n ( t h i s . g e t T i m e ( ) = = d a t e 2 . g e t T i m e ( ) ) ; }  
 D a t e . p r o t o t y p e . e q u a l s I g n o r e T i m e   =   f u n c t i o n ( d a t e 2 ) { i f ( d a t e 2 = = n u l l ) { r e t u r n   f a l s e ; } v a r   d 1   =   n e w   D a t e ( t h i s . g e t T i m e ( ) ) . c l e a r T i m e ( ) ; v a r   d 2   =   n e w   D a t e ( d a t e 2 . g e t T i m e ( ) ) . c l e a r T i m e ( ) ; r e t u r n ( d 1 . g e t T i m e ( ) = = d 2 . g e t T i m e ( ) ) ; }  
 D a t e . p r o t o t y p e . f o r m a t   =   f u n c t i o n ( f o r m a t ) { f o r m a t = f o r m a t + " " ; v a r   r e s u l t = " " ; v a r   i _ f o r m a t = 0 ; v a r   c = " " ; v a r   t o k e n = " " ; v a r   y = t h i s . g e t Y e a r ( ) + " " ; v a r   M = t h i s . g e t M o n t h ( ) + 1 ; v a r   d = t h i s . g e t D a t e ( ) ; v a r   E = t h i s . g e t D a y ( ) ; v a r   H = t h i s . g e t H o u r s ( ) ; v a r   m = t h i s . g e t M i n u t e s ( ) ; v a r   s = t h i s . g e t S e c o n d s ( ) ; v a r   y y y y , y y , M M M , M M , d d , h h , h , m m , s s , a m p m , H H , H , K K , K , k k , k ; v a r   v a l u e = n e w   O b j e c t ( ) ; i f ( y . l e n g t h   <   4 ) { y = " " + ( + y + 1 9 0 0 ) ; } v a l u e [ " y " ] = " " + y ; v a l u e [ " y y y y " ] = y ; v a l u e [ " y y " ] = y . s u b s t r i n g ( 2 , 4 ) ; v a l u e [ " M " ] = M ; v a l u e [ " M M " ] = D a t e . L Z ( M ) ; v a l u e [ " M M M " ] = D a t e . m o n t h N a m e s [ M - 1 ] ; v a l u e [ " N N N " ] = D a t e . m o n t h A b b r e v i a t i o n s [ M - 1 ] ; v a l u e [ " d " ] = d ; v a l u e [ " d d " ] = D a t e . L Z ( d ) ; v a l u e [ " E " ] = D a t e . d a y A b b r e v i a t i o n s [ E ] ; v a l u e [ " E E " ] = D a t e . d a y N a m e s [ E ] ; v a l u e [ " H " ] = H ; v a l u e [ " H H " ] = D a t e . L Z ( H ) ; i f ( H = = 0 ) { v a l u e [ " h " ] = 1 2 ; } e l s e   i f ( H > 1 2 ) { v a l u e [ " h " ] = H - 1 2 ; } e l s e { v a l u e [ " h " ] = H ; } v a l u e [ " h h " ] = D a t e . L Z ( v a l u e [ " h " ] ) ; v a l u e [ " K " ] = v a l u e [ " h " ] - 1 ; v a l u e [ " k " ] = v a l u e [ " H " ] + 1 ; v a l u e [ " K K " ] = D a t e . L Z ( v a l u e [ " K " ] ) ; v a l u e [ " k k " ] = D a t e . L Z ( v a l u e [ " k " ] ) ; i f ( H   >   1 1 ) { v a l u e [ " a " ] = " P M " ; } e l s e { v a l u e [ " a " ] = " A M " ; } v a l u e [ " m " ] = m ; v a l u e [ " m m " ] = D a t e . L Z ( m ) ; v a l u e [ " s " ] = s ; v a l u e [ " s s " ] = D a t e . L Z ( s ) ; w h i l e ( i _ f o r m a t   <   f o r m a t . l e n g t h ) { c = f o r m a t . c h a r A t ( i _ f o r m a t ) ; t o k e n = " " ; w h i l e ( ( f o r m a t . c h a r A t ( i _ f o r m a t ) = = c )   & & ( i _ f o r m a t   <   f o r m a t . l e n g t h ) ) { t o k e n   + =   f o r m a t . c h a r A t ( i _ f o r m a t + + ) ; } i f ( v a l u e [ t o k e n ]   ! =   n u l l ) { r e s u l t = r e s u l t   +   v a l u e [ t o k e n ] ; } e l s e { r e s u l t = r e s u l t   +   t o k e n ; } } r e t u r n   r e s u l t ; }  
 D a t e . p r o t o t y p e . g e t D a y N a m e   =   f u n c t i o n ( ) { r e t u r n   D a t e . d a y N a m e s [ t h i s . g e t D a y ( ) ] ; }  
 D a t e . p r o t o t y p e . g e t D a y A b b r e v i a t i o n   =   f u n c t i o n ( ) { r e t u r n   D a t e . d a y A b b r e v i a t i o n s [ t h i s . g e t D a y ( ) ] ; }  
 D a t e . p r o t o t y p e . g e t M o n t h N a m e   =   f u n c t i o n ( ) { r e t u r n   D a t e . m o n t h N a m e s [ t h i s . g e t M o n t h ( ) ] ; }  
 D a t e . p r o t o t y p e . g e t M o n t h A b b r e v i a t i o n   =   f u n c t i o n ( ) { r e t u r n   D a t e . m o n t h A b b r e v i a t i o n s [ t h i s . g e t M o n t h ( ) ] ; }  
 D a t e . p r o t o t y p e . c l e a r T i m e   =   f u n c t i o n ( ) { t h i s . s e t H o u r s ( 0 ) ; t h i s . s e t M i n u t e s ( 0 ) ; t h i s . s e t S e c o n d s ( 0 ) ; t h i s . s e t M i l l i s e c o n d s ( 0 ) ;  
 r e t u r n   t h i s ; }  
 D a t e . p r o t o t y p e . a d d   =   f u n c t i o n ( i n t e r v a l ,   n u m b e r ) { i f ( t y p e o f ( i n t e r v a l ) = = " u n d e f i n e d "   | |   i n t e r v a l = = n u l l   | |   t y p e o f ( n u m b e r ) = = " u n d e f i n e d "   | |   n u m b e r = = n u l l ) {  
 r e t u r n   t h i s ; } n u m b e r   =   + n u m b e r ; i f ( i n t e r v a l = = ' y ' ) { t h i s . s e t F u l l Y e a r ( t h i s . g e t F u l l Y e a r ( ) + n u m b e r ) ; } e l s e   i f ( i n t e r v a l = = ' M ' ) { t h i s . s e t M o n t h ( t h i s . g e t M o n t h ( ) + n u m b e r ) ; } e l s e   i f ( i n t e r v a l = = ' d ' ) { t h i s . s e t D a t e ( t h i s . g e t D a t e ( ) + n u m b e r ) ; } e l s e   i f ( i n t e r v a l = = ' w ' ) { v a r   s t e p   = ( n u m b e r > 0 ) ? 1 : - 1 ; w h i l e ( n u m b e r ! = 0 ) { t h i s . a d d ( ' d ' , s t e p ) ; w h i l e ( t h i s . g e t D a y ( ) = = 0   | |   t h i s . g e t D a y ( ) = = 6 ) { t h i s . a d d ( ' d ' , s t e p ) ; } n u m b e r   - =   s t e p ; } } e l s e   i f ( i n t e r v a l = = ' h ' ) { t h i s . s e t H o u r s ( t h i s . g e t H o u r s ( )   +   n u m b e r ) ; } e l s e   i f ( i n t e r v a l = = ' m ' ) { t h i s . s e t M i n u t e s ( t h i s . g e t M i n u t e s ( )   +   n u m b e r ) ; } e l s e   i f ( i n t e r v a l = = ' s ' ) { t h i s . s e t S e c o n d s ( t h i s . g e t S e c o n d s ( )   +   n u m b e r ) ; }  
 r e t u r n   t h i s ; }  
  
 f u n c t i o n   C h a n g e C a l e n d e r M o n t h ( o , r , i x ) {  
 	 C h a n g e C a l e n d e r ( o , r , i x )  
 	 / / R e f r e s h P o p u p ( )  
 }  
  
 f u n c t i o n   p a r s e C u r r e n c y ( a m o u n t ) {  
 	 v a r   d e l i m i t e r   =   " , " ;   / /   r e p l a c e   c o m m a   i f   d e s i r e d  
 	 v a r   a   =   a m o u n t . s p l i t ( ' . ' , 2 )  
 	 v a r   d   =   a [ 1 ] ;  
 	 v a r   i   =   p a r s e I n t ( a [ 0 ] ) ;  
 	 i f ( i s N a N ( i ) )   {   r e t u r n   ' ' ;   }  
 	 v a r   m i n u s   =   ' ' ;  
 	 i f ( i   <   0 )   {   m i n u s   =   ' - ' ;   }  
 	 i   =   M a t h . a b s ( i ) ;  
 	 v a r   n   =   n e w   S t r i n g ( i ) ;  
 	 v a r   a   =   [ ] ;  
 	 w h i l e ( n . l e n g t h   >   3 )  
 	 {  
 	 	 v a r   n n   =   n . s u b s t r ( n . l e n g t h - 3 ) ;  
 	 	 a . u n s h i f t ( n n ) ;  
 	 	 n   =   n . s u b s t r ( 0 , n . l e n g t h - 3 ) ;  
 	 }  
 	 i f ( n . l e n g t h   >   0 )   {   a . u n s h i f t ( n ) ;   }  
 	 n   =   a . j o i n ( d e l i m i t e r ) ;  
 	 i f ( d . l e n g t h   <   1 )   {   a m o u n t   =   n ;   }  
 	 e l s e   {   a m o u n t   =   n   +   ' . '   +   d ;   }  
 	 a m o u n t   =   m i n u s   +   a m o u n t ;  
 	 r e t u r n   a m o u n t ;  
 }  
  
  
 / / F a r e S h o p p e r  
  
 / *   c o m m e n t   o n   2 7 0 6 2 0 0 7  
 	 f u n c t i o n   V a l i d F a r e S h o p p e r D a t e ( ) {  
 	 	 S t a t u s   =     t r u e ;  
 	 	 v a r   o 1   =   ' c t r H o m e _ c t r F l i g h t A v a i l a b i l i t y B a s e _ c t r F a r e S h o p p e r M o n t h B a s e _ c t r F a r e S h o p p e r M o n t h O u t b o u n d _ c t r T i k A e r o F a r e S h o p p e r M o n t h '  
 	 	 v a r   o 2   =   ' c t r H o m e _ c t r F l i g h t A v a i l a b i l i t y B a s e _ c t r F a r e S h o p p e r M o n t h B a s e _ c t r F a r e S h o p p e r M o n t h I n b o u n d _ c t r T i k A e r o F a r e S h o p p e r M o n t h '  
 	 	 i f   ( D a y s D i f f ( G e t C a l e n d e r D a t e ( o 2 ) , G e t C a l e n d e r D a t e ( o 1 ) )   <   0 ) {  
 	 	 	 a l e r t ( ' P l e a s e   c h e c k   y o u r   D a t e   f r o m   !   I t   h a s   t o   b e   e q u a l   t o   o r   h i g h e r   t h a n   t h e   T o   D a t e ' )  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 	 }  
 	 }  
 * /  
  
 f u n c t i o n   V a l i d F a r e S h o p p e r D a t e ( ) {  
     v a r   s t r R e t u r n   =   ' c t r H o m e _ c t r F l i g h t A v a i l a b i l i t y B a s e _ c t r F a r e S h o p p e r M o n t h B a s e _ c t r F a r e S h o p p e r M o n t h I n b o u n d _ c t r T i k A e r o F a r e S h o p p e r M o n t h _ c a l e n d e r '  
     v a r   o R e t u r n F i g h 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 r R e t u r n )  
     i f   ( o R e t u r n F i g h t   ! =   n u l l )  
     {  
 	 	 v a r   o 1   =   ' c t r H o m e _ c t r F l i g h t A v a i l a b i l i t y B a s e _ c t r F a r e S h o p p e r M o n t h B a s e _ c t r F a r e S h o p p e r M o n t h O u t b o u n d _ c t r T i k A e r o F a r e S h o p p e r M o n t h '  
 	 	 v a r   o 2   =   ' c t r H o m e _ c t r F l i g h t A v a i l a b i l i t y B a s e _ c t r F a r e S h o p p e r M o n t h B a s e _ c t r F a r e S h o p p e r M o n t h I n b o u n d _ c t r T i k A e r o F a r e S h o p p e r M o n t h '  
 	 	 i f   ( D a y s D i f f ( G e t C a l e n d e r D a t e ( o 2 ) , G e t C a l e n d e r D a t e ( o 1 ) )   <   0 ) {  
 	 	 	 a l e r t ( ' P l e a s e   c h e c k   y o u r   D a t e   f r o m   !   I t   h a s   t o   b e   e q u a l   t o   o r   h i g h e r   t h a n   t h e   T o   D a t e ' )  
 	 	 	 / / r e t u r n   f a l s e  
 	 	 	 S t a t u s   =     f a l s e ;  
 	 }  
     }  
 }  
  
 f u n c t i o n   S h o w H i d e B u t t o n ( o ) {  
 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o   +   ' _ b t m S e a r c h f ' )   ! =   n u l l   ) { 	 	 	 	 	 	 	 	 	 	 	 	  
 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o   +   ' _ t b o P r o m o t i o n C o d 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 ( o   +   ' _ b t m S e a r c h f ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 }  
 	 	 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 ( o   +   ' _ b t m S e a r c h f ' ) . s t y l e . v i s i b i l i t y   =   " h i d d 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 ( o   +   ' _ b t m S e a r c h l f ' )   ! =   n u l l   ) {  
 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o   +   ' _ t b o P r o m o t i o n C o d 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 ( o   +   ' _ b t m S e a r c h l f ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 }  
 	 	 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 ( o   +   ' _ b t m S e a r c h l f ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 }  
 	 }  
 }  
  
 f u n c t i o n   I n p u t L i m i t ( o ) {  
 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 / /   C o n t a c t   D e t a i l  
 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	 / / - - >   F i r s t   N a m e  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 9 ,   o . l e n g t h )   = =   ' f i r s t n a m 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 ( o ) . v a l u e . l e n g t h   >   3 0 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' F i r s t N a m e _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 3 0 ) ;  
 	 	 } 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 ( ' F i r s t N a m e _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 } 	  
 	 / / - - >   S u r n a m e  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 8 ,   o . l e n g t h )   = =   ' l a s t n a m 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 ( o ) . v a l u e . l e n g t h   >   3 0 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' S u r n a m e _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 3 0 ) ;  
 	 	 } 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 ( ' S u r n a m e _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 }  
 	 / / - - >   M o b i l e   N o  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 1 2 ,   o . l e n g t h )   = =   ' p h o n e _ m o b i l 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 ( o ) . v a l u e . l e n g t h   >   6 0 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' M o b i l e N o _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 6 0 ) ;  
 	 	 } 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 o b i l e N o _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 } 	  
 	 / / - - >   H o m e   N o  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 1 0 ,   o . l e n g t h )   = =   ' p h o n e _ h o m 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 ( o ) . v a l u e . l e n g t h   >   6 0 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' H o m e N o _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 6 0 ) ;  
 	 	 } 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 ( ' H o m e N o _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 }  
 	 / / - - >   B u s i n e s s   N o  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 1 4 ,   o . l e n g t h )   = =   ' p h o n e _ b u s i n e s 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 ( o ) . v a l u e . l e n g t h   >   6 0 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' B u s i n e s s N o _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 6 0 ) ;  
 	 	 } 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 ( ' B u s i n e s s N o _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 }  
 	 / / - - >   E m a i l  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 1 3 ,   o . l e n g t h )   = =   ' c o n t a c t _ e m a i l ' ) {  
 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o ) . v a l u e . l e n g t h   >   6 0 ) {  
 	 	 	 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 _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 6 0 ) ;  
 	 	 } 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 ( ' E m a i l _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 }  
 	 / / - - >   A d d r e s s   1  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 1 3 ,   o . l e n g t h )   = =   ' a d d r e s s _ l i n e 1 ' ) {  
 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o ) . v a l u e . l e n g t h   >   6 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 1 _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 6 0 ) ;  
 	 	 } 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 ( ' A d d r e s s 1 _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 } 	  
 	 / / - - >   A d d r e s s   2  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 1 3 ,   o . l e n g t h )   = =   ' a d d r e s s _ l i n e 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 ( o ) . v a l u e . l e n g t h   >   6 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 2 _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 6 0 ) ;  
 	 	 } 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 ( ' A d d r e s s 2 _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 }  
 	 / / - - >   T o w n / C i t y  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 4 ,   o . l e n g t h )   = =   ' c i t y ' ) {  
 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o ) . v a l u e . l e n g t h   >   2 5 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' T o w n C i t y _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 2 5 ) ;  
 	 	 } 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 o w n C i t y _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 }  
 	 / / - - >   C o u n t y  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 8 ,   o . l e n g t h )   = =   ' p r o v i n c 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 ( o ) . v a l u e . l e n g t h   >   2 5 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' C o u n t y _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 2 5 ) ;  
 	 	 } 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 o u n t y _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 }  
 	 / / - - >   P o s t a l   C o d e  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 8 ,   o . l e n g t h )   = =   ' z i p _ c o d 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 ( o ) . v a l u e . l e n g t h   >   2 0 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' P o s t a l C o d e _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 2 0 ) ;  
 	 	 } 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 ( ' P o s t a l C o d e _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 }  
 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 / /   F o r m   o f   P a y m e n t  
 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 	 / / - - >   N a m e   O n   C a r d  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 1 3 ,   o . l e n g t h )   = =   ' t b o N a m e O n C a r d ' ) {  
 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o ) . v a l u e . l e n g t h   >   3 0 ) {  
 	 	 	 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 O n C a r d _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 3 0 ) ;  
 	 	 } 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 ( ' N a m e O n C a r d _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 }  
 	 }  
 	 / / - - >   I s s u e   N u m b e r  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 1 4 ,   o . l e n g t h )   = =   ' t b o I s s u e N u m b e 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 ( o ) . v a l u e . l e n g t h   >   1 0 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' I s s u e N u m b e r _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 1 0 ) ;  
 	 	 } 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 ( ' I s s u e N u m b e r _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 }  
 	 / / - - >   C r e d i t   C a r d   N u m b e r 	  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 1 7 ,   o . l e n g t h )   = =   ' t b o D o c u m e n t N u m b e r ' ) {  
 	 	 v a r   e r r o r T x t   =   ' & n b s p ;   T i p o l o g i a   d i   c a r t a   o   n u m e r o   n o n   v a l i d i ' ;  
 	 	 v a r   e r r o r M s g   =   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 N u m b e r _ E r r o r M s g ' ) ;  
 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o ) . v a l u e . l e n g t h   >   6 ) {  
 	 	 	 v a r   c a r d T y p e   =   C h e c k C a r d T y p e ( d o c u m e n t . g e t E l e m e n t B y I d ( o ) . v a l u e ) ;  
 	 	 	 v a r   i A  
 	 	 	 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 t r B o o k i n g _ c t r B o o k i n g S u m m e r y _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c b m F o r m O f P a y m e n t S u b t y p e ' )   ! =   n u l l ) {  
 	 	 	 	 i A   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' c t r B o o k i n g _ c t r B o o k i n g S u m m e r y _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . 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 ( ' c t r B o o k i n g _ c t r B o o k i n g S u m m e r y _ C t r P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . s e l e c t e d I n d e x ] . v a l u e . s p l i t ( ' | ' )  
 	 	 	 } e l s e {  
 	 	 	 	 i A   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' c t r B o o k i n g _ c t r P a s s e n g e r I n f o s B a s e _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . 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 ( ' c t r B o o k i n g _ c t r P a s s e n g e r I n f o s B a s e _ C t l P a y m e n t s B a s e _ C t l P a y m e n t C r e d i t C a r d _ c b m F o r m O f P a y m e n t S u b t y p e ' ) . s e l e c t e d I n d e x ] . v a l u e . s p l i t ( ' | ' )  
 	 	 	 } 	 	 	  
 	 	 	 v a r   m i   =   1 5 ;  
 	 	 	 v a r   m a   =   1 9 ;  
 	 	 	 i f   ( i A . l e n g t h   >   0   ) {  
 	 	 	 	 i f ( i A [ 0 ]   = =   ' A M E X ' ) {  
 	 	 	 	 	 i f ( c a r d T y p e   = = ' A M E X ' ) {  
 	 	 	 	 	 	 m i   =   1 5 ;  
 	 	 	 	 	 	 m a   =   1 5 ;  
 	 	 	 	 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o ) . v a l u e . l e n g t h   >   m a ) {  
 	 	 	 	 	 	 	 e r r o r M s g . i n n e r H T M L   =   " & n b s p ;   m a x   "   + m a +   "   c h a r a c t e r s " ;  
 	 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 	 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , m a ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 e l s e {  
 	 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e {  
 	 	 	 	 	 	 e r r o r M s g . i n n e r H T M L   =   e r r o r T x t ;  
 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 	 e l s e   	 i f ( i A [ 0 ]   = =   ' E L E C T R O N ' ) {  
 	 	 	 	 	 i f ( c a r d T y p e   = = ' V I S A D R U K '   | |   c a r d T y p e   = = ' V I S A E L U K ' ) {  
 	 	 	 	 	 	 m i   =   1 6 ;  
 	 	 	 	 	 	 m a   =   1 9 ;  
 	 	 	 	 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o ) . v a l u e . l e n g t h   >   m a ) {  
 	 	 	 	 	 	 	 e r r o r M s g . i n n e r H T M L   =   " & n b s p ;   m a x   "   + m a +   "   c h a r a c t e r s " ;  
 	 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 	 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , m a ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 e l s e {  
 	 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e {  
 	 	 	 	 	 	 e r r o r M s g . i n n e r H T M L   =   e r r o r T x t ;  
 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 	 e l s e   	 i f ( i A [ 0 ]   = =   ' M A E S T R O ' ) {  
 	 	 	 	 	 i f ( c a r d T y p e   = = ' M A E S T R O '   | |   c a r d T y p e   = = ' M A E S T R O U K '   | |   c a r d T y p e   = = ' S O L O ' ) {  
 	 	 	 	 	 	 m i   =   1 6 ; 	  
 	 	 	 	 	 	 m a   =   1 9 ;  
 	 	 	 	 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o ) . v a l u e . l e n g t h   >   m a ) {  
 	 	 	 	 	 	 	 e r r o r M s g . i n n e r H T M L   =   " & n b s p ;   m a x   "   + m a +   "   c h a r a c t e r s " ;  
 	 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 	 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , m a ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 e l s e {  
 	 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e {  
 	 	 	 	 	 	 e r r o r M s g . i n n e r H T M L   =   e r r o r T x t ;  
 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 	 e l s e   	 i f ( i A [ 0 ]   = =   ' M C ' ) {  
 	 	 	 	 	 i f ( c a r d T y p e   = = ' M C '   | |   c a r d T y p e   = = ' V I S A D R U K '   | |   c a r d T y p e   = = ' V I S A E L U K '   | |   c a r d T y p e   = = ' V I S A P U '   | |   c a r d T y p e   = = ' V I S A P U ' ) {  
 	 	 	 	 	 	 m i   =   1 6 ;  
 	 	 	 	 	 	 m a   =   1 6 ;  
 	 	 	 	 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o ) . v a l u e . l e n g t h   >   m a ) {  
 	 	 	 	 	 	 	 e r r o r M s g . i n n e r H T M L   =   " & n b s p ;   m a x   "   + m a +   "   c h a r a c t e r s " ;  
 	 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 	 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , m a ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 e l s e {  
 	 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e {  
 	 	 	 	 	 	 e r r o r M s g . i n n e r H T M L   =   e r r o r T x t ;  
 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 	 e l s e   i f ( i A [ 0 ]   = =   ' V I S A ' ) {  
 	 	 	 	 	 i f ( c a r d T y p e   = = ' V I S A '   | |   c a r d T y p e   = = ' V I S A D R U K '   | |   c a r d T y p e   = = ' V I S A E L U K '   | |   c a r d T y p e   = = ' V I S A P U '   | |   c a r d T y p e   = = ' V I S A P U ' ) {  
 	 	 	 	 	 	 m i   =   1 6 ;  
 	 	 	 	 	 	 m a   =   1 9 ;  
 	 	 	 	 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o ) . v a l u e . l e n g t h   >   m a ) {  
 	 	 	 	 	 	 	 e r r o r M s g . i n n e r H T M L   =   " & n b s p ;   m a x   "   + m a +   "   c h a r a c t e r s " ;  
 	 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 	 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , m a ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 	 e l s e {  
 	 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 	 e l s e {  
 	 	 	 	 	 	 e r r o r M s g . i n n e r H T M L   =   e r r o r T x t ;  
 	 	 	 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	 }  
 	 	 }  
 	 	 e l s e {  
 	 	 	 e r r o r M s g . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 }  
 	 } 	  
 	 / / - - >   A d d r e s s   1  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 9 ,   o . l e n g t h )   = =   ' t b o S t r e e t ' ) {  
 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o ) . v a l u e . l e n g t h   >   6 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 1 _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 6 0 ) ;  
 	 	 } 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 ( ' A d d r e s s 1 _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 }  
 	 / / - - >   A d d r e s s   2  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 9 ,   o . l e n g t h )   = =   ' t b o S t r e e t 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 ( o ) . v a l u e . l e n g t h   >   6 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 2 _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 6 0 ) ;  
 	 	 } 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 ( ' A d d r e s s 2 _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 } 	  
 	 / / - - >   T o w n / C i t y  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 7 ,   o . l e n g t h )   = =   ' t b o C i t y ' ) {  
 	 	 i f ( d o c u m e n t . g e t E l e m e n t B y I d ( o ) . v a l u e . l e n g t h   >   2 5 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' T o w n C i t y _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 2 5 ) ;  
 	 	 } 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 o w n C i t y _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 }  
 	 / / - - >   C o u n t y  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 8 ,   o . l e n g t h )   = =   ' t b o S t a t 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 ( o ) . v a l u e . l e n g t h   >   2 5 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' C o u n t y _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 2 5 ) ;  
 	 	 } 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 o u n t y _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 } 	  
 	 }  
 	 / / - - >   P o s t a l   C o d e  
 	 i f ( o . s u b s t r i n g ( o . l e n g t h - 1 0 ,   o . l e n g t h )   = =   ' t b o Z i p C o d 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 ( o ) . v a l u e . l e n g t h   >   2 0 ) {  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' P o s t a l C o d e _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " " ;  
 	 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( o ) . 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 ( o ) . v a l u e . s u b s t r i n g ( 0 , 2 0 ) ;  
 	 	 } 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 ( ' P o s t a l C o d e _ E r r o r M s g ' ) . s t y l e . v i s i b i l i t y   =   " h i d d e n " ;  
 	 	 }  
 	 }  
 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 }  
  
 f u n c t i o n   C o n f i r m C a n c e l F l i g h t _ R e f u n d ( ) {  
 	 r e t u r n   c o n f i r m ( ' S e i   s i c u r o   d i   v o l e r   p r o c e d e r e   c o n   l a   c a n c e l l a z i o n e ? \ n P r i m a   d i   p r o s e g u i r e   t i   i n v i t i a m o   a   c o n s u l t a r e   l a   s e z i o n e    c l a s s i   e   r e g o l e   t a r i f f a r i e  . \ n T i   r i c o r d i a m o   c h e   i l   r i m b o r s o   n o n   p u ?   e s s e r e   e f f e t t u a t o   o n l i n e ,   p e r   m a g g i o r i   d e t t a g l i   i n v i a   l a   r i c h i e s t a   a l l  i n d i r i z z o   a @ a . i t . ' ) ;  
 }  
 f u n c t i o n   C o n f i r m C a n c e l F l i g h t _ N o n e R e f u n d ( ) {  
 	 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 a n t   t o   c a n c e l   t h i s   f l i g h t ? ' ) ;  
 }  
 f u n c t i o n   H i d e S e l e c t F l i g h t C h a n g e ( o )  
 {  
         v a r   c t l S u b m i t   =   d o c u m e n t . g e t E l e m e n t B y I d ( o   +   ' _ b t m S u b m i t F l i g h t S e l e c t ' ) ;  
         i f   ( c t l S u b m i t   ! =   n u l l )  
         {  
                 c t l S u b m i t . s t y l e . v i s i b i l i t y = ' h i d d e n ' ;  
         }  
 }  
  
 f u n c t i o n   g e t D y n a m i c C u r r e n c y ( ) {  
 	 v a r   o b j S p a n D y n a m i c C u r r e n c y   =   d o c u m e n t . g e t E l e m e n t B y I d ( " c t r B o o k i n g _ c t r P a s s e n g e r I n f o s B a s e _ c t l B o o k i n g I n f o _ L a b D y n a m i c C u r r e n c y " ) ;  
 	 v a r   C u r r e n c y   =   " " ;  
 	 i f   ( o b j S p a n D y n a m i c C u r r e n c y   ! =   n u l l )  
 	 {  
 	 	 C u r r e n c y   =   o b j S p a n D y n a m i c C u r r e n c y . i n n e r H T M L ;  
 	 }  
 	 r e t u r n   C u r r e n c y ;  
 }  
 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
 f u n c t i o n   C h e c k A l l P a x ( o 1 ,   o 2 )   {  
         v a r   M a x A l l P a x   =   5 ;  
         v a r   s u f f i x A d u l t   =   " A d u l t " ;  
         v a r   s u f f i x A d u l t s   =   " A d u l t s " ;  
         v a r   s u f f i x C h i l d   =   " C h i l d " ;  
         v a r   s u f f i x C h i l d r e n   =   " C h i l d r e n " ;  
         v a r   s u f f i x   =   " " ;  
  
         v a r   o b j O 1   =   d o c u m e n t . g e t E l e m e n t B y I d ( o 1 ) ;  
         v a r   o b j O 2   =   d o c u m e n t . g e t E l e m e n t B y I d ( o 2 ) ;  
  
         v a r   o b j O 1 S e l e c t e d I n d e x   =   o b j O 1 . s e l e c t e d I n d e x ;  
         v a r   o b j O 2 S e l e c t e d I n d e x   =   o b j O 2 . s e l e c t e d I n d e x ;  
  
         v a r   s e l e c t e d B o x V a l u e   =   p a r s e I n t ( o b j O 1 . v a l u e ) ;  
         v a r   c o m p a r e d B o x V a l u e   =   p a r s e I n t ( o b j O 2 . v a l u e ) ;  
  
         v a r   d i f V a l u e   =   M a x A l l P a x   -   s e l e c t e d B o x V a l u e ;  
  
         v a r   m o r e V a l u e   =   M a x A l l P a x   -   ( s e l e c t e d B o x V a l u e   +   c o m p a r e d B o x V a l u e ) ;  
  
         / /   C l e a r   S e l e c t e d   b o x  
         o b j O 1 . o p t i o n s . l e n g t h   =   0 ;  
  
         / /   C l e a r   f u l l f i l l   b o x  
         o b j O 2 . o p t i o n s . l e n g t h   =   0 ;  
  
         i f   ( o b j O 1 . i d . i n d e x O f ( " C h i l d " )   ! =   - 1 )   {  
                 v a r   n e w O p t i o n   =   d o c u m e n t . c r e a t e E l e m e n t ( ' o p t i o n ' ) ;  
                 n e w O p t i o n . t e x t   =   s u f f i x C h i l d r e n ;  
                 n e w O p t i o n . v a l u e   =   0 ;  
                 t r y   {  
                         o b j O 1 . a d d ( n e w O p t i o n ,   n u l l ) ;   / /   s t a n d a r d s   c o m p l i a n t ;   d o e s n ' t   w o r k   i n   I E  
                 }  
                 c a t c h   ( e x )   {  
                         o b j O 1 . a d d ( n e w O p t i o n ) ;   / /   I E   o n l y  
                 }  
         }  
  
         i f   ( o b j O 2 . i d . i n d e x O f ( " C h i l d " )   ! =   - 1 )   {  
                 v a r   n e w O p t i o n   =   d o c u m e n t . c r e a t e E l e m e n t ( ' o p t i o n ' ) ;  
                 n e w O p t i o n . t e x t   =   s u f f i x C h i l d r e n ;  
                 n e w O p t i o n . v a l u e   =   0 ;  
                 t r y   {  
                         o b j O 2 . a d d ( n e w O p t i o n ,   n u l l ) ;   / /   s t a n d a r d s   c o m p l i a n t ;   d o e s n ' t   w o r k   i n   I E  
                 }  
                 c a t c h   ( e x )   {  
                         o b j O 2 . a d d ( n e w O p t i o n ) ;   / /   I E   o n l y  
                 }  
         }  
  
         / /   A d d   O 2   O p t i o n  
         f o r   ( v a r   i   =   1 ;   i   < =   d i f V a l u e ;   i + + )   {  
                 s u f f i x   =   " " ;  
                 v a r   n e w O p t i o n   =   d o c u m e n t . c r e a t e E l e m e n t ( ' o p t i o n ' ) ;  
                 i f   ( o b j O 2 . i d . i n d e x O f ( " C h i l d " )   ! =   - 1 )   {  
                         i f   ( i   = =   1 )   {  
                                 s u f f i x   =   s u f f i x C h i l d ;  
                         }  
                         e l s e   {  
                                 s u f f i x   =   s u f f i x C h i l d r e n ;  
                         }  
                 }  
                 e l s e   {  
                         i f   ( i   = =   1 )   {  
                                 s u f f i x   =   s u f f i x A d u l t ;  
                         }  
                         e l s e   {  
                                 s u f f i x   =   s u f f i x A d u l t s ;  
                         }  
                 }  
                 i f   ( i   = =   0 )   {  
                         n e w O p t i o n . t e x t   =   s u f f i x ;  
                 }  
                 e l s e   {  
                         n e w O p t i o n . t e x t   =   i   +   "   "   +   s u f f i x ;  
                 }  
                 n e w O p t i o n . v a l u e   =   i ;  
                 t r y   {  
                         o b j O 2 . a d d ( n e w O p t i o n ,   n u l l ) ;   / /   s t a n d a r d s   c o m p l i a n t ;   d o e s n ' t   w o r k   i n   I E  
                 }  
                 c a t c h   ( e x )   {  
                         o b j O 2 . a d d ( n e w O p t i o n ) ;   / /   I E   o n l y  
                 }  
         }  
  
         / /   A d d   O 1   O p t i o n  
         f o r   ( v a r   j   =   1 ;   j   < =   s e l e c t e d B o x V a l u e   +   m o r e V a l u e ;   j + + )   {  
                 s u f f i x   =   " " ;  
                 v a r   n e w O p t i o n   =   d o c u m e n t . c r e a t e E l e m e n t ( ' o p t i o n ' ) ;  
                 i f   ( o b j O 1 . i d . i n d e x O f ( " C h i l d " )   ! =   - 1 )   {  
                         i f   ( j   = =   1 )   {  
                                 s u f f i x   =   s u f f i x C h i l d ;  
                         }  
                         e l s e   {  
                                 s u f f i x   =   s u f f i x C h i l d r e n ;  
                         }  
                 }  
                 e l s e   {  
                         i f   ( j   = =   1 )   {  
                                 s u f f i x   =   s u f f i x A d u l t ;  
                         }  
                         e l s e   {  
                                 s u f f i x   =   s u f f i x A d u l t s ;  
                         }  
                 }  
                 i f   ( j   = =   0 )   {  
                         n e w O p t i o n . t e x t   =   s u f f i x ;  
                 }  
                 e l s e   {  
                         n e w O p t i o n . t e x t   =   j   +   "   "   +   s u f f i x ;  
                 }  
                 n e w O p t i o n . v a l u e   =   j ;  
                 t r y   {  
                         o b j O 1 . a d d ( n e w O p t i o n ,   n u l l ) ;   / /   s t a n d a r d s   c o m p l i a n t ;   d o e s n ' t   w o r k   i n   I E  
                 }  
                 c a t c h   ( e x )   {  
                         o b j O 1 . a d d ( n e w O p t i o n ) ;   / /   I E   o n l y  
                 }  
         }  
  
         o b j O 2 . s e l e c t e d I n d e x   =   o b j O 2 S e l e c t e d I n d e x ;  
         o b j O 1 . s e l e c t e d I n d e x   =   o b j O 1 S e l e c t e d I n d e x ;  
 } 
