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