ÿþv a r   x m l H t t p  
  
  
 f u n c t i o n   a j a x p a g e ( p a r a m e t e r s , f g ) {  
 x m l H t t p = G e t X m l H t t p O b j e c t ( )  
 i f   ( x m l H t t p = = n u l l )  
   {  
   a l e r t   ( " Y o u r   b r o w s e r   d o   n o t   s u p p o r t   H T T P   R e q u e s t " )  
   r e t u r n  
   }    
  
  
 i f   ( f g = = 1 )  
 v a r   u r l = " s e a r c h / m _ d o _ s e a r c h . p h p "  
 e l s e   i f ( f g = = 2 )  
 v a r   u r l = " s e a r c h / m _ d o _ s e s r c h _ d a t e . p h p "  
  
 u r l = u r l   +   p a r a m e t e r s  
  
 u r l = u r l + " & s i d = " + M a t h . r a n d o m ( )  
 x m l H t t p . o n r e a d y s t a t e c h a n g e = s t a t e C h a n g e d  
 x m l H t t p . o p e n ( " G E T " , u r l , t r u e )  
 x m l H t t p . s e n d ( n u l l )  
 }    
  
 / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /  
 f u n c t i o n   s t a t e C h a n g e d ( )    
 {    
   i f   ( x m l H t t p . r e a d y S t a t e = = 0   | |   x m l H t t p . r e a d y S t a t e = = 1     | |   x m l H t t p . r e a d y S t a t e = = 2   | |   x m l H t t p . r e a d y S t a t e = = 3 )  
   {    
   v a r   m s g = " 'D1,'!  'D'F*8'1  -*I  J*E  EH'A'*C  (F*'&,  'D(-+  'DE7DH(. . . . " ;  
   / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /  
     v a r   i m g _ l o a d i n g   =   " i m a g e s / l o a d i n g . g i f " ;    
 i f ( ! i m g _ l o a d i n g ) i m g _ l o a d i n g   =   " " ;   e l s e   i m g _ l o a d i n g   =   " < i m g   s r c = ' " + i m g _ l o a d i n g + " '   / >   " ;    
 d o c u m e n t . g e t E l e m e n t B y I d ( " p o r t a l _ e l e m e n t " ) . i n n e r H T M L   =   i m g _ l o a d i n g + m s g ;    
   / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /  
   }    
   i f   ( x m l H t t p . r e a d y S t a t e = = 4   | |   x m l H t t p . r e a d y S t a t e = = " c o m p l e t e " )  
   {    
   d o c u m e n t . g e t E l e m e n t B y I d ( " p o r t a l _ e l e m e n t " ) . i n n e r H T M L = x m l H t t p . r e s p o n s e T e x t ;  
  
  
 / / c l o s e F o r m ( ) ;  
   }    
 }    
  
 f u n c t i o n   G e t X m l H t t p O b j e c t ( )  
 {  
 v a r   x m l H t t p = n u l l ;  
 t r y  
     {  
     / /   F i r e f o x ,   O p e r a   8 . 0 + ,   S a f a r i  
     x m l H t t p = n e w   X M L H t t p R e q u e s t ( ) ;  
     }  
 c a t c h   ( e )  
     {  
     / /   I n t e r n e t   E x p l o r e r  
     t r y  
         {  
         x m l H t t p = n e w   A c t i v e X O b j e c t ( " M s x m l 2 . X M L H T T P " ) ;  
         }  
     c a t c h   ( e )  
         {  
         x m l H t t p = n e w   A c t i v e X O b j e c t ( " M i c r o s o f t . X M L H T T P " ) ;  
         }  
     }  
 r e t u r n   x m l H t t p ;  
 }  
 
