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