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