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