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