ÿþf u n c t i o n   s h o w p a y ( )   {  
  
         v a r   t e r m   =   d o c u m e n t . g e t E l e m e n t B y I d ( " t b x M o n t h s " ) . v a l u e ;  
         / / v a r   e   =   d o c u m e n t . g e t E l e m e n t B y I d ( " t b x M o n t h s " ) ;  
         / / v a r   t e r m   =   e . o p t i o n s [ e . s e l e c t e d I n d e x ] . v a l u e ;  
         v a r   i n t r   =   d o c u m e n t . g e t E l e m e n t B y I d ( " t b x I n t e r e s t " ) . v a l u e ;  
         / / e   =   d o c u m e n t . g e t E l e m e n t B y I d ( " t b x I n t e r e s t " ) ;  
         / / v a r   i n t r   =   e . o p t i o n s [ e . s e l e c t e d I n d e x ] . v a l u e ;  
         e   =   d o c u m e n t . g e t E l e m e n t B y I d ( " h - v a l u e " ) ;  
         v a r   p r i n c   =   e . i n n e r H T M L ;  
  
         i f   ( ! c h e c k _ t e r m ( t e r m )   | |   ! c h e c k _ i n t r ( i n t r )   | |   ! c h e c k _ p r i n c ( p r i n c ) )   {  
                 d o c u m e n t . g e t E l e m e n t B y I d ( " m o n t h l y R a t e " ) . i n n e r H T M L   =   " P o g r e an i   p o d a c i ! " ;  
                 r e t u r n   0 ;  
         }  
         e l s e   {  
                 i n t r   =   i n t r   /   1 2 0 0 ;  
                 v a r   r e s u l t   =   p r i n c   *   i n t r   /   ( 1   -   ( M a t h . p o w ( 1   /   ( 1   +   i n t r ) ,   t e r m ) ) ) ;  
                 r e s u l t   =   M a t h . r o u n d ( r e s u l t   *   M a t h . p o w ( 1 0 ,   2 ) )   /   M a t h . p o w ( 1 0 ,   2 ) ;  
                 d o c u m e n t . g e t E l e m e n t B y I d ( " m o n t h l y R a t e " ) . i n n e r H T M L   =   " M j e s e n a   r a t a :   "   +   r e s u l t ;  
         }  
 }  
  
  
  
 f u n c t i o n   c h e c k _ t e r m ( v a l u e )   {  
         i f   ( ( ! i s N a N ( p a r s e I n t ( v a l u e ) ) )   & &   ( p a r s e F l o a t ( v a l u e )   = =   p a r s e I n t ( v a l u e ) )   & &   ( v a l u e   >   0 )   & &   ( v a l u e   < =   6 0 0 ) )   {  
                 r e t u r n   t r u e ;  
         }  
         e l s e   {  
                 r e t u r n   f a l s e ;  
         }  
 }  
  
 f u n c t i o n   c h e c k _ p r i n c ( v a l u e )   {  
         i f   ( ( ! i s N a N ( p a r s e I n t ( v a l u e ) ) )   & &   ( p a r s e F l o a t ( v a l u e )   = =   p a r s e I n t ( v a l u e ) )   & &   ( v a l u e   >   0 )   & &   ( v a l u e   < =   3 0 0 0 0 0 ) )   {  
                 r e t u r n   t r u e ;  
         }  
         e l s e   {  
                 r e t u r n   f a l s e ;  
         }  
 }  
  
 f u n c t i o n   c h e c k _ i n t r ( v a l u e )   {  
         i f   ( ( ! i s N a N ( p a r s e F l o a t ( v a l u e ) ) )   & &   ( v a l u e   >   0 )   & &   ( v a l u e   < =   5 0 ) )   {  
                 r e t u r n   t r u e ;  
         }  
         e l s e   {  
                 r e t u r n   f a l s e ;  
         }  
 }   
