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