ÿþ/ /   C h e c k   t h e   b r o w s e r   i s   M i c r o s o f t   I n t e r n e t   E x p l o r e r   o r   n o t .   I f   m a t c h ,   p r i n t   o u t   a   b u t t o n   f o r   p r i n t   f r i e n d l y .  
 v a r   s t r P a t h   =   w i n d o w . l o c a t i o n . p a t h n a m e . t o S t r i n g ( ) ;  
 v a r   i n t E n g E n d   =   s t r P a t h . i n d e x O f ( " e n g " ) ;  
 v a r   i n t C h i E n d   =   s t r P a t h . i n d e x O f ( " c h i " ) ;  
 v a r   i n t C h s E n d   =   s t r P a t h . i n d e x O f ( " c h s " ) ;  
  
 v a r   i n t E n d   =   i n t C h i E n d ;  
 v a r   p r i n t _ l a n g   =   " c h i " ;  
 i f   ( ( i n t C h i E n d = = - 1 )   & &   ( i n t C h s E n d = = - 1 ) )   {  
 	 i n t E n d = i n t E n g E n d ;  
 	 p r i n t _ l a n g = " e n g " ;  
 }   e l s e   {    
 	 i f   ( ( i n t C h i E n d = = - 1 )   & &   ( i n t E n g E n d = = - 1 ) )   {  
 	     i n t E n d = i n t C h s E n d ;  
 	     p r i n t _ l a n g = " c h s " ;  
     }   e l s e   { 	  
 	     i f   ( ( i n t E n g E n d ! = - 1 )   & &   ( i n t E n g E n d < i n t C h i E n d )   )   {  
 	     i n t E n d = i n t E n g E n d ;  
 	     p r i n t _ l a n g = " e n g " ;  
 	 }  
 }  
 }  
  
 / *  
 v a r   i n t E n d   =   i n t C h i E n d ;  
 v a r   p r i n t _ l a n g   =   " c h i " ;  
 i f   ( i n t C h i E n d = = - 1 )   {  
 	 i n t E n d = i n t E n g E n d ;  
 	 p r i n t _ l a n g = " e n g " ;  
 }   e l s e   {    
 	 i f   ( ( i n t E n g E n d ! = - 1 )   & &   ( i n t E n g E n d < i n t C h i E n d )   )   {  
 	 i n t E n d = i n t E n g E n d ;  
 	 p r i n t _ l a n g = " e n g " ;  
 	 }  
 }  
 * /  
 v a r   s t r P i c P a t h   =   s t r P a t h . s u b s t r ( 0 ,   i n t E n d )   +   " i m a g e s / p r i n t _ i c o n . j p g " ;  
 i f   ( s t r P i c P a t h . i n d e x O f ( " \ \ D e v " )   >   - 1 )  
   s t r P i c P a t h   =   s t r P i c P a t h . s u b s t r ( 1 ,   s t r P i c P a t h . l e n g t h ) ;  
  
 i f   ( n a v i g a t o r . a p p N a m e   = =   " M i c r o s o f t   I n t e r n e t   E x p l o r e r " )   {  
   i f   ( p r i n t _ l a n g = = " c h i " )   {  
       d o c u m e n t . w r i t e ( " < a   h r e f   =   \ " j a v a s c r i p t : p r i n t V e r ( ) \ "   i d   =   \ " m 5 \ " > < i m g   s r c   =   \ " "   +   s t r P i c P a t h   +   " \ "   a l t   =   \ " ËS„URpS\ "   b o r d e r   =   \ " 0 \ "   w i d t h   =   \ " 1 9 \ "   h e i g h t   =   \ " 2 1 \ "   s t y l e   =   \ " v e r t i c a l - a l i g n :   b a s e l i n e \ " > < f o n t   s i z e   =   \ " 1 \ "   s t y l e   =   \ " c o l o r :   # 3 3 6 6 9 9 \ " > ËS„URpS< / f o n t > < / a > " ) ;  
   }   e l s e   {  
   	   i f   ( p r i n t _ l a n g = = " e n g " )   {  
           d o c u m e n t . w r i t e ( " < a   h r e f   =   \ " j a v a s c r i p t : p r i n t V e r ( ) \ "   i d   =   \ " m 5 \ " > < i m g   s r c   =   \ " "   +   s t r P i c P a t h   +   " \ "   a l t   =   \ " P r i n t e r   F r i e n d l y   V e r s i o n \ "   b o r d e r   =   \ " 0 \ "   w i d t h   =   \ " 1 9 \ "   h e i g h t   =   \ " 2 1 \ "   s t y l e   =   \ " v e r t i c a l - a l i g n :   m i d d l e \ " > < f o n t   s i z e   =   \ " 1 \ "   s t y l e   =   \ " c o l o r :   # 3 3 6 6 9 9 \ " > P r i n t   F r i e n d l y < / f o n t > < / a > " ) ;  
       }   e l s e   {  
           d o c u m e n t . w r i t e ( " < a   h r e f   =   \ " j a v a s c r i p t : p r i n t V e r ( ) \ "   i d   =   \ " m 5 \ " > < i m g   s r c   =   \ " "   +   s t r P i c P a t h   +   " \ "   a l t   =   \ " ËS„USbpS\ "   b o r d e r   =   \ " 0 \ "   w i d t h   =   \ " 1 9 \ "   h e i g h t   =   \ " 2 1 \ "   s t y l e   =   \ " v e r t i c a l - a l i g n :   b a s e l i n e \ " > < f o n t   s i z e   =   \ " 1 \ "   s t y l e   =   \ " c o l o r :   # 3 3 6 6 9 9 \ " > ËS„USbpS< / f o n t > < / a > " ) ;  
       }  
   }  
 }  
 / /   G e t   t h e   h a s h   v a r i a b l e   f r o m   t h e   u r l .   I f   g o t   t h e   v a l u e ,   d i s a b l e   t h e   a r e a   f o r   p r i n t i n g .  
 i f   ( w i n d o w . l o c a t i o n . h a s h   = =   " # p r i n t " )  
 {  
   m 1 . s t y l e . d i s p l a y   =   " n o n e " ;  
   m 2 . s t y l e . d i s p l a y   =   " n o n e " ;  
   m 3 . s t y l e . d i s p l a y   =   " n o n e " ;  
   m 4 . s t y l e . w i d t h   =   " 6 0 0 " ;  
 / /   m 5 . s t y l e . d i s p l a y   =   " n o n e " ;  
   m 6 . s t y l e . d i s p l a y   =   " " ;  
   / /   P r i n t   o u t   t h e   p o p u p   w i n d o w .  
   w i n d o w . p r i n t ( ) ;  
 }  
  
 / /   F u n c t i o n   f o r   p r e p a r e   p r i n t i n g .  
 f u n c t i o n   p r i n t V e r ( )  
 {  
   v a r   i n t S t a r t   =   w i n d o w . l o c a t i o n . p a t h n a m e . t o S t r i n g ( ) . l a s t I n d e x O f ( " \ \ " ) ;   / /   G e t   t h e   s t a r t   p o i n t   o f   f i l e n a m e   a t   t h e   U R L .  
   v a r   i n t E n d   =   w i n d o w . l o c a t i o n . p a t h n a m e . t o S t r i n g ( ) . l e n g t h ;   / /   G e t   t h e   e n d   p o i n t   o f   f i l e n a m e   a t   t h e   U R L .  
   v a r   s t r P a t h   =   w i n d o w . l o c a t i o n . p a t h n a m e . t o S t r i n g ( )   +   " # p r i n t " ;   / /   C r e a t e   a   U R L   f o r   p a s s i n g   v a r a b l e   t o   p r i t i n g .  
   / /   P o p u p   a   n e w   w i n d o w   f o r   p r i n t i n g .  
   p r i n t W i n   =   w i n d o w . o p e n ( s t r P a t h ,   " P r i n t W i n d o w " ,   " t o o l b a r = n o ,   w i d t h = 6 4 0 ,   s c r o l l b a r s = y e s ,   l o c a t i o n = y e s " ) ;  
 }  
 / *  
 f u n c t i o n   M s g B o x   ( t e x t s t r i n g )   {  
 a l e r t   ( t e x t s t r i n g )    
 }  
 * / 
