ÿþ/ /   f o r m   v a l i d a t i o n   f u n c t i o n   / /  
 f u n c t i o n   v a l i d a t e ( f o r m )   {  
     v a r   a d   =   f o r m . a d . v a l u e ;  
     v a r   t e l   =   f o r m . t e l . v a l u e ;  
     v a r   a d R e g e x   =   / ^ [ a - z A - Z Ü ü ^_01Ö ö Ç ç ] + ( ( [ \ ' \ , \ . \ -   ] [ a - z A - Z Ü ü ^_01Ö ö Ç ç   ] ) ? [ a - z A - Z Ü ü ^_01Ö ö Ç ç ] * ) * $ / ;  
     v a r   t e l R e g e x   =   / ^ [ 0 - 9 ] + ( ( [ \ ' \ , \ . \ -   ] [ 0 - 9   ] ) ? [ 0 - 9 ] * ) * $ / ;  
  
     i f ( a d   = =   " " )   {  
         i n l i n e M s g ( ' a d ' , ' A d 1n 1z 1  y a z 1n 1z . ' , 2 ) ;  
         r e t u r n   f a l s e ;  
     }  
     i f ( ! a d . m a t c h ( a d R e g e x ) )   {  
         i n l i n e M s g ( ' a d ' , ' G e ç e r s i z   b i r   i s i m   g i r d i n i z . ' , 2 ) ;  
         r e t u r n   f a l s e ;  
     }  
     i f ( t e l   = =   " " )   {  
         i n l i n e M s g ( ' t e l ' , ' S i z i   a r a y a b i l e c e i m i z   b i r   t e l e f o n   n u m a r a s 1  y a z 1n 1z . ' , 2 ) ;  
         r e t u r n   f a l s e ;  
     }  
     i f ( ! t e l . m a t c h ( t e l R e g e x ) )   {  
         i n l i n e M s g ( ' t e l ' , ' G e ç e r s i z   b i r   n u m a r a   g i r d i n i z . ' , 2 ) ;  
         r e t u r n   f a l s e ;  
     }  
     r e t u r n   t r u e ;  
 }  
  
 / /   S T A R T   O F   M E S S A G E   S C R I P T   / /  
  
 v a r   M S G T I M E R   =   2 0 ;  
 v a r   M S G S P E E D   =   5 ;  
 v a r   M S G O F F S E T   =   3 ;  
 v a r   M S G H I D E   =   3 ;  
  
 / /   b u i l d   o u t   t h e   d i v s ,   s e t   a t t r i b u t e s   a n d   c a l l   t h e   f a d e   f u n c t i o n   / /  
 f u n c t i o n   i n l i n e M s g ( t a r g e t , s t r i n g , a u t o h i d e )   {  
     v a r   m s g ;  
     v a r   m s g c o n t e n t ;  
     i f ( ! d o c u m e n t . g e t E l e m e n t B y I d ( ' m s g ' ) )   {  
         m s g   =   d o c u m e n t . c r e a t e E l e m e n t ( ' d i v ' ) ;  
         m s g . i d   =   ' m s g ' ;  
         m s g c o n t e n t   =   d o c u m e n t . c r e a t e E l e m e n t ( ' d i v ' ) ;  
         m s g c o n t e n t . i d   =   ' m s g c o n t e n t ' ;  
         d o c u m e n t . b o d y . a p p e n d C h i l d ( m s g ) ;  
         m s g . a p p e n d C h i l d ( m s g c o n t e n t ) ;  
         m s g . s t y l e . f i l t e r   =   ' a l p h a ( o p a c i t y = 0 ) ' ;  
         m s g . s t y l e . o p a c i t y   =   0 ;  
         m s g . a l p h a   =   0 ;  
     }   e l s e   {  
         m s g   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' m s g ' ) ;  
         m s g c o n t e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' m s g c o n t e n t ' ) ;  
     }  
     m s g c o n t e n t . i n n e r H T M L   =   s t r i n g ;  
     m s g . s t y l e . d i s p l a y   =   ' b l o c k ' ;  
     v a r   m s g h e i g h t   =   m s g . o f f s e t H e i g h t ;  
     v a r   t a r g e t d i v   =   d o c u m e n t . g e t E l e m e n t B y I d ( t a r g e t ) ;  
     t a r g e t d i v . f o c u s ( ) ;  
     v a r   t a r g e t h e i g h t   =   t a r g e t d i v . o f f s e t H e i g h t ;  
     v a r   t a r g e t w i d t h   =   t a r g e t d i v . o f f s e t W i d t h ;  
     v a r   t o p p o s i t i o n   =   t o p P o s i t i o n ( t a r g e t d i v )   -   ( ( m s g h e i g h t   -   t a r g e t h e i g h t )   /   2 ) ;  
     v a r   l e f t p o s i t i o n   =   l e f t P o s i t i o n ( t a r g e t d i v )   +   t a r g e t w i d t h   +   M S G O F F S E T ;  
     m s g . s t y l e . t o p   =   t o p p o s i t i o n   +   ' p x ' ;  
     m s g . s t y l e . l e f t   =   l e f t p o s i t i o n   +   ' p x ' ;  
     c l e a r I n t e r v a l ( m s g . t i m e r ) ;  
     m s g . t i m e r   =   s e t I n t e r v a l ( " f a d e M s g ( 1 ) " ,   M S G T I M E R ) ;  
     i f ( ! a u t o h i d e )   {  
         a u t o h i d e   =   M S G H I D E ;      
     }  
     w i n d o w . s e t T i m e o u t ( " h i d e M s g ( ) " ,   ( a u t o h i d e   *   1 0 0 0 ) ) ;  
 }  
  
 / /   h i d e   t h e   f o r m   a l e r t   / /  
 f u n c t i o n   h i d e M s g ( m s g )   {  
     v a r   m s g   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' m s g ' ) ;  
     i f ( ! m s g . t i m e r )   {  
         m s g . t i m e r   =   s e t I n t e r v a l ( " f a d e M s g ( 0 ) " ,   M S G T I M E R ) ;  
     }  
 }  
  
 / /   f a c e   t h e   m e s s a g e   b o x   / /  
 f u n c t i o n   f a d e M s g ( f l a g )   {  
     i f ( f l a g   = =   n u l l )   {  
         f l a g   =   1 ;  
     }  
     v a r   m s g   =   d o c u m e n t . g e t E l e m e n t B y I d ( ' m s g ' ) ;  
     v a r   v a l u e ;  
     i f ( f l a g   = =   1 )   {  
         v a l u e   =   m s g . a l p h a   +   M S G S P E E D ;  
     }   e l s e   {  
         v a l u e   =   m s g . a l p h a   -   M S G S P E E D ;  
     }  
     m s g . a l p h a   =   v a l u e ;  
     m s g . s t y l e . o p a c i t y   =   ( v a l u e   /   1 0 0 ) ;  
     m s g . s t y l e . f i l t e r   =   ' a l p h a ( o p a c i t y = '   +   v a l u e   +   ' ) ' ;  
     i f ( v a l u e   > =   9 9 )   {  
         c l e a r I n t e r v a l ( m s g . t i m e r ) ;  
         m s g . t i m e r   =   n u l l ;  
     }   e l s e   i f ( v a l u e   < =   1 )   {  
         m s g . s t y l e . d i s p l a y   =   " n o n e " ;  
         c l e a r I n t e r v a l ( m s g . t i m e r ) ;  
     }  
 }  
  
 / /   c a l c u l a t e   t h e   p o s i t i o n   o f   t h e   e l e m e n t   i n   r e l a t i o n   t o   t h e   l e f t   o f   t h e   b r o w s e r   / /  
 f u n c t i o n   l e f t P o s i t i o n ( t a r g e t )   {  
     v a r   l e f t   =   0 ;  
     i f ( t a r g e t . o f f s e t P a r e n t )   {  
         w h i l e ( 1 )   {  
             l e f t   + =   t a r g e t . o f f s e t L e f t ;  
             i f ( ! t a r g e t . o f f s e t P a r e n t )   {  
                 b r e a k ;  
             }  
             t a r g e t   =   t a r g e t . o f f s e t P a r e n t ;  
         }  
     }   e l s e   i f ( t a r g e t . x )   {  
         l e f t   + =   t a r g e t . x ;  
     }  
     r e t u r n   l e f t ;  
 }  
  
 / /   c a l c u l a t e   t h e   p o s i t i o n   o f   t h e   e l e m e n t   i n   r e l a t i o n   t o   t h e   t o p   o f   t h e   b r o w s e r   w i n d o w   / /  
 f u n c t i o n   t o p P o s i t i o n ( t a r g e t )   {  
     v a r   t o p   =   0 ;  
     i f ( t a r g e t . o f f s e t P a r e n t )   {  
         w h i l e ( 1 )   {  
             t o p   + =   t a r g e t . o f f s e t T o p ;  
             i f ( ! t a r g e t . o f f s e t P a r e n t )   {  
                 b r e a k ;  
             }  
             t a r g e t   =   t a r g e t . o f f s e t P a r e n t ;  
         }  
     }   e l s e   i f ( t a r g e t . y )   {  
         t o p   + =   t a r g e t . y ;  
     }  
     r e t u r n   t o p ;  
 }  
  
 / /   p r e l o a d   t h e   a r r o w   / /  
 i f ( d o c u m e n t . i m a g e s )   {  
     a r r o w   =   n e w   I m a g e ( 7 , 8 0 ) ;    
     a r r o w . s r c   =   " . . / i m a g e s / m s g _ a r r o w . g i f " ;    
 } 
