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