ÿþ/ * * * * * 
   *   C o p y r i g h t   ©   F A S T B O O K I N G     1 9 9 9 - 2 0 0 6 
   *   2 6 / 0 7 / 2 0 0 6 
 * / 
 
 v a r   F B R E S A   =   " h t t p : / / w w w . f a s t b o o k i n g s . b i z / D I R E C T O R Y / " ; 
 
 
 / /   F o r m :   s h o w   a r r i v a l   d a t e 
 / /   t h i s   f u n c t i o n   t o   r e p l a c e   t h e   t r a d i t i o n a l   s t a r t   f u n c t i o n 
 / /   i n   t h i s   c a s e   n o   u p d a t e   i s   r e q u i r e d   e v e r y   y e a r . 
 
 f u n c t i o n   s t a r t ( )   { 
 v a r   n b m   =   [   3 1 ,   2 8 ,   3 1 ,   3 0 ,   3 1 ,   3 0 ,   3 1 ,   3 1 ,   3 0 ,   3 1 ,   3 0 ,   3 1   ] ; 
 j o u r   =   1 ; 
 	 
 b u i l d _ y e a r _ s e l e c t ( ) ; 
 
 M D   =   n e w   D a t e ( ) ; 
 	 
 n d a y   =   M D . g e t D a t e ( ) ; 
 a d a y   =   M D . g e t D a y ( ) ; 
 a m o i s   =   M D . g e t M o n t h ( ) ; 
 a y e a r   =   t a k e Y e a r ( M D ) ; 
 c u r _ y e a r   =   a y e a r ; 
 	 	 
 n d a y   + =   j o u r ; 
 
 i f ( n d a y   >   n b m [ a m o i s ] ) 
 {       	 	 
 	 n d a y   - =   n b m [ a m o i s ] ; 
 	 a m o i s + + ; 
 	 i f ( a m o i s   >   1 1 )   {   
 	 	 a y e a r + + ; 
 	 	 a m o i s   =   0 ; 
 	 }   
 } 
 	 
 i n d e x D a y   =   n d a y   -   1 ; 
 i n d e x M o i s   =   a m o i s ; 
 i n d e x Y e a r   =   a y e a r   -   c u r _ y e a r ; 
 	 
 i f ( i n d e x D a y   <   0   | |   i n d e x D a y   >   3 0 ) 
 	 i n d e x D a y   =   0 ; 
 i f ( i n d e x M o i s   <   0   | |   i n d e x M o i s   >   1 1 ) 
 	 i n d e x M o i s   =   0 ; 
 i f ( i n d e x Y e a r   <   0   | |   i n d e x Y e a r   >   1 ) 
 	 i n d e x D a y   =   0 ; 
 
 d o c u m e n t . a s p n e t F o r m . f r o m d a y . s e l e c t e d I n d e x   =   i n d e x D a y ; 
 d o c u m e n t . a s p n e t F o r m . f r o m m o n t h . s e l e c t e d I n d e x   =   i n d e x M o i s ; 
 d o c u m e n t . a s p n e t F o r m . f r o m y e a r . s e l e c t e d I n d e x   =   i n d e x Y e a r ; 
 
 u p d a t e _ d e p a r t u r e ( ) ; 
 } 
 
 / /   s t a n d a r d   b o o k i n g   f u n c t i o n 
 f u n c t i o n   h h o t e l P T C ( c n a m e ,   l g ,   c o d e p r i c e ,   c o d e t r a c k ,   c l u s t e r ) 
 { 
 	 h h o t e l R e s a ( c n a m e ,   l g ,   c o d e p r i c e ,   " " ,   " " ,   c o d e t r a c k ,   c l u s t e r ,   " " ,   " " ) 
 } 
 
 / /   s t a n d a r d   p r o m o t i o n   f u n c t i o n 
 f u n c t i o n   h h o t e l P r o m o ( c n a m e ,   l g ,   t h e m e ) 
 { 
 	 h h o t e l R e s a ( c n a m e ,   l g ,   " D Y N P R O M O " ,   " " ,   " " ,   " " ,   " " ,   t h e m e ,   " " ) 
 } 
 
 / /   r e s e r v a t i o n   p r o m o t i o n   f u n c t i o n :   T o   s h o w   o n e   p r o m o t i o n 
 f u n c t i o n   h h o t e l O n e P r o m o ( c n a m e ,   l g ,   c o d e p r i c e ,   c o d e t r a c k ,   c l u s t e r ) 
 { 
 	 h h o t e l R e s a ( c n a m e ,   l g ,   c o d e p r i c e ,   " " ,   " " ,   c o d e t r a c k ,   c l u s t e r ,   " " ,   " s t y l e = D I R E C T P R O M O " ) 
 } 
 
 / /   r e s e r v a t i o n   p a g e   W I T H O U T   t h e   i n d i v i d u a l   a c c e s s 
 f u n c t i o n   h h o t e l N e g o c i a t e d ( c n a m e ,   l g ,   c o d e p r i c e ,   c o d e t r a c k ,   c l u s t e r ) 
 { 
 	 h h o t e l R e s a ( c n a m e ,   l g ,   c o d e p r i c e ,   " " ,   " " ,   c o d e t r a c k ,   c l u s t e r ,   " " ,   " n e g o c i a t e d = 1 " ) ; 
 } 
 
 / /   s t a n d a r d   s e a r c h   a v a i l a b i l i t i e s   i n   a   g r o u p 
 f u n c t i o n   h h o t e l S e a r c h G r o u p ( c l u s t e r ,   l g ,   p r i c e ,   n i g h t s ,   t i t l e ) 
 { 
 	 h h o t e l S e a r c h ( c l u s t e r ,   l g ,   p r i c e ,   n i g h t s ,   t i t l e ,   " " ,   " " ) ; 
 } 
 
 / /   s t a n d a r d   s e a r c h   a v a i l a b i l i t i e s   i n   a   g r o u p   f o r   a   p a r t n e r 
 f u n c t i o n   h h o t e l S e a r c h P a r t n e r ( c l u s t e r ,   l g ,   p r i c e ,   c o d e t r a c k ,   t i t l e ) 
 { 
 	 i f   ( c o d e t r a c k   ! =   " " )   a r g s   =   " & f r o m = " + c o d e t r a c k ; 
 	 e l s e 	 a r g s   =   " " ; 
         h h o t e l S e a r c h ( c l u s t e r ,   l g ,   p r i c e ,   " " ,   t i t l e ,   " " ,   a r g s ) ; 
 } 
 
 / /   s e a r c h   b y   g i v i n g   t h e   i n i t i a l   d a t e 
 f u n c t i o n   h h o t e l S e a r c h P r i c e D a t e ( c l u s t e r ,   p r i c e ,   n i g h t s ,   t i t l e ,   f i r s t d a t e ) 
 { 
 	 / /   f i r s t d a t e   :   f o r m a t   " Y Y M M D D " 
 	 v a r   a r g s = " " ; 
 	 i f   ( f i r s t d a t e   ! =   " " )   a r g s   =   " F i r s t D a t e = " + f i r s t d a t e ; 
 	 h h o t e l S e a r c h ( c l u s t e r ,   " " ,   p r i c e ,   n i g h t s ,   t i t l e ,   " " ,   a r g s ) ; 
 } 
 
 f u n c t i o n   h h o t e l S e a r c h P r i c e D a t e T r a c k ( c l u s t e r ,   l g ,   p r i c e ,   c o d e t r a c k ,   n i g h t s ,   t i t l e ,   f i r s t d a t e ) 
 { 
   v a r   a r g s = " " ; 
   i f   ( c o d e t r a c k   ! =   " " )   a r g s   =   " f r o m = " + c o d e t r a c k ; 
   i f   ( f i r s t d a t e   ! =   " " )   a r g s   + =   " & F i r s t D a t e = " + f i r s t d a t e ; 
   h h o t e l S e a r c h ( c l u s t e r ,   l g ,   p r i c e ,   n i g h t s ,   t i t l e ,   " " ,   a r g s ) ; 
 } 
 
 / /   s e a r c h   a v a i l a b i l i t i e s   f o r   s e l e c t e d   p r o m o t i o n s 
 f u n c t i o n   h h o t e l S e a r c h P r o m o ( c l u s t e r ,   l g ,   t h e m e ) 
 { 
 	 h h o t e l S e a r c h ( c l u s t e r ,   l g ,   " " ,   " " ,   " " ,   t h e m e ,   " " ) ; 
 } 
 
 / /   s e a r c h   a v a i l a b i l i t i e s   w i t h   E x t r a   F i e l d 
 f u n c t i o n   h h o t e l S e a r c h E x t r a ( c l u s t e r ,   l g ,   p r i c e ,   c o d e t r a c k ,   e x t r a t i t l e ,   e x t r a v a l ,   e x t r a s h o w ) 
 { 
 	 v a r   a r g s   =   " E x t r a f i e l d = "   +   e s c a p e ( e x t r a t i t l e )   +   " ; "   +   e x t r a v a l   +   " ; "   +   e x t r a s h o w ; 
 	 i f   ( c o d e t r a c k   ! =   " " )   a r g s   + =   " & f r o m = " + c o d e t r a c k ; 
 	 h h o t e l S e a r c h ( c l u s t e r ,   l g ,   p r i c e ,   " " ,   " " ,   " " ,   a r g s ) ; 
 } 
 
 / /   g o   t o   t h e   c a n c e l   r e s e r v a t i o n   p a g e 
 f u n c t i o n   h h o t e l c a n c e l ( c n a m e , l g ) 
 { 
 	 v a r   w a c t i o n   =   F B R E S A   +   " c a n c e l . p h t m l ? s t a t e = 7 7 & H o t e l n a m e s = " + c n a m e ; 
 	 i f   ( l g   ! =   " " )   w a c t i o n   + =   " & l a n g u e = " + l g ; 
 	 w i n d o w . o p e n ( w a c t i o n , " r e s e r v a t i o n " , " t o o l b a r = n o , w i d t h = 4 0 0 , h e i g h t = 3 5 0 , m e n u b a r = n o , s c r o l l b a r s = y e s , r e s i z a b l e = y e s , a l w a y s R a i s e d = y e s " ) ; 
 } 
 
 / /   g o   t o   t h e   e x t r a c t   r e s e r v a t i o n   p a g e 
 f u n c t i o n   h h o t e l E x t r a c t ( c n a m e ,   l g ) 
 {       
 	 v a r   w a c t i o n   =   F B R E S A   +   " g e t r e s a . p h t m l ? H o t e l n a m e s = " + c n a m e + " & l a n g u e = " + l g ; 
 	 w i n d o w . o p e n ( w a c t i o n ,   ' g e t r e s a ' ,   ' t o o l b a r = n o , w i d t h = 7 0 0 , h e i g h t = 3 0 0 , m e n u b a r = n o , s c r o l l b a r s = y e s , r e s i z a b l e = y e s , a l w a y s R a i s e d = y e s ' ) ; 
       r e t u r n   f a l s e ; 
 } 
 
 / /   c h e c k   i n t e r f a c e 
 f u n c t i o n   h h o t e l c h e c k r a t e s ( c n a m e ,   l g ) 
 { 
 	 v a r   w a c t i o n   =   F B R E S A   +   " c r s . p h t m l ? c l u s t e r N a m e = " + c n a m e ; 
 	 i f   ( l g   ! =   " " )   w a c t i o n   + =   " & l a n g u e = " + l g ; 
 	 w a c t i o n   + =   " & c h e c k P r o m o = 1 " ; 
 	 w i n d o w . o p e n ( w a c t i o n , " s e a r c h " , " t o o l b a r = n o , w i d t h = 8 0 0 , h e i g h t = 5 5 0 , m e n u b a r = n o , s c r o l l b a r s = y e s , r e s i z a b l e = y e s , a l w a y s R a i s e d = y e s " ) ; 
 } 
 
 
 / /   M a i n   s t a n d a r d   r e s e r v a t i o n   f u n c t i o n 
 f u n c t i o n   h h o t e l R e s a ( c n a m e ,   l g ,   c o d e p r i c e ,   f i r s t r o o m ,   f i r s t d a t e ,   c o d e t r a c k ,   c l u s t e r ,   t h e m e ,   a r g s ) 
 { 
 	 v a r   w a c t i o n   =   F B R E S A + " p r e r e s a . p h t m l ? H o t e l n a m e s = " + c n a m e ; 
 	 i f   ( l g   ! =   " " )   w a c t i o n   + =   " & l a n g u e = " + l g ; 
 	 i f   ( f i r s t r o o m   ! =   " " )   { 
 	 	 w a c t i o n   + =   " & F i r s t R o o m N a m e = " + f i r s t r o o m ; 
 	 	 i f   ( c o d e p r i c e   = =   " " ) 
 	 	 	 c o d e p r i c e   =   " D I R E C T " ; 
 	 	 } 
 	 i f   ( f i r s t d a t e   ! =   " " )   { 
 	 	 w a c t i o n   + =   " & F i r s t D a t e = " + f i r s t d a t e ; 
 	 	 i f   ( c o d e p r i c e   = =   " " ) 
 	 	 	 c o d e p r i c e   =   " D I R E C T " ; 
 	 	 } 
 	 i f   ( c o d e p r i c e   ! =   " " )   w a c t i o n   + =   " & F S T B K N G C o d e = " + c o d e p r i c e ; 
 	 i f   ( c o d e t r a c k   ! =   " " )   w a c t i o n   + =   " & F S T B K N G T r a c k L i n k = " + c o d e t r a c k ; 
 	 i f   ( c l u s t e r   ! =   " " )   w a c t i o n   + =   " & c l u s t e r n a m e = " + c l u s t e r ; 
 	 i f   ( t h e m e   ! =   " " )   w a c t i o n   + =   " & t h e m e = " + t h e m e ; 
 	 i f   ( a r g s   ! =   " "   & &   ( a r g s . i n d e x O f ( " = " ) ! =   - 1 )   )   w a c t i o n   + =   " & " + a r g s ; 
 	 w a c t i o n   + =   " & H T T P _ R E F E R E R = " + e s c a p e ( d o c u m e n t . l o c a t i o n . h r e f ) ; 
 	 w i n d o w . o p e n ( w a c t i o n , " r e s e r v a t i o n " , " t o o l b a r = n o , w i d t h = 4 0 0 , h e i g h t = 3 5 0 , m e n u b a r = n o , s c r o l l b a r s = y e s , r e s i z a b l e = y e s , a l w a y s R a i s e d = y e s " ) ; 
 } 
 
 / /   M a i n   d i r e c t   r e s e r v a t i o n   f u n c t i o n 
 f u n c t i o n   h h o t e l R e s a D i r e c t ( c n a m e ,   l g ,   c o d e p r i c e ,   f i r s t r o o m ,   c o d e t r a c k ,   f i r s t d a t e ) 
 { 
   / /   f i r s t d a t e   :   f o r m a t   " Y Y M M D D ; n b n i g h t s ; n b a d u l t s ; n b c h i l d " 
   v a r   w a c t i o n   =   F B R E S A + " p r e r e s a . p h t m l ? H o t e l n a m e s = " + c n a m e ; 
   i f   ( l g   ! =   " " )   w a c t i o n   + =   " & l a n g u e = " + l g ; 
   w a c t i o n   + =   " & s t y l e = D I R E C T " ; 
   i f   ( c o d e p r i c e   ! =   " " )   w a c t i o n   + =   " & F S T B K N G C o d e = " + c o d e p r i c e ; 
   i f   ( f i r s t r o o m   ! =   " " )   w a c t i o n   + =   " & F i r s t R o o m N a m e = " + f i r s t r o o m ; 
   i f   ( c o d e t r a c k   ! =   " " )   w a c t i o n   + =   " & F S T B K N G T r a c k L i n k = " + c o d e t r a c k ; 
   i f   ( f i r s t d a t e   ! =   " " )   w a c t i o n   + =   " & F i r s t D a t e = " + f i r s t d a t e ; 
   w a c t i o n   + =   " & H T T P _ R E F E R E R = " + e s c a p e ( d o c u m e n t . l o c a t i o n . h r e f ) ; 
   w i n d o w . o p e n ( w a c t i o n , " r e s e r v a t i o n " , " t o o l b a r = n o , w i d t h = 4 0 0 , h e i g h t = 3 5 0 , m e n u b a r = n o , s c r o l l b a r s = y e s , r e s i z a b l e = y e s , a l w a y s R a i s e d = y e s " ) ; 
 } 
 
 / /   M a i n   S e a r c h   f u n c t i o n 
 f u n c t i o n   h h o t e l S e a r c h ( c l u s t e r ,   l g ,   p r i c e ,   n i g h t s ,   t i t l e ,   t h e m e ,   a r g s ) 
 { 
 	 v a r   w a c t i o n   =   F B R E S A   +   " c r s . p h t m l ? c l u s t e r N a m e = " + c l u s t e r ; 
 	 i f   ( l g   ! =   " " )   w a c t i o n   + =   " & l a n g u e = " + l g ; 
 	 i f   ( p r i c e   ! =   " " )   w a c t i o n   + =   " & F S T B K N G C o d e = " + p r i c e ; 
 	 i f   ( n i g h t s   ! =   " " )   w a c t i o n   + =   " & n i g h t s = " + n i g h t s ; 
 	 i f   ( t i t l e   ! =   " " )   w a c t i o n   + =   " & t i t l e = " + e s c a p e ( t i t l e ) ; 
 	 i f   ( t h e m e   ! =   " " )   w a c t i o n   + =   " & t h e m e = " + t h e m e ; 
 	 i f   ( a r g s   ! =   " "   & &   ( a r g s . i n d e x O f ( " = " ) ! =   - 1 )   )   w a c t i o n   + =   " & " + a r g s ; 
 	 w i n d o w . o p e n ( w a c t i o n , " s e a r c h " , " t o o l b a r = n o , w i d t h = 8 0 0 , h e i g h t = 5 5 0 , m e n u b a r = n o , s c r o l l b a r s = y e s , r e s i z a b l e = y e s , a l w a y s R a i s e d = y e s " ) ; 
 } 
 
 / /   M a i n   S e a r c h   f u n c t i o n   f o r   M u l t i   C o d e s 
 f u n c t i o n   h h o t e l S e a r c h M u l t C o d e ( c l u s t e r ,   l g ,   c l e c o d e ,   t i t l e ,   c o d e t r a c k ) 
 { 
 	 v a r   w a c t i o n   =   F B R E S A   +   " c r s . p h t m l ? c l u s t e r N a m e = " + c l u s t e r ; 
 	 i f   ( l g   ! =   " " )   w a c t i o n   + =   " & l a n g u e = " + l g ; 
 	 i f   ( c l e c o d e   ! =   " " )   w a c t i o n   + =   " & A c c e s s C o d e = " + c l e c o d e ; 
 	 i f   ( t i t l e   ! =   " " )   w a c t i o n   + =   " & t i t l e = " + e s c a p e ( t i t l e ) ; 
 	 i f   ( c o d e t r a c k   ! =   " " )   w a c t i o n   + =   " & F S T B K N G T r a c k L i n k = " + c o d e t r a c k ; 
 	 w a c t i o n   + =   " & c r o s s S e l l i n g = N O " ;   / /   C R O S S   S E L L I N G   D E S A C T I V A T E D 
 	 w i n d o w . o p e n ( w a c t i o n , " s e a r c h " , " t o o l b a r = n o , w i d t h = 8 0 0 , h e i g h t = 5 5 0 , m e n u b a r = n o , s c r o l l b a r s = y e s , r e s i z a b l e = y e s , a l w a y s R a i s e d = y e s " ) ; 
 } 
 / /   M a i n   S e a r c h   f u n c t i o n   f o r   C r o s s   S e l l i n g 
 
 f u n c t i o n   h h o t e l S e a r c h C r o s s S e l l ( c l u s t e r ,   l g ,   c o d e t r a c k ,   c r o s s S e l l i n g ) 
 { 
 	 v a r   w a c t i o n   =   F B R E S A   +   " c r s . p h t m l ? c l u s t e r N a m e = " + c l u s t e r ; 
 	 i f   ( l g   ! =   " " )   w a c t i o n   + =   " & l a n g u e = " + l g ; 
 	 i f   ( c o d e t r a c k   ! =   " " )   w a c t i o n   + =   " & F S T B K N G T r a c k L i n k = " + c o d e t r a c k ; 
 	 i f   ( c r o s s S e l l i n g   ! =   " " )   w a c t i o n   + =   " & c r o s s S e l l i n g = " + c r o s s S e l l i n g ; 
 	 w i n d o w . o p e n ( w a c t i o n , " s e a r c h " , " t o o l b a r = n o , w i d t h = 8 0 0 , h e i g h t = 5 5 0 , m e n u b a r = n o , s c r o l l b a r s = y e s , r e s i z a b l e = y e s , a l w a y s R a i s e d = y e s " ) ; 
 } 
 / /   M A I N   A V A I L A B I L I T Y   C H E C K   
 f u n c t i o n   h h o t e l D i s p o p r i c e F H P ( c n a m e ,   l g ,   c o d e t r a c k ,   y e a r ,   m o n t h ,   d a y ,   n i g h t s ,   c u r r e n c y ) 
 { 
 	 v a r   w a c t i o n   =   F B R E S A + " d i s p o p r i c e . p h t m l ? c l u s t e r N a m e = " + c n a m e + " & H o t e l n a m e s = " + c n a m e ; 
 	 i f   ( l g   ! =   " " )   w a c t i o n   + =   " & l a n g u e = " + l g ; 
 	 i f   ( c o d e t r a c k   ! =   " " )   w a c t i o n   + =   " & F S T B K N G T r a c k L i n k = " + c o d e t r a c k ; 
 	 i f   ( y e a r   ! =   " " )   w a c t i o n   + =   " & f r o m y e a r = " + y e a r ; 
 	 i f   ( m o n t h   ! =   " " )   w a c t i o n   + =   " & f r o m m o n t h = " + m o n t h ; 
 	 i f   ( d a y   ! =   " " )   w a c t i o n   + =   " & f r o m d a y = " + d a y ; 
 	 i f   ( n i g h t s   ! =   " " )   w a c t i o n   + =   " & n b d a y s = " + n i g h t s ; 
 	 i f   ( c u r r e n c y   ! =   " " )   w a c t i o n   + =   " & C u r r e n c y L a b e l = " + c u r r e n c y ; 
 	 w a c t i o n   + =   " & s h o w P r o m o t i o n s = 3 " ; 
 	 w i n d o w . o p e n ( w a c t i o n , " r e s e r v a t i o n " , " t o o l b a r = n o , w i d t h = 7 5 0 , h e i g h t = 6 0 0 , m e n u b a r = n o , s c r o l l b a r s = y e s , r e s i z a b l e = y e s , a l w a y s R a i s e d = y e s " ) ; 
 } 
 
 
 / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
 / /   F o r m   f u n c t i o n s 
 / /   S i m p l e   f o r m   v a l i d a t i o n   ( u s e d   f o r   c o m p a t i b i l i t y   i s s u e s ) 
 f u n c t i o n   h h o t e l D i s p o p r i c e ( m y F o r m ) 
 { 
 	 h h o t e l F o r m V a l i d a t i o n ( m y F o r m ,   0 ) ; 
 } 
 
 / /   T h ê m   v à o   :   c h u y Ãn   ¿n   f i l e   b o o k i n g . a s p x 
 f u n c t i o n   c h e c k r o o m ( m y F o r m ) 
 { 
         v a r   i n d e x   =   m y F o r m . f r o m y e a r . s e l e c t e d I n d e x ; 
         v a r   i n d e x m   =   m y F o r m . f r o m m o n t h . s e l e c t e d I n d e x ; 
         v a r   i n d e x d   =   m y F o r m . f r o m d a y . s e l e c t e d I n d e x ; 
         v a r   i n d e x s   =   m y F o r m . n b d a y s . s e l e c t e d I n d e x ; 
         v a r   i n d e x a   =   m y F o r m . a d u l t e r e s a . s e l e c t e d I n d e x ; 
         v a r   i n d e x c   =   m y F o r m . e n f a n t r e s a . s e l e c t e d I n d e x ; 
         
         v a r   t h a n g   =   m y F o r m . f r o m m o n t h . o p t i o n s [ i n d e x m ] . v a l u e ; 
         v a r   n g a y   =   m y F o r m . f r o m d a y . o p t i o n s [ i n d e x d ] . v a l u e ; 
         v a r   n a m   =   m y F o r m . f r o m y e a r . o p t i o n s [ i n d e x ] . v a l u e ; 
         
         v a r   s o d e m   =   m y F o r m . n b d a y s . o p t i o n s [ i n d e x s ] . v a l u e ; 
         v a r   n l o n   =   m y F o r m . a d u l t e r e s a . o p t i o n s [ i n d e x a ] . v a l u e ; 
         v a r   t c o n   =   m y F o r m . e n f a n t r e s a . o p t i o n s [ i n d e x c ] . v a l u e ; 
         
         / / v a r   i a t a   =   m y F o r m . A c c e s s C o d e . v a l u e ; 
         
         v a r   l i n k   =   " b o o k i n g . a s p x ? n g a y = " + n g a y + " & t h a n g = " + t h a n g + " & n a m = " + n a m + " & s o d e m = " + s o d e m + " & n l o n = " + n l o n + " & t c o n = " + t c o n ; 
         w i n d o w . o p e n ( l i n k , " B o o k i n g R o o m s " , " t o o l b a r = n o , w i d t h = 1 0 2 4 , h e i g h t = 7 5 0 , m e n u b a r = n o , s c r o l l b a r s = y e s , r e s i z a b l e = y e s " ) ;   
 } 
 
 / /   F o r m   v a l i d a t i o n   w i t h   c o n t r o l 
 f u n c t i o n   h h o t e l F o r m V a l i d a t i o n ( m y F o r m ,   m a n d a t o r y C o d e ) { 
 	 i f   ( m a n d a t o r y C o d e   = =   1   & &   m y F o r m . A c c e s s C o d e . v a l u e   = =   " " )   { 
 	 	 a l e r t ( " Y o u   m u s t   t y p e   i n   y o u r   c o d e   I D " ) ; 
 	 	 r e t u r n   ( f a l s e ) ; 
 	 } 
 	 v a r   l a n g u e t y p e   =   t y p e o f   m y F o r m . a c t i o n ; 
 	 m y F o r m . a c t i o n   =   F B R E S A   +   " d i s p o p r i c e . p h t m l " ; 
 	 w i n d o w . o p e n ( ' ' , ' d i s p o p r i c e ' ,   ' t o o l b a r = n o , w i d t h = 8 0 0 , h e i g h t = 5 5 0 , m e n u b a r = n o , s c r o l l b a r s = y e s , r e s i z a b l e = y e s ' ) ; 
 	 m y F o r m . s u b m i t ( ) ; 
 	 r e t u r n   ( t r u e ) ; 
 } 
 
 / /   F o r m :   u p d a t e   t h e   s e l e c t e d   h o t e l   n a m e 
 f u n c t i o n   h h o t e l F o r m U p d a t e H o t e l n a m e s ( m y F o r m ) 
 { 
 	 m e n u N u m   =   m y F o r m . H o t e l L i s t . s e l e c t e d I n d e x ; 
 	 i f   ( m e n u N u m   = =   n u l l ) 
 	 	 r e t u r n ; 
 	 m y F o r m . H o t e l n a m e s . v a l u e   =   m y F o r m . H o t e l L i s t . o p t i o n s [ m e n u N u m ] . v a l u e ; 
 } 
 
 / /   F o r m :   s h o w   t h e   c a n c e l   p a g e 
 f u n c t i o n   h h o t e l F o r m C a n c e l ( m y F o r m ) { 
 	 v a r   C N a m e   =   m y F o r m . H o t e l n a m e s . v a l u e ; 
 	 v a r   l a n g u e t y p e   =   t y p e o f   m y F o r m . l a n g u e ; 
 	 v a r   l a n g u e ; 
 	 i f   ( l a n g u e t y p e   = =   " u n d e f i n e d " ) 
 	 	 l a n g u e   =   " " ; 
 	 e l s e 
 	 	 l a n g u e   =   m y F o r m . l a n g u e . v a l u e ; 
 	 i f   ( C N a m e   = =   n u l l   | |   C N a m e   = =   ' A l l '   | |   C N a m e   = =   ' ' ) {   a l e r t ( ' P l e a s e   s e l e c t   a   h o t e l   f i r s t ' ) ;   r e t u r n   ( f a l s e ) ;   } 
 	 r e t u r n   h h o t e l c a n c e l ( C N a m e ,   l a n g u e ) ; 
 } 
 
 / /   F o r m :   s h o w   t h e   e x t r a c t   p a g e 
 f u n c t i o n   h h o t e l F o r m E x t r a c t ( m y F o r m ) 
 {       
 	 v a r   C N a m e   =   m y F o r m . H o t e l n a m e s . v a l u e ; 
 	 v a r   l a n g u e t y p e   =   t y p e o f   m y F o r m . l a n g u e ; 
 	 v a r   l a n g u e ; 
 	 i f   ( l a n g u e t y p e   = =   " u n d e f i n e d " ) 
 	 	 l a n g u e   =   " " ; 
 	 e l s e 
 	 	 l a n g u e   =   m y F o r m . l a n g u e . v a l u e ; 
 	 i f   ( C N a m e   = =   n u l l   | |   C N a m e   = =   ' A l l '   | |   C N a m e   = =   ' ' ) {   a l e r t ( ' P l e a s e   s e l e c t   a   h o t e l   f i r s t ' ) ;   r e t u r n   ( f a l s e ) ;   } 
 	 r e t u r n   h h o t e l E x t r a c t ( C N a m e ,   l a n g u e ) ; 
 } 
 
 / /   F o r m :   s h o w   l a n g u a g e s 
 
 f u n c t i o n   h h o t e l S h o w L a n g ( l a n g )   
 { 
 	 h h o t e l S h o w L a n g _ _ ( t h i s . d o c u m e n t ,   l a n g ) ; 
 } 
 f u n c t i o n   h h o t e l S h o w L a n g O p e n e r ( l a n g ) 
 { 
 	 h h o t e l S h o w L a n g _ _ ( w i n d o w . o p e n e r . d o c u m e n t ,   l a n g ) ; 
 	 w i n d o w . c l o s e ( ) ; 
 } 
 f u n c t i o n   h h o t e l S h o w L a n g _ _ ( m y d o c ,   l a n g ) 
 { 
 	 m y d o c . a s p n e t F o r m . l a n g u e . v a l u e = l a n g ; 
 
 	 v a r   i m g L a n g   =   h h o t e l L a n g 2 I m g ( l a n g ) ; 
 	 i f   ( i m g L a n g   ! =   " " )   { 
 	 	 v a r   f o r m F l a g   =   m y d o c . s e l L g F l a g ; 
 	 	 i f   ( f o r m F l a g   ! =   n u l l ) 
 	 	 	 m y d o c . s e l L g F l a g . s r c =   " f a s t b o o k i n g / f l a g s / " + i m g L a n g + " . g i f " ; 
 	 	 v a r   f o r m F l a g   =   m y d o c . s e l L g T x t ; 
 	 	 i f   ( f o r m F l a g   ! =   n u l l ) 
 	 	 	 m y d o c . s e l L g T x t . s r c =   " f a s t b o o k i n g / f l a g s / " + i m g L a n g + " l g . g i f " ; 
 	 } 
 } 
 
 / /   F a s t B o o k i n g   l a n g u a g e   a n d   i m a g e   c o d e 
 v a r   F B L a n g C o d e   =   n e w   A r r a y   ( 
 	 " u k " ,   " f r a n c e " ,   " g e r m a n y " ,   " s p a i n " ,   " p o r t u g u e s e " ,   " i t a l y " ,   " n e t h e r " ,   " r u s s i a n " , 
 	 " d a n s k " ,   " s v e n s k " ,   " i s l e n s k " ,   " n o r s k " ,   " t u r k " ,   " h u n g r i a " ,   " g r e e k " ,   " a r a b " , 
 	 " c h i n a " ,   " c o r e e n " ,   " j a p a n " , " c r o a t e " , " c z e c h " , " p o l a n d " ) ; 
 v a r   F B L a n g I m g   =   n e w   A r r a y   ( 
 	 " g r a n d b r e t " ,   " f r a n c e " ,   " g e r m a n y " ,   " s p a i n " ,   " p o r t u g u e s e " ,   " i t a l y " ,   " n e t h e r " ,   " r u s s i a " , 
 	 " d e n m a r k " ,   " s w e e d e n " ,   " i c e l a n d " ,   " n o r w a y " ,   " t u r k e y " ,   " h u n g a r y " ,   " g r e e k " ,   " a r a b " , 
 	 " c h i n a " ,   " c o r e e n " ,   " j a p a n " , " c r o a t e " , " c z e c h " , " p o l a n d " ) ; 
 f u n c t i o n   h h o t e l L a n g 2 I m g ( l a n g ) 
 { 
 	 f o r ( i   =   0 ;   i   <   F B L a n g C o d e . l e n g t h ;   i + + )   { 
 	 	 i f   ( F B L a n g C o d e [ i ]   = =   l a n g ) 
 	 	 	 b r e a k ; 
 	 } 
 	 r e t u r n   F B L a n g I m g [ i ] ; 
 } 
 
 f u n c t i o n   h h o t e l L a n g S e l e c t o r ( ) 
 { 
 	 w i n d o w . o p e n ( ' f a s t b o o k i n g / f l a g s / l a n g S e l e c t o r . h t m l ' ,   ' ' ,   ' w i d t h = 3 3 0 , h e i g h t = 1 8 0 ' ) ; 
 } 
 
 
 v a r   l a n g c o d e s   =   n e w   A r r a y ( " e n " ,   " u k " ,   " f r " ,   " f r a n c e " ,   " d e " ,   " g e r m a n y " ,   " e s " ,   " s p a i n   " ,   " p t " ,   " p o r t u g u e s e " ,   " i t " ,   " i t a l y " ,   " n l " ,   " n e t h e r " ,   " j a " ,   " j a p a n   " ,   " k o " ,   " c o r e e n " ,   " z h " ,   " c h i n a " ,   " a r " ,   " a r a b " ,   " r u " ,   " r u s s i a n " ,   " t r " ,   " t u r k " ,   " e l " ,   " g r e e k " ,   " h u " ,   " h u n g r i a " ,   " d a " ,   " d a n s k " ,   " s v " ,   " s v e n s k " ,   " i s " ,   " i s l e n s k " ,   " n o " ,   " n o r s k " ,   " h r " ,   " c r o a t e " ,   " c s " ,   " c z e c h " ,   " p l " ,   " p o l a n d " ,   " i w " ,   " h e b r e w " ) ; 
 
 f u n c t i o n   s e l e c t L a n g ( ) 
 { 
 
 i f ( n a v i g a t o r . a p p N a m e   = =   " M i c r o s o f t   I n t e r n e t   E x p l o r e r " )   U L   =   n a v i g a t o r . u s e r L a n g u a g e . s u b s t r i n g ( 0 ,   2 ) ; 
 e l s e   i f ( n a v i g a t o r . a p p N a m e   = =   " N e t s c a p e " )   U L   =   n a v i g a t o r . l a n g u a g e ; 
 e l s e   r e t u r n ; 
 
 f o r ( i   =   0 ;   i   <   l a n g c o d e s . l e n g t h ;   i   + =   2 ) 
 	 i f ( U L   = =   l a n g c o d e s [ i ] ) 
 	 	 b r e a k ; 
 	 	 
 l a n g   =   ( i   <   l a n g c o d e s . l e n g t h )   ?   l a n g c o d e s [ i + 1 ]   :   " u k " ; 
 h h o t e l S h o w L a n g ( l a n g ) ; 
 } 
 
 	 / / 
 	 / /   b u i l d   y e a r   s e l e c t 
 f u n c t i o n   b u i l d _ y e a r _ s e l e c t ( )   { 
 	 	 
 v a r   c u r _ d a t e   =   n e w   D a t e ( ) ; 
 v a r   c u r _ y e a r   =   t a k e Y e a r ( c u r _ d a t e ) ; 
 	 
 c u r _ y   =   n e w   O p t i o n ( c u r _ y e a r ,   c u r _ y e a r ,   t r u e ,   t r u e ) ; 
 d o c u m e n t . a s p n e t F o r m . f r o m y e a r . o p t i o n s [ 0 ]   =   c u r _ y ; 
 i f ( d o c u m e n t . a s p n e t F o r m . t o y e a r   ! =   n u l l )   { 
 	 c u r _ y b   =   n e w   O p t i o n ( c u r _ y e a r ,   c u r _ y e a r ,   t r u e ,   t r u e ) ; 
 	 d o c u m e n t . a s p n e t F o r m . t o y e a r . o p t i o n s [ 0 ]   =   c u r _ y b ; 
 } 
 	 
 n e x t _ y   =   n e w   O p t i o n ( c u r _ y e a r   +   1 ,   c u r _ y e a r   +   1 ,   f a l s e ,   f a l s e ) ; 
 d o c u m e n t . a s p n e t F o r m . f r o m y e a r . o p t i o n s [ 1 ]   =   n e x t _ y ; 
 n e x t _ y b   =   n e w   O p t i o n ( c u r _ y e a r   +   1 ,   c u r _ y e a r   +   1 ,   f a l s e ,   f a l s e ) ; 
 i f ( d o c u m e n t . a s p n e t F o r m . t o y e a r   ! =   n u l l )   { 
 	 d o c u m e n t . a s p n e t F o r m . t o y e a r . o p t i o n s [ 1 ]   =   n e x t _ y b ; 
 	 } 
 } 
 	 
 
 / /   c h e c k   d e p a r t u r e   d a t e   t o   a r r i v a l   d a t e   +   1   d a y   ( e v e r y   t i m e   t h e   a r r i v a l   d a t e   i s   c h a n g e d ) 
 f u n c t i o n   c h e c k _ d e p a r t u r e ( )   { 
 	 
 	 i f ( d o c u m e n t . a s p n e t F o r m . t o d a y   ! =   n u l l )   { 
 	 	 v a r   n b m   =   [   3 1 ,   2 8 ,   3 1 ,   3 0 ,   3 1 ,   3 0 ,   3 1 ,   3 1 ,   3 0 ,   3 1 ,   3 0 ,   3 1   ] ; 
 	 	 
 	 	 v a r   a r _ d a y   =   p a r s e I n t ( d o c u m e n t . a s p n e t F o r m . f r o m d a y . v a l u e )   +   1 ; 
 	 	 v a r   a r _ m o n t h   =   p a r s e I n t ( d o c u m e n t . a s p n e t F o r m . f r o m m o n t h . v a l u e ) ; 
 	 	 v a r   a r _ y e a r   =   p a r s e I n t ( d o c u m e n t . a s p n e t F o r m . f r o m y e a r . v a l u e ) ; 
 	 	 	 	 
 	 	 i f ( a r _ d a y   >   n b m [ a r _ m o n t h   -   1 ] )   { 
 	 	 	 a r _ d a y   =   1 ; 
 	 	 	 a r _ m o n t h   + =   1 ; 
 	 	 	 i f ( a r _ m o n t h   >   1 2 )   { 
 	 	 	 	 a r _ m o n t h   =   1 ; 
 	 	 	 	 a r _ y e a r   + =   1 ; 
 	 	 	 } 
 	 	 } 
 	 	 	 	 
 	 	 v a r   c u r _ d a t e   =   n e w   D a t e ( ) ; 
 	 	 v a r   c u r _ y e a r   =   t a k e Y e a r ( c u r _ d a t e ) ; 
 	 	 
 	 	 d o c u m e n t . a s p n e t F o r m . t o d a y . s e l e c t e d I n d e x   =   a r _ d a y   -   1 ; 
 	 	 d o c u m e n t . a s p n e t F o r m . t o m o n t h . s e l e c t e d I n d e x   =   a r _ m o n t h   -   1 ; 
 	 	 d o c u m e n t . a s p n e t F o r m . t o y e a r . s e l e c t e d I n d e x   =   a r _ y e a r   -   c u r _ y e a r ; 
 	 } 
 } 
 
 / /   u p d a t e   d e p a r t u r e   :   c h e c k   
 f u n c t i o n   u p d a t e _ d e p a r t u r e ( )   { 
 	 
 	 i f ( d o c u m e n t . a s p n e t F o r m . t o d a y   ! =   n u l l )   { 
 	 	 
 	 	 v a r   a r _ d a y   =   p a r s e I n t ( d o c u m e n t . a s p n e t F o r m . f r o m d a y . v a l u e )   +   1 ; 
 	 	 v a r   a r _ m o n t h   =   p a r s e I n t ( d o c u m e n t . a s p n e t F o r m . f r o m m o n t h . v a l u e ) ; 
 	 	 v a r   a r _ y e a r   =   p a r s e I n t ( d o c u m e n t . a s p n e t F o r m . f r o m y e a r . v a l u e ) ; 
 	 	 	 	 
 	 	 v a r   d e _ d a y   =   p a r s e I n t ( d o c u m e n t . a s p n e t F o r m . t o d a y . v a l u e )   +   1 ; 
 	 	 v a r   d e _ m o n t h   =   p a r s e I n t ( d o c u m e n t . a s p n e t F o r m . t o m o n t h . v a l u e ) ; 
 	 	 v a r   d e _ y e a r   =   p a r s e I n t ( d o c u m e n t . a s p n e t F o r m . t o y e a r . v a l u e ) ; 
 	 	 
 	 	 i f ( d e _ y e a r   <   a r _ y e a r )   { 
 	 	 	 c h e c k _ d e p a r t u r e ( ) ; 
 	 	 }   e l s e   { 
 	 	 	 i f ( d e _ y e a r   = =   a r _ y e a r )   { 
 	 	 	 	 i f ( d e _ m o n t h   <   a r _ m o n t h )   { 
 	 	 	 	 	 c h e c k _ d e p a r t u r e ( ) ; 
 	 	 	 	 }   e l s e   { 
 	 	 	 	 	 i f ( d e _ m o n t h   = =   a r _ m o n t h )   { 
 	 	 	 	 	 	 i f ( d e _ d a y   < =   a r _ d a y )   { 
 	 	 	 	 	 	 	 c h e c k _ d e p a r t u r e ( ) ; 
 	 	 	 	 	 	 } 
 	 	 	 	 	 } 
 	 	 	 	 } 
 	 	 	 } 
 	 	 } 
 	 	 	 	 
 	 } 
 } 
 
 
 f u n c t i o n   t a k e Y e a r ( t h e D a t e ) 
 { 
                 x   =   t h e D a t e . g e t Y e a r ( ) ; 
                 v a r   y   =   x   %   1 0 0 ; 
                 y   + =   ( y   <   3 8 )   ?   2 0 0 0   :   1 9 0 0 ; 
                 r e t u r n   y ; 
 } 
 
 
