ÿþi f ( l o c a t i o n . h r e f . m a t c h ( / ( \ ? | & ) l a n g = ( [ 1 - 4 ] ) / ) ) {  
 	 v a r   c u r r e n t L a n g   =   l o c a t i o n . h r e f . m a t c h ( / ( \ ? | & ) l a n g = ( [ 1 - 4 ] ) / ) [ 2 ] ;  
 } e l s e {  
 	 v a r   c u r r e n t L a n g   =   2 ;  
 }  
  
 v a r   r o o m _ f i l t e r   =   {  
 	 s u b m i t :   f u n c t i o n ( ) {  
 	 	 / / d o c u m e n t . g e t E l e m e n t B y I d ( t h i s . f r m ) . s u b m i t ( ) ;  
 	 	 i f ( c h e c k e r ( [  
 	 	 	 { i d : ' i n p u t _ a r r i v a l ' , c h e c k e r : ' i s D a t e ' , i s D a t e : " a f t e r _ a n d , " + ( n e w   D a t e ( ) ) . a d d D a y s ( 2 ) , m s g : m s g . i n p u t _ a r r i v a l } ,  
 	 	 	 { i d : ' i n p u t _ d e p a r t u r e ' , c h e c k e r : ' i s N u l l ' , m s g : m s g . i n p u t _ d e p a r t u r e } ,  
 	 	 	 { i d : ' n o _ o f _ n i g h t s _ i n p u t ' , c h e c k e r : ' i s V a l u e B e t w e e n ' , i s V a l u e B e t w e e n : b e t w e e n _ l i m i t . n o _ o f _ n i g h t s , m s g : m s g . n o _ o f _ n i g h t s } ,  
 	 	 	 { i d : ' n o _ o f _ r o o m s _ i n p u t ' , c h e c k e r : ' i s V a l u e B e t w e e n ' , i s V a l u e B e t w e e n : b e t w e e n _ l i m i t . n o _ o f _ r o o m s , m s g : m s g . n o _ o f _ r o o m s } ,  
 	 	 	 { i d : ' n o _ o f _ a d u l t s _ i n p u t ' , c h e c k e r : ' i s V a l u e B e t w e e n ' , i s V a l u e B e t w e e n : b e t w e e n _ l i m i t . n o _ o f _ a d u l t s , m s g : m s g . n o _ o f _ a d u l t s } ,  
 	 	 	 { i d : ' s p e c i a l ' , c h e c k e r : ' r o o m s A v e r a g e ' , m s g : m s g . r o o m s A v e r a g e }  
 	 	 ] ) ) {  
 	 	 	 $ ( ' a : n o t ( . e m a i l ) ' ) . b i n d ( ' c l i c k ' , f u n c t i o n ( ) {  
 	 	 	 	 r e t u r n   f a l s e ;  
 	 	 	 } ) ;  
 	 	 	 d o c u m e n t . a c t F o r m . s u b m i t ( ) ;  
 	 	 }  
 	 } ,  
 	 r e s e t :   f u n c t i o n ( ) {  
 	 	 d o c u m e n t . a c t F o r m . r e s e t ( ) ;  
 	 	 $ ( ' # n o _ o f _ n i g h t s _ i n p u t ' ) . v a l ( ' 1 ' ) ;  
 	 	 $ ( ' # n o _ o f _ n i g h t s ' ) . v a l ( ' 1 ' ) ;  
 	 	 $ ( ' # n o _ o f _ r o o m s _ i n p u t ' ) . v a l ( ' 1 ' ) ;  
 	 	 $ ( ' # n o _ o f _ r o o m s ' ) . v a l ( ' 1 ' ) ;  
 	 	 $ ( ' # n o _ o f _ a d u l t s _ i n p u t ' ) . v a l ( ' 2 ' ) ;  
 	 	 $ ( ' # n o _ o f _ a d u l t s ' ) . v a l ( ' 2 ' ) ;  
 	 	 $ ( ' # i n p u t _ a r r i v a l ' ) . v a l ( ( n e w   D a t e ( ) ) . a d d D a y s ( 2 ) . a s S t r i n g ( d a t e s F o r m a t ) ) . t r i g g e r ( ' c h a n g e ' ) ;  
 	 	 $ ( ' # i n p u t _ d e p a r t u r e ' ) . v a l ( ( n e w   D a t e ( ) ) . a d d D a y s ( 3 ) . a s S t r i n g ( d a t e s F o r m a t ) ) . t r i g g e r ( ' c h a n g e ' ) ;  
 	 }  
 }  
  
 v a r   r o o m _ s e l e c t   =   {  
 	 b a c k :   f u n c t i o n ( ) {  
 	 	 d o c u m e n t . a c t F o r m . f r m _ a c t i o n . v a l u e   =   ' b a c k ' ;  
 	 	 d o c u m e n t . a c t F o r m . a c t i o n   =   ' r o o m _ f i l t e r . p h p ? l a n g = ' + c u r r e n t L a n g ;  
 	 	 d o c u m e n t . a c t F o r m . s u b m i t ( ) ;  
 	 } ,  
 	 b o o k :   f u n c t i o n ( c o d e ,   r o o m _ t y p e ,   p r i c e ) {  
 	 	 d o c u m e n t . a c t F o r m . p a c k a g e _ c o d e . v a l u e   =   c o d e ;  
 	 	 d o c u m e n t . a c t F o r m . r o o m _ t y p e . v a l u e   =   r o o m _ t y p e ;  
 	 	 d o c u m e n t . a c t F o r m . t o t a l _ a m o u n t . v a l u e   =   p r i c e ;  
 	 	 d o c u m e n t . a c t F o r m . s u b m i t ( ) ;  
 	 }  
 }  
  
 v a r   g u e s t _ f i l l   =   {  
 	 s u b m i t R e s e r v a t i o n :   f u n c t i o n ( ) {  
 	 	 i f ( c h e c k e r ( [  
 	 	 	 { i d : ' f i r s t _ n a m e ' , c h e c k e r : ' i s N u l l ' , m s g : m s g . f i r s t _ n a m e } ,  
 	 	 	 { i d : ' l a s t _ n a m e ' , c h e c k e r : ' i s N u l l ' , m s g : m s g . l a s t _ n a m e } ,  
 	 	 	 { i d : ' n u m b e r ' , c h e c k e r : ' i s N u l l ' , m s g : m s g . n u m b e r } ,  
 	 	 	 { i d : ' n u m b e r ' , c h e c k e r : ' i s P h o n e ' , m s g : m s g . v a l i d _ n u m b e r } ,  
 	 	 	 { i d : ' n u m b e r ' , c h e c k e r : ' i s B e t w e e n ' , i s B e t w e e n : ' 6 , 2 0 ' , m s g : m s g . n u m b e r _ b e t w e e n } ,  
 	 	 	 { i d : ' e m a i l ' , c h e c k e r : ' i s E m a i l ' , m s g : m s g . e m a i l } ,  
 	 	 	 { i d : ' s p e c i a l ' , c h e c k e r : ' p a y m e n t M e t h o d ' , m s g : m s g . p a y m e n t _ m e t h o d } ,  
 	 	 	 { i d : ' t e r m ' , c h e c k e r : ' i s C h e c k e d ' , m s g : m s g . t e r m s _ c o n d i t i o n s }  
 	 	 ] ) ) {  
 	 	 	 d o c u m e n t . a c t F o r m . s u b m i t ( ) ;  
 	 	 }  
 	 } ,  
 	 s e l e c t :   f u n c t i o n ( ) {  
 	 	 d o c u m e n t . a c t F o r m . f r m _ a c t i o n . v a l u e   =   ' s e l e c t ' ;  
 	 	 d o c u m e n t . a c t F o r m . a c t i o n   =   ' r o o m _ s e l e c t . p h p ? l a n g = ' + c u r r e n t L a n g ;  
 	 	 d o c u m e n t . a c t F o r m . s u b m i t ( ) ;  
 	 } ,  
 	 s e a r c h :   f u n c t i o n ( ) {  
 	 	 d o c u m e n t . a c t F o r m . f r m _ a c t i o n . v a l u e   =   ' b a c k ' ;  
 	 	 d o c u m e n t . a c t F o r m . a c t i o n   =   ' r o o m _ f i l t e r . p h p ? l a n g = ' + c u r r e n t L a n g ;  
 	 	 d o c u m e n t . a c t F o r m . s u b m i t ( ) ;  
 	 } ,  
 	 p a y m e n t _ m e t h o d :   f u n c t i o n ( s t r ) {  
 	 	 d o c u m e n t . a c t F o r m . p a y m e n t _ m e t h o d . v a l u e   =   s t r ;  
 	 }  
 }  
  
 v a r   c o n f i r m   =   {  
 	 p r i n t :   f u n c t i o n ( ) {  
 	 	 w i n d o w . p r i n t ( ) ;  
 	 } ,  
 	 s a v e :   f u n c t i o n ( ) {  
 	 	 d o c u m e n t . a c t F o r m . f r m _ a c t i o n . v a l u e   =   ' s a v e ' ;  
 	 	 d o c u m e n t . a c t F o r m . a c t i o n   =   ' c o n f i r m . p h p ? l a n g = ' + c u r r e n t L a n g ;  
 	 	 d o c u m e n t . a c t F o r m . s u b m i t ( ) ;  
 	 } ,  
 	 c l o s e :   f u n c t i o n ( ) {  
 	 	 w i n d o w . c l o s e ( ) ;  
 	 }  
 }  
  
 v a r   c h e c k _ b o o k i n g   =   {  
 	 s u b m i t :   f u n c t i o n ( ) {  
 	 	 / / d o c u m e n t . g e t E l e m e n t B y I d ( t h i s . f r m ) . s u b m i t ( ) ;  
 	 	 v a r   g o   =   f a l s e ;  
 	 	 g o   =   c h e c k e r ( [  
 	 	 	 { i d : ' c o n f i r m a t i o n ' , c h e c k e r : ' i s N u l l ' , m s g : m s g . c o n f i r m a t i o n } ,  
 	 	 	 { i d : ' e m a i l , n u m b e r ' , c h e c k e r : ' i s N u l l & i s P h o n e ' , a n d O r : ' | ' , m s g : m s g . n u m b e r _ o r _ e m a i l }  
 	 	 ] ) ;  
 	 	 i f ( g o   & &   $ ( ' # e m a i l ' ) . v a l ( ) ! = ' ' ) {  
 	 	 	 g o   =   c h e c k e r ( [  
 	 	 	 	 { i d : ' e m a i l ' , c h e c k e r : ' i s N u l l , i s E m a i l ' , a n d O r : ' & ' , m s g : m s g . e m a i l }  
 	 	 	 ] )  
 	 	 }  
 	 	 i f ( g o ) {  
 	 	 	 d o c u m e n t . a c t F o r m . s u b m i t ( ) ;  
 	 	 }  
 	 } ,  
 	 r e s e t :   f u n c t i o n ( ) {  
 	 	 d o c u m e n t . a c t F o r m . r e s e t ( ) ;  
 	 }  
 }  
  
 v a r   c h e c k _ b o o k i n g _ r e s u l t   =   {  
 	 p r i n t :   f u n c t i o n ( ) {  
 	 	 w i n d o w . p r i n t ( ) ;  
 	 } ,  
 	 s a v e :   f u n c t i o n ( ) {  
 	 	 d o c u m e n t . a c t F o r m . f r m _ a c t i o n . v a l u e   =   ' s a v e ' ;  
 	 	 d o c u m e n t . a c t F o r m . a c t i o n   =   ' c h e c k _ b o o k i n g _ r e s u l t . p h p ? l a n g = ' + c u r r e n t L a n g ;  
 	 	 d o c u m e n t . a c t F o r m . s u b m i t ( ) ;  
 	 } ,  
 	 c l o s e :   f u n c t i o n ( ) {  
 	 	 w i n d o w . c l o s e ( ) ;  
 	 }  
 } 
