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