ÿþf u n c t i o n   e c a r d e ( )   {  
 w i n d o w . o p e n ( ' h t t p : / / w w w . m e d c o m . c o m . h k / e h s / c h i n e s e / e c a r d / i n d e x . h t m ' , ' e c a r d ' , ' 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 , w i d t h = 8 0 0 , h e i g h t = 6 0 0 ' ) ;  
 }  
  
  
 f u n c t i o n   e c a r d c ( )   {  
 w i n d o w . o p e n ( ' h t t p : / / w w w . m e d c o m . c o m . h k / e h s / c h i n e s e / e c a r d / i n d e x . h t m ' , ' e c a r d ' , ' 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 , w i d t h = 8 0 0 , h e i g h t = 6 0 0 ' ) ;  
 }  
  
  
 v a r   l a n g s A l t   =   [ ' A~Ôš' , ' !|SO' , ' E n g l i s h ' ] ;  
 v a r   l a n g s P a t h   =   [ ' c h i n e s e ' , ' s c ' , ' e n g l i s h ' ] ;  
 v a r   l a n g s I m g   =   n e w   A r r a y ( ) ;  
 l a n g s I m g [ 0 ]   =   [ 1 1 , 3 , 4 ] ;  
 l a n g s I m g [ 1 ]   =   [ 3 , 4 , 1 1 ] ;  
 l a n g s I m g [ 2 ]   =   [ 3 , 4 , 1 1 ] ;  
 v a r   l a n g   =   ' ' ;  
 v a r   l a n g I d   =   0 ;  
 i f ( l o c a t i o n . h r e f . s e a r c h ( ' / p u b l i c a t i o n s / ' ) = = - 1 ) {  
 	 f o r ( x   i n   l a n g s P a t h ) {  
 	 	 i f ( l o c a t i o n . h r e f . s e a r c h ( ' / ' + l a n g s P a t h [ x ] + ' / ' ) ! = - 1 ) {  
 	 	 	 l a n g I d   =   x ;  
 	 	 }  
 	 }  
 	 l a n g   =   l a n g s P a t h [ l a n g I d ] ;  
 	 v a r   l o c a   =   l o c a t i o n . h r e f . m a t c h ( e v a l ( ' / ^ . * \ \ \ / ' + l a n g + ' \ \ \ / / ' ) ) [ 0 ] ;  
 	 v a r   g e t   =   {  
 	 	 b i g 5 :   f u n c t i o n ( ) {  
 	 	 	 d o c u m e n t . w r i t e ( ' < a   h r e f = " ' + l o c a t i o n . h r e f . r e p l a c e ( ' / ' + l a n g + ' / ' ,   ' / c h i n e s e / ' ) . r e p l a c e ( ' - e ' , ' - c ' ) + ' " > < i m g   s r c = " ' + l o c a + ' i m a g e s / c l f / m a i n b a r ' + l a n g s I m g [ l a n g I d ] [ 0 ] + ' . g i f "   t i t l e = " ' + l a n g s A l t [ 0 ] + ' "   o n M o u s e O u t = " m o u s e O u t ( t h i s ) " ;   o n M o u s e O v e r = " m o u s e O v e r ( t h i s ) "   a l t = " ' + l a n g s A l t [ 0 ] + ' "   b o r d e r = " 0 "   / > < / a > ' ) ;  
 	 	 } ,  
 	 	 g b :   f u n c t i o n ( ) {  
 	 	 	 d o c u m e n t . w r i t e ( ' < a   h r e f = " ' + l o c a t i o n . h r e f . r e p l a c e ( ' / ' + l a n g + ' / ' ,   ' / s c / ' ) . r e p l a c e ( ' - e ' , ' - c ' ) + ' " > < i m g   s r c = " ' + l o c a + ' i m a g e s / c l f / m a i n b a r ' + l a n g s I m g [ l a n g I d ] [ 1 ] + ' . g i f "   o n M o u s e O u t = " m o u s e O u t ( t h i s ) " ;   o n M o u s e O v e r = " m o u s e O v e r ( t h i s ) "   t i t l e = " ' + l a n g s A l t [ 1 ] + ' "   a l t = " ' + l a n g s A l t [ 1 ] + ' "   b o r d e r = " 0 "   / > < / a > ' ) ;  
 	 	 } ,  
 	 	 e n :   f u n c t i o n ( ) {  
 	 	 	 d o c u m e n t . w r i t e ( ' < a   h r e f = " ' + l o c a t i o n . h r e f . r e p l a c e ( ' / ' + l a n g + ' / ' ,   ' / e n g l i s h / ' ) . r e p l a c e ( ' - c ' , ' - e ' ) + ' " > < i m g   s r c = " ' + l o c a + ' i m a g e s / c l f / m a i n b a r ' + l a n g s I m g [ l a n g I d ] [ 2 ] + ' . g i f "   o n M o u s e O u t = " m o u s e O u t ( t h i s ) " ;   o n M o u s e O v e r = " m o u s e O v e r ( t h i s ) "   t i t l e = " ' + l a n g s A l t [ 2 ] + ' "   a l t = " ' + l a n g s A l t [ 2 ] + ' "   b o r d e r = " 0 "   / > < / a > ' ) ;  
 	 	 }  
 	 }  
 } e l s e {  
 	 v a r   l o c a   =   l o c a t i o n . h r e f . m a t c h ( e v a l ( ' / ^ . * \ \ \ / p u b l i c a t i o n s \ \ \ / / ' ) ) [ 0 ] ;  
 }  
 f u n c t i o n   m o u s e O v e r ( m e ) {  
 	 m e . s r c   =   m e . s r c . r e p l a c e ( ' . g i f ' , ' _ f 2 . g i f ' ) ;  
 }  
 f u n c t i o n   m o u s e O u t ( m e ) {  
 	 m e . s r c   =   m e . s r c . r e p l a c e ( ' _ f 2 . g i f ' , ' . g i f ' ) ;  
 }  
  
 v a r   m a t r i x   =   [  
 	 [ " / p u b l i c a t i o n s / 1 9 9 9 / " , " / p u b l i c a t i o n s / 1 9 9 9 _ s c / " ] ,  
 	 [ " / p u b l i c a t i o n s / c b o o k . h t m " , " / p u b l i c a t i o n s / s c b o o k . h t m " , " / p u b l i c a t i o n s / e b o o k . h t m " ] ,  
 	 [ " / p u b l i c a t i o n s / c p u b l i c a t i o n s t e x t . h t m " , " / p u b l i c a t i o n s / s c p u b l i c a t i o n s t e x t . h t m " , " / p u b l i c a t i o n s / e p u b l i c a t i o n s t e x t . h t m " ] ,  
 	 [ " / p u b l i c a t i o n s / c p u b l i c a t i o n s t e x t 1 . h t m " , " / p u b l i c a t i o n s / s c p u b l i c a t i o n s t e x t 1 . h t m " , " / p u b l i c a t i o n s / e p u b l i c a t i o n s t e x t 1 . h t m " ] ,  
 	 [ " / p u b l i c a t i o n s / c p u b l i c a t i o n s t e x t 2 . h t m " , " / p u b l i c a t i o n s / s c p u b l i c a t i o n s t e x t 2 . h t m " , " / p u b l i c a t i o n s / e p u b l i c a t i o n s t e x t 2 . h t m " ] ,  
 	 [ " / p u b l i c a t i o n s / c p u b l i c a t i o n s t e x t 3 . h t m " , " / p u b l i c a t i o n s / s c p u b l i c a t i o n s t e x t 3 . h t m " , " / p u b l i c a t i o n s / e p u b l i c a t i o n s t e x t 3 . h t m " ] ,  
 	 [ " / p u b l i c a t i o n s / r e s o u r c e _ b o o k _ o n _ p s y c h o s o c i a l . h t m " , " / p u b l i c a t i o n s / s c r e s o u r c e _ b o o k _ o n _ p s y c h o s o c i a l . h t m " ] ,  
 	 [ " / p u b l i c a t i o n s / d e m e n / d e m e n - c . h t m " , " / p u b l i c a t i o n s / d e m e n / d e m e n - s c . h t m " ] ,  
 	 [ " / p u b l i c a t i o n s / h a p p y a g e i n g / h a p p y a g e i n g - c . h t m " , " / p u b l i c a t i o n s / h a p p y a g e i n g / h a p p y a g e i n g - s c . h t m " ] ,  
 	 [ " / p u b l i c a t i o n s / H e a l t h y A g e i n g / " , " / p u b l i c a t i o n s / H e a l t h y A g e i n g _ s c / " ]  
 ] ;  
 f u n c t i o n   s w i t c h L a n g P u b ( t o ) {  
 	 v a r   i n M a t r i x   =   - 1 ;  
 	 v a r   t c s c   =   - 1 ;  
 	 v a r   l o c a   =   l o c a t i o n . h r e f ;  
 	 f o r ( x   i n   m a t r i x ) {  
 	 	 f o r ( y   i n   m a t r i x [ x ] ) {  
 	 	 	 i f ( l o c a t i o n . h r e f . s e a r c h ( m a t r i x [ x ] [ y ] ) ! = - 1 ) {  
 	 	 	 	 i n M a t r i x   =   x ;  
 	 	 	 	 t c s c   =   y ;  
 	 	 	 }  
 	 	 }  
 	 }  
 	 i f ( i n M a t r i x   ! =   - 1   & &   t c s c   ! =   - 1 ) {  
 	 	 s w i t c h ( t o ) {  
 	 	 	 c a s e   ' t c ' :  
 	 	 	 	 l o c a   =   l o c a . r e p l a c e ( m a t r i x [ i n M a t r i x ] [ t c s c ] ,   m a t r i x [ i n M a t r i x ] [ 0 ] ) ;  
 	 	 	 	 b r e a k ;  
 	 	 	 c a s e   ' s c ' :  
 	 	 	 	 l o c a   =   l o c a . r e p l a c e ( m a t r i x [ i n M a t r i x ] [ t c s c ] ,   m a t r i x [ i n M a t r i x ] [ 1 ] ) ;  
 	 	 	 	 b r e a k ;  
 	 	 }  
 	 	 l o c a t i o n . h r e f   =   l o c a ;  
 	 }  
 } 
