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