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