ÿþ 
 v a r   m y T W i n   =   w i n d o w . m y T W i n ;  
  
 / / d o c u m e n t . f o r m . m e s t o _ o d k u d . f o c u s ;  
 f u n c t i o n   O p e n M y W i n ( l i n k )    
 {    
     l i n k . t a r g e t   =   ' _ M y W i n ' ;    
     i f   ( m y T W i n   ! =   n u l l   & &   ! m y T W i n . c l o s e d )  
     {    
         m y T W i n . f o c u s ( ) ;    
         m y T W i n . l o c a t i o n . h r e f   =   l i n k . h r e f ;    
     }    
     e l s e    
     {    
         m y T W i n   =   w i n d o w . o p e n ( l i n k . h r e f , ' _ M y W i n ' , ' d e p e n d e n t = y e s , m e n u b a r = n o , r e s i z a b l e = n o , w i d t h = 7 8 0 , h e i g h t = 4 8 5 , t o o l b a r = n o ' ) ;    
         / / m y T W i n   =   w i n d o w . o p e n ( l i n k . h r e f , ' _ M y W i n ' , ' d e p e n d e n t = y e s , m e n u b a r = n o , r e s i z a b l e = n o , w i d t h = '   &   o u r w i d t h   & ' , h e i g h t = 4 8 5 , t o o l b a r = n o ' ) ;    
         i f   ( m y T W i n   ! =   n u l l )    
             m y T W i n . f o c u s ( ) ;  
     }    
     r e t u r n   m y T W i n ;    
 }    
  
 f u n c t i o n   O p e n M y W i n S u p e r ( l i n k )    
 {    
     l i n k . t a r g e t   =   ' _ M y W i n ' ;    
     i f   ( m y T W i n   ! =   n u l l   & &   ! m y T W i n . c l o s e d )  
     {    
         m y T W i n . f o c u s ( ) ;    
         m y T W i n . l o c a t i o n . h r e f   =   l i n k . h r e f ;    
     }    
     e l s e    
     {    
         m y T W i n   =   w i n d o w . o p e n ( l i n k . h r e f , ' _ M y W i n ' , ' s c r o l l b a r s = y e s , r e s i z a b l e = y e s , m e n u b a r = n o , w i d t h = 1 0 5 0 , h e i g h t = 7 8 0 , t o p = 5 , l e f t = 5 , t o o l b a r = n o ' ) ;    
         i f   ( m y T W i n   ! =   n u l l )    
             m y T W i n . f o c u s ( ) ;  
     }    
     r e t u r n   m y T W i n ;    
 }    
  
 f u n c t i o n   k o n t r o l a _ f o r m u l a r e _ o s o b y   ( )   {    
         p l a t n y   =   t r u e ;    
          
         i f   ( ( ! k o n t r o l a _ p r a z d n y   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m ' ) . t e l e f o n . v a l u e ) )   & &   ( ! k o n t r o l a _ e m a i l   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m ' ) . E m a i l . v a l u e ) ) )   {    
                 p l a t n y   =   f a l s e ;    
                 a l e r t   ( ' P r o s í m ,   v y p l Ht e   V á a  E - m a i l   n e b o   a l e s p o H  t e l e f o n ! ' ) ;    
         }            
         r e t u r n   p l a t n y ;    
 }    
  
  
 f u n c t i o n   k o n t r o l a _ f o r m u l a r e   ( )   {    
         p l a t n y   =   t r u e ;    
 	 i f   ( (   d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m ' ) . m e s t o _ o d k u d . v a l u e ) = =   " "     & &   (     d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m ' ) . c a s t _ o d k u d . v a l u e ) = =   " " )         {    
 	 d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m ' ) . m e s t o _ o d k u d . f o c u s  
 	 p l a t n y   =   f a l s e ;  
 	 a l e r t   ( ' P r o s í m ,   n a p i at e ,   o d k u d   s e   b u d e   s t h o v a t ! ' ) ;    
 	  
 }  
          
         i f   ( ( ! k o n t r o l a _ p r a z d n y   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m ' ) . t e l e f o n . v a l u e ) )   & &   ( ! k o n t r o l a _ e m a i l   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m ' ) . E m a i l . v a l u e ) ) )   {    
                 p l a t n y   =   f a l s e ;    
                 a l e r t   ( ' P r o s í m ,   v y p l Ht e   V á a  E - m a i l   n e b o   a l e s p o H  t e l e f o n ! ' ) ;    
         }            
         r e t u r n   p l a t n y ;    
 }    
  
 f u n c t i o n   k o n t r o l a _ f o r m u l a r e _ p r a c e   ( )   {    
         p l a t n y   =   t r u e ;    
 	          
         i f   ( ( ! k o n t r o l a _ p r a z d n y   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m ' ) . t e l e f o n . v a l u e ) )   & &   ( ! k o n t r o l a _ e m a i l   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m ' ) . e m a i l . v a l u e ) ) )   {    
                 p l a t n y   =   f a l s e ;    
                 a l e r t   ( ' P r o s í m ,   v y p l Ht e   V á a  E - m a i l   n e b o   a l e s p o H  t e l e f o n ! ' ) ;    
         }  
         / / k o n t r o l a   p l a t n o s t i   e m a i l u            
         i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m ' ) . e m a i l . v a l u e   ! =   ' '   & &   ! k o n t r o l a _ e m a i l _ o l d   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m ' ) . e m a i l . v a l u e ) )   {  
                 p l a t n y   =   f a l s e ;  
                 a l e r t ( ' Z a d a n ý   e m a i l   n e n í   p l a t n ý ! ' ) ;  
         }  
         / / k o n t r o l a   z a d a n i   t e x t u  
         i f   ( d o c u m e n t . g e t E l e m e n t B y I d ( ' f o r m ' ) . c o s t e h o v a t . v a l u e   = =   ' ' )   {  
                 p l a t n y   =   f a l s e ;  
                 a l e r t ( ' N e z a d a l i   j s t e   ~á d n ý   t e x t ! ' ) ;  
         }  
         r e t u r n   p l a t n y ;    
 }    
  
 f u n c t i o n   k o n t r o l a _ p r a z d n y   ( t )   {    
         i f   ( t   = =   ' '   | |   t   = =   "   " )    
                 r e t u r n   f a l s e ;    
         e l s e    
                 r e t u r n   t r u e ;    
 }    
  
 f u n c t i o n   k o n t r o l a _ e m a i l   ( e )   {    
         i f   ( e   = =   ' '   | |   e   = =   "   "   | |   e   = =   " @ " )    
                 r e t u r n   f a l s e ;    
         e l s e    
                 r e t u r n   t r u e ;    
 }    
  
 f u n c t i o n   k o n t r o l a _ e m a i l _ o l d   ( a )   {    
         v a r   m   =   / ^ [ _ a - z 0 - 9 - ] + ( \ . [ _ a - z 0 - 9 - ] + ) * @ [ _ a - z 0 - 9 - ] + ( \ . [ a - z ] { 2 , 4 } ) + $ / i . t e s t ( a ) ;    
         r e t u r n   m ;    
 }    
  
 f u n c t i o n   t a b ( )   {   / /   k l á v e s a   e n t e r  
 	 i f ( e v e n t . k e y C o d e = = 1 3 )   e v e n t . k e y C o d e = 9 ;  
 }  
 
