ÿþf u n c t i o n   a d d _ c o m m e n t ( )   {  
  
 v a r   x m l h t t p ;  
 i f   ( w i n d o w . X M L H t t p R e q u e s t )  
     {  
     / /   c o d e   f o r   I E 7 + ,   F i r e f o x ,   C h r o m e ,   O p e r a ,   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 ( ) ;  
     }  
 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 )  
     {  
     / /   c o d e   f o r   I E 6 ,   I E 5  
     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 " ) ;  
     }  
 e l s e  
     {  
     a l e r t ( " 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   X M L H T T P ! " ) ;  
     }  
  
 v a r   u r l   =   " s u b m i t c o m m e n t . c f m " ;  
 v a r   p a r a m s   =   " v i d = "   +   d o c u m e n t . g e t E l e m e n t B y I d ( " V i d e o I D " ) . v a l u e   +   " & c o m m e n t = "   +   d o c u m e n t . g e t E l e m e n t B y I d ( " C o m m e n t " ) . v a l u e ;  
 x m l h t t p . o p e n ( " P O S T " ,   u r l ,   t r u e ) ;  
  
 / / S e n d   t h e   p r o p e r   h e a d e r   i n f o r m a t i o n   a l o n g   w i t h   t h e   r e q u e s t  
 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 " ) ;  
 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 - l e n g t h " ,   p a r a m s . l e n g t h ) ;  
 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 n e c t i o n " ,   " c l o s e " ) ;  
  
 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 ( )   { / / C a l l   a   f u n c t i o n   w h e n   t h e   s t a t e   c h a n g e s .  
 	 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 )   {  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' n e w b u b b l e ' ) . 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 ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' t h a n k s ' ) . i n n e r H T M L = " T h a n k   Y o u " ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' S u b m i t ' ) . v a l u e = " C o m m e n t   P o s t e d ! " ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' c o u n t d i v ' ) . i n n e r H T M L = " " ;  
 	 	 d o c u m e n t . c o m m e n t f o r m . C o m m e n t . d i s a b l e d = t r u e ;  
 	 	 d o c u m e n t . c o m m e n t f o r m . S u b m i t . d i s a b l e d = t r u e ;  
 	 }  
 }  
 x m l h t t p . s e n d ( p a r a m s ) ;  
  
 }  
  
 f u n c t i o n   a d d _ t a g ( )   {  
  
 v a r   x m l h t t p ;  
 i f   ( w i n d o w . X M L H t t p R e q u e s t )  
     {  
     / /   c o d e   f o r   I E 7 + ,   F i r e f o x ,   C h r o m e ,   O p e r a ,   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 ( ) ;  
     }  
 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 )  
     {  
     / /   c o d e   f o r   I E 6 ,   I E 5  
     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 " ) ;  
     }  
 e l s e  
     {  
     a l e r t ( " 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   X M L H T T P ! " ) ;  
     }  
  
 v a r   u r l   =   " s u b m i t t a g . c f m " ;  
 v a r   p a r a m s   =   " v i d = "   +   d o c u m e n t . g e t E l e m e n t B y I d ( " v i d " ) . v a l u e   +   " & t a g = "   +   d o c u m e n t . g e t E l e m e n t B y I d ( " t a g " ) . v a l u e ;  
 x m l h t t p . o p e n ( " P O S T " ,   u r l ,   t r u e ) ;  
  
 / / S e n d   t h e   p r o p e r   h e a d e r   i n f o r m a t i o n   a l o n g   w i t h   t h e   r e q u e s t  
 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 " ) ;  
 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 - l e n g t h " ,   p a r a m s . l e n g t h ) ;  
 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 n e c t i o n " ,   " c l o s e " ) ;  
  
 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 ( )   { / / C a l l   a   f u n c t i o n   w h e n   t h e   s t a t e   c h a n g e s .  
 	 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 )   {  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' t a g ' ) . v a l u e = " " ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' t a g _ b u t t o n ' ) . v a l u e = " A d d   A n o t h e r   T a g " ;  
 	 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' v i d e o t a g s ' ) . 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 ; 	 	  
 	 }  
 }  
 x m l h t t p . s e n d ( p a r a m s ) ;  
  
 } 
