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