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