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