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