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