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