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