ÿþ/ * N o n   D e p e n d a n t   F u n c t i o n s * / 
 f u n c t i o n   g e t U r l V a r s ( )   { 
         v a r   v a r s   =   [ ] ,   h a s h ; 
         v a r   h a s h e s   =   w i n d o w . l o c a t i o n . h r e f . s l i c e ( w i n d o w . l o c a t i o n . h r e f . i n d e x O f ( ' ? ' )   +   1 ) . s p l i t ( ' & ' ) ; 
         f o r ( v a r   i   =   0 ;   i   <   h a s h e s . l e n g t h ;   i + + ) 
         { 
                 h a s h   =   h a s h e s [ i ] . s p l i t ( ' = ' ) ; 
                 v a r s . p u s h ( h a s h [ 0 ] ) ; 
                 v a r s [ h a s h [ 0 ] ]   =   h a s h [ 1 ] ; 
         } 
         r e t u r n   v a r s ; 
 } 
 f u n c t i o n   s t r p o s   ( h a y s t a c k ,   n e e d l e ,   o f f s e t )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   O n n o   M a r s m a n         
         / /   +       b u g f i x e d   b y :   D a n i e l   E s t e b a n 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   *           e x a m p l e   1 :   s t r p o s ( ' K e v i n   v a n   Z o n n e v e l d ' ,   ' e ' ,   5 ) ; 
         / /   *           r e t u r n s   1 :   1 4 
         v a r   i   =   ( h a y s t a c k   +   ' ' ) . i n d e x O f ( n e e d l e ,   ( o f f s e t   | |   0 ) ) ; 
         r e t u r n   i   = = =   - 1   ?   f a l s e   :   i ; 
 } 
 f u n c t i o n   u c f i r s t   ( s t r )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       b u g f i x e d   b y :   O n n o   M a r s m a n 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   *           e x a m p l e   1 :   u c f i r s t ( ' k e v i n   v a n   z o n n e v e l d ' ) ; 
         / /   *           r e t u r n s   1 :   ' K e v i n   v a n   z o n n e v e l d ' 
         s t r   + =   ' ' ; 
         v a r   f   =   s t r . c h a r A t ( 0 ) . t o U p p e r C a s e ( ) ; 
         r e t u r n   f   +   s t r . s u b s t r ( 1 ) ; 
 } 
 f u n c t i o n   u c w o r d s   ( s t r )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   J o n a s   R a o n i   S o a r e s   S i l v a   ( h t t p : / / w w w . j s f r o m h e l l . c o m ) 
         / /   +       i m p r o v e d   b y :   W a l d o   M a l q u i   S i l v a 
         / /   +       b u g f i x e d   b y :   O n n o   M a r s m a n 
         / /   +       i m p r o v e d   b y :   R o b i n 
         / /   +             i n p u t   b y :   J a m e s   ( h t t p : / / w w w . j a m e s - b e l l . c o . u k / ) 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   *           e x a m p l e   1 :   u c w o r d s ( ' k e v i n   v a n     z o n n e v e l d ' ) ; 
         / /   *           r e t u r n s   1 :   ' K e v i n   V a n     Z o n n e v e l d ' 
         / /   *           e x a m p l e   2 :   u c w o r d s ( ' H E L L O   W O R L D ' ) ; 
         / /   *           r e t u r n s   2 :   ' H E L L O   W O R L D ' 
         r e t u r n   ( s t r   +   ' ' ) . r e p l a c e ( / ^ ( [ a - z ] ) | \ s + ( [ a - z ] ) / g ,   f u n c t i o n   ( $ 1 )   { 
                 r e t u r n   $ 1 . t o U p p e r C a s e ( ) ; 
         } ) ; 
 } 
 f u n c t i o n   s t r t o l o w e r   ( s t r )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   O n n o   M a r s m a n 
         / /   *           e x a m p l e   1 :   s t r t o l o w e r ( ' K e v i n   v a n   Z o n n e v e l d ' ) ; 
         / /   *           r e t u r n s   1 :   ' k e v i n   v a n   z o n n e v e l d ' 
 
         r e t u r n   ( s t r + ' ' ) . t o L o w e r C a s e ( ) ; 
 } 
 f u n c t i o n   s t r t o u p p e r   ( s t r )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   O n n o   M a r s m a n 
         / /   *           e x a m p l e   1 :   s t r t o u p p e r ( ' K e v i n   v a n   Z o n n e v e l d ' ) ; 
         / /   *           r e t u r n s   1 :   ' K E V I N   V A N   Z O N N E V E L D ' 
 
         r e t u r n   ( s t r + ' ' ) . t o U p p e r C a s e ( ) ; 
 } 
 f u n c t i o n   u c w o r d s   ( s t r )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   J o n a s   R a o n i   S o a r e s   S i l v a   ( h t t p : / / w w w . j s f r o m h e l l . c o m ) 
         / /   +       i m p r o v e d   b y :   W a l d o   M a l q u i   S i l v a 
         / /   +       b u g f i x e d   b y :   O n n o   M a r s m a n 
         / /   +       i m p r o v e d   b y :   R o b i n 
         / /   +             i n p u t   b y :   J a m e s   ( h t t p : / / w w w . j a m e s - b e l l . c o . u k / ) 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   *           e x a m p l e   1 :   u c w o r d s ( ' k e v i n   v a n     z o n n e v e l d ' ) ; 
         / /   *           r e t u r n s   1 :   ' K e v i n   V a n     Z o n n e v e l d ' 
         / /   *           e x a m p l e   2 :   u c w o r d s ( ' H E L L O   W O R L D ' ) ; 
         / /   *           r e t u r n s   2 :   ' H E L L O   W O R L D ' 
 
         r e t u r n   ( s t r   +   ' ' ) . r e p l a c e ( / ^ ( [ a - z ] ) | \ s + ( [ a - z ] ) / g ,   f u n c t i o n   ( $ 1 )   { 
                 r e t u r n   $ 1 . t o U p p e r C a s e ( ) ; 
         } ) ; 
 } 
 f u n c t i o n   u c f i r s t   ( s t r )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       b u g f i x e d   b y :   O n n o   M a r s m a n 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   *           e x a m p l e   1 :   u c f i r s t ( ' k e v i n   v a n   z o n n e v e l d ' ) ; 
         / /   *           r e t u r n s   1 :   ' K e v i n   v a n   z o n n e v e l d ' 
 
         s t r   + =   ' ' ; 
         v a r   f   =   s t r . c h a r A t ( 0 ) . t o U p p e r C a s e ( ) ; 
         r e t u r n   f   +   s t r . s u b s t r ( 1 ) ; 
 } 
 f u n c t i o n   t r i m   ( s t r ,   c h a r l i s t )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   m d s j a c k   ( h t t p : / / w w w . m d s j a c k . b o . i t ) 
         / /   +       i m p r o v e d   b y :   A l e x a n d e r   E r m o l a e v   ( h t t p : / / s n i p p e t s . d z o n e . c o m / u s e r / A l e x a n d e r E r m o l a e v ) 
         / /   +             i n p u t   b y :   E r k e k j e t t e r 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +             i n p u t   b y :   D x G x 
         / /   +       i m p r o v e d   b y :   S t e v e n   L e v i t h a n   ( h t t p : / / b l o g . s t e v e n l e v i t h a n . c o m ) 
         / /   +         t w e a k e d   b y :   J a c k 
         / /   +       b u g f i x e d   b y :   O n n o   M a r s m a n 
         / /   *           e x a m p l e   1 :   t r i m ( '         K e v i n   v a n   Z o n n e v e l d         ' ) ; 
         / /   *           r e t u r n s   1 :   ' K e v i n   v a n   Z o n n e v e l d ' 
         / /   *           e x a m p l e   2 :   t r i m ( ' H e l l o   W o r l d ' ,   ' H d l e ' ) ; 
         / /   *           r e t u r n s   2 :   ' o   W o r ' 
         / /   *           e x a m p l e   3 :   t r i m ( 1 6 ,   1 ) ; 
         / /   *           r e t u r n s   3 :   6 
 
         v a r   w h i t e s p a c e ,   l   =   0 ,   i   =   0 ; 
         s t r   + =   ' ' ; 
         
         i f   ( ! c h a r l i s t )   { 
                 / /   d e f a u l t   l i s t 
                 w h i t e s p a c e   =   "   \ n \ r \ t \ f \ x 0 b \ x a 0 \ u 2 0 0 0 \ u 2 0 0 1 \ u 2 0 0 2 \ u 2 0 0 3 \ u 2 0 0 4 \ u 2 0 0 5 \ u 2 0 0 6 \ u 2 0 0 7 \ u 2 0 0 8 \ u 2 0 0 9 \ u 2 0 0 a \ u 2 0 0 b \ u 2 0 2 8 \ u 2 0 2 9 \ u 3 0 0 0 " ; 
         }   e l s e   { 
                 / /   p r e g _ q u o t e   c u s t o m   l i s t 
                 c h a r l i s t   + =   ' ' ; 
                 w h i t e s p a c e   =   c h a r l i s t . r e p l a c e ( / ( [ \ [ \ ] \ ( \ ) \ . \ ? \ / \ * \ { \ } \ + \ $ \ ^ \ : ] ) / g ,   ' $ 1 ' ) ; 
         } 
         
         l   =   s t r . l e n g t h ; 
         f o r   ( i   =   0 ;   i   <   l ;   i + + )   { 
                 i f   ( w h i t e s p a c e . i n d e x O f ( s t r . c h a r A t ( i ) )   = = =   - 1 )   { 
                         s t r   =   s t r . s u b s t r i n g ( i ) ; 
                         b r e a k ; 
                 } 
         } 
         
         l   =   s t r . l e n g t h ; 
         f o r   ( i   =   l   -   1 ;   i   > =   0 ;   i - - )   { 
                 i f   ( w h i t e s p a c e . i n d e x O f ( s t r . c h a r A t ( i ) )   = = =   - 1 )   { 
                         s t r   =   s t r . s u b s t r i n g ( 0 ,   i   +   1 ) ; 
                         b r e a k ; 
                 } 
         } 
         
         r e t u r n   w h i t e s p a c e . i n d e x O f ( s t r . c h a r A t ( 0 ) )   = = =   - 1   ?   s t r   :   ' ' ; 
 } 
 f u n c t i o n   e x p l o d e   ( d e l i m i t e r ,   s t r i n g ,   l i m i t )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +           o r i g i n a l   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +           i m p r o v e d   b y :   k e n n e t h 
         / /   +           i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +           i m p r o v e d   b y :   d 3 x 
         / /   +           b u g f i x e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   *           e x a m p l e   1 :   e x p l o d e ( '   ' ,   ' K e v i n   v a n   Z o n n e v e l d ' ) ; 
         / /   *           r e t u r n s   1 :   { 0 :   ' K e v i n ' ,   1 :   ' v a n ' ,   2 :   ' Z o n n e v e l d ' } 
         / /   *           e x a m p l e   2 :   e x p l o d e ( ' = ' ,   ' a = b c = d ' ,   2 ) ; 
         / /   *           r e t u r n s   2 :   [ ' a ' ,   ' b c = d ' ] 
   
         v a r   e m p t y A r r a y   =   {   0 :   ' '   } ; 
         
         / /   t h i r d   a r g u m e n t   i s   n o t   r e q u i r e d 
         i f   (   a r g u m e n t s . l e n g t h   <   2   | | 
                 t y p e o f   a r g u m e n t s [ 0 ]   = =   ' u n d e f i n e d '   | | 
                 t y p e o f   a r g u m e n t s [ 1 ]   = =   ' u n d e f i n e d '   )   { 
                 r e t u r n   n u l l ; 
         } 
   
         i f   (   d e l i m i t e r   = = =   ' '   | | 
                 d e l i m i t e r   = = =   f a l s e   | | 
                 d e l i m i t e r   = = =   n u l l   )   { 
                 r e t u r n   f a l s e ; 
         } 
   
         i f   (   t y p e o f   d e l i m i t e r   = =   ' f u n c t i o n '   | | 
                 t y p e o f   d e l i m i t e r   = =   ' o b j e c t '   | | 
                 t y p e o f   s t r i n g   = =   ' f u n c t i o n '   | | 
                 t y p e o f   s t r i n g   = =   ' o b j e c t '   )   { 
                 r e t u r n   e m p t y A r r a y ; 
         } 
   
         i f   (   d e l i m i t e r   = = =   t r u e   )   { 
                 d e l i m i t e r   =   ' 1 ' ; 
         } 
         
         i f   ( ! l i m i t )   { 
                 r e t u r n   s t r i n g . t o S t r i n g ( ) . s p l i t ( d e l i m i t e r . t o S t r i n g ( ) ) ; 
         }   e l s e   { 
                 / /   s u p p o r t   f o r   l i m i t   a r g u m e n t 
                 v a r   s p l i t t e d   =   s t r i n g . t o S t r i n g ( ) . s p l i t ( d e l i m i t e r . t o S t r i n g ( ) ) ; 
                 v a r   p a r t A   =   s p l i t t e d . s p l i c e ( 0 ,   l i m i t   -   1 ) ; 
                 v a r   p a r t B   =   s p l i t t e d . j o i n ( d e l i m i t e r . t o S t r i n g ( ) ) ; 
                 p a r t A . p u s h ( p a r t B ) ; 
                 r e t u r n   p a r t A ; 
         } 
 } 
 f u n c t i o n   u r l e n c o d e   ( s t r )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   P h i l i p   P e t e r s o n 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +             i n p u t   b y :   A J 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       b u g f i x e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +             i n p u t   b y :   t r a v c 
         / /   +             i n p u t   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       b u g f i x e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   L a r s   F i s c h e r 
         / /   +             i n p u t   b y :   R a t h e o u s 
         / /   +             r e i m p l e m e n t e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       b u g f i x e d   b y :   J o r i s 
         / /   +             r e i m p l e m e n t e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   %                     n o t e   1 :   T h i s   r e f l e c t s   P H P   5 . 3 / 6 . 0 +   b e h a v i o r 
         / /   %                 n o t e   2 :   P l e a s e   b e   a w a r e   t h a t   t h i s   f u n c t i o n   e x p e c t s   t o   e n c o d e   i n t o   U T F - 8   e n c o d e d   s t r i n g s ,   a s   f o u n d   o n 
         / /   %                 n o t e   2 :   p a g e s   s e r v e d   a s   U T F - 8 
         / /   *           e x a m p l e   1 :   u r l e n c o d e ( ' K e v i n   v a n   Z o n n e v e l d ! ' ) ; 
         / /   *           r e t u r n s   1 :   ' K e v i n + v a n + Z o n n e v e l d % 2 1 ' 
         / /   *           e x a m p l e   2 :   u r l e n c o d e ( ' h t t p : / / k e v i n . v a n z o n n e v e l d . n e t / ' ) ; 
         / /   *           r e t u r n s   2 :   ' h t t p % 3 A % 2 F % 2 F k e v i n . v a n z o n n e v e l d . n e t % 2 F ' 
         / /   *           e x a m p l e   3 :   u r l e n c o d e ( ' h t t p : / / w w w . g o o g l e . n l / s e a r c h ? q = p h p . j s & i e = u t f - 8 & o e = u t f - 8 & a q = t & r l s = c o m . u b u n t u : e n - U S : u n o f f i c i a l & c l i e n t = f i r e f o x - a ' ) ; 
         / /   *           r e t u r n s   3 :   ' h t t p % 3 A % 2 F % 2 F w w w . g o o g l e . n l % 2 F s e a r c h % 3 F q % 3 D p h p . j s % 2 6 i e % 3 D u t f - 8 % 2 6 o e % 3 D u t f - 8 % 2 6 a q % 3 D t % 2 6 r l s % 3 D c o m . u b u n t u % 3 A e n - U S % 3 A u n o f f i c i a l % 2 6 c l i e n t % 3 D f i r e f o x - a ' 
         s t r   =   ( s t r   +   ' ' ) . t o S t r i n g ( ) ; 
 
         / /   T i l d e   s h o u l d   b e   a l l o w e d   u n e s c a p e d   i n   f u t u r e   v e r s i o n s   o f   P H P   ( a s   r e f l e c t e d   b e l o w ) ,   b u t   i f   y o u   w a n t   t o   r e f l e c t   c u r r e n t 
         / /   P H P   b e h a v i o r ,   y o u   w o u l d   n e e d   t o   a d d   " . r e p l a c e ( / ~ / g ,   ' % 7 E ' ) ; "   t o   t h e   f o l l o w i n g . 
         r e t u r n   e n c o d e U R I C o m p o n e n t ( s t r ) . r e p l a c e ( / ! / g ,   ' % 2 1 ' ) . r e p l a c e ( / ' / g ,   ' % 2 7 ' ) . r e p l a c e ( / \ ( / g ,   ' % 2 8 ' ) . 
         r e p l a c e ( / \ ) / g ,   ' % 2 9 ' ) . r e p l a c e ( / \ * / g ,   ' % 2 A ' ) . r e p l a c e ( / % 2 0 / g ,   ' + ' ) ; 
 } 
 f u n c t i o n   u r l d e c o d e   ( s t r )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   P h i l i p   P e t e r s o n 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +             i n p u t   b y :   A J 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +             i n p u t   b y :   t r a v c 
         / /   +             i n p u t   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       b u g f i x e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   L a r s   F i s c h e r 
         / /   +             i n p u t   b y :   R a t h e o u s 
         / /   +       i m p r o v e d   b y :   O r l a n d o 
         / /   +             r e i m p l e m e n t e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +             b u g f i x e d   b y :   R o b 
         / /   +             i n p u t   b y :   e - m i k e 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   %                 n o t e   1 :   i n f o   o n   w h a t   e n c o d i n g   f u n c t i o n s   t o   u s e   f r o m :   h t t p : / / x k r . u s / a r t i c l e s / j a v a s c r i p t / e n c o d e - c o m p a r e / 
         / /   %                 n o t e   2 :   P l e a s e   b e   a w a r e   t h a t   t h i s   f u n c t i o n   e x p e c t s   t o   d e c o d e   f r o m   U T F - 8   e n c o d e d   s t r i n g s ,   a s   f o u n d   o n 
         / /   %                 n o t e   2 :   p a g e s   s e r v e d   a s   U T F - 8 
         / /   *           e x a m p l e   1 :   u r l d e c o d e ( ' K e v i n + v a n + Z o n n e v e l d % 2 1 ' ) ; 
         / /   *           r e t u r n s   1 :   ' K e v i n   v a n   Z o n n e v e l d ! ' 
         / /   *           e x a m p l e   2 :   u r l d e c o d e ( ' h t t p % 3 A % 2 F % 2 F k e v i n . v a n z o n n e v e l d . n e t % 2 F ' ) ; 
         / /   *           r e t u r n s   2 :   ' h t t p : / / k e v i n . v a n z o n n e v e l d . n e t / ' 
         / /   *           e x a m p l e   3 :   u r l d e c o d e ( ' h t t p % 3 A % 2 F % 2 F w w w . g o o g l e . n l % 2 F s e a r c h % 3 F q % 3 D p h p . j s % 2 6 i e % 3 D u t f - 8 % 2 6 o e % 3 D u t f - 8 % 2 6 a q % 3 D t % 2 6 r l s % 3 D c o m . u b u n t u % 3 A e n - U S % 3 A u n o f f i c i a l % 2 6 c l i e n t % 3 D f i r e f o x - a ' ) ; 
         / /   *           r e t u r n s   3 :   ' h t t p : / / w w w . g o o g l e . n l / s e a r c h ? q = p h p . j s & i e = u t f - 8 & o e = u t f - 8 & a q = t & r l s = c o m . u b u n t u : e n - U S : u n o f f i c i a l & c l i e n t = f i r e f o x - a ' 
         r e t u r n   d e c o d e U R I C o m p o n e n t ( ( s t r   +   ' ' ) . r e p l a c e ( / \ + / g ,   ' % 2 0 ' ) ) ; 
 } 
 f u n c t i o n   u t f 8 _ e n c o d e   ( a r g S t r i n g )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   W e b t o o l k i t . i n f o   ( h t t p : / / w w w . w e b t o o l k i t . i n f o / ) 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   s o w b e r r y 
         / /   +         t w e a k e d   b y :   J a c k 
         / /   +       b u g f i x e d   b y :   O n n o   M a r s m a n 
         / /   +       i m p r o v e d   b y :   Y v e s   S u c a e t 
         / /   +       b u g f i x e d   b y :   O n n o   M a r s m a n 
         / /   +       b u g f i x e d   b y :   U l r i c h 
         / /   *           e x a m p l e   1 :   u t f 8 _ e n c o d e ( ' K e v i n   v a n   Z o n n e v e l d ' ) ; 
         / /   *           r e t u r n s   1 :   ' K e v i n   v a n   Z o n n e v e l d ' 
         v a r   s t r i n g   =   ( a r g S t r i n g   +   ' ' ) ;   / /   . r e p l a c e ( / \ r \ n / g ,   " \ n " ) . r e p l a c e ( / \ r / g ,   " \ n " ) ; 
         v a r   u t f t e x t   =   " " , 
                 s t a r t ,   e n d ,   s t r i n g l   =   0 ; 
 
         s t a r t   =   e n d   =   0 ; 
         s t r i n g l   =   s t r i n g . l e n g t h ; 
         f o r   ( v a r   n   =   0 ;   n   <   s t r i n g l ;   n + + )   { 
                 v a r   c 1   =   s t r i n g . c h a r C o d e A t ( n ) ; 
                 v a r   e n c   =   n u l l ; 
 
                 i f   ( c 1   <   1 2 8 )   { 
                         e n d + + ; 
                 }   e l s e   i f   ( c 1   >   1 2 7   & &   c 1   <   2 0 4 8 )   { 
                         e n c   =   S t r i n g . f r o m C h a r C o d e ( ( c 1   > >   6 )   |   1 9 2 )   +   S t r i n g . f r o m C h a r C o d e ( ( c 1   &   6 3 )   |   1 2 8 ) ; 
                 }   e l s e   { 
                         e n c   =   S t r i n g . f r o m C h a r C o d e ( ( c 1   > >   1 2 )   |   2 2 4 )   +   S t r i n g . f r o m C h a r C o d e ( ( ( c 1   > >   6 )   &   6 3 )   |   1 2 8 )   +   S t r i n g . f r o m C h a r C o d e ( ( c 1   &   6 3 )   |   1 2 8 ) ; 
                 } 
                 i f   ( e n c   ! = =   n u l l )   { 
                         i f   ( e n d   >   s t a r t )   { 
                                 u t f t e x t   + =   s t r i n g . s l i c e ( s t a r t ,   e n d ) ; 
                         } 
                         u t f t e x t   + =   e n c ; 
                         s t a r t   =   e n d   =   n   +   1 ; 
                 } 
         } 
 
         i f   ( e n d   >   s t a r t )   { 
                 u t f t e x t   + =   s t r i n g . s l i c e ( s t a r t ,   s t r i n g l ) ; 
         } 
 
         r e t u r n   u t f t e x t ; 
 } 
 / * F u n c t i o n s   W i t h   D e p e n d a n c e i e s   -   P l e a s e   P r e d e f i n e   B e f o r e   U s e * / 
 f u n c t i o n   b a s e 6 4 _ e n c o d e   ( d a t a )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   T y l e r   A k i n s   ( h t t p : / / r u m k i n . c o m ) 
         / /   +       i m p r o v e d   b y :   B a y r o n   G u e v a r a 
         / /   +       i m p r o v e d   b y :   T h u n d e r . m 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       b u g f i x e d   b y :   P e l l e n t e s q u e   M a l e s u a d a 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   -         d e p e n d s   o n :   u t f 8 _ e n c o d e 
         / /   *           e x a m p l e   1 :   b a s e 6 4 _ e n c o d e ( ' K e v i n   v a n   Z o n n e v e l d ' ) ; 
         / /   *           r e t u r n s   1 :   ' S 2 V 2 a W 4 g d m F u I F p v b m 5 l d m V s Z A = = ' 
         / /   m o z i l l a   h a s   t h i s   n a t i v e 
         / /   -   b u t   b r e a k s   i n   2 . 0 . 0 . 1 2 ! 
         / / i f   ( t y p e o f   t h i s . w i n d o w [ ' a t o b ' ]   = =   ' f u n c t i o n ' )   { 
         / /         r e t u r n   a t o b ( d a t a ) ; 
         / / } 
         v a r   b 6 4   =   " A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 + / = " ; 
         v a r   o 1 ,   o 2 ,   o 3 ,   h 1 ,   h 2 ,   h 3 ,   h 4 ,   b i t s ,   i   =   0 , 
                 a c   =   0 , 
                 e n c   =   " " , 
                 t m p _ a r r   =   [ ] ; 
 
         i f   ( ! d a t a )   { 
                 r e t u r n   d a t a ; 
         } 
 
         d a t a   =   t h i s . u t f 8 _ e n c o d e ( d a t a   +   ' ' ) ; 
 
         d o   {   / /   p a c k   t h r e e   o c t e t s   i n t o   f o u r   h e x e t s 
                 o 1   =   d a t a . c h a r C o d e A t ( i + + ) ; 
                 o 2   =   d a t a . c h a r C o d e A t ( i + + ) ; 
                 o 3   =   d a t a . c h a r C o d e A t ( i + + ) ; 
 
                 b i t s   =   o 1   < <   1 6   |   o 2   < <   8   |   o 3 ; 
 
                 h 1   =   b i t s   > >   1 8   &   0 x 3 f ; 
                 h 2   =   b i t s   > >   1 2   &   0 x 3 f ; 
                 h 3   =   b i t s   > >   6   &   0 x 3 f ; 
                 h 4   =   b i t s   &   0 x 3 f ; 
 
                 / /   u s e   h e x e t s   t o   i n d e x   i n t o   b 6 4 ,   a n d   a p p e n d   r e s u l t   t o   e n c o d e d   s t r i n g 
                 t m p _ a r r [ a c + + ]   =   b 6 4 . c h a r A t ( h 1 )   +   b 6 4 . c h a r A t ( h 2 )   +   b 6 4 . c h a r A t ( h 3 )   +   b 6 4 . c h a r A t ( h 4 ) ; 
         }   w h i l e   ( i   <   d a t a . l e n g t h ) ; 
 
         e n c   =   t m p _ a r r . j o i n ( ' ' ) ; 
 
         s w i t c h   ( d a t a . l e n g t h   %   3 )   { 
         c a s e   1 : 
                 e n c   =   e n c . s l i c e ( 0 ,   - 2 )   +   ' = = ' ; 
                 b r e a k ; 
         c a s e   2 : 
                 e n c   =   e n c . s l i c e ( 0 ,   - 1 )   +   ' = ' ; 
                 b r e a k ; 
         } 
 
         r e t u r n   e n c ; 
 } 
 f u n c t i o n   b a s e 6 4 _ d e c o d e   ( d a t a )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   T y l e r   A k i n s   ( h t t p : / / r u m k i n . c o m ) 
         / /   +       i m p r o v e d   b y :   T h u n d e r . m 
         / /   +             i n p u t   b y :   A m a n   G u p t a 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       b u g f i x e d   b y :   O n n o   M a r s m a n 
         / /   +       b u g f i x e d   b y :   P e l l e n t e s q u e   M a l e s u a d a 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +             i n p u t   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       b u g f i x e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   -         d e p e n d s   o n :   u t f 8 _ d e c o d e 
         / /   *           e x a m p l e   1 :   b a s e 6 4 _ d e c o d e ( ' S 2 V 2 a W 4 g d m F u I F p v b m 5 l d m V s Z A = = ' ) ; 
         / /   *           r e t u r n s   1 :   ' K e v i n   v a n   Z o n n e v e l d ' 
         / /   m o z i l l a   h a s   t h i s   n a t i v e 
         / /   -   b u t   b r e a k s   i n   2 . 0 . 0 . 1 2 ! 
         / / i f   ( t y p e o f   t h i s . w i n d o w [ ' b t o a ' ]   = =   ' f u n c t i o n ' )   { 
         / /         r e t u r n   b t o a ( d a t a ) ; 
         / / } 
         v a r   b 6 4   =   " A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 + / = " ; 
         v a r   o 1 ,   o 2 ,   o 3 ,   h 1 ,   h 2 ,   h 3 ,   h 4 ,   b i t s ,   i   =   0 , 
                 a c   =   0 , 
                 d e c   =   " " , 
                 t m p _ a r r   =   [ ] ; 
 
         i f   ( ! d a t a )   { 
                 r e t u r n   d a t a ; 
         } 
 
         d a t a   + =   ' ' ; 
 
         d o   {   / /   u n p a c k   f o u r   h e x e t s   i n t o   t h r e e   o c t e t s   u s i n g   i n d e x   p o i n t s   i n   b 6 4 
                 h 1   =   b 6 4 . i n d e x O f ( d a t a . c h a r A t ( i + + ) ) ; 
                 h 2   =   b 6 4 . i n d e x O f ( d a t a . c h a r A t ( i + + ) ) ; 
                 h 3   =   b 6 4 . i n d e x O f ( d a t a . c h a r A t ( i + + ) ) ; 
                 h 4   =   b 6 4 . i n d e x O f ( d a t a . c h a r A t ( i + + ) ) ; 
 
                 b i t s   =   h 1   < <   1 8   |   h 2   < <   1 2   |   h 3   < <   6   |   h 4 ; 
 
                 o 1   =   b i t s   > >   1 6   &   0 x f f ; 
                 o 2   =   b i t s   > >   8   &   0 x f f ; 
                 o 3   =   b i t s   &   0 x f f ; 
 
                 i f   ( h 3   = =   6 4 )   { 
                         t m p _ a r r [ a c + + ]   =   S t r i n g . f r o m C h a r C o d e ( o 1 ) ; 
                 }   e l s e   i f   ( h 4   = =   6 4 )   { 
                         t m p _ a r r [ a c + + ]   =   S t r i n g . f r o m C h a r C o d e ( o 1 ,   o 2 ) ; 
                 }   e l s e   { 
                         t m p _ a r r [ a c + + ]   =   S t r i n g . f r o m C h a r C o d e ( o 1 ,   o 2 ,   o 3 ) ; 
                 } 
         }   w h i l e   ( i   <   d a t a . l e n g t h ) ; 
 
         d e c   =   t m p _ a r r . j o i n ( ' ' ) ; 
         d e c   =   t h i s . u t f 8 _ d e c o d e ( d e c ) ; 
 
         r e t u r n   d e c ; 
 } 
 f u n c t i o n   s t r i p _ t a g s   ( i n p u t ,   a l l o w e d )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   L u k e   G o d f r e y 
         / /   +             i n p u t   b y :   P u l 
         / /   +       b u g f i x e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       b u g f i x e d   b y :   O n n o   M a r s m a n 
         / /   +             i n p u t   b y :   A l e x 
         / /   +       b u g f i x e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +             i n p u t   b y :   M a r c   P a l a u 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +             i n p u t   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       b u g f i x e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       b u g f i x e d   b y :   E r i c   N a g e l 
         / /   +             i n p u t   b y :   B o b b y   D r a k e 
         / /   +       b u g f i x e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       b u g f i x e d   b y :   T o m a s z   W e s o l o w s k i 
         / /   +             i n p u t   b y :   E v e r t j a n   G a r r e t s e n 
         / /   +         r e v i s e d   b y :   R a f a Å    K u k a w s k i   ( h t t p : / / b l o g . k u k a w s k i . p l / ) 
         / /   *           e x a m p l e   1 :   s t r i p _ t a g s ( ' < p > K e v i n < / p >   < b r   / > < b > v a n < / b >   < i > Z o n n e v e l d < / i > ' ,   ' < i > < b > ' ) ; 
         / /   *           r e t u r n s   1 :   ' K e v i n   < b > v a n < / b >   < i > Z o n n e v e l d < / i > ' 
         / /   *           e x a m p l e   2 :   s t r i p _ t a g s ( ' < p > K e v i n   < i m g   s r c = " s o m e i m a g e . p n g "   o n m o u s e o v e r = " s o m e F u n c t i o n ( ) " > v a n   < i > Z o n n e v e l d < / i > < / p > ' ,   ' < p > ' ) ; 
         / /   *           r e t u r n s   2 :   ' < p > K e v i n   v a n   Z o n n e v e l d < / p > ' 
         / /   *           e x a m p l e   3 :   s t r i p _ t a g s ( " < a   h r e f = ' h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ' > K e v i n   v a n   Z o n n e v e l d < / a > " ,   " < a > " ) ; 
         / /   *           r e t u r n s   3 :   ' < a   h r e f = ' h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ' > K e v i n   v a n   Z o n n e v e l d < / a > ' 
         / /   *           e x a m p l e   4 :   s t r i p _ t a g s ( ' 1   <   5   5   >   1 ' ) ; 
         / /   *           r e t u r n s   4 :   ' 1   <   5   5   >   1 ' 
         / /   *           e x a m p l e   5 :   s t r i p _ t a g s ( ' 1   < b r / >   1 ' ) ; 
         / /   *           r e t u r n s   5 :   ' 1     1 ' 
         / /   *           e x a m p l e   6 :   s t r i p _ t a g s ( ' 1   < b r / >   1 ' ,   ' < b r > ' ) ; 
         / /   *           r e t u r n s   6 :   ' 1     1 ' 
         / /   *           e x a m p l e   7 :   s t r i p _ t a g s ( ' 1   < b r / >   1 ' ,   ' < b r > < b r / > ' ) ; 
         / /   *           r e t u r n s   7 :   ' 1   < b r / >   1 ' 
         a l l o w e d   =   ( ( ( a l l o w e d   | |   " " )   +   " " ) . t o L o w e r C a s e ( ) . m a t c h ( / < [ a - z ] [ a - z 0 - 9 ] * > / g )   | |   [ ] ) . j o i n ( ' ' ) ;   / /   m a k i n g   s u r e   t h e   a l l o w e d   a r g   i s   a   s t r i n g   c o n t a i n i n g   o n l y   t a g s   i n   l o w e r c a s e   ( < a > < b > < c > ) 
         v a r   t a g s   =   / < \ / ? ( [ a - z ] [ a - z 0 - 9 ] * ) \ b [ ^ > ] * > / g i , 
                 c o m m e n t s A n d P h p T a g s   =   / < ! - - [ \ s \ S ] * ? - - > | < \ ? ( ? : p h p ) ? [ \ s \ S ] * ? \ ? > / g i ; 
         r e t u r n   i n p u t . r e p l a c e ( c o m m e n t s A n d P h p T a g s ,   ' ' ) . r e p l a c e ( t a g s ,   f u n c t i o n   ( $ 0 ,   $ 1 )   { 
                 r e t u r n   a l l o w e d . i n d e x O f ( ' < '   +   $ 1 . t o L o w e r C a s e ( )   +   ' > ' )   >   - 1   ?   $ 0   :   ' ' ; 
         } ) ; 
 } 
 f u n c t i o n   i s _ n u m e r i c   ( m i x e d _ v a r )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   D a v i d 
         / /   +       i m p r o v e d   b y :   t a i t h 
         / /   +       b u g f i x e d   b y :   T i m   d e   K o n i n g 
         / /   +       b u g f i x e d   b y :   W e b D e v H o b o   ( h t t p : / / w e b d e v h o b o . b l o g s p o t . c o m / ) 
         / /   +       b u g f i x e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   *           e x a m p l e   1 :   i s _ n u m e r i c ( 1 8 6 . 3 1 ) ; 
         / /   *           r e t u r n s   1 :   t r u e 
         / /   *           e x a m p l e   2 :   i s _ n u m e r i c ( ' K e v i n   v a n   Z o n n e v e l d ' ) ; 
         / /   *           r e t u r n s   2 :   f a l s e 
         / /   *           e x a m p l e   3 :   i s _ n u m e r i c ( ' + 1 8 6 . 3 1 e 2 ' ) ; 
         / /   *           r e t u r n s   3 :   t r u e 
         / /   *           e x a m p l e   4 :   i s _ n u m e r i c ( ' ' ) ; 
         / /   *           r e t u r n s   4 :   f a l s e 
         / /   *           e x a m p l e   4 :   i s _ n u m e r i c ( [ ] ) ; 
         / /   *           r e t u r n s   4 :   f a l s e 
         r e t u r n   ( t y p e o f ( m i x e d _ v a r )   = = =   ' n u m b e r '   | |   t y p e o f ( m i x e d _ v a r )   = = =   ' s t r i n g ' )   & &   m i x e d _ v a r   ! = =   ' '   & &   ! i s N a N ( m i x e d _ v a r ) ; 
 } 
 f u n c t i o n   s t r t o t i m e   ( s t r ,   n o w )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   C a i o   A r i e d e   ( h t t p : / / c a i o a r i e d e . c o m ) 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +             i n p u t   b y :   D a v i d 
         / /   +       i m p r o v e d   b y :   C a i o   A r i e d e   ( h t t p : / / c a i o a r i e d e . c o m ) 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       b u g f i x e d   b y :   W a g n e r   B .   S o a r e s 
         / /   +       b u g f i x e d   b y :   A r t u r   T c h e r n y c h e v 
         / /   %                 n o t e   1 :   E x a m p l e s   a l l   h a v e   a   f i x e d   t i m e s t a m p   t o   p r e v e n t   t e s t s   t o   f a i l   b e c a u s e   o f   v a r i a b l e   t i m e ( z o n e s ) 
         / /   *           e x a m p l e   1 :   s t r t o t i m e ( ' + 1   d a y ' ,   1 1 2 9 6 3 3 2 0 0 ) ; 
         / /   *           r e t u r n s   1 :   1 1 2 9 7 1 9 6 0 0 
         / /   *           e x a m p l e   2 :   s t r t o t i m e ( ' + 1   w e e k   2   d a y s   4   h o u r s   2   s e c o n d s ' ,   1 1 2 9 6 3 3 2 0 0 ) ; 
         / /   *           r e t u r n s   2 :   1 1 3 0 4 2 5 2 0 2 
         / /   *           e x a m p l e   3 :   s t r t o t i m e ( ' l a s t   m o n t h ' ,   1 1 2 9 6 3 3 2 0 0 ) ; 
         / /   *           r e t u r n s   3 :   1 1 2 7 0 4 1 2 0 0 
         / /   *           e x a m p l e   4 :   s t r t o t i m e ( ' 2 0 0 9 - 0 5 - 0 4   0 8 : 3 0 : 0 0 ' ) ; 
         / /   *           r e t u r n s   4 :   1 2 4 1 4 1 8 6 0 0 
         v a r   i ,   m a t c h ,   s ,   s t r T m p   =   ' ' , 
                 p a r s e   =   ' ' ; 
 
         s t r T m p   =   s t r ; 
         s t r T m p   =   s t r T m p . r e p l a c e ( / \ s { 2 , } | ^ \ s | \ s $ / g ,   '   ' ) ;   / /   u n e c e s s a r y   s p a c e s 
         s t r T m p   =   s t r T m p . r e p l a c e ( / [ \ t \ r \ n ] / g ,   ' ' ) ;   / /   u n e c e s s a r y   c h a r s 
         i f   ( s t r T m p   = =   ' n o w ' )   { 
                 r e t u r n   ( n e w   D a t e ( ) ) . g e t T i m e ( )   /   1 0 0 0 ;   / /   R e t u r n   s e c o n d s ,   n o t   m i l l i - s e c o n d s 
         }   e l s e   i f   ( ! i s N a N ( p a r s e   =   D a t e . p a r s e ( s t r T m p ) ) )   { 
                 r e t u r n   ( p a r s e   /   1 0 0 0 ) ; 
         }   e l s e   i f   ( n o w )   { 
                 n o w   =   n e w   D a t e ( n o w   *   1 0 0 0 ) ;   / /   A c c e p t   P H P - s t y l e   s e c o n d s 
         }   e l s e   { 
                 n o w   =   n e w   D a t e ( ) ; 
         } 
 
         s t r T m p   =   s t r T m p . t o L o w e r C a s e ( ) ; 
 
         v a r   _ _ i s   =   { 
                 d a y :   { 
                         ' s u n ' :   0 , 
                         ' m o n ' :   1 , 
                         ' t u e ' :   2 , 
                         ' w e d ' :   3 , 
                         ' t h u ' :   4 , 
                         ' f r i ' :   5 , 
                         ' s a t ' :   6 
                 } , 
                 m o n :   { 
                         ' j a n ' :   0 , 
                         ' f e b ' :   1 , 
                         ' m a r ' :   2 , 
                         ' a p r ' :   3 , 
                         ' m a y ' :   4 , 
                         ' j u n ' :   5 , 
                         ' j u l ' :   6 , 
                         ' a u g ' :   7 , 
                         ' s e p ' :   8 , 
                         ' o c t ' :   9 , 
                         ' n o v ' :   1 0 , 
                         ' d e c ' :   1 1 
                 } 
         } ; 
 
         v a r   p r o c e s s   =   f u n c t i o n   ( m )   { 
                 v a r   a g o   =   ( m [ 2 ]   & &   m [ 2 ]   = =   ' a g o ' ) ; 
                 v a r   n u m   =   ( n u m   =   m [ 0 ]   = =   ' l a s t '   ?   - 1   :   1 )   *   ( a g o   ?   - 1   :   1 ) ; 
 
                 s w i t c h   ( m [ 0 ] )   { 
                 c a s e   ' l a s t ' : 
                 c a s e   ' n e x t ' : 
                         s w i t c h   ( m [ 1 ] . s u b s t r i n g ( 0 ,   3 ) )   { 
                         c a s e   ' y e a ' : 
                                 n o w . s e t F u l l Y e a r ( n o w . g e t F u l l Y e a r ( )   +   n u m ) ; 
                                 b r e a k ; 
                         c a s e   ' m o n ' : 
                                 n o w . s e t M o n t h ( n o w . g e t M o n t h ( )   +   n u m ) ; 
                                 b r e a k ; 
                         c a s e   ' w e e ' : 
                                 n o w . s e t D a t e ( n o w . g e t D a t e ( )   +   ( n u m   *   7 ) ) ; 
                                 b r e a k ; 
                         c a s e   ' d a y ' : 
                                 n o w . s e t D a t e ( n o w . g e t D a t e ( )   +   n u m ) ; 
                                 b r e a k ; 
                         c a s e   ' h o u ' : 
                                 n o w . s e t H o u r s ( n o w . g e t H o u r s ( )   +   n u m ) ; 
                                 b r e a k ; 
                         c a s e   ' m i n ' : 
                                 n o w . s e t M i n u t e s ( n o w . g e t M i n u t e s ( )   +   n u m ) ; 
                                 b r e a k ; 
                         c a s e   ' s e c ' : 
                                 n o w . s e t S e c o n d s ( n o w . g e t S e c o n d s ( )   +   n u m ) ; 
                                 b r e a k ; 
                         d e f a u l t : 
                                 v a r   d a y ; 
                                 i f   ( t y p e o f ( d a y   =   _ _ i s . d a y [ m [ 1 ] . s u b s t r i n g ( 0 ,   3 ) ] )   ! =   ' u n d e f i n e d ' )   { 
                                         v a r   d i f f   =   d a y   -   n o w . g e t D a y ( ) ; 
                                         i f   ( d i f f   = =   0 )   { 
                                                 d i f f   =   7   *   n u m ; 
                                         }   e l s e   i f   ( d i f f   >   0 )   { 
                                                 i f   ( m [ 0 ]   = =   ' l a s t ' )   { 
                                                         d i f f   - =   7 ; 
                                                 } 
                                         }   e l s e   { 
                                                 i f   ( m [ 0 ]   = =   ' n e x t ' )   { 
                                                         d i f f   + =   7 ; 
                                                 } 
                                         } 
                                         n o w . s e t D a t e ( n o w . g e t D a t e ( )   +   d i f f ) ; 
                                 } 
                         } 
                         b r e a k ; 
 
                 d e f a u l t : 
                         i f   ( / \ d + / . t e s t ( m [ 0 ] ) )   { 
                                 n u m   * =   p a r s e I n t ( m [ 0 ] ,   1 0 ) ; 
 
                                 s w i t c h   ( m [ 1 ] . s u b s t r i n g ( 0 ,   3 ) )   { 
                                 c a s e   ' y e a ' : 
                                         n o w . s e t F u l l Y e a r ( n o w . g e t F u l l Y e a r ( )   +   n u m ) ; 
                                         b r e a k ; 
                                 c a s e   ' m o n ' : 
                                         n o w . s e t M o n t h ( n o w . g e t M o n t h ( )   +   n u m ) ; 
                                         b r e a k ; 
                                 c a s e   ' w e e ' : 
                                         n o w . s e t D a t e ( n o w . g e t D a t e ( )   +   ( n u m   *   7 ) ) ; 
                                         b r e a k ; 
                                 c a s e   ' d a y ' : 
                                         n o w . s e t D a t e ( n o w . g e t D a t e ( )   +   n u m ) ; 
                                         b r e a k ; 
                                 c a s e   ' h o u ' : 
                                         n o w . s e t H o u r s ( n o w . g e t H o u r s ( )   +   n u m ) ; 
                                         b r e a k ; 
                                 c a s e   ' m i n ' : 
                                         n o w . s e t M i n u t e s ( n o w . g e t M i n u t e s ( )   +   n u m ) ; 
                                         b r e a k ; 
                                 c a s e   ' s e c ' : 
                                         n o w . s e t S e c o n d s ( n o w . g e t S e c o n d s ( )   +   n u m ) ; 
                                         b r e a k ; 
                                 } 
                         }   e l s e   { 
                                 r e t u r n   f a l s e ; 
                         } 
                         b r e a k ; 
                 } 
                 r e t u r n   t r u e ; 
         } ; 
 
         m a t c h   =   s t r T m p . m a t c h ( / ^ ( \ d { 2 , 4 } - \ d { 2 } - \ d { 2 } ) ( ? : \ s ( \ d { 1 , 2 } : \ d { 2 } ( : \ d { 2 } ) ? ) ? ( ? : \ . ( \ d + ) ) ? ) ? $ / ) ; 
         i f   ( m a t c h   ! =   n u l l )   { 
                 i f   ( ! m a t c h [ 2 ] )   { 
                         m a t c h [ 2 ]   =   ' 0 0 : 0 0 : 0 0 ' ; 
                 }   e l s e   i f   ( ! m a t c h [ 3 ] )   { 
                         m a t c h [ 2 ]   + =   ' : 0 0 ' ; 
                 } 
 
                 s   =   m a t c h [ 1 ] . s p l i t ( / - / g ) ; 
 
                 f o r   ( i   i n   _ _ i s . m o n )   { 
                         i f   ( _ _ i s . m o n [ i ]   = =   s [ 1 ]   -   1 )   { 
                                 s [ 1 ]   =   i ; 
                         } 
                 } 
                 s [ 0 ]   =   p a r s e I n t ( s [ 0 ] ,   1 0 ) ; 
 
                 s [ 0 ]   =   ( s [ 0 ]   > =   0   & &   s [ 0 ]   < =   6 9 )   ?   ' 2 0 '   +   ( s [ 0 ]   <   1 0   ?   ' 0 '   +   s [ 0 ]   :   s [ 0 ]   +   ' ' )   :   ( s [ 0 ]   > =   7 0   & &   s [ 0 ]   < =   9 9 )   ?   ' 1 9 '   +   s [ 0 ]   :   s [ 0 ]   +   ' ' ; 
                 r e t u r n   p a r s e I n t ( t h i s . s t r t o t i m e ( s [ 2 ]   +   '   '   +   s [ 1 ]   +   '   '   +   s [ 0 ]   +   '   '   +   m a t c h [ 2 ] )   +   ( m a t c h [ 4 ]   ?   m a t c h [ 4 ]   /   1 0 0 0   :   ' ' ) ,   1 0 ) ; 
         } 
 
         v a r   r e g e x   =   ' ( [ + - ] ? \ \ d + \ \ s '   +   ' ( y e a r s ? | m o n t h s ? | w e e k s ? | d a y s ? | h o u r s ? | m i n | m i n u t e s ? | s e c | s e c o n d s ? '   +   ' | s u n \ \ . ? | s u n d a y | m o n \ \ . ? | m o n d a y | t u e \ \ . ? | t u e s d a y | w e d \ \ . ? | w e d n e s d a y '   +   ' | t h u \ \ . ? | t h u r s d a y | f r i \ \ . ? | f r i d a y | s a t \ \ . ? | s a t u r d a y ) '   +   ' | ( l a s t | n e x t ) \ \ s '   +   ' ( y e a r s ? | m o n t h s ? | w e e k s ? | d a y s ? | h o u r s ? | m i n | m i n u t e s ? | s e c | s e c o n d s ? '   +   ' | s u n \ \ . ? | s u n d a y | m o n \ \ . ? | m o n d a y | t u e \ \ . ? | t u e s d a y | w e d \ \ . ? | w e d n e s d a y '   +   ' | t h u \ \ . ? | t h u r s d a y | f r i \ \ . ? | f r i d a y | s a t \ \ . ? | s a t u r d a y ) ) '   +   ' ( \ \ s a g o ) ? ' ; 
 
         m a t c h   =   s t r T m p . m a t c h ( n e w   R e g E x p ( r e g e x ,   ' g i ' ) ) ;   / /   B r e t t :   s e e m s   s h o u l d   b e   c a s e   i n s e n s i t i v e   p e r   d o c s ,   s o   a d d e d   ' i ' 
         i f   ( m a t c h   = =   n u l l )   { 
                 r e t u r n   f a l s e ; 
         } 
 
         f o r   ( i   =   0 ;   i   <   m a t c h . l e n g t h ;   i + + )   { 
                 i f   ( ! p r o c e s s ( m a t c h [ i ] . s p l i t ( '   ' ) ) )   { 
                         r e t u r n   f a l s e ; 
                 } 
         } 
 
         r e t u r n   ( n o w . g e t T i m e ( )   /   1 0 0 0 ) ; 
 } 
 f u n c t i o n   d a t e   ( f o r m a t ,   t i m e s t a m p )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   C a r l o s   R .   L .   R o d r i g u e s   ( h t t p : / / w w w . j s f r o m h e l l . c o m ) 
         / /   +             p a r t s   b y :   P e t e r - P a u l   K o c h   ( h t t p : / / w w w . q u i r k s m o d e . o r g / j s / b e a t . h t m l ) 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   M e E t c   ( h t t p : / / y a s s . m e e t c w e b . c o m ) 
         / /   +       i m p r o v e d   b y :   B r a d   T o u e s n a r d 
         / /   +       i m p r o v e d   b y :   T i m   W i e l 
         / /   +       i m p r o v e d   b y :   B r y a n   E l l i o t t 
         / / 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       i m p r o v e d   b y :   D a v i d   R a n d a l l 
         / /   +             i n p u t   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       b u g f i x e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       i m p r o v e d   b y :   T h e r i a u l t 
         / /   +     d e r i v e d   f r o m :   g e t t i m e o f d a y 
         / /   +             i n p u t   b y :   m a j a k 
         / /   +       b u g f i x e d   b y :   m a j a k 
         / /   +       b u g f i x e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +             i n p u t   b y :   A l e x 
         / /   +       b u g f i x e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       i m p r o v e d   b y :   T h e r i a u l t 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       i m p r o v e d   b y :   T h e r i a u l t 
         / /   +       i m p r o v e d   b y :   T h o m a s   B e a u c o u r t   ( h t t p : / / w w w . w e b a p p . f r ) 
         / /   +       i m p r o v e d   b y :   J T 
         / /   +       i m p r o v e d   b y :   T h e r i a u l t 
         / /   +       i m p r o v e d   b y :   R a f a B  K u k a w s k i   ( h t t p : / / b l o g . k u k a w s k i . p l ) 
         / /   +             i n p u t   b y :   M a r t i n 
         / /   +             i n p u t   b y :   A l e x   W i l s o n 
         / /   %                 n o t e   1 :   U s e s   g l o b a l :   p h p _ j s   t o   s t o r e   t h e   d e f a u l t   t i m e z o n e 
         / /   %                 n o t e   2 :   A l t h o u g h   t h e   f u n c t i o n   p o t e n t i a l l y   a l l o w s   t i m e z o n e   i n f o   ( s e e   n o t e s ) ,   i t   c u r r e n t l y   d o e s   n o t   s e t 
         / /   %                 n o t e   2 :   p e r   a   t i m e z o n e   s p e c i f i e d   b y   d a t e _ d e f a u l t _ t i m e z o n e _ s e t ( ) .   I m p l e m e n t e r s   m i g h t   u s e 
         / /   %                 n o t e   2 :   t h i s . p h p _ j s . c u r r e n t T i m e z o n e O f f s e t   a n d   t h i s . p h p _ j s . c u r r e n t T i m e z o n e D S T   s e t   b y   t h a t   f u n c t i o n 
         / /   %                 n o t e   2 :   i n   o r d e r   t o   a d j u s t   t h e   d a t e s   i n   t h i s   f u n c t i o n   ( o r   o u r   o t h e r   d a t e   f u n c t i o n s ! )   a c c o r d i n g l y 
         / /   *           e x a m p l e   1 :   d a t e ( ' H : m : s   \ \ m   \ \ i \ \ s   \ \ m \ \ o \ \ n \ \ t \ \ h ' ,   1 0 6 2 4 0 2 4 0 0 ) ; 
         / /   *           r e t u r n s   1 :   ' 0 9 : 0 9 : 4 0   m   i s   m o n t h ' 
         / /   *           e x a m p l e   2 :   d a t e ( ' F   j ,   Y ,   g : i   a ' ,   1 0 6 2 4 6 2 4 0 0 ) ; 
         / /   *           r e t u r n s   2 :   ' S e p t e m b e r   2 ,   2 0 0 3 ,   2 : 2 6   a m ' 
         / /   *           e x a m p l e   3 :   d a t e ( ' Y   W   o ' ,   1 0 6 2 4 6 2 4 0 0 ) ; 
         / /   *           r e t u r n s   3 :   ' 2 0 0 3   3 6   2 0 0 3 ' 
         / /   *           e x a m p l e   4 :   x   =   d a t e ( ' Y   m   d ' ,   ( n e w   D a t e ( ) ) . g e t T i m e ( ) / 1 0 0 0 ) ;   
         / /   *           e x a m p l e   4 :   ( x + ' ' ) . l e n g t h   = =   1 0   / /   2 0 0 9   0 1   0 9 
         / /   *           r e t u r n s   4 :   t r u e 
         / /   *           e x a m p l e   5 :   d a t e ( ' W ' ,   1 1 0 4 5 3 4 0 0 0 ) ; 
         / /   *           r e t u r n s   5 :   ' 5 3 ' 
         / /   *           e x a m p l e   6 :   d a t e ( ' B   t ' ,   1 1 0 4 5 3 4 0 0 0 ) ; 
         / /   *           r e t u r n s   6 :   ' 9 9 9   3 1 ' 
         / /   *           e x a m p l e   7 :   d a t e ( ' W   U ' ,   1 2 9 3 7 5 0 0 0 0 . 8 2 ) ;   / /   2 0 1 0 - 1 2 - 3 1 
         / /   *           r e t u r n s   7 :   ' 5 2   1 2 9 3 7 5 0 0 0 0 ' 
         / /   *           e x a m p l e   8 :   d a t e ( ' W ' ,   1 2 9 3 8 3 6 4 0 0 ) ;   / /   2 0 1 1 - 0 1 - 0 1 
         / /   *           r e t u r n s   8 :   ' 5 2 ' 
         / /   *           e x a m p l e   9 :   d a t e ( ' W   Y - m - d ' ,   1 2 9 3 9 7 4 0 5 4 ) ;   / /   2 0 1 1 - 0 1 - 0 2 
         / /   *           r e t u r n s   9 :   ' 5 2   2 0 1 1 - 0 1 - 0 2 ' 
         v a r   t h a t   =   t h i s , 
                 j s d a t e ,   f ,   f o r m a t C h r   =   / \ \ ? ( [ a - z ] ) / g i , 
                 f o r m a t C h r C b , 
                 / /   K e e p   t h i s   h e r e   ( w o r k s ,   b u t   f o r   c o d e   c o m m e n t e d - o u t 
                 / /   b e l o w   f o r   f i l e   s i z e   r e a s o n s ) 
                 / / ,   t a l =   [ ] , 
                 _ p a d   =   f u n c t i o n   ( n ,   c )   { 
                         i f   ( ( n   =   n   +   ' ' ) . l e n g t h   <   c )   { 
                                 r e t u r n   n e w   A r r a y ( ( + + c )   -   n . l e n g t h ) . j o i n ( ' 0 ' )   +   n ; 
                         } 
                         r e t u r n   n ; 
                 } , 
                 t x t _ w o r d s   =   [ " S u n " ,   " M o n " ,   " T u e s " ,   " W e d n e s " ,   " T h u r s " ,   " F r i " ,   " S a t u r " ,   " J a n u a r y " ,   " F e b r u a r y " ,   " M a r c h " ,   " A p r i l " ,   " M a y " ,   " J u n e " ,   " J u l y " ,   " A u g u s t " ,   " S e p t e m b e r " ,   " O c t o b e r " ,   " N o v e m b e r " ,   " D e c e m b e r " ] ; 
         f o r m a t C h r C b   =   f u n c t i o n   ( t ,   s )   { 
                 r e t u r n   f [ t ]   ?   f [ t ] ( )   :   s ; 
         } ; 
         f   =   { 
                 / /   D a y 
                 d :   f u n c t i o n   ( )   {   / /   D a y   o f   m o n t h   w / l e a d i n g   0 ;   0 1 . . 3 1 
                         r e t u r n   _ p a d ( f . j ( ) ,   2 ) ; 
                 } , 
                 D :   f u n c t i o n   ( )   {   / /   S h o r t h a n d   d a y   n a m e ;   M o n . . . S u n 
                         r e t u r n   f . l ( ) . s l i c e ( 0 ,   3 ) ; 
                 } , 
                 j :   f u n c t i o n   ( )   {   / /   D a y   o f   m o n t h ;   1 . . 3 1 
                         r e t u r n   j s d a t e . g e t D a t e ( ) ; 
                 } , 
                 l :   f u n c t i o n   ( )   {   / /   F u l l   d a y   n a m e ;   M o n d a y . . . S u n d a y 
                         r e t u r n   t x t _ w o r d s [ f . w ( ) ]   +   ' d a y ' ; 
                 } , 
                 N :   f u n c t i o n   ( )   {   / /   I S O - 8 6 0 1   d a y   o f   w e e k ;   1 [ M o n ] . . 7 [ S u n ] 
                         r e t u r n   f . w ( )   | |   7 ; 
                 } , 
                 S :   f u n c t i o n   ( )   {   / /   O r d i n a l   s u f f i x   f o r   d a y   o f   m o n t h ;   s t ,   n d ,   r d ,   t h 
                         v a r   j   =   f . j ( ) ; 
                         r e t u r n   j   >   4   | |   j   <   2 1   ?   ' t h '   :   { 1 :   ' s t ' ,   2 :   ' n d ' ,   3 :   ' r d ' } [ j   %   1 0 ]   | |   ' t h ' ; 
                 } , 
                 w :   f u n c t i o n   ( )   {   / /   D a y   o f   w e e k ;   0 [ S u n ] . . 6 [ S a t ] 
                         r e t u r n   j s d a t e . g e t D a y ( ) ; 
                 } , 
                 z :   f u n c t i o n   ( )   {   / /   D a y   o f   y e a r ;   0 . . 3 6 5 
                         v a r   a   =   n e w   D a t e ( f . Y ( ) ,   f . n ( )   -   1 ,   f . j ( ) ) , 
                                 b   =   n e w   D a t e ( f . Y ( ) ,   0 ,   1 ) ; 
                         r e t u r n   M a t h . r o u n d ( ( a   -   b )   /   8 6 4 e 5 )   +   1 ; 
                 } , 
 
                 / /   W e e k 
                 W :   f u n c t i o n   ( )   {   / /   I S O - 8 6 0 1   w e e k   n u m b e r 
                         v a r   a   =   n e w   D a t e ( f . Y ( ) ,   f . n ( )   -   1 ,   f . j ( )   -   f . N ( )   +   3 ) , 
                                 b   =   n e w   D a t e ( a . g e t F u l l Y e a r ( ) ,   0 ,   4 ) ; 
                         r e t u r n   _ p a d ( 1   +   M a t h . r o u n d ( ( a   -   b )   /   8 6 4 e 5   /   7 ) ,   2 ) ; 
                 } , 
 
                 / /   M o n t h 
                 F :   f u n c t i o n   ( )   {   / /   F u l l   m o n t h   n a m e ;   J a n u a r y . . . D e c e m b e r 
                         r e t u r n   t x t _ w o r d s [ 6   +   f . n ( ) ] ; 
                 } , 
                 m :   f u n c t i o n   ( )   {   / /   M o n t h   w / l e a d i n g   0 ;   0 1 . . . 1 2 
                         r e t u r n   _ p a d ( f . n ( ) ,   2 ) ; 
                 } , 
                 M :   f u n c t i o n   ( )   {   / /   S h o r t h a n d   m o n t h   n a m e ;   J a n . . . D e c 
                         r e t u r n   f . F ( ) . s l i c e ( 0 ,   3 ) ; 
                 } , 
                 n :   f u n c t i o n   ( )   {   / /   M o n t h ;   1 . . . 1 2 
                         r e t u r n   j s d a t e . g e t M o n t h ( )   +   1 ; 
                 } , 
                 t :   f u n c t i o n   ( )   {   / /   D a y s   i n   m o n t h ;   2 8 . . . 3 1 
                         r e t u r n   ( n e w   D a t e ( f . Y ( ) ,   f . n ( ) ,   0 ) ) . g e t D a t e ( ) ; 
                 } , 
 
                 / /   Y e a r 
                 L :   f u n c t i o n   ( )   {   / /   I s   l e a p   y e a r ? ;   0   o r   1 
                         r e t u r n   n e w   D a t e ( f . Y ( ) ,   1 ,   2 9 ) . g e t M o n t h ( )   = = =   1   |   0 ; 
                 } , 
                 o :   f u n c t i o n   ( )   {   / /   I S O - 8 6 0 1   y e a r 
                         v a r   n   =   f . n ( ) , 
                                 W   =   f . W ( ) , 
                                 Y   =   f . Y ( ) ; 
                         r e t u r n   Y   +   ( n   = = =   1 2   & &   W   <   9   ?   - 1   :   n   = = =   1   & &   W   >   9 ) ; 
                 } , 
                 Y :   f u n c t i o n   ( )   {   / /   F u l l   y e a r ;   e . g .   1 9 8 0 . . . 2 0 1 0 
                         r e t u r n   j s d a t e . g e t F u l l Y e a r ( ) ; 
                 } , 
                 y :   f u n c t i o n   ( )   {   / /   L a s t   t w o   d i g i t s   o f   y e a r ;   0 0 . . . 9 9 
                         r e t u r n   ( f . Y ( )   +   " " ) . s l i c e ( - 2 ) ; 
                 } , 
 
                 / /   T i m e 
                 a :   f u n c t i o n   ( )   {   / /   a m   o r   p m 
                         r e t u r n   j s d a t e . g e t H o u r s ( )   >   1 1   ?   " p m "   :   " a m " ; 
                 } , 
                 A :   f u n c t i o n   ( )   {   / /   A M   o r   P M 
                         r e t u r n   f . a ( ) . t o U p p e r C a s e ( ) ; 
                 } , 
                 B :   f u n c t i o n   ( )   {   / /   S w a t c h   I n t e r n e t   t i m e ;   0 0 0 . . 9 9 9 
                         v a r   H   =   j s d a t e . g e t U T C H o u r s ( )   *   3 6 e 2 , 
                                 / /   H o u r s 
                                 i   =   j s d a t e . g e t U T C M i n u t e s ( )   *   6 0 , 
                                 / /   M i n u t e s 
                                 s   =   j s d a t e . g e t U T C S e c o n d s ( ) ;   / /   S e c o n d s 
                         r e t u r n   _ p a d ( M a t h . f l o o r ( ( H   +   i   +   s   +   3 6 e 2 )   /   8 6 . 4 )   %   1 e 3 ,   3 ) ; 
                 } , 
                 g :   f u n c t i o n   ( )   {   / /   1 2 - H o u r s ;   1 . . 1 2 
                         r e t u r n   f . G ( )   %   1 2   | |   1 2 ; 
                 } , 
                 G :   f u n c t i o n   ( )   {   / /   2 4 - H o u r s ;   0 . . 2 3 
                         r e t u r n   j s d a t e . g e t H o u r s ( ) ; 
                 } , 
                 h :   f u n c t i o n   ( )   {   / /   1 2 - H o u r s   w / l e a d i n g   0 ;   0 1 . . 1 2 
                         r e t u r n   _ p a d ( f . g ( ) ,   2 ) ; 
                 } , 
                 H :   f u n c t i o n   ( )   {   / /   2 4 - H o u r s   w / l e a d i n g   0 ;   0 0 . . 2 3 
                         r e t u r n   _ p a d ( f . G ( ) ,   2 ) ; 
                 } , 
                 i :   f u n c t i o n   ( )   {   / /   M i n u t e s   w / l e a d i n g   0 ;   0 0 . . 5 9 
                         r e t u r n   _ p a d ( j s d a t e . g e t M i n u t e s ( ) ,   2 ) ; 
                 } , 
                 s :   f u n c t i o n   ( )   {   / /   S e c o n d s   w / l e a d i n g   0 ;   0 0 . . 5 9 
                         r e t u r n   _ p a d ( j s d a t e . g e t S e c o n d s ( ) ,   2 ) ; 
                 } , 
                 u :   f u n c t i o n   ( )   {   / /   M i c r o s e c o n d s ;   0 0 0 0 0 0 - 9 9 9 0 0 0 
                         r e t u r n   _ p a d ( j s d a t e . g e t M i l l i s e c o n d s ( )   *   1 0 0 0 ,   6 ) ; 
                 } , 
 
                 / /   T i m e z o n e 
                 e :   f u n c t i o n   ( )   {   / /   T i m e z o n e   i d e n t i f i e r ;   e . g .   A t l a n t i c / A z o r e s ,   . . . 
                         / /   T h e   f o l l o w i n g   w o r k s ,   b u t   r e q u i r e s   i n c l u s i o n   o f   t h e   v e r y   l a r g e 
                         / /   t i m e z o n e _ a b b r e v i a t i o n s _ l i s t ( )   f u n c t i o n . 
 / *                             r e t u r n   t h i s . d a t e _ d e f a u l t _ t i m e z o n e _ g e t ( ) ; 
 * / 
                         t h r o w   ' N o t   s u p p o r t e d   ( s e e   s o u r c e   c o d e   o f   d a t e ( )   f o r   t i m e z o n e   o n   h o w   t o   a d d   s u p p o r t ) ' ; 
                 } , 
                 I :   f u n c t i o n   ( )   {   / /   D S T   o b s e r v e d ? ;   0   o r   1 
                         / /   C o m p a r e s   J a n   1   m i n u s   J a n   1   U T C   t o   J u l   1   m i n u s   J u l   1   U T C . 
                         / /   I f   t h e y   a r e   n o t   e q u a l ,   t h e n   D S T   i s   o b s e r v e d . 
                         v a r   a   =   n e w   D a t e ( f . Y ( ) ,   0 ) , 
                                 / /   J a n   1 
                                 c   =   D a t e . U T C ( f . Y ( ) ,   0 ) , 
                                 / /   J a n   1   U T C 
                                 b   =   n e w   D a t e ( f . Y ( ) ,   6 ) , 
                                 / /   J u l   1 
                                 d   =   D a t e . U T C ( f . Y ( ) ,   6 ) ;   / /   J u l   1   U T C 
                         r e t u r n   0   +   ( ( a   -   c )   ! = =   ( b   -   d ) ) ; 
                 } , 
                 O :   f u n c t i o n   ( )   {   / /   D i f f e r e n c e   t o   G M T   i n   h o u r   f o r m a t ;   e . g .   + 0 2 0 0 
                         v a r   a   =   j s d a t e . g e t T i m e z o n e O f f s e t ( ) ; 
                         r e t u r n   ( a   >   0   ?   " - "   :   " + " )   +   _ p a d ( M a t h . a b s ( a   /   6 0   *   1 0 0 ) ,   4 ) ; 
                 } , 
                 P :   f u n c t i o n   ( )   {   / /   D i f f e r e n c e   t o   G M T   w / c o l o n ;   e . g .   + 0 2 : 0 0 
                         v a r   O   =   f . O ( ) ; 
                         r e t u r n   ( O . s u b s t r ( 0 ,   3 )   +   " : "   +   O . s u b s t r ( 3 ,   2 ) ) ; 
                 } , 
                 T :   f u n c t i o n   ( )   {   / /   T i m e z o n e   a b b r e v i a t i o n ;   e . g .   E S T ,   M D T ,   . . . 
                         / /   T h e   f o l l o w i n g   w o r k s ,   b u t   r e q u i r e s   i n c l u s i o n   o f   t h e   v e r y 
                         / /   l a r g e   t i m e z o n e _ a b b r e v i a t i o n s _ l i s t ( )   f u n c t i o n . 
 / *                             v a r   a b b r   =   ' ' ,   i   =   0 ,   o s   =   0 ,   d e f a u l t   =   0 ; 
                         i f   ( ! t a l . l e n g t h )   { 
                                 t a l   =   t h a t . t i m e z o n e _ a b b r e v i a t i o n s _ l i s t ( ) ; 
                         } 
                         i f   ( t h a t . p h p _ j s   & &   t h a t . p h p _ j s . d e f a u l t _ t i m e z o n e )   { 
                                 d e f a u l t   =   t h a t . p h p _ j s . d e f a u l t _ t i m e z o n e ; 
                                 f o r   ( a b b r   i n   t a l )   { 
                                         f o r   ( i = 0 ;   i   <   t a l [ a b b r ] . l e n g t h ;   i + + )   { 
                                                 i f   ( t a l [ a b b r ] [ i ] . t i m e z o n e _ i d   = = =   d e f a u l t )   { 
                                                         r e t u r n   a b b r . t o U p p e r C a s e ( ) ; 
                                                 } 
                                         } 
                                 } 
                         } 
                         f o r   ( a b b r   i n   t a l )   { 
                                 f o r   ( i   =   0 ;   i   <   t a l [ a b b r ] . l e n g t h ;   i + + )   { 
                                         o s   =   - j s d a t e . g e t T i m e z o n e O f f s e t ( )   *   6 0 ; 
                                         i f   ( t a l [ a b b r ] [ i ] . o f f s e t   = = =   o s )   { 
                                                 r e t u r n   a b b r . t o U p p e r C a s e ( ) ; 
                                         } 
                                 } 
                         } 
 * / 
                         r e t u r n   ' U T C ' ; 
                 } , 
                 Z :   f u n c t i o n   ( )   {   / /   T i m e z o n e   o f f s e t   i n   s e c o n d s   ( - 4 3 2 0 0 . . . 5 0 4 0 0 ) 
                         r e t u r n   - j s d a t e . g e t T i m e z o n e O f f s e t ( )   *   6 0 ; 
                 } , 
 
                 / /   F u l l   D a t e / T i m e 
                 c :   f u n c t i o n   ( )   {   / /   I S O - 8 6 0 1   d a t e . 
                         r e t u r n   ' Y - m - d \ \ T h : i : s P ' . r e p l a c e ( f o r m a t C h r ,   f o r m a t C h r C b ) ; 
                 } , 
                 r :   f u n c t i o n   ( )   {   / /   R F C   2 8 2 2 
                         r e t u r n   ' D ,   d   M   Y   H : i : s   O ' . r e p l a c e ( f o r m a t C h r ,   f o r m a t C h r C b ) ; 
                 } , 
                 U :   f u n c t i o n   ( )   {   / /   S e c o n d s   s i n c e   U N I X   e p o c h 
                         r e t u r n   j s d a t e . g e t T i m e ( )   /   1 0 0 0   |   0 ; 
                 } 
         } ; 
         t h i s . d a t e   =   f u n c t i o n   ( f o r m a t ,   t i m e s t a m p )   { 
                 t h a t   =   t h i s ; 
                 j s d a t e   =   ( ( t y p e o f   t i m e s t a m p   = = =   ' u n d e f i n e d ' )   ?   n e w   D a t e ( )   :   / /   N o t   p r o v i d e d 
                 ( t i m e s t a m p   i n s t a n c e o f   D a t e )   ?   n e w   D a t e ( t i m e s t a m p )   :   / /   J S   D a t e ( ) 
                 n e w   D a t e ( t i m e s t a m p   *   1 0 0 0 )   / /   U N I X   t i m e s t a m p   ( a u t o - c o n v e r t   t o   i n t ) 
                 ) ; 
                 r e t u r n   f o r m a t . r e p l a c e ( f o r m a t C h r ,   f o r m a t C h r C b ) ; 
         } ; 
         r e t u r n   t h i s . d a t e ( f o r m a t ,   t i m e s t a m p ) ; 
 } 
 f u n c t i o n   t i m e _ s l e e p _ u n t i l   ( t i m e s t a m p )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   %                     n o t e :   F o r   s t u d y   p u r p o s e s .   C u r r e n t   i m p l e m e n t a t i o n   c o u l d   l o c k   u p   t h e   u s e r ' s   b r o w s e r . 
         / /   %                     n o t e :   E x p e c t s   a   t i m e s t a m p   i n   s e c o n d s ,   s o   D O   N O T   p a s s   i n   a   J a v a S c r i p t   t i m e s t a m p   w h i c h   a r e   i n   m i l l i s e c o n d s   ( e . g . ,   n e w   D a t e ( ) )   o r   o t h e r w i s e   t h e   f u n c t i o n   w i l l   l o c k   u p   t h e   b r o w s e r   1 0 0 0   t i m e s   l o n g e r   t h a n   p r o b a b l y   i n t e n d e d . 
         / /   %                     n o t e :   C o n s i d e r   u s i n g   s e t T i m e o u t ( )   i n s t e a d . 
         / /   *           e x a m p l e   1 :   t i m e _ s l e e p _ u n t i l ( 1 2 3 3 1 4 6 5 0 1 )   / /   d e l a y s   u n t i l   t h e   t i m e   i n d i c a t e d   b y   t h e   g i v e n   t i m e s t a m p   i s   r e a c h e d 
         / /   *           r e t u r n s   1 :   t r u e 
         w h i l e   ( n e w   D a t e ( )   <   t i m e s t a m p   *   1 0 0 0 )   { } 
         r e t u r n   t r u e ; 
 } 
 f u n c t i o n   e c h o   ( )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   P h i l i p   P e t e r s o n 
         / /   +       i m p r o v e d   b y :   e c h o   i s   b a d 
         / /   +       i m p r o v e d   b y :   N a t e 
         / /   +         r e v i s e d   b y :   D e r   S i m o n   ( h t t p : / / i n n e r d o m . s o u r c e f o r g e . n e t / ) 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       b u g f i x e d   b y :   E u g e n e   B u l k i n   ( h t t p : / / d o u b l e a w . c o m / ) 
         / /   +       i n p u t   b y :   J B 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       b u g f i x e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       b u g f i x e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       b u g f i x e d   b y :   E d o r F a u s 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   %                 n o t e   1 :   I f   b r o w s e r s   s t a r t   t o   s u p p o r t   D O M   L e v e l   3   L o a d   a n d   S a v e   ( p a r s i n g / s e r i a l i z i n g ) , 
         / /   %                 n o t e   1 :   w e   w o u l d n ' t   n e e d   a n y   s u c h   l o n g   c o d e   ( e v e n   m o s t   o f   t h e   c o d e   b e l o w ) .   S e e 
         / /   %                 n o t e   1 :   l i n k   b e l o w   f o r   a   c r o s s - b r o w s e r   i m p l e m e n t a t i o n   i n   J a v a S c r i p t .   H T M L 5   m i g h t 
         / /   %                 n o t e   1 :   p o s s i b l y   s u p p o r t   D O M P a r s e r ,   b u t   t h a t   i s   n o t   p r e s e n t l y   a   s t a n d a r d . 
         / /   %                 n o t e   2 :   A l t h o u g h   i n n e r H T M L   i s   w i d e l y   u s e d   a n d   m a y   b e c o m e   s t a n d a r d   a s   o f   H T M L 5 ,   i t   i s   a l s o   n o t   i d e a l   f o r 
         / /   %                 n o t e   2 :   u s e   w i t h   a   t e m p o r a r y   h o l d e r   b e f o r e   a p p e n d i n g   t o   t h e   D O M   ( a s   i s   o u r   l a s t   r e s o r t   b e l o w ) , 
         / /   %                 n o t e   2 :   s i n c e   i t   m a y   n o t   w o r k   i n   a n   X M L   c o n t e x t 
         / /   %                 n o t e   3 :   U s i n g   i n n e r H T M L   t o   d i r e c t l y   a d d   t o   t h e   B O D Y   i s   v e r y   d a n g e r o u s   b e c a u s e   i t   w i l l 
         / /   %                 n o t e   3 :   b r e a k   a l l   p r e - e x i s t i n g   r e f e r e n c e s   t o   H T M L E l e m e n t s . 
         / /   *           e x a m p l e   1 :   e c h o ( ' < d i v > < p > a b c < / p > < p > a b c < / p > < / d i v > ' ) ; 
         / /   *           r e t u r n s   1 :   u n d e f i n e d 
         / /   F i x :   T h i s   f u n c t i o n   r e a l l y   n e e d s   t o   a l l o w   n o n - X H T M L   i n p u t   ( u n l e s s   i n   t r u e   X H T M L   m o d e )   a s   i n   j Q u e r y 
         v a r   a r g   =   ' ' , 
                 a r g c   =   a r g u m e n t s . l e n g t h , 
                 a r g v   =   a r g u m e n t s , 
                 i   =   0 , 
                 h o l d e r ,   w i n   =   t h i s . w i n d o w , 
                 d   =   w i n . d o c u m e n t , 
                 n s _ x h t m l   =   ' h t t p : / / w w w . w 3 . o r g / 1 9 9 9 / x h t m l ' , 
                 n s _ x u l   =   ' h t t p : / / w w w . m o z i l l a . o r g / k e y m a s t e r / g a t e k e e p e r / t h e r e . i s . o n l y . x u l ' ;   / /   I f   w e ' r e   i n   a   X U L   c o n t e x t 
         v a r   s t r i n g T o D O M   =   f u n c t i o n   ( s t r ,   p a r e n t ,   n s ,   c o n t a i n e r )   { 
                 v a r   e x t r a N S s   =   ' ' ; 
                 i f   ( n s   = = =   n s _ x u l )   { 
                         e x t r a N S s   =   '   x m l n s : h t m l = " '   +   n s _ x h t m l   +   ' " ' ; 
                 } 
                 v a r   s t r i n g C o n t a i n e r   =   ' < '   +   c o n t a i n e r   +   '   x m l n s = " '   +   n s   +   ' " '   +   e x t r a N S s   +   ' > '   +   s t r   +   ' < / '   +   c o n t a i n e r   +   ' > ' ; 
                 v a r   d i l s   =   w i n . D O M I m p l e m e n t a t i o n L S , 
                         d p   =   w i n . D O M P a r s e r , 
                         a x   =   w i n . A c t i v e X O b j e c t ; 
                 i f   ( d i l s   & &   d i l s . c r e a t e L S I n p u t   & &   d i l s . c r e a t e L S P a r s e r )   { 
                         / /   F o l l o w s   t h e   D O M   3   L o a d   a n d   S a v e   s t a n d a r d ,   b u t   n o t 
                         / /   i m p l e m e n t e d   i n   b r o w s e r s   a t   p r e s e n t ;   H T M L 5   i s   t o   s t a n d a r d i z e   o n   i n n e r H T M L ,   b u t   n o t   f o r   X M L   ( t h o u g h 
                         / /   p o s s i b l y   w i l l   a l s o   s t a n d a r d i z e   w i t h   D O M P a r s e r ) ;   i n   t h e   m e a n t i m e ,   t o   e n s u r e   f u l l e s t   b r o w s e r   s u p p o r t ,   c o u l d 
                         / /   a t t a c h   h t t p : / / s v n 2 . a s s e m b l a . c o m / s v n / b r e t t z 9 / D O M T o S t r i n g / D O M 3 . j s   ( s e e   h t t p : / / s v n 2 . a s s e m b l a . c o m / s v n / b r e t t z 9 / D O M T o S t r i n g / D O M 3 . x h t m l   f o r   a   s i m p l e   t e s t   f i l e ) 
                         v a r   l s I n p u t   =   d i l s . c r e a t e L S I n p u t ( ) ; 
                         / /   I f   w e ' r e   i n   X H T M L ,   w e ' l l   t r y   t o   a l l o w   t h e   X H T M L   n a m e s p a c e   t o   b e   a v a i l a b l e   b y   d e f a u l t 
                         l s I n p u t . s t r i n g D a t a   =   s t r i n g C o n t a i n e r ; 
                         v a r   l s P a r s e r   =   d i l s . c r e a t e L S P a r s e r ( 1 ,   n u l l ) ;   / /   s y n c h r o n o u s ,   n o   s c h e m a   t y p e 
                         r e t u r n   l s P a r s e r . p a r s e ( l s I n p u t ) . f i r s t C h i l d ; 
                 }   e l s e   i f   ( d p )   { 
                         / /   I f   w e ' r e   i n   X H T M L ,   w e ' l l   t r y   t o   a l l o w   t h e   X H T M L   n a m e s p a c e   t o   b e   a v a i l a b l e   b y   d e f a u l t 
                         t r y   { 
                                 v a r   f c   =   n e w   d p ( ) . p a r s e F r o m S t r i n g ( s t r i n g C o n t a i n e r ,   ' t e x t / x m l ' ) ; 
                                 i f   ( f c   & &   f c . d o c u m e n t E l e m e n t   & &   f c . d o c u m e n t E l e m e n t . l o c a l N a m e   ! = =   ' p a r s e r e r r o r '   & &   f c . d o c u m e n t E l e m e n t . n a m e s p a c e U R I   ! = =   ' h t t p : / / w w w . m o z i l l a . o r g / n e w l a y o u t / x m l / p a r s e r e r r o r . x m l ' )   { 
                                         r e t u r n   f c . d o c u m e n t E l e m e n t . f i r s t C h i l d ; 
                                 } 
                                 / /   I f   t h e r e ' s   a   p a r s i n g   e r r o r ,   w e   j u s t   c o n t i n u e   o n 
                         }   c a t c h   ( e )   { 
                                 / /   I f   t h e r e ' s   a   p a r s i n g   e r r o r ,   w e   j u s t   c o n t i n u e   o n 
                         } 
                 }   e l s e   i f   ( a x )   {   / /   W e   d o n ' t   b o t h e r   w i t h   a   h o l d e r   i n   E x p l o r e r   a s   i t   d o e s n ' t   s u p p o r t   n a m e s p a c e s 
                         v a r   a x o   =   n e w   a x ( ' M S X M L 2 . D O M D o c u m e n t ' ) ; 
                         a x o . l o a d X M L ( s t r ) ; 
                         r e t u r n   a x o . d o c u m e n t E l e m e n t ; 
                 } 
 / * e l s e   i f   ( w i n . X M L H t t p R e q u e s t )   {   / /   S u p p o s e d   t o   w o r k   i n   o l d e r   S a f a r i 
                         v a r   r e q   =   n e w   w i n . X M L H t t p R e q u e s t ; 
                         r e q . o p e n ( ' G E T ' ,   ' d a t a : a p p l i c a t i o n / x m l ; c h a r s e t = u t f - 8 , ' + e n c o d e U R I C o m p o n e n t ( s t r ) ,   f a l s e ) ; 
                         i f   ( r e q . o v e r r i d e M i m e T y p e )   { 
                                 r e q . o v e r r i d e M i m e T y p e ( ' a p p l i c a t i o n / x m l ' ) ; 
                         } 
                         r e q . s e n d ( n u l l ) ; 
                         r e t u r n   r e q . r e s p o n s e X M L ; 
                 } * / 
                 / /   D o c u m e n t   f r a g m e n t   d i d   n o t   w o r k   w i t h   i n n e r H T M L ,   s o   w e   c r e a t e   a   t e m p o r a r y   e l e m e n t   h o l d e r 
                 / /   I f   w e ' r e   i n   X H T M L ,   w e ' l l   t r y   t o   a l l o w   t h e   X H T M L   n a m e s p a c e   t o   b e   a v a i l a b l e   b y   d e f a u l t 
                 / / i f   ( d . c r e a t e E l e m e n t N S   & &   ( d . c o n t e n t T y p e   & &   d . c o n t e n t T y p e   ! = =   ' t e x t / h t m l ' ) )   {   / /   D o n ' t   c r e a t e   n a m e s p a c e d   e l e m e n t s   i f   w e ' r e   b e i n g   s e r v e d   a s   H T M L   ( c u r r e n t l y   o n l y   M o z i l l a   s u p p o r t s   t h i s   d e t e c t i o n   i n   t r u e   X H T M L - s u p p o r t i n g   b r o w s e r s ,   b u t   S a f a r i   a n d   O p e r a   s h o u l d   w o r k   w i t h   t h e   a b o v e   D O M P a r s e r   a n y w a y s ,   a n d   I E   d o e s n ' t   s u p p o r t   c r e a t e E l e m e n t N S   a n y w a y s ) 
                 i f   ( d . c r e a t e E l e m e n t N S   & &   / /   B r o w s e r   s u p p o r t s   t h e   m e t h o d 
                 ( d . d o c u m e n t E l e m e n t . n a m e s p a c e U R I   | |   / /   W e   c a n   u s e   i f   t h e   d o c u m e n t   i s   u s i n g   a   n a m e s p a c e 
                 d . d o c u m e n t E l e m e n t . n o d e N a m e . t o L o w e r C a s e ( )   ! = =   ' h t m l '   | |   / /   W e   k n o w   i t ' s   n o t   H T M L 4   o r   l e s s ,   i f   t h e   t a g   i s   n o t   H T M L   ( e v e n   i f   t h e   r o o t   n a m e s p a c e   i s   n u l l ) 
                 ( d . c o n t e n t T y p e   & &   d . c o n t e n t T y p e   ! = =   ' t e x t / h t m l ' )   / /   W e   k n o w   i t ' s   n o t   r e g u l a r   H T M L 4   o r   l e s s   i f   t h i s   i s   M o z i l l a   ( o n l y   b r o w s e r   s u p p o r t i n g   t h e   a t t r i b u t e )   a n d   t h e   c o n t e n t   t y p e   i s   s o m e t h i n g   o t h e r   t h a n   t e x t / h t m l ;   o t h e r   H T M L 5   r o o t s   ( l i k e   s v g )   s t i l l   h a v e   a   n a m e s p a c e 
                 ) )   {   / /   D o n ' t   c r e a t e   n a m e s p a c e d   e l e m e n t s   i f   w e ' r e   b e i n g   s e r v e d   a s   H T M L   ( c u r r e n t l y   o n l y   M o z i l l a   s u p p o r t s   t h i s   d e t e c t i o n   i n   t r u e   X H T M L - s u p p o r t i n g   b r o w s e r s ,   b u t   S a f a r i   a n d   O p e r a   s h o u l d   w o r k   w i t h   t h e   a b o v e   D O M P a r s e r   a n y w a y s ,   a n d   I E   d o e s n ' t   s u p p o r t   c r e a t e E l e m e n t N S   a n y w a y s ) ;   l a s t   t e s t   i s   f o r   t h e   s a k e   o f   b e i n g   i n   a   p u r e   X M L   d o c u m e n t 
                         h o l d e r   =   d . c r e a t e E l e m e n t N S ( n s ,   c o n t a i n e r ) ; 
                 }   e l s e   { 
                         h o l d e r   =   d . c r e a t e E l e m e n t ( c o n t a i n e r ) ;   / /   D o c u m e n t   f r a g m e n t   d i d   n o t   w o r k   w i t h   i n n e r H T M L 
                 } 
                 h o l d e r . i n n e r H T M L   =   s t r ; 
                 w h i l e   ( h o l d e r . f i r s t C h i l d )   { 
                         p a r e n t . a p p e n d C h i l d ( h o l d e r . f i r s t C h i l d ) ; 
                 } 
                 r e t u r n   f a l s e ; 
                 / /   t h r o w   ' Y o u r   b r o w s e r   d o e s   n o t   s u p p o r t   D O M   p a r s i n g   a s   r e q u i r e d   b y   e c h o ( ) ' ; 
         } ; 
 
 
         v a r   i e F i x   =   f u n c t i o n   ( n o d e )   { 
                 i f   ( n o d e . n o d e T y p e   = = =   1 )   { 
                         v a r   n e w N o d e   =   d . c r e a t e E l e m e n t ( n o d e . n o d e N a m e ) ; 
                         v a r   i ,   l e n ; 
                         i f   ( n o d e . a t t r i b u t e s   & &   n o d e . a t t r i b u t e s . l e n g t h   >   0 )   { 
                                 f o r   ( i   =   0 ,   l e n   =   n o d e . a t t r i b u t e s . l e n g t h ;   i   <   l e n ;   i + + )   { 
                                         n e w N o d e . s e t A t t r i b u t e ( n o d e . a t t r i b u t e s [ i ] . n o d e N a m e ,   n o d e . g e t A t t r i b u t e ( n o d e . a t t r i b u t e s [ i ] . n o d e N a m e ) ) ; 
                                 } 
                         } 
                         i f   ( n o d e . c h i l d N o d e s   & &   n o d e . c h i l d N o d e s . l e n g t h   >   0 )   { 
                                 f o r   ( i   =   0 ,   l e n   =   n o d e . c h i l d N o d e s . l e n g t h ;   i   <   l e n ;   i + + )   { 
                                         n e w N o d e . a p p e n d C h i l d ( i e F i x ( n o d e . c h i l d N o d e s [ i ] ) ) ; 
                                 } 
                         } 
                         r e t u r n   n e w N o d e ; 
                 }   e l s e   { 
                         r e t u r n   d . c r e a t e T e x t N o d e ( n o d e . n o d e V a l u e ) ; 
                 } 
         } ; 
 
         v a r   r e p l a c e r   =   f u n c t i o n   ( s ,   m 1 ,   m 2 )   { 
                 / /   W e   a s s u m e   f o r   n o w   t h a t   e m b e d d e d   v a r i a b l e s   d o   n o t   h a v e   d o l l a r   s i g n ;   t o   a d d   a   d o l l a r   s i g n ,   y o u   c u r r e n t l y   m u s t   u s e   { $ $ v a r }   ( W e   m i g h t   c h a n g e   t h i s ,   h o w e v e r . ) 
                 / /   D o e s n ' t   c o v e r   a l l   c a s e s   y e t :   s e e   h t t p : / / p h p . n e t / m a n u a l / e n / l a n g u a g e . t y p e s . s t r i n g . p h p # l a n g u a g e . t y p e s . s t r i n g . s y n t a x . d o u b l e 
                 i f   ( m 1   ! = =   ' \ \ ' )   { 
                         r e t u r n   m 1   +   e v a l ( m 2 ) ; 
                 }   e l s e   { 
                         r e t u r n   s ; 
                 } 
         } ; 
 
         t h i s . p h p _ j s   =   t h i s . p h p _ j s   | |   { } ; 
         v a r   p h p j s   =   t h i s . p h p _ j s , 
                 i n i   =   p h p j s . i n i , 
                 o b s   =   p h p j s . o b s ; 
         f o r   ( i   =   0 ;   i   <   a r g c ;   i + + )   { 
                 a r g   =   a r g v [ i ] ; 
                 i f   ( i n i   & &   i n i [ ' p h p j s . e c h o _ e m b e d d e d _ v a r s ' ] )   { 
                         a r g   =   a r g . r e p l a c e ( / ( . ? ) \ { ? \ $ ( \ w * ? \ } | \ w * ) / g ,   r e p l a c e r ) ; 
                 } 
 
                 i f   ( ! p h p j s . f l u s h i n g   & &   o b s   & &   o b s . l e n g t h )   {   / /   I f   f l u s h i n g   w e   o u t p u t ,   b u t   o t h e r w i s e   p r e s e n c e   o f   a   b u f f e r   m e a n s   c a c h i n g   o u t p u t 
                         o b s [ o b s . l e n g t h   -   1 ] . b u f f e r   + =   a r g ; 
                         c o n t i n u e ; 
                 } 
 
                 i f   ( d . a p p e n d C h i l d )   { 
                         i f   ( d . b o d y )   { 
                                 i f   ( w i n . n a v i g a t o r . a p p N a m e   = = =   ' M i c r o s o f t   I n t e r n e t   E x p l o r e r ' )   {   / /   W e   u n f o r t u n a t e l y   c a n n o t   u s e   f e a t u r e   d e t e c t i o n ,   s i n c e   t h i s   i s   a n   I E   b u g   w i t h   c l o n e N o d e   n o d e s   b e i n g   a p p e n d e d 
                                         d . b o d y . a p p e n d C h i l d ( s t r i n g T o D O M ( i e F i x ( a r g ) ) ) ; 
                                 }   e l s e   { 
                                         v a r   u n a p p e n d e d L e f t   =   s t r i n g T o D O M ( a r g ,   d . b o d y ,   n s _ x h t m l ,   ' d i v ' ) . c l o n e N o d e ( t r u e ) ;   / /   W e   w i l l   n o t   a c t u a l l y   a p p e n d   t h e   d i v   t a g   ( j u s t   u s i n g   f o r   p r o v i d i n g   X H T M L   n a m e s p a c e   b y   d e f a u l t ) 
                                         i f   ( u n a p p e n d e d L e f t )   { 
                                                 d . b o d y . a p p e n d C h i l d ( u n a p p e n d e d L e f t ) ; 
                                         } 
                                 } 
                         }   e l s e   { 
                                 d . d o c u m e n t E l e m e n t . a p p e n d C h i l d ( s t r i n g T o D O M ( a r g ,   d . d o c u m e n t E l e m e n t ,   n s _ x u l ,   ' d e s c r i p t i o n ' ) ) ;   / /   W e   w i l l   n o t   a c t u a l l y   a p p e n d   t h e   d e s c r i p t i o n   t a g   ( j u s t   u s i n g   f o r   p r o v i d i n g   X U L   n a m e s p a c e   b y   d e f a u l t ) 
                         } 
                 }   e l s e   i f   ( d . w r i t e )   { 
                         d . w r i t e ( a r g ) ; 
                 } 
 / *   e l s e   {   / /   T h i s   c o u l d   r e c u r s e   i f   w e   e v e r   a d d   p r i n t ! 
                         p r i n t ( a r g ) ; 
                 } * / 
         } 
 } 
 f u n c t i o n   i 1 8 n _ l o c _ s e t _ d e f a u l t   ( n a m e )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   %                     n o t e   1 :   R e n a m e d   i n   P H P 6   f r o m   l o c a l e _ s e t _ d e f a u l t ( ) .   N o t   l i s t e d   y e t   a t   p h p . n e t 
         / /   %                     n o t e   2 :   L i s t   o f   l o c a l e s   a t   h t t p : / / d e m o . i c u - p r o j e c t . o r g / i c u - b i n / l o c e x p   ( u s e   f o r   i m p l e m e n t i n g   o t h e r   l o c a l e s   h e r e ) 
         / /   %                     n o t e   3 :   T o   b e   u s a b l e   w i t h   s o r t ( )   i f   i t   i s   p a s s e d   t h e   S O R T _ L O C A L E _ S T R I N G   s o r t i n g   f l a g :   h t t p : / / p h p . n e t / m a n u a l / e n / f u n c t i o n . s o r t . p h p 
         / /   *           e x a m p l e   1 :   i 1 8 n _ l o c _ s e t _ d e f a u l t ( ' p t _ P T ' ) ; 
         / /   *           r e t u r n s   1 :   t r u e 
 
         / /   B E G I N   R E D U N D A N T 
         t h i s . p h p _ j s   =   t h i s . p h p _ j s   | |   { } ; 
         / /   E N D   R E D U N D A N T 
 
         t h i s . p h p _ j s . i 1 8 n L o c a l e s   =   { 
                 e n _ U S _ P O S I X :   { 
                         s o r t i n g :   f u n c t i o n   ( s t r 1 ,   s t r 2 )   {   / /   F i x :   T h i s   o n e   t a k e n   f r o m   s t r c m p ,   b u t   n e e d   f o r   o t h e r   l o c a l e s ;   w e   d o n ' t   u s e   l o c a l e C o m p a r e   s i n c e   i t s   l o c a l e   i s   n o t   s e t t a b l e 
                                 r e t u r n   ( s t r 1   = =   s t r 2 )   ?   0   :   ( ( s t r 1   >   s t r 2 )   ?   1   :   - 1 ) ; 
                         } 
                 } 
         } ; 
 
         t h i s . p h p _ j s . i 1 8 n L o c a l e   =   n a m e ; 
         r e t u r n   t r u e ; 
 } 
 f u n c t i o n   i 1 8 n _ l o c _ g e t _ d e f a u l t   ( )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   %                     n o t e   1 :   R e n a m e d   i n   P H P 6   f r o m   l o c a l e _ g e t _ d e f a u l t ( ) .   N o t   l i s t e d   y e t   a t   p h p . n e t 
         / /   %                     n o t e   2 :   L i s t   o f   l o c a l e s   a t   h t t p : / / d e m o . i c u - p r o j e c t . o r g / i c u - b i n / l o c e x p 
         / /   %                     n o t e   3 :   T o   b e   u s a b l e   w i t h   s o r t ( )   i f   i t   i s   p a s s e d   t h e   S O R T _ L O C A L E _ S T R I N G   s o r t i n g   f l a g :   h t t p : / / p h p . n e t / m a n u a l / e n / f u n c t i o n . s o r t . p h p 
         / /   -         d e p e n d s   o n :   i 1 8 n _ l o c _ s e t _ d e f a u l t 
         / /   *           e x a m p l e   1 :   i 1 8 n _ l o c _ g e t _ d e f a u l t ( ) ; 
         / /   *           r e t u r n s   1 :   ' e n _ U S _ P O S I X ' 
 
         / /   B E G I N   R E D U N D A N T 
         t h i s . p h p _ j s   =   t h i s . p h p _ j s   | |   { } ; 
         / /   E N D   R E D U N D A N T 
         r e t u r n   t h i s . p h p _ j s . i 1 8 n L o c a l e   | |   ( i 1 8 n _ l o c _ s e t _ d e f a u l t ( ' e n _ U S _ P O S I X ' ) ,   ' e n _ U S _ P O S I X ' ) ;   / /   E n s u r e   d e f a u l t s   a r e   s e t   u p 
 } 
 f u n c t i o n   s t r c m p   ( s t r 1 ,   s t r 2 )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   W a l d o   M a l q u i   S i l v a 
         / /   +             i n p u t   b y :   S t e v e   H i l d e r 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +         r e v i s e d   b y :   g o r t h a u r 
         / /   *           e x a m p l e   1 :   s t r c m p (   ' w a l d o ' ,   ' o w a l d '   ) ; 
         / /   *           r e t u r n s   1 :   1 
         / /   *           e x a m p l e   2 :   s t r c m p (   ' o w a l d ' ,   ' w a l d o '   ) ; 
         / /   *           r e t u r n s   2 :   - 1 
         r e t u r n   ( ( s t r 1   = =   s t r 2 )   ?   0   :   ( ( s t r 1   >   s t r 2 )   ?   1   :   - 1 ) ) ; 
 } 
 f u n c t i o n   s t r n a t c m p   ( f _ s t r i n g 1 ,   f _ s t r i n g 2 ,   f _ v e r s i o n )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   M a r t i j n   W i e r i n g a 
         / /   +   n a m e s p a c e d   b y :   M i c h a e l   W h i t e   ( h t t p : / / g e t s p r i n k . c o m ) 
         / /   +         t w e a k e d   b y :   J a c k 
         / /   +       b u g f i x e d   b y :   O n n o   M a r s m a n 
         / /   -         d e p e n d s   o n :   s t r c m p 
         / /   %                     n o t e :   A d d e d   f _ v e r s i o n   a r g u m e n t   a g a i n s t   c o d e   g u i d e l i n e s ,   b e c a u s e   i t ' s   s o   n e a t 
         / /   *           e x a m p l e   1 :   s t r n a t c m p ( ' P r i c e   1 2 . 9 ' ,   ' P r i c e   1 2 . 1 5 ' ) ; 
         / /   *           r e t u r n s   1 :   1 
         / /   *           e x a m p l e   2 :   s t r n a t c m p ( ' P r i c e   1 2 . 0 9 ' ,   ' P r i c e   1 2 . 1 5 ' ) ; 
         / /   *           r e t u r n s   2 :   - 1 
         / /   *           e x a m p l e   3 :   s t r n a t c m p ( ' P r i c e   1 2 . 9 0 ' ,   ' P r i c e   1 2 . 1 5 ' ) ; 
         / /   *           r e t u r n s   3 :   1 
         / /   *           e x a m p l e   4 :   s t r n a t c m p ( ' V e r s i o n   1 2 . 9 ' ,   ' V e r s i o n   1 2 . 1 5 ' ,   t r u e ) ; 
         / /   *           r e t u r n s   4 :   - 6 
         / /   *           e x a m p l e   5 :   s t r n a t c m p ( ' V e r s i o n   1 2 . 1 5 ' ,   ' V e r s i o n   1 2 . 9 ' ,   t r u e ) ; 
         / /   *           r e t u r n s   5 :   6 
         v a r   i   =   0 ; 
 
         i f   ( f _ v e r s i o n   = =   u n d e f i n e d )   { 
                 f _ v e r s i o n   =   f a l s e ; 
         } 
 
         v a r   _ _ s t r n a t c m p _ s p l i t   =   f u n c t i o n   ( f _ s t r i n g )   { 
                 v a r   r e s u l t   =   [ ] ; 
                 v a r   b u f f e r   =   ' ' ; 
                 v a r   c h r   =   ' ' ; 
                 v a r   i   =   0 , 
                         f _ s t r i n g l   =   0 ; 
 
                 v a r   t e x t   =   t r u e ; 
 
                 f _ s t r i n g l   =   f _ s t r i n g . l e n g t h ; 
                 f o r   ( i   =   0 ;   i   <   f _ s t r i n g l ;   i + + )   { 
                         c h r   =   f _ s t r i n g . s u b s t r i n g ( i ,   i   +   1 ) ; 
                         i f   ( c h r . m a t c h ( / \ d / ) )   { 
                                 i f   ( t e x t )   { 
                                         i f   ( b u f f e r . l e n g t h   >   0 )   { 
                                                 r e s u l t [ r e s u l t . l e n g t h ]   =   b u f f e r ; 
                                                 b u f f e r   =   ' ' ; 
                                         } 
 
                                         t e x t   =   f a l s e ; 
                                 } 
                                 b u f f e r   + =   c h r ; 
                         }   e l s e   i f   ( ( t e x t   = =   f a l s e )   & &   ( c h r   = =   ' . ' )   & &   ( i   <   ( f _ s t r i n g . l e n g t h   -   1 ) )   & &   ( f _ s t r i n g . s u b s t r i n g ( i   +   1 ,   i   +   2 ) . m a t c h ( / \ d / ) ) )   { 
                                 r e s u l t [ r e s u l t . l e n g t h ]   =   b u f f e r ; 
                                 b u f f e r   =   ' ' ; 
                         }   e l s e   { 
                                 i f   ( t e x t   = =   f a l s e )   { 
                                         i f   ( b u f f e r . l e n g t h   >   0 )   { 
                                                 r e s u l t [ r e s u l t . l e n g t h ]   =   p a r s e I n t ( b u f f e r ,   1 0 ) ; 
                                                 b u f f e r   =   ' ' ; 
                                         } 
                                         t e x t   =   t r u e ; 
                                 } 
                                 b u f f e r   + =   c h r ; 
                         } 
                 } 
 
                 i f   ( b u f f e r . l e n g t h   >   0 )   { 
                         i f   ( t e x t )   { 
                                 r e s u l t [ r e s u l t . l e n g t h ]   =   b u f f e r ; 
                         }   e l s e   { 
                                 r e s u l t [ r e s u l t . l e n g t h ]   =   p a r s e I n t ( b u f f e r ,   1 0 ) ; 
                         } 
                 } 
 
                 r e t u r n   r e s u l t ; 
         } ; 
 
         v a r   a r r a y 1   =   _ _ s t r n a t c m p _ s p l i t ( f _ s t r i n g 1   +   ' ' ) ; 
         v a r   a r r a y 2   =   _ _ s t r n a t c m p _ s p l i t ( f _ s t r i n g 2   +   ' ' ) ; 
 
         v a r   l e n   =   a r r a y 1 . l e n g t h ; 
         v a r   t e x t   =   t r u e ; 
 
         v a r   r e s u l t   =   - 1 ; 
         v a r   r   =   0 ; 
 
         i f   ( l e n   >   a r r a y 2 . l e n g t h )   { 
                 l e n   =   a r r a y 2 . l e n g t h ; 
                 r e s u l t   =   1 ; 
         } 
 
         f o r   ( i   =   0 ;   i   <   l e n ;   i + + )   { 
                 i f   ( i s N a N ( a r r a y 1 [ i ] ) )   { 
                         i f   ( i s N a N ( a r r a y 2 [ i ] ) )   { 
                                 t e x t   =   t r u e ; 
 
                                 i f   ( ( r   =   t h i s . s t r c m p ( a r r a y 1 [ i ] ,   a r r a y 2 [ i ] ) )   ! =   0 )   { 
                                         r e t u r n   r ; 
                                 } 
                         }   e l s e   i f   ( t e x t )   { 
                                 r e t u r n   1 ; 
                         }   e l s e   { 
                                 r e t u r n   - 1 ; 
                         } 
                 }   e l s e   i f   ( i s N a N ( a r r a y 2 [ i ] ) )   { 
                         i f   ( t e x t )   { 
                                 r e t u r n   - 1 ; 
                         }   e l s e   { 
                                 r e t u r n   1 ; 
                         } 
                 }   e l s e   { 
                         i f   ( t e x t   | |   f _ v e r s i o n )   { 
                                 i f   ( ( r   =   ( a r r a y 1 [ i ]   -   a r r a y 2 [ i ] ) )   ! =   0 )   { 
                                         r e t u r n   r ; 
                                 } 
                         }   e l s e   { 
                                 i f   ( ( r   =   t h i s . s t r c m p ( a r r a y 1 [ i ] . t o S t r i n g ( ) ,   a r r a y 2 [ i ] . t o S t r i n g ( ) ) )   ! =   0 )   { 
                                         r e t u r n   r ; 
                                 } 
                         } 
 
                         t e x t   =   f a l s e ; 
                 } 
         } 
 
         r e t u r n   r e s u l t ; 
 } 
 f u n c t i o n   a s o r t   ( i n p u t A r r ,   s o r t _ f l a g s )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       i n p u t   b y :   p a u l o   k u o n g 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       b u g f i x e d   b y :   A d a m   W a l l n e r   ( h t t p : / / w e b 2 . b i t b a r o . h u / ) 
         / /   +       i m p r o v e d   b y :   T h e r i a u l t 
         / /   %                 n o t e   1 :   S O R T _ S T R I N G   ( a s   w e l l   a s   n a t s o r t   a n d   n a t c a s e s o r t )   m i g h t   a l s o   b e 
         / /   %                 n o t e   1 :   i n t e g r a t e d   i n t o   a l l   o f   t h e s e   f u n c t i o n s   b y   a d a p t i n g   t h e   c o d e   a t 
         / /   %                 n o t e   1 :   h t t p : / / s o u r c e f r o g . n e t / p r o j e c t s / n a t s o r t / n a t c o m p a r e . j s 
         / /   %                 n o t e   2 :   T h e   e x a m p l e s   a r e   c o r r e c t ,   t h i s   i s   a   n e w   w a y 
         / /   %                 n o t e   2 :   C r e d i t s   t o :   h t t p : / / j a v a s c r i p t . i n t e r n e t . c o m / m a t h - r e l a t e d / b u b b l e - s o r t . h t m l 
         / /   %                 n o t e   3 :   T h i s   f u n c t i o n   d e v i a t e s   f r o m   P H P   i n   r e t u r n i n g   a   c o p y   o f   t h e   a r r a y   i n s t e a d 
         / /   %                 n o t e   3 :   o f   a c t i n g   b y   r e f e r e n c e   a n d   r e t u r n i n g   t r u e ;   t h i s   w a s   n e c e s s a r y   b e c a u s e 
         / /   %                 n o t e   3 :   I E   d o e s   n o t   a l l o w   d e l e t i n g   a n d   r e - a d d i n g   o f   p r o p e r t i e s   w i t h o u t   c a c h i n g 
         / /   %                 n o t e   3 :   o f   p r o p e r t y   p o s i t i o n ;   y o u   c a n   s e t   t h e   i n i   o f   " p h p j s . s t r i c t F o r I n "   t o   t r u e   t o 
         / /   %                 n o t e   3 :   g e t   t h e   P H P   b e h a v i o r ,   b u t   u s e   t h i s   o n l y   i f   y o u   a r e   i n   a n   e n v i r o n m e n t 
         / /   %                 n o t e   3 :   s u c h   a s   F i r e f o x   e x t e n s i o n s   w h e r e   f o r - i n   i t e r a t i o n   o r d e r   i s   f i x e d   a n d   t r u e 
         / /   %                 n o t e   3 :   p r o p e r t y   d e l e t i o n   i s   s u p p o r t e d .   N o t e   t h a t   w e   i n t e n d   t o   i m p l e m e n t   t h e   P H P 
         / /   %                 n o t e   3 :   b e h a v i o r   b y   d e f a u l t   i f   I E   e v e r   d o e s   a l l o w   i t ;   o n l y   g i v e s   s h a l l o w   c o p y   s i n c e 
         / /   %                 n o t e   3 :   i s   b y   r e f e r e n c e   i n   P H P   a n y w a y s 
         / /   %                 n o t e   4 :   S i n c e   J S   o b j e c t s '   k e y s   a r e   a l w a y s   s t r i n g s ,   a n d   ( t h e 
         / /   %                 n o t e   4 :   d e f a u l t )   S O R T _ R E G U L A R   f l a g   d i s t i n g u i s h e s   b y   k e y   t y p e , 
         / /   %                 n o t e   4 :   i f   t h e   c o n t e n t   i s   a   n u m e r i c   s t r i n g ,   w e   t r e a t   t h e 
         / /   %                 n o t e   4 :   " o r i g i n a l   t y p e "   a s   n u m e r i c . 
         / /   -         d e p e n d s   o n :   s t r n a t c m p 
         / /   -         d e p e n d s   o n :   i 1 8 n _ l o c _ g e t _ d e f a u l t 
         / /   *           e x a m p l e   1 :   d a t a   =   { d :   ' l e m o n ' ,   a :   ' o r a n g e ' ,   b :   ' b a n a n a ' ,   c :   ' a p p l e ' } ; 
         / /   *           e x a m p l e   1 :   d a t a   =   a s o r t ( d a t a ) ; 
         / /   *           r e s u l t s   1 :   d a t a   = =   { c :   ' a p p l e ' ,   b :   ' b a n a n a ' ,   d :   ' l e m o n ' ,   a :   ' o r a n g e ' } 
         / /   *           r e t u r n s   1 :   t r u e 
         / /   *           e x a m p l e   2 :   i n i _ s e t ( ' p h p j s . s t r i c t F o r I n ' ,   t r u e ) ; 
         / /   *           e x a m p l e   2 :   d a t a   =   { d :   ' l e m o n ' ,   a :   ' o r a n g e ' ,   b :   ' b a n a n a ' ,   c :   ' a p p l e ' } ; 
         / /   *           e x a m p l e   2 :   a s o r t ( d a t a ) ; 
         / /   *           r e s u l t s   2 :   d a t a   = =   { c :   ' a p p l e ' ,   b :   ' b a n a n a ' ,   d :   ' l e m o n ' ,   a :   ' o r a n g e ' } 
         / /   *           r e t u r n s   2 :   t r u e 
         v a r   v a l A r r   =   [ ] ,   v a l A r r L e n   =   0 , 
                 k ,   i ,   r e t ,   s o r t e r ,   t h a t   =   t h i s , 
                 s t r i c t F o r I n   =   f a l s e , 
                 p o p u l a t e A r r   =   { } ; 
 
         s w i t c h   ( s o r t _ f l a g s )   { 
         c a s e   ' S O R T _ S T R I N G ' : 
                 / /   c o m p a r e   i t e m s   a s   s t r i n g s 
                 s o r t e r   =   f u n c t i o n   ( a ,   b )   { 
                         r e t u r n   t h a t . s t r n a t c m p ( a ,   b ) ; 
                 } ; 
                 b r e a k ; 
         c a s e   ' S O R T _ L O C A L E _ S T R I N G ' : 
                 / /   c o m p a r e   i t e m s   a s   s t r i n g s ,   b a s e d   o n   t h e   c u r r e n t   l o c a l e   ( s e t   w i t h   i 1 8 n _ l o c _ s e t _ d e f a u l t ( )   a s   o f   P H P 6 ) 
                 v a r   l o c   =   t h i s . i 1 8 n _ l o c _ g e t _ d e f a u l t ( ) ; 
                 s o r t e r   =   t h i s . p h p _ j s . i 1 8 n L o c a l e s [ l o c ] . s o r t i n g ; 
                 b r e a k ; 
         c a s e   ' S O R T _ N U M E R I C ' : 
                 / /   c o m p a r e   i t e m s   n u m e r i c a l l y 
                 s o r t e r   =   f u n c t i o n   ( a ,   b )   { 
                         r e t u r n   ( a   -   b ) ; 
                 } ; 
                 b r e a k ; 
         c a s e   ' S O R T _ R E G U L A R ' : 
                 / /   c o m p a r e   i t e m s   n o r m a l l y   ( d o n ' t   c h a n g e   t y p e s ) 
         d e f a u l t : 
                 s o r t e r   =   f u n c t i o n   ( a ,   b )   { 
                         v a r   a F l o a t   =   p a r s e F l o a t ( a ) , 
                                 b F l o a t   =   p a r s e F l o a t ( b ) , 
                                 a N u m e r i c   =   a F l o a t   +   ' '   = = =   a , 
                                 b N u m e r i c   =   b F l o a t   +   ' '   = = =   b ; 
                         i f   ( a N u m e r i c   & &   b N u m e r i c )   { 
                                 r e t u r n   a F l o a t   >   b F l o a t   ?   1   :   a F l o a t   <   b F l o a t   ?   - 1   :   0 ; 
                         }   e l s e   i f   ( a N u m e r i c   & &   ! b N u m e r i c )   { 
                                 r e t u r n   1 ; 
                         }   e l s e   i f   ( ! a N u m e r i c   & &   b N u m e r i c )   { 
                                 r e t u r n   - 1 ; 
                         } 
                         r e t u r n   a   >   b   ?   1   :   a   <   b   ?   - 1   :   0 ; 
                 } ; 
                 b r e a k ; 
         } 
 
         / /   B E G I N   R E D U N D A N T 
         t h i s . p h p _ j s   =   t h i s . p h p _ j s   | |   { } ; 
         t h i s . p h p _ j s . i n i   =   t h i s . p h p _ j s . i n i   | |   { } ; 
         / /   E N D   R E D U N D A N T 
         s t r i c t F o r I n   =   t h i s . p h p _ j s . i n i [ ' p h p j s . s t r i c t F o r I n ' ]   & &   t h i s . p h p _ j s . i n i [ ' p h p j s . s t r i c t F o r I n ' ] . l o c a l _ v a l u e   & &   t h i s . p h p _ j s . i n i [ ' p h p j s . s t r i c t F o r I n ' ] . l o c a l _ v a l u e   ! = =   ' o f f ' ; 
         p o p u l a t e A r r   =   s t r i c t F o r I n   ?   i n p u t A r r   :   p o p u l a t e A r r ; 
 
         / /   G e t   k e y   a n d   v a l u e   a r r a y s 
         f o r   ( k   i n   i n p u t A r r )   { 
                 i f   ( i n p u t A r r . h a s O w n P r o p e r t y ( k ) )   { 
                         v a l A r r . p u s h ( [ k ,   i n p u t A r r [ k ] ] ) ; 
                         i f   ( s t r i c t F o r I n )   { 
                                 d e l e t e   i n p u t A r r [ k ] ; 
                         } 
                 } 
         } 
         
         v a l A r r . s o r t ( f u n c t i o n   ( a ,   b )   { 
                 r e t u r n   s o r t e r ( a [ 1 ] ,   b [ 1 ] ) ; 
         } ) ; 
 
         / /   R e p o p u l a t e   t h e   o l d   a r r a y 
         f o r   ( i   =   0 ,   v a l A r r L e n   =   v a l A r r . l e n g t h ;   i   <   v a l A r r L e n ;   i + + )   { 
                 p o p u l a t e A r r [ v a l A r r [ i ] [ 0 ] ]   =   v a l A r r [ i ] [ 1 ] ; 
         } 
 
         r e t u r n   s t r i c t F o r I n   | |   p o p u l a t e A r r ; 
 } 
 f u n c t i o n   k s o r t   ( i n p u t A r r ,   s o r t _ f l a g s )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   G e e k F G   ( h t t p : / / g e e k f g . b l o g s p o t . c o m ) 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   +       i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   %                     n o t e   1 :   T h e   e x a m p l e s   a r e   c o r r e c t ,   t h i s   i s   a   n e w   w a y 
         / /   %                 n o t e   2 :   T h i s   f u n c t i o n   d e v i a t e s   f r o m   P H P   i n   r e t u r n i n g   a   c o p y   o f   t h e   a r r a y   i n s t e a d 
         / /   %                 n o t e   2 :   o f   a c t i n g   b y   r e f e r e n c e   a n d   r e t u r n i n g   t r u e ;   t h i s   w a s   n e c e s s a r y   b e c a u s e 
         / /   %                 n o t e   2 :   I E   d o e s   n o t   a l l o w   d e l e t i n g   a n d   r e - a d d i n g   o f   p r o p e r t i e s   w i t h o u t   c a c h i n g 
         / /   %                 n o t e   2 :   o f   p r o p e r t y   p o s i t i o n ;   y o u   c a n   s e t   t h e   i n i   o f   " p h p j s . s t r i c t F o r I n "   t o   t r u e   t o 
         / /   %                 n o t e   2 :   g e t   t h e   P H P   b e h a v i o r ,   b u t   u s e   t h i s   o n l y   i f   y o u   a r e   i n   a n   e n v i r o n m e n t 
         / /   %                 n o t e   2 :   s u c h   a s   F i r e f o x   e x t e n s i o n s   w h e r e   f o r - i n   i t e r a t i o n   o r d e r   i s   f i x e d   a n d   t r u e 
         / /   %                 n o t e   2 :   p r o p e r t y   d e l e t i o n   i s   s u p p o r t e d .   N o t e   t h a t   w e   i n t e n d   t o   i m p l e m e n t   t h e   P H P 
         / /   %                 n o t e   2 :   b e h a v i o r   b y   d e f a u l t   i f   I E   e v e r   d o e s   a l l o w   i t ;   o n l y   g i v e s   s h a l l o w   c o p y   s i n c e 
         / /   %                 n o t e   2 :   i s   b y   r e f e r e n c e   i n   P H P   a n y w a y s 
         / /   %                 n o t e   3 :   S i n c e   J S   o b j e c t s '   k e y s   a r e   a l w a y s   s t r i n g s ,   a n d   ( t h e 
         / /   %                 n o t e   3 :   d e f a u l t )   S O R T _ R E G U L A R   f l a g   d i s t i n g u i s h e s   b y   k e y   t y p e , 
         / /   %                 n o t e   3 :   i f   t h e   c o n t e n t   i s   a   n u m e r i c   s t r i n g ,   w e   t r e a t   t h e 
         / /   %                 n o t e   3 :   " o r i g i n a l   t y p e "   a s   n u m e r i c . 
         / /   -         d e p e n d s   o n :   i 1 8 n _ l o c _ g e t _ d e f a u l t 
         / /   -         d e p e n d s   o n :   s t r n a t c m p 
         / /   *           e x a m p l e   1 :   d a t a   =   { d :   ' l e m o n ' ,   a :   ' o r a n g e ' ,   b :   ' b a n a n a ' ,   c :   ' a p p l e ' } ; 
         / /   *           e x a m p l e   1 :   d a t a   =   k s o r t ( d a t a ) ; 
         / /   *           r e s u l t s   1 :   { a :   ' o r a n g e ' ,   b :   ' b a n a n a ' ,   c :   ' a p p l e ' ,   d :   ' l e m o n ' } 
         / /   *           e x a m p l e   2 :   i n i _ s e t ( ' p h p j s . s t r i c t F o r I n ' ,   t r u e ) ; 
         / /   *           e x a m p l e   2 :   d a t a   =   { 2 :   ' v a n ' ,   3 :   ' Z o n n e v e l d ' ,   1 :   ' K e v i n ' } ; 
         / /   *           e x a m p l e   2 :   k s o r t ( d a t a ) ; 
         / /   *           r e s u l t s   2 :   d a t a   = =   { 1 :   ' K e v i n ' ,   2 :   ' v a n ' ,   3 :   ' Z o n n e v e l d ' } 
         / /   *           r e t u r n s   2 :   t r u e 
         v a r   t m p _ a r r   =   { } , 
                 k e y s   =   [ ] , 
                 s o r t e r ,   i ,   k ,   t h a t   =   t h i s , 
                 s t r i c t F o r I n   =   f a l s e , 
                 p o p u l a t e A r r   =   { } ; 
 
         s w i t c h   ( s o r t _ f l a g s )   { 
         c a s e   ' S O R T _ S T R I N G ' : 
                 / /   c o m p a r e   i t e m s   a s   s t r i n g s 
                 s o r t e r   =   f u n c t i o n   ( a ,   b )   { 
                         r e t u r n   t h a t . s t r n a t c m p ( a ,   b ) ; 
                 } ; 
                 b r e a k ; 
         c a s e   ' S O R T _ L O C A L E _ S T R I N G ' : 
                 / /   c o m p a r e   i t e m s   a s   s t r i n g s ,   b a s e d   o n   t h e   c u r r e n t   l o c a l e   ( s e t   w i t h     i 1 8 n _ l o c _ s e t _ d e f a u l t ( )   a s   o f   P H P 6 ) 
                 v a r   l o c   =   t h i s . i 1 8 n _ l o c _ g e t _ d e f a u l t ( ) ; 
                 s o r t e r   =   t h i s . p h p _ j s . i 1 8 n L o c a l e s [ l o c ] . s o r t i n g ; 
                 b r e a k ; 
         c a s e   ' S O R T _ N U M E R I C ' : 
                 / /   c o m p a r e   i t e m s   n u m e r i c a l l y 
                 s o r t e r   =   f u n c t i o n   ( a ,   b )   { 
                         r e t u r n   ( ( a   +   0 )   -   ( b   +   0 ) ) ; 
                 } ; 
                 b r e a k ; 
                 / /   c a s e   ' S O R T _ R E G U L A R ' :   / /   c o m p a r e   i t e m s   n o r m a l l y   ( d o n ' t   c h a n g e   t y p e s ) 
         d e f a u l t : 
                 s o r t e r   =   f u n c t i o n   ( a ,   b )   { 
                         v a r   a F l o a t   =   p a r s e F l o a t ( a ) , 
                                 b F l o a t   =   p a r s e F l o a t ( b ) , 
                                 a N u m e r i c   =   a F l o a t   +   ' '   = = =   a , 
                                 b N u m e r i c   =   b F l o a t   +   ' '   = = =   b ; 
                         i f   ( a N u m e r i c   & &   b N u m e r i c )   { 
                                 r e t u r n   a F l o a t   >   b F l o a t   ?   1   :   a F l o a t   <   b F l o a t   ?   - 1   :   0 ; 
                         }   e l s e   i f   ( a N u m e r i c   & &   ! b N u m e r i c )   { 
                                 r e t u r n   1 ; 
                         }   e l s e   i f   ( ! a N u m e r i c   & &   b N u m e r i c )   { 
                                 r e t u r n   - 1 ; 
                         } 
                         r e t u r n   a   >   b   ?   1   :   a   <   b   ?   - 1   :   0 ; 
                 } ; 
                 b r e a k ; 
         } 
 
         / /   M a k e   a   l i s t   o f   k e y   n a m e s 
         f o r   ( k   i n   i n p u t A r r )   { 
                 i f   ( i n p u t A r r . h a s O w n P r o p e r t y ( k ) )   { 
                         k e y s . p u s h ( k ) ; 
                 } 
         } 
         k e y s . s o r t ( s o r t e r ) ; 
 
         / /   B E G I N   R E D U N D A N T 
         t h i s . p h p _ j s   =   t h i s . p h p _ j s   | |   { } ; 
         t h i s . p h p _ j s . i n i   =   t h i s . p h p _ j s . i n i   | |   { } ; 
         / /   E N D   R E D U N D A N T 
         s t r i c t F o r I n   =   t h i s . p h p _ j s . i n i [ ' p h p j s . s t r i c t F o r I n ' ]   & &   t h i s . p h p _ j s . i n i [ ' p h p j s . s t r i c t F o r I n ' ] . l o c a l _ v a l u e   & &   t h i s . p h p _ j s . i n i [ ' p h p j s . s t r i c t F o r I n ' ] . l o c a l _ v a l u e   ! = =   ' o f f ' ; 
         p o p u l a t e A r r   =   s t r i c t F o r I n   ?   i n p u t A r r   :   p o p u l a t e A r r ; 
 
         / /   R e b u i l d   a r r a y   w i t h   s o r t e d   k e y   n a m e s 
         f o r   ( i   =   0 ;   i   <   k e y s . l e n g t h ;   i + + )   { 
                 k   =   k e y s [ i ] ; 
                 t m p _ a r r [ k ]   =   i n p u t A r r [ k ] ; 
                 i f   ( s t r i c t F o r I n )   { 
                         d e l e t e   i n p u t A r r [ k ] ; 
                 } 
         } 
         f o r   ( i   i n   t m p _ a r r )   { 
                 i f   ( t m p _ a r r . h a s O w n P r o p e r t y ( i ) )   { 
                         p o p u l a t e A r r [ i ]   =   t m p _ a r r [ i ] ; 
                 } 
         } 
 
         r e t u r n   s t r i c t F o r I n   | |   p o p u l a t e A r r ; 
 } 
 f u n c t i o n   p r i n t _ r   ( a r r a y ,   r e t u r n _ v a l )   { 
         / /   h t t p : / / k e v i n . v a n z o n n e v e l d . n e t 
         / /   +       o r i g i n a l   b y :   M i c h a e l   W h i t e   ( h t t p : / / g e t s p r i n k . c o m ) 
         / /   +       i m p r o v e d   b y :   B e n   B r y a n 
         / /   +             i n p u t   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +             i m p r o v e d   b y :   B r e t t   Z a m i r   ( h t t p : / / b r e t t - z a m i r . m e ) 
         / /   +       i m p r o v e d   b y :   K e v i n   v a n   Z o n n e v e l d   ( h t t p : / / k e v i n . v a n z o n n e v e l d . n e t ) 
         / /   -         d e p e n d s   o n :   e c h o 
         / /   *           e x a m p l e   1 :   p r i n t _ r ( 1 ,   t r u e ) ; 
         / /   *           r e t u r n s   1 :   1 
         v a r   o u t p u t   =   ' ' , 
                 p a d _ c h a r   =   '   ' , 
                 p a d _ v a l   =   4 , 
                 d   =   t h i s . w i n d o w . d o c u m e n t , 
                 g e t F u n c N a m e   =   f u n c t i o n   ( f n )   { 
                         v a r   n a m e   =   ( / \ W * f u n c t i o n \ s + ( [ \ w \ $ ] + ) \ s * \ ( / ) . e x e c ( f n ) ; 
                         i f   ( ! n a m e )   { 
                                 r e t u r n   ' ( A n o n y m o u s ) ' ; 
                         } 
                         r e t u r n   n a m e [ 1 ] ; 
                 } , 
                 r e p e a t _ c h a r   =   f u n c t i o n   ( l e n ,   p a d _ c h a r )   { 
                         v a r   s t r   =   ' ' ; 
                         f o r   ( v a r   i   =   0 ;   i   <   l e n ;   i + + )   { 
                                 s t r   + =   p a d _ c h a r ; 
                         } 
                         r e t u r n   s t r ; 
                 } , 
                 f o r m a t A r r a y   =   f u n c t i o n   ( o b j ,   c u r _ d e p t h ,   p a d _ v a l ,   p a d _ c h a r )   { 
                         i f   ( c u r _ d e p t h   >   0 )   { 
                                 c u r _ d e p t h + + ; 
                         } 
 
                         v a r   b a s e _ p a d   =   r e p e a t _ c h a r ( p a d _ v a l   *   c u r _ d e p t h ,   p a d _ c h a r ) ; 
                         v a r   t h i c k _ p a d   =   r e p e a t _ c h a r ( p a d _ v a l   *   ( c u r _ d e p t h   +   1 ) ,   p a d _ c h a r ) ; 
                         v a r   s t r   =   ' ' ; 
 
                         i f   ( t y p e o f   o b j   = = =   ' o b j e c t '   & &   o b j   ! = =   n u l l   & &   o b j . c o n s t r u c t o r   & &   g e t F u n c N a m e ( o b j . c o n s t r u c t o r )   ! = =   ' P H P J S _ R e s o u r c e ' )   { 
                                 s t r   + =   ' A r r a y \ n '   +   b a s e _ p a d   +   ' ( \ n ' ; 
                                 f o r   ( v a r   k e y   i n   o b j )   { 
                                         i f   ( O b j e c t . p r o t o t y p e . t o S t r i n g . c a l l ( o b j [ k e y ] )   = = =   ' [ o b j e c t   A r r a y ] ' )   { 
                                                 s t r   + =   t h i c k _ p a d   +   ' [ '   +   k e y   +   ' ]   = >   '   +   f o r m a t A r r a y ( o b j [ k e y ] ,   c u r _ d e p t h   +   1 ,   p a d _ v a l ,   p a d _ c h a r ) ; 
                                         } 
                                         e l s e   { 
                                                 s t r   + =   t h i c k _ p a d   +   ' [ '   +   k e y   +   ' ]   = >   '   +   o b j [ k e y ]   +   ' \ n ' ; 
                                         } 
                                 } 
                                 s t r   + =   b a s e _ p a d   +   ' ) \ n ' ; 
                         } 
                         e l s e   i f   ( o b j   = = =   n u l l   | |   o b j   = = =   u n d e f i n e d )   { 
                                 s t r   =   ' ' ; 
                         } 
                         e l s e   {   / /   f o r   o u r   " r e s o u r c e "   c l a s s 
                                 s t r   =   o b j . t o S t r i n g ( ) ; 
                         } 
 
                         r e t u r n   s t r ; 
                 } ; 
 
         o u t p u t   =   f o r m a t A r r a y ( a r r a y ,   0 ,   p a d _ v a l ,   p a d _ c h a r ) ; 
 
         i f   ( r e t u r n _ v a l   ! = =   t r u e )   { 
                 i f   ( d . b o d y )   { 
                         t h i s . e c h o ( o u t p u t ) ; 
                 } 
                 e l s e   { 
                         t r y   { 
                                 d   =   X U L D o c u m e n t ;   / /   W e ' r e   i n   X U L ,   s o   a p p e n d i n g   a s   p l a i n   t e x t   w o n ' t   w o r k ;   t r i g g e r   a n   e r r o r   o u t   o f   X U L 
                                 t h i s . e c h o ( ' < p r e   x m l n s = " h t t p : / / w w w . w 3 . o r g / 1 9 9 9 / x h t m l "   s t y l e = " w h i t e - s p a c e : p r e ; " > '   +   o u t p u t   +   ' < / p r e > ' ) ; 
                         }   c a t c h   ( e )   { 
                                 t h i s . e c h o ( o u t p u t ) ;   / /   O u t p u t t i n g   a s   p l a i n   t e x t   m a y   w o r k   i n   s o m e   p l a i n   X M L 
                         } 
                 } 
                 r e t u r n   t r u e ; 
         } 
         r e t u r n   o u t p u t ; 
 } 
 / * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 - - - - - - - - |   J Q u e r y   F u n c t i o n s   | - - - - - - - 
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * / 
 i f ( t y p e o f ( j Q u e r y )   ! = =   ' u n d e f i n e d ' ) { 
 j Q u e r y . f n . F o r c e N u m e r i c O n l y   =   f u n c t i o n ( ) { 
         r e t u r n   t h i s . e a c h ( f u n c t i o n ( )   { 
                 $ ( t h i s ) . k e y d o w n ( f u n c t i o n ( e )   { 
                         v a r   k e y   =   e . c h a r C o d e   | |   e . k e y C o d e   | |   0 ; 
                         / /   a l l o w   b a c k s p a c e ,   t a b ,   d e l e t e ,   a r r o w s ,   p e r i o d ,   n u m b e r s   a n d   k e y p a d   n u m b e r s   O N L Y 
                         r e t u r n   ( 
                                 k e y   = = =   8   | |   
                                 k e y   = = =   9   | | 
                                 k e y   = = =   4 6   | | 
                                 k e y   = = =   1 9 0   | | 
                                 ( k e y   > =   3 7   & &   k e y   < =   4 0 )   | | 
                                 ( k e y   > =   4 8   & &   k e y   < =   5 7 )   | | 
                                 ( k e y   > =   9 6   & &   k e y   < =   1 0 5 ) ) ; 
                 } ) 
         } ) 
 } 
 } 
