ÿþ/ * j s l i n t   w h i t e :   t r u e ,   b r o w s e r :   t r u e ,   w i n d o w s :   t r u e ,   f o r i n :   t r u e ,     u n d e f :   t r u e ,  
     e q e q e q :   t r u e ,   p l u s p l u s :   t r u e ,   b i t w i s e :   t r u e ,   r e g e x p :   t r u e ,   i m m e d :   t r u e   * /  
  
 / * g l o b a l   w i n d o w :   f a l s e   * /  
  
 / * m e m b e r s   F u s i o n C h a r t s ,   a r g s ,   a t t r i b u t e s ,   c l a s s ,   c o n s t r u c t o r ,   c o r e ,  
         e x t e n d ,   g e t O b j e c t R e f e r e n c e ,   h e i g h t ,   i d ,   i n s e r t M o d e ,   i t e m s ,   l a n g ,   l a s t I d ,  
         l e n g t h ,   o p t i o n s ,   o v e r l a y B u t t o n ,   p a r s e P o l i c i e s ,   p o l i c i e s ,   p r o d u c t ,  
         p r o t o t y p e ,   r a i s e E r r o r ,   r a i s e E v e n t ,   r a i s e W a r n i n g ,   r e s i z e T o ,   s a f e M o d e ,  
         s r c ,   s w f U r l ,   t o S t r i n g ,   u n i q u e I d ,   v e r s i o n ,   w i d t h ,   r e f ,   _ _ s t a t e  
 * /  
  
 / * !  
   *   F u s i o n C h a r t s   J a v a S c r i p t   L i b r a r y  
   *   C o p y r i g h t   F u s i o n C h a r t s   T e c h n o l o g i e s   L L P  
   *   L i c e n s e   I n f o r m a t i o n   a t   < h t t p : / / w w w . f u s i o n c h a r t s . c o m / l i c e n s e >  
   *  
   *   @ a u t h o r   F u s i o n C h a r t s  
   *   @ v e r s i o n   3 . 2 . 1 - r e l e a s e  
   *  
   *   T h i r d - p a r t y   a t t r i b u t i o n s :  
   *   S W F O b j e c t   v 2 . 2   < h t t p : / / c o d e . g o o g l e . c o m / p / s w f o b j e c t / >  
   *   J S O N   v 2   < h t t p : / / w w w . J S O N . o r g / j s . h t m l >  
   *   F i r e b u g   L i t e   1 . 3 . 0   < h t t p : / / g e t f i r e b u g . c o m / f i r e b u g l i t e >  
   *   j Q u e r y   1 . 4 . 2   < h t t p : / / j q u e r y . c o m / >  
   * /  
  
 / * *  
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
   *   F u s i o n C h a r t s   C o r e   F r a m e w o r k  
   *   F u s i o n C h a r t s   c o r e   f r a m e w o r k   m o d u l e .   T h i s   m o d u l e   c o n t a i n s   t h e   b a s i c   r o u t i n e s  
   *   r e q u i r e d   b y   s u b s e q u e n t   m o d u l e s   t o   e x t e n d / s c a l e   o r   a d d   f u n c t i o n a l i t y   t o   t h e  
   *   F u s i o n C h a r t s   o b j e c t .  
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
   * /  
 ( f u n c t i o n   ( )   {  
  
         / /   I n   c a s e   F u s i o n C h a r t s   o  
         / /   b j e c t   a l r e a d y   e x i s t s ,   w e   s k i p   t h i s   f u n c t i o n .  
         i f   ( t y p e o f   w i n d o w . F u s i o n C h a r t s   ! = =   ' u n d e f i n e d ' )   {  
                 r e t u r n ;  
         }  
  
         / * *  
           *   @ v a r   { o b j e c t }   g l o b a l   T h e   g l o b a l   v a r i a b l e   w o u l d   s t o r e   a l l   p r i v a t e   m e t h o d s  
           *   a n d   p r o p e r t i e s   a v a i l a b l e   t o   e a c h   m o d u l e .  
           *  
           *   @ v a r   { o b j e c t }   m o d u l e s   F o r   m a i n t a i n i n g   m o d u l e   i n f o r m a t i o n .  
           *  
           *   @ v a r   { A r r a y }   a r g s T   S p e c i f i e s   t h e   o r d e r   i n   w h i c h   t h e   p a r a m e t e r s   o f   t h e   n e w  
           *   F u s i o n C h a r t s   o b j e c t s   a r e   i n t e r p r e t e d   a n d   c o n v e r t e d   t o   o p t i o n s   o b j e c t .  
           * /  
         v a r   g l o b a l   =   { } ,   m o d u l e s   =   { } ,   a r g s T   =   [ ' s w f U r l ' ,   ' i d ' ,   ' w i d t h ' ,   ' h e i g h t ' ,  
                 ' d e b u g M o d e ' ,   ' r e g i s t e r W i t h J S ' ,   ' b g C o l o r ' ,   ' s c a l e M o d e ' ,   ' l a n g ' ,  
                 ' d e t e c t F l a s h V e r s i o n ' ,   ' a u t o I n s t a l l R e d i r e c t ' ] ;  
  
         / * *  
           *   T h i s   m e t h o d ,   w h e n   a d d e d   t o   t h e   p r o t o t y p e   o f   a n   o b j e c t ,  
           *   a l l o w s   s h a l l o w   o r   d e e p   e x t e n s i o n   o f   t h e   o b j e c t   w i t h   a n o t h e r  
           *   o b j e c t .  
           * /  
         g l o b a l . e x t e n d   =   f u n c t i o n   ( o b j 1 ,   o b j 2 )   {  
  
                 / /   G e t   s h a l l o w   o r   d e e p   c o p y   i n f o r m a t i o n  
                 v a r   d e e p   =   t y p e o f   a r g u m e n t s [ a r g u m e n t s . l e n g t h   -   1 ]   = = =   ' b o o l e a n '   ?  
                         a r g u m e n t s [ a r g u m e n t s . l e n g t h   -   1 ]   :   f a l s e ;  
  
                 / /   D e c i d e   w h i c h   p a r a m e t e r   i s   g o i n g   t o   b e   s o u r c e   a n d   w h i c h   o n e   w i l l   b e  
                 / /   s i n k .  
                 v a r   s r c   =   o b j 2 ,   s n k   =   o b j 1 ;  
                 i f   ( t y p e o f   o b j 2   = = =   ' b o o l e a n '   | |   a r g u m e n t s . l e n g t h   = = =   1 )   {  
                         s n k   =   g l o b a l . c o r e ;  
                         s r c   =   o b j 1 ;  
                 }  
                 / /   W h e n   ' s h a l l o w '   i s   m a r k e d   a s   t r u e ,   t h e   m e t h o d s   a n d   p r o p e r t i e s  
                 / /   o f   s o u r c e   i s   n o t   a d d e d   t o   t h e   p r o t o t y p e   o f   t h e   s i n k .  
                 i f   ( d e e p   = = =   t r u e )   {  
                         s n k   =   s n k . p r o t o t y p e ;  
                 }  
  
                 / /   C o p y   a l l   m e t h o d s   a n d   p r o p e r t i e s   o f   t h e   o b j e c t   p a s s e d   i n   p a r a m e t e r  
                 / /   t o   t h e   o b j e c t   t o   w h i c h   t h i s   f u n c t i o n   i s   a t t a c h e d .  
                 f o r   ( v a r   i t e m   i n   s r c )   {  
                         s n k [ i t e m ]   =   s r c [ i t e m ] ;  
                 }  
  
                 r e t u r n   s n k ;  
         } ;  
  
         / /   F u n c t i o n   t h a t   a u t o - g e n e r a t e s   a   u n i q u e   i d .  
         g l o b a l . u n i q u e I d   =   f u n c t i o n   ( )   {  
                 r e t u r n   ' c h a r t o b j e c t - '   +   ( g l o b a l . u n i q u e I d . l a s t I d   + =   1 ) ;  
         } ;  
         g l o b a l . u n i q u e I d . l a s t I d   =   0 ;  
  
         / /   D e f i n e   t h e   p o l i c y   t o   c r e a t e   d e f a u l t   p a r a m e t e r s   f o r   t h e   s w f O b j e c t .  
         / /   V a l u e s   a r e   i n   f o r m a t   [ s o u r c e O p t i o n ,   d e f a u l t V a l u e ]  
         / /   T h i s   h e l p s   i n   b u i l d i n g   t h e   i n i t i a l   F u s i o n C h a r t s   o b j e c t   w h e n   n e w   i n s t a n c e s  
         / /   a r e   c r e a t e d   f r o m   u s e r   p a r a m e t e r s .  
         g l o b a l . p o l i c i e s   =   {  
                 / * *  
                   *   @ v a r   o p t i o n s   { o b j e c t }   C o n t a i n s   a l l   t h e   c u s t o m i z a b l e   o p t i o n s   t h a t   a r e  
                   *   u s e d   b y   t h e   l i b r a r y   i n t e r n a l l y   a n d   h a s   n o t h i n g   t o   d o   w i t h   r e n d e r e r  
                   *   a t t r i b u t e s ,   v a r s   o r   p a r a m e t e r s  
                   * /  
                 o p t i o n s :   {  
                         p r o d u c t :   [ ' p r o d u c t ' ,   ' v 3 ' ] ,  
                         i n s e r t M o d e :   [ ' i n s e r t M o d e ' ,   ' r e p l a c e ' ] ,  
                         s a f e M o d e :   [ ' s a f e M o d e ' ,   t r u e ] ,  
                         o v e r l a y B u t t o n :   [ ' o v e r l a y B u t t o n ' ,   u n d e f i n e d ]  
                 } ,  
                 / * *  
                   *   @ v a r   a t t r i b u t e s   { o b j e c t }   C o n t a i n s   c o n f i g u r a t i o n s   p e r t a i n i n g   t o   t h e  
                   *   h o s t   ( b r o w s e r )   e n v i r o n m e n t .  
                   * /  
                 a t t r i b u t e s :   {  
                         l a n g :   [ ' l a n g ' ,   ' E N ' ] ,  
                         ' c l a s s ' :   [ ' c l a s s N a m e ' ,   ' F u s i o n C h a r t s ' ]  
                 } ,  
  
                 / * *  
                   *   @ v a r   { A r r a y }   w i d t h   c o n f i g u r a t i o n   f o r   w i d t h   o f   t h e   c h a r t .  
                   *   @ v a r   { A r r a y }   h e i g h t   c o n f i g u r a t i o n   f o r   h e i g h t   o f   t h e   c h a r t .  
                   *   @ v a r   { A r r a y }   s r c   s p e c i f i e s   c h a r t   s w f   u r l  
                   * /  
                 w i d t h :   [ ' w i d t h ' ,   ' 4 0 0 ' ] ,  
                 h e i g h t :   [ ' h e i g h t ' ,   ' 3 0 0 ' ] ,  
                 s r c :   [ ' s w f U r l ' ,   ' ' ] ,  
                  
                 _ _ s t a t e :   { }  
         } ;  
  
         / * *  
           *   A l l o w s   t h e   c o r e   t o   p r o c e s s   a n   a r g u m e n t s   o b j e c t   b a s e d   o n   a   s e t   o f   p o l i c i e s  
           *   a n d   c o n s t r u c t   a n   o b j e c t   o u t   o f   i t   t h a t   i s   m a p p e d   e x a c t l y   a s   r e s p e c t i v e  
           *   p a r a m e t e r   p o l i c y   d e f i n e s .   I n   o t h e r   w o r d s ,   i t   u s e s   a n   o b j e c t   a n d  
           *   c r e a t e s   a n o t h e r   o b j e c t   o r   u p d a t e s   a n o t h e r   o b j e c t   w i t h   v a l u e s   f r o m   t h e  
           *   o r i g i n a l   a r g u m e n t s   o b j e c t   i n   a   p a r t i c u l a r   h i e r a r c h y   a n d   n a m e   t h a t   a   s e t  
           *   o f   r u l e s   ( p o l i c i e s )   d e f i n e .  
           * /  
         g l o b a l . p a r s e P o l i c i e s   =   f u n c t i o n   ( o b j ,   p o l i c i e s ,   o p t i o n s )   {  
                 v a r   p r o p ,   p o l i c y ,   v a l u e ;  
  
                 / /   I t e r a t e   t h r o u g h   t h e   d a t a   p o l i c y   a n d   c o r r e s p o n d i n g l y   c r e a t e   t h e  
                 / /   t h r e e   s t a c k s   o f   p a r a m e t e r s ,   a t t r i b u t e s   a n d   f l a s h V a r s  
                 f o r   ( p o l i c y   i n   p o l i c i e s )   {  
  
                         / /   S e t   j u s t   t h e   p o l i c y   o b j e c t   i n   c a s e   o f   s i n g l e - l e v e l   p o l i c y .  
                         i f   ( g l o b a l . p o l i c i e s [ p o l i c y ]   i n s t a n c e o f   A r r a y )   {  
                                 v a l u e   =   o p t i o n s [ p o l i c i e s [ p o l i c y ] [ 0 ] ] ;  
                                 o b j [ p o l i c y ]   =   v a l u e   = = =   u n d e f i n e d   ?   p o l i c i e s [ p o l i c y ] [ 1 ]   :   v a l u e ;  
                                 c o n t i n u e ;  
                         }  
  
                         / /   D e f i n e   o b j e c t s   t h a t   w o u l d   h o l d   p a r a m e t e r s   f o r   s w f o b j e c t .   A l s o  
                         / /   p o p u l a t e   w i t h   v a r i a b l e s   f r o m   t h e   p a r a m e t e r s  
                         i f   ( t y p e o f   o b j [ p o l i c y ]   ! = =   ' o b j e c t ' )   {  
                                 o b j [ p o l i c y ]   =   { } ;  
                         }  
  
                         / /   S e t   e v e r y   s u b - o b j e c t   f o r   t w o - l e v e l   p o l i c y  
                         f o r   ( p r o p   i n   p o l i c i e s [ p o l i c y ] )   {  
                                 v a l u e   =   o p t i o n s [ p o l i c i e s [ p o l i c y ] [ p r o p ] [ 0 ] ] ;  
                                 o b j [ p o l i c y ] [ p r o p ]   =   v a l u e   = = =   u n d e f i n e d   ?    
                                         p o l i c i e s [ p o l i c y ] [ p r o p ] [ 1 ]   :   v a l u e ;  
                         }  
                 }  
         } ;  
          
         g l o b a l . c o r e   =   f u n c t i o n   ( c o m m a n d )   {  
                 / /   T h i s   p o i n t   o n w a r d s ,   w e   m u s t   c h e c k   w h e t h e r   t h i s   i s   b e i n g   u s e d   a s   a  
                 / /   c o n s t r u c t o r   o r   n o t  
                 i f   ( ! ( t h i s   i n s t a n c e o f   g l o b a l . c o r e ) )   {  
                         / /   A l l o w   p r i v a t e   c o m m u n i c a t i o n   w i t h   m o d u l e s .   I n   c a s e   F u s i o n C h a r t s   i s  
                         / /   n o t   c a l l e d   a s   c o n s t r u c t o r   a n d   i t   i s   p a s s e d   a n   a r r a y   t h a t   i s   m a r k e d  
                         / /   t o   d o   p r i v a t e   c o m m u n i c a t i o n ,   t h e n   s h a r e   t h e   g l o b a l   v a r i a b l e .  
                         i f   ( a r g u m e n t s . l e n g t h   = = =   1   & &  
                                 c o m m a n d   i n s t a n c e o f   A r r a y   & &   c o m m a n d [ 0 ]   = = =   ' p r i v a t e ' )   {  
                                 / /   P r e v e n t   o v e r w r i t i n g   a n d   d u p l i c a t e   e x e c u t i o n   o f   m o d u l e s .  
                                 i f   ( m o d u l e s [ c o m m a n d [ 1 ] ]   = = =   t r u e )   {  
                                         r e t u r n   u n d e f i n e d ;  
                                 }  
                                 m o d u l e s [ c o m m a n d [ 1 ] ]   =   t r u e ;  
                                 r e t u r n   g l o b a l ;  
                         }  
  
                         / /   A l l o w   u s i n g   F u s i o n C h a r t s   o b j e c t   t o   d i r e c t l y   a c c e s s   i t s   n e w   i t e m s  
                         i f   ( a r g u m e n t s . l e n g t h   = = =   1   & &   t y p e o f   c o m m a n d   = = =   ' s t r i n g ' )   {  
                                 r e t u r n   g l o b a l . c o r e . i t e m s [ c o m m a n d ] ;  
                         }  
                         / /   I n   c a s e   a l l   a b o v e   c o m b i n a t i o n   o f   a r g u m e n t s   f a i l ,   w e   c a n   u n s a f e l y  
                         / /   a s s u m e   t h a t   u s e r   f o r g o t   t h e   ' n e w '   k e y w o r d .  
                         g l o b a l . r a i s e E r r o r ( t h i s ,   ' 2 5 0 8 1 8 4 0 ' ,   ' r u n ' ,   ' ' ,   n e w   S y n t a x E r r o r (  
                                 " U s e   t h e   \ " n e w \ "   k e y w o r d   w h i l e   c r e a t i n g   a   n e w   F u s i o n C h a r t s   o b j e c t " ) ) ;  
                 }  
  
                 / /   D e f i n e   a   v a r i a b l e   f o r   i t e r a t i v e   k e y   i n   v a r i o u s   l o o p s   a n d   t h e  
                 / /   o b j e c t   v a r i a b l e   t h a t   s t o r e s   t h e   o p t i o n s .  
                 v a r   o p t i o n s   =   { } ,   p r o p ;  
  
                 / /   C h e c k   w h e t h e r   l i n e a r   a r g u m e n t s   a r e   s e n t   a n d   c o n v e r t   i t   t o   o b j e c t .  
                 i f   ( a r g u m e n t s . l e n g t h   = = =   1   & &   t y p e o f   a r g u m e n t s [ 0 ]   = = =   ' o b j e c t ' )   {  
                         / /   I f   t h e   a b o v e   c o n d i t i o n   m a t c h e s ,   t h e n   w e   c a n   s a f e l y   a s s u m e   t h a t  
                         / /   t h e   f i r s t   p a r a m e t e r   i s   t h e   o p t i o n s   o b j e c t .  
                         o p t i o n s   =   a r g u m e n t s [ 0 ] ;  
                 }  
                 e l s e   {  
                         / /   I t e r a t e   t h r o u g h   t h e   a r g u m e n t s   t e m p l a t e   a n d   a d d   t h e   k e y s   t o   t h e  
                         / /   o p t i o n s   o b j e c t   w h i l e   f e t c h i n g   c o r r e s p o n d i n g   v a l u e s   f r o m   a r g u m e n t s  
                         / /   a r r a y .  
                         f o r   ( p r o p   i n   a r g s T )   {  
                                 o p t i o n s [ a r g s T [ p r o p ] ]   =   a r g u m e n t s [ p r o p ] ;  
                         }  
                 }  
  
                 / /   I n c o r p o r a t e   t h e   t r a i l i n g   o b j e c t   p a r a m e t e r   a s   o b j e c t - s t y l e  
                 / /   p a r a m e t e r   i n p u t   o v e r r i d e s .  
                 i f   ( t y p e o f   a r g u m e n t s [ a r g u m e n t s . l e n g t h   -   1 ]   = = =   ' o b j e c t ' )   {  
                         d e l e t e   o p t i o n s [ a r g u m e n t s . l e n g t h   -   1 ] ;  
                         g l o b a l . e x t e n d ( o p t i o n s ,   a r g u m e n t s [ a r g u m e n t s . l e n g t h   -   1 ] ) ;  
                 }  
  
                 / /   S e t   a u t o g e n e r a t e d   c h a r t - i d   i n   c a s e   o n e   i s   n o t   s p e c i f i e d  
                 t h i s . i d   =   t y p e o f   o p t i o n s . i d   = = =   ' u n d e f i n e d '   ?  
                         t h i s . i d   =   g l o b a l . u n i q u e I d ( )   :   o p t i o n s . i d ;  
  
                 / /   S e t   d i m e n s i o n   p a s s e d   b y   u s e r   a n d   s u b s e q u e n t l y   v a l i d a t e   t h e   o p t i o n s .  
                 / /   -   R e m o v e   t r a i l i n g   ' p x '  
                 t h i s . a r g s   =   o p t i o n s ;  
  
                 / /   I f   a n   i t e m   i s   c r e a t e d   w i t h   s a m e   i d ,   t h e   p r e v i o u s   i t e m   i s   d i s p o s e d .  
                 i f   ( g l o b a l . c o r e . i t e m s [ t h i s . i d ]   i n s t a n c e o f   g l o b a l . c o r e )   {  
                         t h i s . i d   =   g l o b a l . u n i q u e I d ( ) ;  
                         g l o b a l . r a i s e W a r n i n g ( t h i s ,   ' 0 6 0 9 1 8 4 7 ' ,   ' p a r a m ' ,   ' ' ,  
                                 ' A   F u s i o n C h a r t   o j e c t   w i t h   t h e   s p e c i f i e d   i d   \ " '   +   t h i s . i d   +  
                                 ' \ "   a l r e a d y   e x i s t s .   R e n a m i n g   i t   t o   '   +   t h i s . i d ) ;  
                 }  
                  
                 / /   P a r s e   g l o b a l   p o l i c i e s .  
                 g l o b a l . p a r s e P o l i c i e s ( t h i s ,   g l o b a l . p o l i c i e s ,   o p t i o n s ) ;  
  
                 / /   S e t   i n i t i a l   d i m e n s i o n   o f   c h a r t s  
                 t h i s . r e s i z e T o ( o p t i o n s . w i d t h ,   o p t i o n s . h e i g h t ,   t r u e ) ;  
                  
                 / /   E x e c u t e   a l l   c o n s t r u c t o r s   o n e   a f t e r   t h e   o t h e r   u s i n g   e v e n t s .  
                 g l o b a l . r a i s e E v e n t ( ' B e f o r e I n i t i a l i z e ' ,   o p t i o n s ,   t h i s ) ;  
  
                 / /   A d d   t h i s   o b j e c t   t o   t h e   r e p o s i t o r y   o f   o b j e c t s   w i t h i n   c o r e   o b j e c t .  
                 g l o b a l . c o r e . i t e m s [ t h i s . i d ]   =   t h i s ;  
  
                 / /   R a i s e   i n i t i a l i z a t i o n   e v e n t .  
                 g l o b a l . r a i s e E v e n t ( ' I n i t i a l i z e d ' ,   o p t i o n s ,   t h i s ) ;  
  
                 r e t u r n   t h i s ;  
         } ;  
  
         / /   M a k e   t h e   c o r e   e x t e n s i b l e   a n d   r e s e t   t h e   c o n s t r u c t o r   o f   t h e   o b j e c t  
         / /   f o r   m a i n t a i n i n g   c o r r e c t   p r o t o t y p e   c h a i n .  
         g l o b a l . c o r e . p r o t o t y p e   =   { } ;  
         / /   R e s e t   c o n s t r u c t o r .  
         g l o b a l . c o r e . p r o t o t y p e . c o n s t r u c t o r   =   g l o b a l . c o r e ;  
  
         g l o b a l . e x t e n d ( {  
                 i d :   ' F u s i o n C h a r t s ' ,  
                 / * *  
                   *   T h e   v e r s i o n   o f   F u s i o n C h a r t s . j s  
                   * /  
                 v e r s i o n :   [ 3 ,   2 ,   1 ,   ' r e l e a s e ' ,   1 7 5 0 ] ,  
  
                 / /   A d d   a   c o n t a i n e r   o f   a l l   c h a r t   o b j e c t s .   T h i s   w i l l   a l l o w   e a s y   r e t u r n i n g  
                 / /   o f   F u s i o n C h a r t s   o b j e c t s   t h r o u g h   g e t C h a r t F r o m I d .  
                 i t e m s :   { } ,  
  
                 / /   A d d   a n   o b j e c t   t o   s t o r e   o p t i o n s  
                 o p t i o n s :   { } ,  
                  
                 / /   A d d   f u n c t i o n   t o   a c c e s s   t h e   o b j e c t   c r e a t e d   b y   r e n d e r e r s .  
                 g e t O b j e c t R e f e r e n c e :   f u n c t i o n   ( i d )   {  
                         r e t u r n   g l o b a l . c o r e . i t e m s [ i d ] . r e f ;  
                 }  
         } ,   f a l s e ) ;  
  
         / /   E x p o s e   t h e   c o r e   t o   t h e   g l o b a l   s c o p e .  
         w i n d o w . F u s i o n C h a r t s   =   g l o b a l . c o r e ;  
  
 } ( ) ) ;  
  
  
  
 / * j s l i n t   w h i t e :   t r u e ,   b r o w s e r :   t r u e ,   w i n d o w s :   t r u e ,   f o r i n :   t r u e ,     u n d e f :   t r u e ,  
     e q e q e q :   t r u e ,   p l u s p l u s :   t r u e ,   b i t w i s e :   t r u e ,   r e g e x p :   t r u e ,   i m m e d :   t r u e   * /  
  
 / * g l o b a l   A r r a y :   f a l s e ,   F u s i o n C h a r t s ,   w i n d o w :   f a l s e   * /  
  
 / * m e m b e r s   " * " ,   B e f o r e D i s p o s e ,   B e f o r e I n i t i a l i z e ,   D a t a L o a d C a n c e l l e d ,   B e f o r e D a t a U p d a t e ,  
         D a t a L o a d E r r o r ,   D a t a L o a d R e q u e s t C a n c e l l e d ,   D a t a L o a d R e q u e s t C o m p l e t e d ,   D a t a U p d a t e C a n c e l l e d ,  
         D a t a L o a d R e q u e s t e d ,   D a t a L o a d e d ,   D a t a X M L I n v a l i d ,   D i s p o s e d ,   D r a w C o m p l e t e ,  
         F u s i o n C h a r t s E v e n t s ,   I n i t i a l i z e d ,   I n v a l i d D a t a E r r o r ,   L o a d e d ,   D a t a U p d a t e d  
         N o D a t a T o D i s p l a y ,   R e n d e r e d ,   R e s i z e d ,   a d d E v e n t L i s t e n e r ,   a d d L i s t e n e r ,   c a l l ,  
         c a n c e l ,   c o r e ,   e v e n t I d ,   e v e n t T y p e ,   e x t e n d ,   i t e m s ,   l a s t E v e n t I d ,   l e n g t h ,  
         l i s t e n e r s ,   p u s h ,   r a i s e E r r o r ,   r a i s e E v e n t ,   r e m o v e E v e n t L i s t e n e r ,  
         r e m o v e L i s t e n e r ,   s e n d e r ,   s p l i c e ,   s t o p P r o p a g a t i o n ,   t o L o w e r C a s e ,  
         t r i g g e r E v e n t  
 * /  
  
 / * *  
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
   *   E v e n t   H a n d l e r   F r a m e w o r k  
   *   T h i s   m o d u l e   a l l o w s   F u s i o n C h a r t s   t o   w o r k   w i t h   W 3 C   L e v e l   2   s t y l e   e v e n t s   f o r  
   *   a l l o w i n g   m u l t i p l e   h a n d l e r s   p e r   e v e n t   a n d   a l s o   t o   d o   e v e n t   d r i v e n   d e v e l o p m e n t  
   *   o n   a   g l o b a l   o r   p e r - c h a r t   b a s i s .  
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
   * /  
 ( f u n c t i o n   ( )   {  
  
         / /   T r y   r e g i s t e r   t h e   m o d u l e   w i t h   F u s i o n C h a r t s .  
         v a r   g l o b a l   =   F u s i o n C h a r t s ( [ ' p r i v a t e ' ,   ' E v e n t M a n a g e r ' ] ) ;  
         / /   C h e c k   w h e t h e r   t h e   m o d u l e   h a s   b e e n   a l r e a d y   r e g i s t e r e d .   I f   t r u e ,   t h e n  
         / /   d o   n o t   b o t h e r   t o   r e - r e g i s t e r .  
         i f   ( g l o b a l   = = =   u n d e f i n e d )   {  
                 r e t u r n ;  
         }  
  
         / /   C o l l e c t i o n   o f   F u s i o n C h a r t s   e v e n t s  
         w i n d o w . F u s i o n C h a r t s E v e n t s   =   {  
                 B e f o r e I n i t i a l i z e :   ' b e f o r e i n i t i a l i z e ' ,  
                 I n i t i a l i z e d :   ' i n i t i a l i z e d ' ,  
                 L o a d e d :   ' l o a d e d ' ,  
                 R e n d e r e d :   ' r e n d e r e d ' ,  
                 D a t a L o a d R e q u e s t e d :   ' d a t a l o a d r e q u e s t e d ' ,  
                 D a t a L o a d R e q u e s t C a n c e l l e d :   ' d a t a l o a d r e q u e s t c a n c e l l e d ' ,  
                 D a t a L o a d R e q u e s t C o m p l e t e d :   ' d a t a l o a d r e q u e s t c o m p l e t e d ' ,  
                 B e f o r e D a t a U p d a t e :   ' b e f o r e d a t a u p d a t e ' ,  
                 D a t a U p d a t e C a n c e l l e d :   ' d a t a u p d a t e c a n c e l l e d ' ,  
                 D a t a U p d a t e d :   ' d a t a u p d a t e d ' ,  
                 D a t a L o a d C a n c e l l e d :   ' d a t a l o a d c a n c e l l e d ' ,  
                 D a t a L o a d e d :   ' d a t a l o a d e d ' ,  
                 D a t a L o a d E r r o r :   ' d a t a l o a d e r r o r ' ,  
                 N o D a t a T o D i s p l a y :   ' n o d a t a t o d i s p l a y ' ,  
                 D a t a X M L I n v a l i d :   ' d a t a x m l i n v a l i d ' ,  
                 I n v a l i d D a t a E r r o r :   ' i n v a l i d d a t a e r r o r ' ,  
                 D r a w C o m p l e t e :   ' d r a w c o m p l e t e ' ,  
                 R e s i z e d :   ' r e s i z e d ' ,  
                 B e f o r e D i s p o s e :   ' b e f o r e d i s p o s e ' ,  
                 D i s p o s e d :   ' d i s p o s e d '  
         } ;  
  
         / /   A   f u n c t i o n   t o   c r e a t e   a n   a b s t r a c t i o n   l a y e r   s o   t h a t   t h e   t r y - c a t c h   /  
         / /   e r r o r   s u p p r e s s i o n   o f   f l a s h   c a n   b e   a v o i d e d   w h i l e   r a i s i n g   e v e n t s .  
         v a r   m a n a g e d F n C a l l   =   f u n c t i o n   ( i t e m ,   s c o p e ,   e v e n t ,   a r g s )   {  
                 / /   W e   c h a n g e   t h e   s c o p e   o f   t h e   f u n c t i o n   w i t h   r e s p e c t   t o   t h e  
                 / /   o b j e c t   t h a t   r a i s e d   t h e   e v e n t .  
                 t r y   {  
                         i t e m [ 0 ] . c a l l ( s c o p e ,   e v e n t ,   a r g s   | |   { } ) ;  
                 }  
                 c a t c h   ( e )   {  
                         / /   C a l l   e r r o r   i n   a   s e p a r a t e   t h r e a d   t o   a v o i d   s t o p p i n g  
                         / /   o f   c h a r t   l o a d .  
                         s e t T i m e o u t ( f u n c t i o n   ( )   {    
                                 t h r o w   e ;  
                         } ,   0 ) ;  
                 }  
         } ;  
  
         / /   F u n c t i o n   t h a t   e x e c u t e s   a l l   f u n c t i o n s   t h a t   a r e   t o   b e   i n v o k e d   u p o n   t r i g g e r  
         / /   o f   a n   e v e n t .  
         v a r   s l o t L o a d e r   =   f u n c t i o n   ( s l o t ,   e v e n t ,   a r g s )   {  
                 / /   I f   s l o t   d o e s   n o t   h a v e   a   q u e u e ,   w e   a s s u m e   t h a t   t h e   l i s t e n e r  
                 / /   w a s   n e v e r   a d d e d   a n d   h a l t   m e t h o d .  
                 i f   ( ! ( s l o t   i n s t a n c e o f   A r r a y ) )   {  
                         / /   S t a t u t o r y   W 3 C   N O T   p r e v e n t D e f a u l t   f l a g  
                         r e t u r n ;  
                 }  
                  
                 / /   I n i t i a l i z e   v a r i a b l e s .  
                 v a r   i   =   0 ,   s c o p e ;  
  
                 / /   I t e r a t e   t h r o u g h   t h e   s l o t   a n d   l o o k   f o r   m a t c h   w i t h   r e s p e c t   t o  
                 / /   t y p e   a n d   b i n d i n g .  
                 f o r   ( ;   i   <   s l o t . l e n g t h ;   i   + =   1 )   {  
  
                         / /   I f   t h e r e   i s   a   m a t c h   f o u n d   w . r . t .   t y p e   a n d   b i n d ,   w e   f i r e   i t .  
                         i f   ( s l o t [ i ] [ 1 ]   = = =   e v e n t . s e n d e r   | |   s l o t [ i ] [ 1 ]   = = =   u n d e f i n e d )   {  
  
                                 / /   D e t e r m i n e   t h e   s e n d e r   o f   t h e   e v e n t   f o r   g l o b a l   e v e n t s .  
                                 / /   T h e   c h o i c e   o f   s c o p e   d i f f e r e s   d e p e n d i n g   o n   w h e t h e r   a  
                                 / /   g l o b a l   o r   a   l o c a l   e v e n t   i s   b e i n g   r a i s e d .  
                                 s c o p e   =   s l o t [ i ] [ 1 ]   = = =   e v e n t . s e n d e r   ?  
                                         e v e n t . s e n d e r   :   g l o b a l . c o r e ;  
  
                                 m a n a g e d F n C a l l ( s l o t [ i ] ,   s c o p e ,   e v e n t ,   a r g s ) ;  
                         }  
  
                         / /   C h e c k   w h e t h e r   p r o p a g a t i o n   f l a g   i s   s e t   t o   f a l s e   a n d   d i s c o n t n u e  
                         / /   i t e r a t i o n   i f   n e e d e d .  
                         i f   ( e v e n t . c a n c e l   = = =   t r u e )   {  
                                 b r e a k ;  
                         }  
                 }  
         } ;  
  
         v a r   E v e n t T a r g e t   =   {  
  
                 / /   E n t i r e   c o l l e c t i o n   o f   l i s t e n e r s .  
                 l i s t e n e r s :   { } ,  
  
                 / /   T h e   l a s t   r a i s e d   e v e n t   i d .   A l l o w s   t o   c a l c u l a t e   t h e   n e x t   e v e n t   i d .  
                 l a s t E v e n t I d :   0 ,  
  
                 a d d L i s t e n e r :   f u n c t i o n   ( t y p e ,   l i s t e n e r ,   b i n d )   {  
  
                         / /   I n   c a s e   t y p e   i s   s e n t   a s   a r r a y ,   w e   r e c u r s e   t h i s   f u n c t i o n .  
                         i f   ( t y p e   i n s t a n c e o f   A r r a y )   {  
                                 / /   W e   l o o k   i n t o   e a c h   i t e m   o f   t h e   ' t y p e '   p a r a m e t e r   a n d   s e n d   i t ,  
                                 / /   a l o n g   w i t h   o t h e r   p a r a m e t e r s   t o   a   r e c u r s e d   a d d L i s t e n e r  
                                 / /   m e t h o d .  
                                 f o r   ( v a r   i   =   0 ;   i   <   t y p e . l e n g t h ;   i   + =   1 )   {  
                                         E v e n t T a r g e t . a d d L i s t e n e r ( t y p e [ i ] ,   l i s t e n e r ,   b i n d ) ;  
                                 }  
                                 r e t u r n ;  
                         }  
  
                         / /   V a l i d a t e   t h e   t y p e   p a r a m e t e r .   L i s t e n e r   c a n n o t   b e   a d d e d   w i t h o u t  
                         / /   v a l i d   t y p e .  
                         i f   ( t y p e o f   t y p e   ! = =   ' s t r i n g ' )   {  
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 0 3 0 9 1 5 4 9 ' ,   ' p a r a m ' ,   ' : : E v e n t T a r g e t . a d d L i s t e n e r ' ,  
                                         n e w   E r r o r ( ' U n s p e c i f i e d   E v e n t   T y p e ' ) ) ;  
                                 r e t u r n ;  
                         }  
  
                         / /   L i s t e n e r   m u s t   b e   a   f u n c t i o n .   I t   w i l l   n o t   e v a l   a   s t r i n g .  
                         i f   ( t y p e o f   l i s t e n e r   ! = =   ' f u n c t i o n ' )   {  
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 0 3 0 9 1 5 5 0 ' ,   ' p a r a m ' ,   ' : : E v e n t T a r g e t . a d d L i s t e n e r ' ,  
                                         n e w   E r r o r ( ' I n v a l i d   E v e n t   L i s t e n e r ' ) ) ;  
                                 r e t u r n ;  
                         }  
  
                         / /   D e s e n s i t i z e   t h e   t y p e   c a s e   f o r   u s e r   a c c e s s a b i l i t y .  
                         t y p e   =   t y p e . t o L o w e r C a s e ( ) ;  
  
                         / /   I f   t h e   i n s e r t i o n   p o s i t i o n   d o e s   n o t   h a v e   a   q u e u e ,   t h e n   c r e a t e   o n e .  
                         i f   ( ! ( E v e n t T a r g e t . l i s t e n e r s [ t y p e ]   i n s t a n c e o f   A r r a y ) )   {  
                                 E v e n t T a r g e t . l i s t e n e r s [ t y p e ]   =   [ ] ;  
                         }  
  
                         / /   A d d   t h e   l i s t e n e r   t o   t h e   q u e u e .  
                         E v e n t T a r g e t . l i s t e n e r s [ t y p e ] . p u s h ( [ l i s t e n e r ,   b i n d ] ) ;  
  
                 } ,  
  
                 r e m o v e L i s t e n e r :   f u n c t i o n   ( t y p e ,   l i s t e n e r ,   b i n d )   {  
 	 	  
 	 	 	 v a r   i ;  
 	 	  
                         / /   I n   c a s e   t y p e   i s   s e n t   a s   a r r a y ,   w e   r e c u r s e   t h i s   f u n c t i o n .  
                         i f   ( t y p e   i n s t a n c e o f   A r r a y )   {  
                                 / /   W e   l o o k   i n t o   e a c h   i t e m   o f   t h e   ' t y p e '   p a r a m e t e r   a n d   s e n d   i t ,  
                                 / /   a l o n g   w i t h   o t h e r   p a r a m e t e r s   t o   a   r e c u r s e d   a d d L i s t e n e r  
                                 / /   m e t h o d .  
                                 f o r   ( i   =   0 ;   i   <   t y p e . l e n g t h ;   i   + =   1 )   {  
                                         E v e n t T a r g e t . r e m o v e L i s t e n e r ( t y p e [ i ] ,   l i s t e n e r ,   b i n d ) ;  
                                 }  
                                 r e t u r n ;  
                         }  
  
                         / /   V a l i d a t e   t h e   t y p e   p a r a m e t e r .   L i s t e n e r   c a n n o t   b e   r e m o v e d   w i t h o u t  
                         / /   v a l i d   t y p e .  
                         i f   ( t y p e o f   t y p e   ! = =   ' s t r i n g ' )   {  
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 0 3 0 9 1 5 5 9 ' ,   ' p a r a m ' ,   ' : : E v e n t T a r g e t . r e m o v e L i s t e n e r ' ,  
                                         n e w   E r r o r ( ' U n s p e c i f i e d   E v e n t   T y p e ' ) ) ;  
                                 r e t u r n ;  
                         }  
  
                         / /   L i s t e n e r   m u s t   b e   a   f u n c t i o n .   E l s e   w e   h a v e   n o t h i n g   t o   r e m o v e !  
                         i f   ( t y p e o f   l i s t e n e r   ! = =   ' f u n c t i o n ' )   {  
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 0 3 0 9 1 5 6 0 ' ,   ' p a r a m ' ,   ' : : E v e n t T a r g e t . r e m o v e L i s t e n e r ' ,  
                                         n e w   E r r o r ( ' I n v a l i d   E v e n t   L i s t e n e r ' ) ) ;  
                                 r e t u r n ;  
                         }  
  
                         / /   D e s e n s i t i z e   t h e   t y p e   c a s e   f o r   u s e r   a c c e s s a b i l i t y .  
                         t y p e   =   t y p e . t o L o w e r C a s e ( ) ;  
  
                         / /   C r e a t e   a   r e f e r e n c e   t o   t h e   s l o t   f o r   e a s y   l o o k u p   i n   t h i s   m e t h o d .  
                         v a r   s l o t   =   E v e n t T a r g e t . l i s t e n e r s [ t y p e ] ;  
  
                         / /   I f   s l o t   d o e s   n o t   h a v e   a   q u e u e ,   w e   a s s u m e   t h a t   t h e   l i s t e n e r  
                         / /   w a s   n e v e r   a d d e d   a n d   h a l t   m e t h o d .  
                         i f   ( ! ( s l o t   i n s t a n c e o f   A r r a y ) )   {  
                                 r e t u r n ;  
                         }  
  
                         / /   I t e r a t e   t h r o u g h   t h e   s l o t   a n d   r e m o v e   e v e r y   i n s t a n c e   o f   t h e  
                         / /   e v e n t   h a n d l e r .  
                         f o r   ( i   =   0 ;   i   <   s l o t . l e n g t h ;   i   + =   1 )   {  
                                 / /   R e m o v e   a l l   i n s t a n c e s   o f   t h e   l i s t e n e r   f o u n d   i n   t h e   q u e u e .  
                                 i f   ( s l o t [ i ] [ 0 ]   = = =   l i s t e n e r   & &   s l o t [ i ] [ 1 ]   = = =   b i n d )   {  
                                         s l o t . s p l i c e ( i ,   1 ) ;  
                                         i   - =   1 ;  
                                 }  
                         }  
                 } ,  
  
                 / /   o p t s   c a n   h a v e   {   a s y n c : t r u e ,   o m n i : t r u e   }  
                 t r i g g e r E v e n t :   f u n c t i o n   ( t y p e ,   s e n d e r ,   a r g s )   {  
  
                         / /   I n   c a s e ,   e v e n t   t y p e   i s   m i s s i n g ,   d i s p a t c h   c a n n o t   p r o c e e d .  
                         i f   ( t y p e o f   t y p e   ! = =   ' s t r i n g ' )   {  
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 0 3 0 9 1 6 0 2 ' ,   ' p a r a m ' ,   ' : : E v e n t T a r g e t . d i s p a t c h E v e n t ' ,  
                                         n e w   E r r o r ( ' I n v a l i d   E v e n t   T y p e ' ) ) ;  
                                 r e t u r n   u n d e f i n e d ;  
                         }  
  
                         / /   D e s e n s i t i z e   t h e   t y p e   c a s e   f o r   u s e r   a c c e s s a b i l i t y .  
                         t y p e   =   t y p e . t o L o w e r C a s e ( ) ;  
                          
                         / /   M o d e l   t h e   e v e n t   a s   p e r   W 3 C   s t a n d a r d s .   A d d   t h e   f u n c t i o n   t o   c a n c e l  
                         / /   e v e n t   p r o p a g a t i o n   b y   u s e r   h a n d l e r s .   A l s o   a p p e n d   a n   i n c r e m e n t a l  
                         / /   e v e n t   i d .  
                         v a r   e v e n t   =   {  
                                 e v e n t T y p e :   t y p e ,  
                                 e v e n t I d :   ( E v e n t T a r g e t . l a s t E v e n t I d   + =   1 ) ,  
                                 s e n d e r :   ( t y p e o f   s e n d e r   = = =   ' s t r i n g '   ?  
                                         g l o b a l . c o r e . i t e m s [ s e n d e r ]   :   s e n d e r ) ,  
                                 s t o p P r o p a g a t i o n :   f u n c t i o n   ( )   {  
                                         r e t u r n   ( t h i s . c a n c e l   =   t r u e )   = = =   f a l s e ;  
                                 }  
                         } ;  
  
                         / /   E x e c u t e   t h e   f u n c t i o n s   p r e s e n t   w i t h i n   t h e   e v e n t   s l o t   ( c o l l e c t i o n  
                         / /   o f   f u n c t i o n s   f o r   a   p a r t i c u l a r   e v e n t ) .  
                         s l o t L o a d e r ( E v e n t T a r g e t . l i s t e n e r s [ t y p e ] ,   e v e n t ,   a r g s ) ;  
                          
                         / /   F a c i l i t a t e   t h e   c a l l   o f   a   g l o b a l   e v e n t   l i s t e n e r .  
                         s l o t L o a d e r ( E v e n t T a r g e t . l i s t e n e r s [ ' * ' ] ,   e v e n t ,   a r g s ) ;  
  
                         / /   S t a t u t o r y   W 3 C   N O T   p r e v e n t D e f a u l t   f l a g  
                         r e t u r n   t r u e ;  
                 }  
         } ;  
  
         / /   F a c i l i t a t e   f o r   r a i s i n g   e v e n t s   i n t e r n a l l y .  
         g l o b a l . r a i s e E v e n t   =   f u n c t i o n   ( t y p e ,   a r g s ,   o b j )   {  
                 r e t u r n   E v e n t T a r g e t . t r i g g e r E v e n t ( t y p e ,  
                         ( o b j   = = =   u n d e f i n e d   ?   g l o b a l . c o r e   :   o b j ) ,   a r g s ) ;  
         } ;  
  
         / /   E x t e n d   t h e   e v e n t l i s t e n e r s   t o   i n t e r n a l   g l o b a l .  
         g l o b a l . a d d E v e n t L i s t e n e r   =   f u n c t i o n   ( t y p e ,   l i s t e n e r )   {  
                 r e t u r n   E v e n t T a r g e t . a d d L i s t e n e r ( t y p e ,   l i s t e n e r ) ;  
         } ;  
         g l o b a l . r e m o v e E v e n t L i s t e n e r   =   f u n c t i o n   ( t y p e ,   l i s t e n e r )   {  
                 r e t u r n   E v e n t T a r g e t . r e m o v e L i s t e n e r ( t y p e ,   l i s t e n e r ) ;  
         } ;  
  
         / /   A d d   e v e n t L i s t e n e r   e x t e n s i b i l i t y   t o   F u s i o n C h a r t s   o b j e c t  
         g l o b a l . e x t e n d ( {  
                 a d d E v e n t L i s t e n e r :   g l o b a l . a d d E v e n t L i s t e n e r ,  
                 r e m o v e E v e n t L i s t e n e r :   g l o b a l . r e m o v e E v e n t L i s t e n e r  
         } ,   f a l s e ) ;  
  
         / /   A d d   e v e n t L i s t e n e r   e x t e n s i b i l i t y   t o   F u s i o n C h a r t s   p r o t o t y p e   s o   t h a t  
         / /   i n d i v i d u a l   F u s i o n C h a r t s   o b j e c t s   c a n   u s e   p e r - c h a r t   e v e n t s  
         g l o b a l . e x t e n d ( {  
                 a d d E v e n t L i s t e n e r :   f u n c t i o n   ( t y p e ,   l i s t e n e r )   {  
                         r e t u r n   E v e n t T a r g e t . a d d L i s t e n e r ( t y p e ,   l i s t e n e r ,   t h i s ) ;  
                 } ,  
                 r e m o v e E v e n t L i s t e n e r :   f u n c t i o n   ( t y p e ,   l i s t e n e r )   {  
                         r e t u r n   E v e n t T a r g e t . r e m o v e L i s t e n e r ( t y p e ,   l i s t e n e r ,   t h i s ) ;  
                 }  
         } ,   t r u e ) ;  
  
         / /   C l e a n u p   o n   d i s p o s e  
         g l o b a l . a d d E v e n t L i s t e n e r ( ' B e f o r e D i s p o s e ' ,   f u n c t i o n   ( e )   {  
                 v a r   t y p e ,   i ;  
                 / /   I t e r a t e   t h r o u g h   a l l   e v e n t s   i n   t h e   c o l l e c t i o n   o f   l i s t e n e r s  
                 f o r   ( t y p e   i n   E v e n t T a r g e t . l i s t e n e r s )   {  
                         f o r   ( i   =   0 ;   i   <   E v e n t T a r g e t . l i s t e n e r s [ t y p e ] . l e n g t h ;   i   + =   1 )   {  
                                 / /   W h e n   a   m a t c h   i s   f o u n d ,   d e l e t e   t h e   l i s t e n e r   f r o m   t h e  
                                 / /   c o l l e c t i o n .  
                                 i f   ( E v e n t T a r g e t . l i s t e n e r s [ t y p e ] [ i ] [ 1 ]   = = =   e . s e n d e r )   {  
                                         E v e n t T a r g e t . l i s t e n e r s [ t y p e ] . s p l i c e ( i ,   1 ) ;  
                                 }  
                         }  
                 }  
         } ) ;  
  
 } ( ) ) ;  
  
  
  
 / * j s l i n t   w h i t e :   t r u e ,   b r o w s e r :   t r u e ,   w i n d o w s :   t r u e ,   f o r i n :   t r u e ,     u n d e f :   t r u e ,  
     e q e q e q :   t r u e ,   p l u s p l u s :   t r u e ,   b i t w i s e :   t r u e ,   r e g e x p :   t r u e ,   i m m e d :   t r u e   * /  
  
 / * g l o b a l   A r r a y :   f a l s e ,   F u s i o n C h a r t s ,   w i n d o w :   f a l s e ,   c o n s o l e :   f a l s e   * /  
  
 / * m e m b e r s   _ e n a b l e F i r e b u g L i t e ,   a p p e n d C h i l d ,   c o m p ,   c o n s o l e ,   c o r e ,  
         c r e a t e E l e m e n t ,   c u r r e n t O u t p u t H e l p e r ,   d e b u g M o d e ,   e n a b l e d ,   e v e n t ,   e v e n t I d ,  
         e v e n t T y p e ,   e x t e n d ,   f i r e b u g ,   g e t E l e m e n t s B y T a g N a m e ,   i d ,   i m p l ,   l e n g t h ,  
         l e v e l ,   l o g ,   m e s s a g e ,   m o d u l e ,   n a m e ,   n a t u r e ,   o n l o a d ,   o n r e a d y s t a t e c h a n g e ,  
         o p t i o n s ,   o u t p u t F a i l e d ,   o u t p u t F o r m a t ,   o u t p u t H a n d l e r ,   o u t p u t H e l p e r s ,  
         o u t p u t T o ,   p a r a m ,   r a i s e E r r o r ,   r a i s e E v e n t ,   r a i s e W a r n i n g ,   r a n g e ,  
         r e a d y S t a t e ,   r u n ,   s c r i p t B a s e U r i ,   s e n d e r ,   s e t T i m e o u t ,   s o u r c e ,   s r c ,   t e x t ,  
         t o L o w e r C a s e ,   t o S t r i n g ,   t y p e ,   u n d e f i n e d ,   v e r b o s e  
 * /  
  
 / * *  
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
   *   F u s i o n C h a r t s   J a v a S c r i p t   L i b r a r y  
   *   E r r o r   H a n d l e r   F r a m e w o r k  
   *  
   *   T h i s   m o d u l e   a l l o w s   o t h e r   F u s i o n C h a r t s   J a v a S c r i p t   L i b r a r y   m o d u l e s   t o   r a i s e  
   *   e r r o r   a n d   w a r n i n g   m e s s a g e s .  
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
   * /  
 ( f u n c t i o n   ( )   {  
  
         / /   T r y   r e g i s t e r   t h e   m o d u l e   w i t h   F u s i o n C h a r t s .  
         v a r   g l o b a l   =   F u s i o n C h a r t s ( [ ' p r i v a t e ' ,   ' E r r o r H a n d l e r ' ] ) ;  
         / /   C h e c k   w h e t h e r   t h e   m o d u l e   h a s   b e e n   a l r e a d y   r e g i s t e r e d .   I f   t r u e ,   t h e n  
         / /   d o   n o t   b o t h e r   t o   r e - r e g i s t e r .  
         i f   ( g l o b a l   = = =   u n d e f i n e d )   {  
                 r e t u r n ;  
         }  
  
         / /   S e t   t h e   d e f a u l t   o p t i o n s   f o r   t h e   d e f a u l t   o u t p u t   h e l p e r .  
         v a r   D E F A U L T _ O U T P U T _ H E L P E R   =   ' t e x t ' ;  
  
         / * *  
           *   @ v a r   { o b j e c t }   e r r o r N a t u r e   i s   a n   e n u m e r a t i o n   c o n t a i n i n g   p o s s i b l e   e r r o r  
           *   t y p e s .   T h i s   i s   u s e d   s o   t h a t   s h o r t h a n d   r e f e r e n c e   t o   . r a i s e E r r o r   a n d  
           *   . r a i s e W a r n i n g   c a n   b e   e x p a n d e d   f o r   e a s i e r   u s e r   r e f e r e n c e .  
           * /  
         v a r   e r r o r N a t u r e s   =   {  
                 t y p e :   ' T y p e E x c e p t i o n ' ,  
                 r a n g e :   ' V a l u e R a n g e E x c e p t i o n ' ,  
                 i m p l :   ' N o t I m p l e m e n t e d E x c e p t i o n ' ,  
                 p a r a m :   ' P a r a m e t e r E x c e p t i o n ' ,  
                 r u n :   ' R u n t i m e E x c e p t i o n ' ,  
                 c o m p :   ' D e s i g n T i m e E r r o r ' ,  
                 ' u n d e f i n e d ' :   ' U n s p e c i f i e d E x c e p t i o n '  
         } ;  
  
  
         / * *  
           *   T h i s   f u n c t i o n   r a i s e s   t h e   e r r o r   e v e n t   a f t e r   a p p r o p r i a t e l y   f o r m a t t i n g   t h e  
           *   p a r a m e t e r s .  
           *   @ p a r a m   { F u s i o n C h a r t s }   s e n d e r  
           *   @ p a r a m   { s t r i n g }   i d   I s   t h e   e r r o r   r e f e r e n c e   i d .  
           *   @ p a r a m   { s t r i n g }   n a t u r e   I s   a   c u e   a s   t o   w h a t   c a t e g o r y   o f   e r r o r   i s   t h i s .  
           *                   T h e   v a l u e   o f   t h i s   p a r a m   m u s t   b e   s a m e   a s   o n e   o f   t h e   " k e y s "   w i t h i n  
           *                   t h e   " e r r o r N a t u r e s "   c o l l e c t i o n .  
           *   @ p a r a m   { s t r i n g }   s o u r c e   I s   a   c u e   a s   t o   w h i c h   o b j e c t / m o d u l e   c a u s e d   t h i s  
           *                   e r r o r .  
           *   @ p a r a m   { E r r o r }   e r r  
           *   @ p a r a m   { s t r i n g }   l e v e l   I n d i c a t e s   w h e t h e r   t h i s   e r r o r   e v e n t   i s   a n   e r r o r  
           *                   o r   w a r n i n g   e v e n t .   I t s   v a l u e s   c a n   b e   " E r r o r "   o r   " W a r n i n g " .  
           *  
           *   @ t y p e   v o i d  
           * /  
         v a r   r a i s e E W E v e n t   =   f u n c t i o n   ( s e n d e r ,   i d ,   n a t u r e ,   s o u r c e ,   e r r ,   l e v e l )   {  
  
                 / /   W e   c r e a t e   a   h u m a n - r e a d a b l e   m e s s a g e   f o r   t h i s   e r r o r .  
                 v a r   m e s s a g e   =   ' # '   +   i d   +   '   '   +   s e n d e r . i d   +   s o u r c e   +   '   '   +   l e v e l   +   '   > >   ' ;  
  
                 / /   I f   e r r   i s   s e n t   a s   e r r o r   o b j e c t ,   w e   i n p u t   m o r e   d e t a i l s   t o   t h e   e r r o r  
                 / /   o b j e c t  
                 i f   ( e r r   i n s t a n c e o f   E r r o r )   {  
                         e r r . n a m e   =   e r r o r N a t u r e s [ n a t u r e ] ;  
                         e r r . m o d u l e   =   ' F u s i o n C h a r t s '   +   s o u r c e ;  
                         e r r . l e v e l   =   l e v e l ;  
  
                         / /   U p d a t e   t h e   e r r o r   m e s s a g e .  
                         e r r . m e s s a g e   =   m e s s a g e   +   e r r . m e s s a g e ;  
                         m e s s a g e   =   e r r . m e s s a g e ;  
                          
                         / /   T h r o w   e r r o r   i n   a   s e p a r a t e   s c o p e   s o   t h a t   t h e   e x e c u t i o n   o f   t h i s   s c r i p t  
                         / /   i s   n o t   b l o c k e d .   D o   t h i s   o n l y   w h e n   d e b u g M o d e   i s   e n a b l e d  
                         w i n d o w . s e t T i m e o u t ( f u n c t i o n   ( )   {  
                                 t h r o w   e r r ;  
                         } ,   0 ) ;  
  
                 }  
                 e l s e   {  
                         / /   A p p e n d   t h e   m e s s a g e   s t r i n g   t o   t h e   e r r o r   m e s s a g e   a n d   s y n c   w i t h   e r r .  
                         m e s s a g e   =   m e s s a g e   +   e r r ;  
                 }  
  
                 / /   P r e p a r e   t h e   e v e n t   a r g u m e n t   o b j e c t .  
                 v a r   a r g s   =   {  
                         i d :   i d ,  
                         n a t u r e :   e r r o r N a t u r e s [ n a t u r e ] ,  
                         s o u r c e :   ' F u s i o n C h a r t s '   +   s o u r c e ,  
                         m e s s a g e :   m e s s a g e  
                 } ;  
                 / /   R a i s e   t h e   a p p r o p r i a t e   e v e n t .  
                 g l o b a l . r a i s e E v e n t ( l e v e l ,   a r g s ,   s e n d e r ) ;  
  
                 / /   R a i s e   l e g a c y   e v e n t s  
                 i f   ( t y p e o f   w i n d o w [ ' F C _ '   +   l e v e l ]   = = =   ' f u n c t i o n ' )   {  
                         w i n d o w [ ' F C _ '   +   l e v e l ] ( a r g s ) ;  
                 }  
  
         } ;  
  
         / * *  
           *   T h i s   f u n c t i o n   r a i s e s   a n   " E r r o r "   e v e n t   b a s e d   u p o n   t h e   p a r a m e t e r s   p a s s e d  
           *   t o   i t .  
           *   @ p a r a m   { F u s i o n C h a r t s }   s e n d e r  
           *   @ p a r a m   { s t r i n g }   i d   I s   t h e   e r r o r   r e f e r e n c e   i d .  
           *   @ p a r a m   { s t r i n g }   n a t u r e   I s   a   c u e   a s   t o   w h a t   c a t e g o r y   o f   e r r o r   i s   t h i s .  
           *                   T h e   v a l u e   o f   t h i s   p a r a m   m u s t   b e   s a m e   a s   o n e   o f   t h e   " k e y s "   w i t h i n  
           *                   t h e   " e r r o r N a t u r e s "   c o l l e c t i o n .  
           *   @ p a r a m   { s t r i n g }   s o u r c e   I s   a   c u e   a s   t o   w h i c h   o b j e c t / m o d u l e   c a u s e d   t h i s  
           *                   e r r o r .  
           *   @ p a r a m   { s t r i n g }   m e s s a g e  
           *  
           *   @ t y p e   v o i d  
           * /  
         g l o b a l . r a i s e E r r o r   =   f u n c t i o n   ( s e n d e r ,   i d ,   n a t u r e ,   s o u r c e ,   m e s s a g e )   {  
                 r a i s e E W E v e n t ( s e n d e r ,   i d ,   n a t u r e ,   s o u r c e ,   m e s s a g e ,   ' E r r o r ' ) ;  
         } ;  
  
         / * *  
           *   T h i s   f u n c t i o n   r a i s e s   a n   " W a r n i n g "   e v e n t   b a s e d   u p o n   t h e   p a r a m e t e r s   p a s s e d  
           *   t o   i t .  
           *   @ p a r a m   { F u s i o n C h a r t s }   s e n d e r  
           *   @ p a r a m   { s t r i n g }   i d   I s   t h e   e r r o r   r e f e r e n c e   i d .  
           *   @ p a r a m   { s t r i n g }   n a t u r e   I s   a   c u e   a s   t o   w h a t   c a t e g o r y   o f   e r r o r   i s   t h i s .  
           *                   T h e   v a l u e   o f   t h i s   p a r a m   m u s t   b e   s a m e   a s   o n e   o f   t h e   " k e y s "   w i t h i n  
           *                   t h e   " e r r o r N a t u r e s "   c o l l e c t i o n .  
           *   @ p a r a m   { s t r i n g }   s o u r c e   I s   a   c u e   a s   t o   w h i c h   o b j e c t / m o d u l e   c a u s e d   t h i s  
           *                   e r r o r .  
           *   @ p a r a m   { s t r i n g }   m e s s a g e  
           *  
           *   @ t y p e   v o i d  
           * /  
         g l o b a l . r a i s e W a r n i n g   =   f u n c t i o n   ( s e n d e r ,   i d ,   n a t u r e ,   s o u r c e ,   m e s s a g e )   {  
                 r a i s e E W E v e n t ( s e n d e r ,   i d ,   n a t u r e ,   s o u r c e ,   m e s s a g e ,   ' W a r n i n g ' ) ;  
         } ;  
  
         / * *  
           *   @ v a r   { o b j e c t }   l o g g e r   C o n a t i n s   a l l   r o u t i n e s   p e r t a i n i n g   t o   l o g g i n g   a   d e b u g  
           *   o u t o u t .  
           * /  
         v a r   l o g g e r   =   {  
                 / * *  
                   *   @ v a r   { o b j e c t }   o u t p u t H e l p e r s   I s   t h e   c o l l e c t i o n   o f   f u n c t i o n s   t h a t   c a l l s  
                   *   t h e   o u t p u t T o   f u n c t i o n   w i t h   a r g u m e n t s   f o r m a t t e d   i n   a   s p e c i f i c   m a n n e r .  
                   * /  
                 o u t p u t H e l p e r s :   {  
                         / /   S i m p l e   t e x t   o u t p u t   f u n c t i o n .  
                         ' t e x t ' :   f u n c t i o n   ( e ,   a )   {  
                                 v a r   s e n d e r   =   ( e . s e n d e r . i d   | |   e . s e n d e r ) . t o S t r i n g ( ) ;  
                                 l o g g e r . o u t p u t T o ( ' # '   +   e . e v e n t I d   +   '   [ '   +   s e n d e r   +   ' ]   f i r e d   " '   +  
                                         e . e v e n t T y p e   +   ' "   e v e n t .   '   +   ( e . e v e n t T y p e   = = =   ' e r r o r '   | |  
                                         e . e v e n t T y p e   = = =   ' w a r n i n g '   ?   a . m e s s a g e   :   ' ' ) ) ;  
                         } ,  
                         / /   F u n c t i o n   t h a t   c a l l s   t h e   d e b u g g e r   m e t h o d   i n   t y p i c a l   F u s i o n C h a r t s  
                         / /   e v e n t s   a r g u m e n t   f o r m a t .  
                         ' e v e n t ' :   f u n c t i o n   ( e ,   a )   {  
                                 t h i s . o u t p u t T o ( e ,   a ) ;  
                         } ,  
                         / /   T h i s   f u n c t i o n   f o r m a t s   o u t p u t s   w i t h   a l l   d e t a i l s ,   a n d   s t i l l ,  
                         / /   m a i n t a i n i n g   h u m a n   r e a d a b l e   f o r m a t .   I t   i s   b e s t   u s e d   i n   c o n j u n c t i o n  
                         / /   w i t h   a n   a d v a n c e d   J S   c o n s o l e .  
                         ' v e r b o s e ' :   f u n c t i o n   ( e ,   a )   {  
                                 l o g g e r . o u t p u t T o ( e . e v e n t I d ,   e . s e n d e r . i d ,   e . e v e n t T y p e ,   a ) ;  
                         }  
                 } ,  
  
                 / * *  
                   *   @ v a r   { o b j e c t }   o u t p u t H a n d l e r   I s   t h e   e v e n t H a n d l e r   t h a t   i n d i r e c t l y   c a l l s  
                   *   t h e   o u t p u t   f u n c t i o n   v i a   o u t p u t   h e l p e r s   w h e n e v e r   a n y   e v e n t   i s   r a i s e d .  
                   * /  
                 o u t p u t H a n d l e r :   f u n c t i o n   ( e ,   a )   {  
                         / /   V e r i f y   w h e t h e r   t h e   o u t p u t   f u n c t i o n   e x i s t s   o r   n o t .  
                         i f   ( t y p e o f   l o g g e r . o u t p u t T o   ! = =   ' f u n c t i o n ' )   {  
                                 g l o b a l . c o r e . d e b u g M o d e . o u t p u t F a i l e d   =   t r u e ;  
                                 r e t u r n ;  
                         }  
                         / /   C l e a r   f l a g   o f   d a t a   l o a d   f a i l   u p o n   r e a c h i n g   t h i s   l i n e .  
                         g l o b a l . c o r e . d e b u g M o d e . o u t p u t F a i l e d   =   f a l s e ;  
                         / /   C a l l   t h e   c u r r e n t   o u t p u t H e l p e r   i n   o r d e r   t o   i n v o k e   t h e  
                         / /   r e q u i r e d   f u n c t i o n .  
                         l o g g e r . c u r r e n t O u t p u t H e l p e r ( e ,   a ) ;  
                 } ,  
  
                 / * *  
                   *   @ v a r   { f u n c t i o n }   c u r r e n t O u t p u t H e l p e r   I s   t h e   f u n c t i o n   t h a t   f o r m a t s   t h e  
                   *   d e b u g   o u t p u t   i f   e v e n t   f o r m a t   t o   d i f f e r e n t   f o r m a t s   a s   a r g u m e n t s .  
                   *   @ v a r   { f u n c t i o n }   o u t p u t T o   I s   t h e   r e f e r e n c e   t o   t h e   f u n c t i o n   t h a t   i s  
                   *   c a l l e d   w h e n   a   d e b u g   e v e n t   i s   r a i s e d .  
                   *   @ v a r   { b o o l e a n }   k e e p s   a   t r a c k   w h e t h e r   t h e   l o g g e r   i s   e n a b l e d   o r   n o t .  
                   * /  
                 c u r r e n t O u t p u t H e l p e r :   u n d e f i n e d ,  
  
                 o u t p u t T o :   u n d e f i n e d ,  
  
                 e n a b l e d :   f a l s e  
         } ;  
  
         / /   S e t   t h e   i n i t i a l   d e f a u l t   o u t p u t   h e l p e r   t o   t h e   o n e   s p e c i f i e d   a s   d e f a u l t .  
         l o g g e r . c u r r e n t O u t p u t H e l p e r   =   l o g g e r . o u t p u t H e l p e r s [ D E F A U L T _ O U T P U T _ H E L P E R ] ;  
  
         / /   A d d   d e b u g M o d e   A P I   t o   F u s i o n C h a r t s   c o r e   o b j e c t ,   s o   t h a t   i t   c a n   b e   a c c e s s e d  
         / /   b y   u s e r s   g l o b a l l y .  
         g l o b a l . e x t e n d ( {  
                 d e b u g M o d e :   {  
                         / * *  
                           *   S p e c i f i e s   h o w   t o   f o r m a t   t h e   o u t p u t   t o   t h e   f u n c t i o n   t h a t   w i l l  
                           *   a c c e p t   o u t p u t   f r o m   t h e   d e b u g g e r .  
                           *   @ i d   F u s i o n C h a r t s . d e b u g M o d e . o u t p u t F o r m a t  
                           *  
                           *   @ p a r a m   { s t r i n g }   f o r m a t   C a n   b e   o n e   o f   t h e   a c c e p t e d   f o r m a t   n a m e s  
                           *   s u c h   a s   " t e x t " ,   " v e r b o s e " ,   " e v e n t " .  
                           *  
                           *   @ t y p e   b o o l e a n  
                           * /  
                         o u t p u t F o r m a t :   f u n c t i o n   ( f o r m a t )   {    
                                 / /   V a l i d a t e   t h e   p a r a m e t e r .  
                                 i f   ( f o r m a t   & &   t y p e o f   f o r m a t . t o L o w e r C a s e   = = =   ' f u n c t i o n '   & &  
                                         t y p e o f   l o g g e r . o u t p u t H e l p e r s [ f o r m a t   =   f o r m a t . t o L o w e r C a s e ( ) ]   = = =   ' f u n c t i o n ' )   {  
                                         / /   s e t   t h e   c u r r e n t   o u t p u t   h e l p e r   f u n c t i o n   t o   t h e   o n e   s p e c i f i e d  
                                         / /   i n   p a r a m e t e r  
                                         l o g g e r . c u r r e n t O u t p u t H e l p e r   =   l o g g e r . o u t p u t H e l p e r s [ f o r m a t ] ;  
                                         / /   R e t u r n   " t r u e "   t o   u s e r s ,   i n d i c a t i n g ,   o u t p u t   f o r m a t  
                                         / /   s u c c e s s f u l l y   u p d a t e d .  
                                         r e t u r n   t r u e ;  
                                 }  
                                 / /   I n   c a s e   v a l i d a t i o n   f a i l s ,   n o t i f y   u s e r   t h a t   i t   f a i l e d   b y  
                                 / /   r e t u r n i n g   f a l s e ;  
                                 r e t u r n   f a l s e ;  
                         } ,  
  
                         / * *  
                           *   A l l o w s   y o u   t o   s p e c i f y   t h e   f u n c t i o n   t o   w h i c h   t h e   d e b u g g e r   o u t p u t  
                           *   w i l l   b e   r e d i r e c t e d .  
                           *   @ i d   F u s i o n C h a r t s . d e b u g M o d e . o u t p u t T o  
                           *  
                           *   @ p a r a m   { f u n c t i o n }   f n   i s   t h e   f u n c t i o n   t o   w h i c h   t h e   d e b u g M o d e   o u t p u t  
                           *   w i l l   b e   p a s s e d   o n .  
                           *  
                           *   @ t y p e   v o i d  
                           * /  
                         o u t p u t T o :   f u n c t i o n   ( f n )   {  
                                 / /   C h e c k   w h e t h e r   t h e   l o g g e r   i s   a   f u n c t i o n   o r   n o t .   I f   i t   i s   a  
                                 / /   f u n c t i o n ,   w e   s e t   a   r e f e r e n c e   t o   i t   t o   b e   u s e d   l a t e r   a s   t h e  
                                 / /   l o g g e r   f u n c t i o n .  
                                 i f   ( t y p e o f   f n   = = =   ' f u n c t i o n ' )   {  
                                         l o g g e r . o u t p u t T o   =   f n ;  
                                 }  
                                  
                                 / /   I n   c a s e   u s e r   s e n d s   ' n u l l '   a s   t h e   v a l u e   o f   t h e   l o g g e r   f u n c t i o n ,  
                                 / /   w e   c a n   a s s u m e   t h a t   u s e r   w a n t s   n o t   t o   l o g   a n y   o u t p u t .  
                                 e l s e   i f   ( f n   = = =   n u l l )   {  
                                         g l o b a l . c o r e . d e b u g M o d e . e n a b l e d ( f a l s e ) ;  
                                         d e l e t e   l o g g e r . o u t p u t T o ;  
                                 }  
                         } ,  
  
                         / * *  
                           *   E n a b l e s ,   d i s a b l e s   a n d   c o n f i g u r e s   t h e   d e b u g M o d e .  
                           *   @ F u s i o n C H a r t s . e d b u g M o d e . e n a b l e d  
                           *  
                           *   @ p a r a m   { b o o l e a n }   s t a t e   s p e c i f i e s   w h e t h e r   t o   e n a b l e   l o g g i n g   o f  
                           *   d e b u g   i n f o r m a t i o n .  
                           *   @ p a r a m   { f u n c t i o n }   o u t p u t T o   i s   t h e   f u n c t i o n   t o   w h i c h   t h e   d e b u g M o d e  
                           *   o u t p u t   w i l l   b e   p a s s e d   o n .  
                           *   @ p a r a m   { s t r i n g }   f o r m a t   C a n   b e   o n e   o f   t h e   a c c e p t e d   f o r m a t   n a m e s  
                           *   s u c h   a s   " t e x t " ,   " v e r b o s e " ,   " e v e n t " .  
                           *  
                           *   @ r e t u r n   T h e   c u r r e n t   ' e n a b l e '   s t a t e   o f   t h e   d e b u g M o d e .  
                           *   @ t y p e   b o o l e a n  
                           * /  
                         e n a b l e d :   f u n c t i o n   ( s t a t e ,   o u t p u t T o ,   f o r m a t )   {  
  
                                 / /   I n   c a s e   u s e r   s e n d   i n   o n l y   o n e   p a r a m e t e r   a n d   t h a t   t o o   a  
                                 / /   f u n c t i o n ,   w e   c a n   a s s u m e   t h a t   h e   w a n t s   t o   u s e   i t   a s   a   l o g g e r  
                                 / /   f u n c t i o n   a n d   a l s o   e n a b l e   l o g g i n g .  
                                 i f   ( t y p e o f   s t a t e   = = =   ' f u n c t i o n ' )   {  
                                         i f   ( t y p e o f   o u t p u t T o   = = =   ' s t r i n g '   & &   a r g u m e n t s . l e n g t h   = = =   2 )   {  
                                                 f o r m a t   =   o u t p u t T o ;  
                                         }  
                                         o u t p u t T o   =   s t a t e ;  
                                         s t a t e   =   t r u e ;  
                                 }  
                                  
                                 / /   I n   c a s e   u s e r   s e n d s   i n   a   v a l i d   p a r a m e t e r   t o   c h a n g e   t h e   c u r r e n t  
                                 / /   s t a t e   o f   t h e   d e b u g g e r ,   w e   u p d a t e   t h e   d e b u g g e r   s t a t e .  
                                 i f   ( t y p e o f   s t a t e   = = =   ' b o o l e a n '   & &   s t a t e   ! = =   l o g g e r . e n a b l e d )   {  
                                         g l o b a l . c o r e [ ( l o g g e r . e n a b l e d   =   s t a t e )   ?   ' a d d E v e n t L i s t e n e r '  
                                                 :   ' r e m o v e E v e n t L i s t e n e r ' ] ( ' * ' ,   l o g g e r . o u t p u t H a n d l e r ) ;  
                                 }  
  
                                 / /   I f   u s e r   s e n d s   i n   a   p a r a m e t e r   f o r   t h e   l o g g e r   p a r a m e t e r ,   w e  
                                 / /   s e t   i t   t o   t h e   l o g g e r   f u n c t i o n   r e f e r e n c e .  
                                 i f   ( t y p e o f   o u t p u t T o   = = =   ' f u n c t i o n ' )   {  
                                         l o g g e r . o u t p u t T o   =   o u t p u t T o ;  
                                 }  
  
                                 / /   S e t   o u t p u t   f o r m a t   i f   n e e d e d .  
                                 g l o b a l . c o r e . d e b u g M o d e . o u t p u t F o r m a t ( f o r m a t ) ;  
  
                                 / /   F i n a l l y   s e n d   t h e   c u r r e n t   d e b u g g e r   s t a t e   t o   t h e   u s e r .  
                                 r e t u r n   l o g g e r . e n a b l e d ;  
                         } ,  
  
                         / * *  
                           *   T h i s   m e t h o d   f e t c h e s   F i r e b u g L i t e   c o m p o n e n t ' s   c o d e   a n d   a d d s   i t   t o  
                           *   c u r r e n t   p a g e .   S u b s e q u e n t l y ,   o n   l o a d   o f   t h e   s c r i p t   i t   e n a b l e s  
                           *   a d v a n c e d   c o n s o l e   l o g g i n g   t o   i t .  
                           *   @ i d   F u s i o n C h a r t s . d e b u g M o d e . _ e n a b l e F i r e b u g L i t e  
                           *  
                           *   @ p a r a m   { s t r i n g }   u r l   i s   t h e   p a t h   t o   t h e   l o c a t i o n   w h e r e   t h e   f i r e b u g  
                           *   j a v a s c r i p t   e x i s t s .  
                           *  
                           *   @ t y p e   v o i d  
                           *   @ p r i v a t e   t r u e  
                           * /  
                         _ e n a b l e F i r e b u g L i t e :   f u n c t i o n   ( u r l )   {  
                                 / /   C h e c k   w h e t h e r   f i r e b u g   a l r e a d y   e x i s t s .  
                                 i f   ( w i n d o w . c o n s o l e   & &   w i n d o w . c o n s o l e . f i r e b u g )   {  
                                         / /   I f   f i r e b u g   a l r e a d y   e x i s t s ,   w e   d o   n o t   n e e d   t o   i n c l u d e   a n y  
                                         / /   s c r i p t   f o r   f i r e b u - l i t e   a n d   w e   s i m p l y   e n a b l e   l o g g i n g   t o  
                                         / / c o n s o l e .  
                                         g l o b a l . c o r e . d e b u g M o d e . e n a b l e d ( c o n s o l e . l o g ,   ' v e r b o s e ' ) ;  
                                         r e t u r n ;  
                                 }  
  
                                 / /   C h e c k   f o r   " X S S   a t t a c k   c h a r a c t e r s "  
  
                                 / /   I n s t a l l   f i r e b u g - l i t e   w i t h i n   p a g e   b y   c r e a t i n g   n e w   ' s c r i p t '  
                                 / /   e l e m e n t   a n d   a p p e n d i n g   t o   p a g e   h e a d .  
  
                                 / /   C r e a t e   t h e   e l e m e n t   w i t h   i t s   a t t r i b u t e s .  
                                 v a r   s c r i p t   =   d o c u m e n t . c r e a t e E l e m e n t ( ' s c r i p t ' ) ;  
                                 s c r i p t . t y p e   =   ' t e x t / j a v a s c r i p t ' ;  
                                 s c r i p t . s r c   =   t y p e o f   u r l   = = =   ' s t r i n g '   ?   u r l   :  
                                         g l o b a l . c o r e . o p t i o n s . s c r i p t B a s e U r i   +   ' f i r e b u g - l i t e . j s ' ;  
  
                                 / /   S e t   d e f a u l t   c o n f i g u r a t i o n   o f   f i r e b u g - l i t e  
                                 s c r i p t [ ' \ v '   = = =   ' v '   ?   ' t e x t '   :   ' i n n e r H T M L ' ]   =  
                                         ' {   s t a r t O p e n e d :   t r u e   } ' ;  
  
  
                                 / /   A t t a c h   e v e n t s   t o   c h e c k   w h e n   t h e   s c r i p t   h a s   l o a d e d   o r   n o t .  
                                 / /   o n   l o a d   o f   t h e   s c r i p t ,   e n a b l e   l o g g i n g   t o   c o n s o l e .  
                                 s c r i p t . o n l o a d   =   f u n c t i o n   ( )   {  
                                         g l o b a l . c o r e . d e b u g M o d e . e n a b l e d ( c o n s o l e . l o g ,   ' v e r b o s e ' ) ;  
                                 } ;  
                                 s c r i p 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   ( t h i s . r e a d y S t a t e   = = =   ' c o m p l e t e '   | |   t h i s . r e a d y S t a t e   = = =  
                                                 ' l o a d e d ' )   {  
                                                 g l o b a l . c o r e . d e b u g M o d e . e n a b l e d ( c o n s o l e . l o g ,   ' v e r b o s e ' ) ;  
                                         }  
                                 } ;  
                                  
                                 / /   A p p e n d   t h e   s c r i p t   t o   t h e   h e a d   o f   t h i s   p a g e .  
                                 d o c u m e n t . g e t E l e m e n t s B y T a g N a m e ( ' h e a d ' ) [ 0 ] . a p p e n d C h i l d ( s c r i p t ) ;  
                         }  
                 }  
         } ,   f a l s e ) ;  
          
 } ( ) ) ;  
  
  
  
 / * j s l i n t   w h i t e :   t r u e ,   b r o w s e r :   t r u e ,   w i n d o w s :   t r u e ,   f o r i n :   t r u e ,     u n d e f :   t r u e ,  
     e q e q e q :   t r u e ,   p l u s p l u s :   t r u e ,   b i t w i s e :   t r u e ,   r e g e x p :   t r u e ,   i m m e d :   t r u e   * /  
  
 / * g l o b a l   A r r a y :   f a l s e ,   F u s i o n C h a r t s ,   R e g E x p :   f a l s e ,   w i n d o w :   f a l s e  
         F u s i o n C h a r t s D a t a F o r m a t s :   t r u e   * /  
  
 / * m e m b e r s   F u s i o n C h a r t s ,   X M L U R L ,   a d d E v e n t L i s t e n e r ,   a p p e n d C h i l d ,   a p p l y ,  
         a r g s ,   c a l l ,   c o n f i g ,   c o n f i g u r e ,   c o n t a i n e r E l e m e n t ,   c o n t a i n e r E l e m e n t I d ,  
         c o r e ,   c r e a t e E l e m e n t ,   c u r r e n t R e n d e r e r N a m e ,   d a t a F o r m a t ,   e x t e n d ,  
         f i r s t C h i l d ,   g e t A t t r i b u t e ,   g e t E l e m e n t B y I d ,   g e t E l e m e n t s B y T a g N a m e ,  
         g e t E x t e r n a l I n t e r f a c e M e t h o d s ,   g e t R e n d e r e r ,   g e t R e n d e r e r P o l i c y ,  
         h a s C h i l d N o d e s ,   i d ,   i n i t ,   i n i t i a l i z e d ,   i n s e r t M o d e ,   i t e m s ,   l e n g t h ,  
         o p t i o n s ,   p a r s e P o l i c i e s ,   p o l i c i e s ,   p r o t o t y p e ,   r a i s e E r r o r ,   r a i s e E v e n t ,  
         r e f ,   r e g i s t e r ,   r e m o v e C h i l d ,   r e n d e r ,   r e n d e r e r ,   r e s i z e ,   s e n d e r ,  
         s e t A t t r i b u t e ,   s e t C u r r e n t R e n d e r e r ,   s e t D e f a u l t ,   s l i c e ,   s p l i t ,   s u c c e s s ,  
         t o L o w e r C a s e ,   t o S t r i n g ,   u n d e f i n e d ,   u p d a t e ,   _ _ s t a t e ,   r e n d e r i n g  
 * /  
  
 / * *  
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
   *   R e n d e r e r   A b s t r a c t i o n   F r a m e w o r k  
   *   T h i s   m o d u l e   a l l o w s   d e v e l o p e r s   t o   a b s t r a c t   t h e   e n t i r e   r e n d e r i n g   e n g i n e .   T h i s  
   *   h e l p s   i n   m u l t i p l e   i m p l e m e n t a t i o n s   o f   F u s i o n C h a r t s   i n   v a r i o u s   t e c h n o l o g i e s  
   *   s u c h   a s   f l a s h ,   H T M L 5 ,   e t c .  
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
   * /  
 ( f u n c t i o n   ( )   {  
  
         / /   R e g i s t e r   t h e   m o d u l e   w i t h   F u s i o n C h a r t s .  
         v a r   g l o b a l   =   F u s i o n C h a r t s ( [ ' p r i v a t e ' ,   ' R e n d e r e r M a n a g e r ' ] ) ;  
         / /   C h e c k   w h e t h e r   t h e   m o d u l e   h a s   b e e n   a l r e a d y   r e g i s t e r e d .   I f   t r u e ,   t h e n  
         / /   d o   n o t   b o t h e r   t o   r e - r e g i s t e r .  
         i f   ( g l o b a l   = = =   u n d e f i n e d )   {  
                 r e t u r n ;  
         }  
  
         / /   A l l o w   F u s i o n C h a r t s   t o   a c c e p t   p a r a m e t e r   t o   s p e c i f y   w h e r e   t o   r e n d e r   t h e  
         / /   c h a r t .  
         g l o b a l . p o l i c i e s . o p t i o n s . c o n t a i n e r E l e m e n t I d   =   [ ' r e n d e r A t ' ,   u n d e f i n e d ] ;  
         g l o b a l . p o l i c i e s . o p t i o n s . r e n d e r e r   =   [ ' r e n d e r e r ' ,   u n d e f i n e d ] ;  
  
         / /   C o l l e c t i o n   o f   r e n d e r e r s .  
         v a r   n o t D e f i n e d   =   f u n c t i o n   ( )   {  
                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 2 5 0 8 1 8 4 5 ' ,   ' r u n ' ,   ' : : R e n d e r e r M a n a g e r ' ,  
                         n e w   E r r o r ( ' N o   a c t i v e   r e n d e r e r ' ) ) ;  
                 r e t u r n ;  
         } ;  
         v a r   r e n d e r e r s   =   {  
                 ' u n d e f i n e d ' :   {  
                         r e n d e r :   n o t D e f i n e d ,    
                         u p d a t e :   n o t D e f i n e d ,  
                         r e s i z e :   n o t D e f i n e d ,  
                         c o n f i g :   n o t D e f i n e d ,  
                         p o l i c i e s :   { }  
                 }  
         } ,   s t o r e   =   { } ;   / /   s t o r e   w h i c h   c h a r t   h a s   w h a t   r e n d e r e r  
  
         / /   A P I   t o   a d d   r e n d e r e r   a n d   a l s o   t o   s e t / g e t   t h e   c u r r e n t   r e n d e r e r .  
         g l o b a l . r e n d e r e r   =   {  
                 r e g i s t e r :   f u n c t i o n   ( n a m e ,   o b j )   {  
                         / /   V a l i d a t e   p a r a m e t e r s  
                         i f   ( ! n a m e   | |   t y p e o f   n a m e . t o S t r i n g   ! = =   ' f u n c t i o n ' )   {  
                                 t h r o w   " # 0 3 0 9 1 4 3 6   ~ r e n d e r e r . r e g i s t e r ( )   I n v a l i d   v a l u e   f o r   r e n d e r e r   n a m e . " ;  
                         }  
  
                         / /   D e s e n s i t i z e   c h a r a c t e r   c a s e   f o r   r e n d e r e r   n a m e  
                         n a m e   =   n a m e . t o S t r i n g ( ) . t o L o w e r C a s e ( ) ;  
  
                         / /   P r e v e n t   a d d i t i o n   o f   d u p l i c a t e   r e n d e r e r  
                         i f   ( r e n d e r e r s [ n a m e ]   ! = =   u n d e f i n e d )   {  
                                 g l o b a l . r a i s e E r r o r ( g l o b a l . c o r e ,   ' 0 3 0 9 1 4 3 8 ' ,   ' p a r a m ' ,   ' : : R e n d e r e r M a n a g e r > r e g i s t e r ' ,  
                                         ' D u p l i c a t e   r e n d e r e r   n a m e   s p e c i f i e d   i n   " n a m e " ' ) ;  
                                 r e t u r n   f a l s e ;  
                         }  
  
                         / /   A d d   r e n d e r e r   t o   t h e   c o l l e c t i o n   o f   r e n d e r e r s .  
                         r e n d e r e r s [ n a m e ]   =   o b j ;  
                         / /   R e t u r n   t r u e   w h e n   a   n e w   r e n d e r e r   i s   s u c c e s s f u l l y   a d d e d .  
                         r e t u r n   t r u e ;  
                 } ,  
  
                 / /   S e t   t h e   c u r r e n t   r e n d e r e r  
                 s e t D e f a u l t :   f u n c t i o n   ( n a m e )   {  
                         / /   V a l i d a t e   p a r a m e t e r s  
                         i f   ( ! n a m e   | |   t y p e o f   n a m e . t o S t r i n g   ! = =   ' f u n c t i o n ' )   {  
                                 g l o b a l . r a i s e E r r o r ( g l o b a l . c o r e ,   ' 2 5 0 8 1 7 3 1 ' ,   ' p a r a m ' ,   ' : : R e n d e r e r M a n a g e r > s e t D e f a u l t ' ,  
                                         ' I n v a l i d   r e n d e r e r   n a m e   s p e c i f i e d   i n   " n a m e " ' ) ;  
                                 r e t u r n   f a l s e ;  
                         }  
                          
                         / /   V a l i d a t e   t h e   r e n d e r e r   n a m e   a n d   s e e   w h e t h e r   t h e   p a r a m e t e r   r e f e r s   t o   a  
                         / /   v a l i d   r e n d e r e r .  
                         / /   A L S O :   D e s e n s i t i z e   c h a r a c t e r   c a s e   f o r   r e n d e r e r   n a m e .  
                         i f   ( r e n d e r e r s [ n a m e   =   n a m e . t o S t r i n g ( ) . t o L o w e r C a s e ( ) ]   = = =   u n d e f i n e d )   {  
                                 g l o b a l . r a i s e E r r o r ( g l o b a l . c o r e ,   ' 2 5 0 8 1 7 3 3 ' ,   ' r a n g e ' ,   ' : : R e n d e r e r M a n a g e r > s e t D e f a u l t ' ,  
                                         ' T h e   s p e c i f i e d   r e n d e r e r   d o e s   n o t   e x i s t . ' ) ;  
                                 r e t u r n   f a l s e ;  
                         }  
  
                         / /   S e t   r e f e r e n c e   t o   t h e   c u r r e n t   r e n d e r e r .  
                         g l o b a l . p o l i c i e s . o p t i o n s . r e n d e r e r   =   [ ' r e n d e r e r ' ,   n a m e ] ;  
                         r e t u r n   t r u e ;  
                 } ,  
  
                 g e t R e n d e r e r :   f u n c t i o n   ( n a m e )   {  
                         r e t u r n   r e n d e r e r s [ n a m e ] ;  
                 } ,  
  
                 g e t R e n d e r e r P o l i c y :   f u n c t i o n   ( n a m e )   {  
                         v a r   p o l i c i e s   =   r e n d e r e r s [ n a m e ] . p o l i c i e s ;  
                         r e t u r n   t y p e o f   p o l i c i e s   = = =   ' o b j e c t '   ?   p o l i c i e s   :   { } ;  
                 } ,  
  
                 c u r r e n t R e n d e r e r N a m e :   f u n c t i o n   ( )   {  
                         r e t u r n   g l o b a l . p o l i c i e s . o p t i o n s . r e n d e r e r [ 1 ] ;  
                 } ,  
  
                 u p d a t e :   f u n c t i o n   ( o b j )   {  
                         s t o r e [ o b j . i d ] . u p d a t e . a p p l y ( o b j ,  
                                 A r r a y . p r o t o t y p e . s l i c e . c a l l ( a r g u m e n t s ,   1 ) ) ;  
                 } ,  
  
                 r e n d e r :   f u n c t i o n   ( o b j )   {  
                         s t o r e [ o b j . i d ] . r e n d e r . a p p l y ( o b j ,  
                                 A r r a y . p r o t o t y p e . s l i c e . c a l l ( a r g u m e n t s ,   1 ) ) ;  
                 } ,  
  
                 r e s i z e :   f u n c t i o n   ( o b j )   {  
                         s t o r e [ o b j . i d ] . r e s i z e . a p p l y ( o b j ,  
                                 A r r a y . p r o t o t y p e . s l i c e . c a l l ( a r g u m e n t s ,   1 ) ) ;  
                 } ,  
  
                 c o n f i g :   f u n c t i o n   ( o b j )   {  
                         s t o r e [ o b j . i d ] . c o n f i g . a p p l y ( o b j ,  
                                 A r r a y . p r o t o t y p e . s l i c e . c a l l ( a r g u m e n t s ,   1 ) ) ;  
                 }  
         } ;  
  
  
         / /   T h i s   f u n c t i o n   a l l o w s   u s e r s   t o   m a k e   a   g e n e r i c   c a l l   t o   e x t e r n a l   i n t e r f a c e  
         / /   o f   t h e   c h a r t   v i a   t h e   F u s i o n C h a r t s   o b j e c t  
         v a r   e i C a l l   =   f u n c t i o n   ( m e t h o d )   {  
                 r e t u r n   f u n c t i o n   ( )   {  
                         / /   V e r i f y   w h e t h e r   t h e   c h a r t   i s   v a l i d   o b j e c t   a n d   t h e n   p r o c e e d .  
                         i f   ( t h i s . r e f   = = =   u n d e f i n e d     | |   t h i s . r e f   = = =   n u l l     | |  
                                 t y p e o f   t h i s . r e f [ m e t h o d ]   ! = =   ' f u n c t i o n ' )   {  
                                 / /   R a i s e   e r r o r   e v e n t   t o   n o t i f y   t h a t   a   m e t h o d   o n   t h e   r e n d e r e r   w a s  
                                 / /   i n v o k e d   w h i l e   t h e   r e n d e r e r   d o e s   n o t   h a v e   s u c h   a   m e t h o d .  
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 2 5 0 8 1 6 1 7 ' ,   ' r u n ' ,   ' ~ '   +   m e t h o d   +   ' ( ) ' ,  
                                         ' E x t e r n a l I n t e r f a c e   c a l l   f a i l e d .   C h e c k   w h e t h e r   c h a r t   h a s   b e e n   r e n d e r e d . ' ) ;  
                                 r e t u r n   u n d e f i n e d ;  
                         }  
                          
                         r e t u r n   t h i s . r e f [ m e t h o d ] . a p p l y ( t h i s . r e f ,   a r g u m e n t s ) ;  
                 } ;  
         } ;  
  
         / /   C o n s t r u c t o r   t o   a d d   r e n d e r e r   f u n c t i o n s  
         g l o b a l . a d d E v e n t L i s t e n e r ( ' B e f o r e I n i t i a l i z e ' ,   f u n c t i o n   ( e v e n t )   {  
                 / /   R e f e r e n c e   t o   e v e n t   s e n d e r .  
                 v a r   o b j   =   e v e n t . s e n d e r ;  
                  
                 / /   C h e c k   i f   c o n s t r u c t i o n   h a s   t h e   d e f a u l t   r e n d e r e r   n a m e   s a v e d .  
                 i f   ( t y p e o f   o b j . o p t i o n s . r e n d e r e r   = = =   ' s t r i n g '   & &  
                         r e n d e r e r s [ o b j . o p t i o n s . r e n d e r e r . t o L o w e r C a s e ( ) ]   = = =   u n d e f i n e d )   {  
                         o b j . o p t i o n s . r e n d e r e r   =   g l o b a l . p o l i c i e s . o p t i o n s . r e n d e r e r [ 1 ] ;  
                 }  
                 / /   D e s e n s i t i z e   t h e   c a s e   o f   t h e   p a r a m e t e r .  
                 o b j . o p t i o n s . r e n d e r e r   =   o b j . o p t i o n s . r e n d e r e r . t o L o w e r C a s e ( ) ;  
  
                 / /   K e e p   a   r e f e r e n c e  
                 s t o r e [ o b j . i d ]   =   r e n d e r e r s [ o b j . o p t i o n s . r e n d e r e r ] ;  
  
                 / /   C h e c k   w h e t h e r   t h i s   p a r t i c u l a r   r e n d e r e r   h a s   b e e n   r e n d e r e d .  
                 i f   ( s t o r e [ o b j . i d ] . i n i t i a l i z e d   ! = =   t r u e   & &  
                         t y p e o f   s t o r e [ o b j . i d ] . i n i t   = = =   ' f u n c t i o n ' )   {  
                         / /   C a l l   t h e   ' i n i t '   f u n c t i o n   o n   t h e   r e n d e r e r   a n d   s e t   a   f l a g .  
                         s t o r e [ o b j . i d ] . i n i t ( ) ;  
                         s t o r e [ o b j . i d ] . i n i t i a l i z e d   =   t r u e ;  
                 }  
  
                 / /   P a r s e   c o n s t r u c t i o n   p o l i c i e s   s p e c i f i c   t o   t h i s   r e n d e r e r .  
                 g l o b a l . p a r s e P o l i c i e s ( o b j ,   s t o r e [ o b j . i d ] . p o l i c i e s   | |   { } ,   o b j . a r g s ) ;  
  
                 / /   C o p y   t h e   p r o t o t y p e   o f   t h e   r e n d e r e r   s p e c i f i e d   i n   c o n s t r u c t o r   t o   t h e  
                 / /   m a i n   o b j e c t .  
                 f o r   ( v a r   p r o p   i n   s t o r e [ o b j . i d ] . p r o t o t y p e )   {  
                         o b j [ p r o p ]   =   s t o r e [ o b j . i d ] . p r o t o t y p e [ p r o p ] ;  
                 }  
  
         } ) ;  
  
         g l o b a l . a d d E v e n t L i s t e n e r ( ' L o a d e d ' ,   f u n c t i o n   ( e )   {  
  
                 / /   S t o r e   a   r e f e r e n c e   t o   t h e   c h a r t   s w f   H T M L   N o d e .  
                 v a r   o b j   =   e . s e n d e r ,   c h a r t O b j   =   e . s e n d e r . r e f ;  
  
                 / /   C l e a r   t h e   f l a g   t h a t   k e e p s   a   t r a c k   w h e t h e r   t h e   c h a r t   i s   p r e s e n t l y  
                 / /   i n   a   ' r e n d e r i n g '   s t a t e  
                 i f   ( o b j   i n s t a n c e o f   g l o b a l . c o r e )   {  
                         d e l e t e   o b j . _ _ s t a t e . r e n d e r i n g ;  
                 }  
  
                 / /   V a l i d a t e   w h e t h e r   t h e   c h a r t   s w f   n o d e   e x i s t s   a n d   t h a t   i t   h a s  
                 / /   t h e   p r e r e q u i s i t e   e x t e r n a l I n t e r f a c e   f u n c t i o n s .  
                 i f   ( c h a r t O b j   = = =   u n d e f i n e d   | |   c h a r t O b j   = = =   n u l l   | |   t y p e o f  
                         c h a r t O b j . g e t E x t e r n a l I n t e r f a c e M e t h o d s   ! = =   ' f u n c t i o n ' )   {  
                         r e t u r n ;  
                 }  
  
                 / /   T h e   e x t e r n a l I n t e r f a c e M e t h o d s   n a m e s   a r e   p a r s e d   f r o m   C S V   t o  
                 / /   A r r a y .  
                 v a r   e i I t e m s   =   c h a r t O b j . g e t E x t e r n a l I n t e r f a c e M e t h o d s ( ) . s p l i t ( ' , ' ) ,  
                         i ;  
  
                 / /   W e   i t e r a t e   t h r o u g h   a l l   t h e   e x t e r n a l I n t e r f a c e   m e t h o d   n a m e s   a n d  
                 / /   c r e a t e   a n   e x t e n s i b l e   A P I   o b j e c t   t h a t   i s   a d d e d   t o   m a i n  
                 / /   F u s i o n C h a r t s   o b j e c t   a s   r e f e r e n c e .  
                 f o r   ( i   =   0 ;   i   <   e i I t e m s . l e n g t h ;   i   + =   1 )   {  
                         / /   C o p y   m e t h o d   f r o m   r e n d e r e r   o n l y   w h e n   a   l o c a l   m e t h o d   d o e s   n o t   e x i s t  
                         i f   ( o b j [ e i I t e m s [ i ] ]   = = =   u n d e f i n e d )   {  
                                 o b j [ e i I t e m s [ i ] ]   =   e i C a l l ( e i I t e m s [ i ] ) ;  
                         }  
                 }  
         } ) ;  
  
  
 / /   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =  
  
         / /   F u n c t i o n   t h a t   c h e c k s   d u p l i c a t e .  
         v a r   i s D u p l i c a t e I d   =   f u n c t i o n   ( l o o k u p I d ,   c o n t a i n e r )   {  
                 / /   G e t   t h e   l o o k u p   e l e m e n t   f r o m   t h e   I D   s e n t   v i a   p a r a m e t e r .  
                 v a r   l o o k u p E l e m e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( l o o k u p I d ) ,  
                         / /   G e t   t h e   I D   o f   t h e   c o n t a i n e r   e l e m e n t .  
                         c o n t a i n e r I d   =   c o n t a i n e r . g e t A t t r i b u t e ( ' i d ' ) ;  
  
                 / /   C h e c k   w h e t h e r   t h e   e l e m e n t   e x i s t s   o r   n o t .   I f   i t   d o e s   n o t   e x i s t ,   i t  
                 / /   i m p l i e s   t h a t   t h e r e   c a n n o t   b e   a n y   d u p l i c a t e .  
                 i f   ( l o o k u p E l e m e n t   = = =   n u l l )   {  
                         r e t u r n   f a l s e ;  
                 }  
  
                 / /   I n   c a s e   c h a r t ' s   I d   a n d   c o n t a i n e r ' s   I d   i s   s a m e   t h e n   i s   d u p l i c a t e .  
                 i f   ( l o o k u p I d   = = =   c o n t a i n e r I d )   {  
                         r e t u r n   t r u e ;  
                 }  
  
                 / /   C h e c k   w h e t h e r   t h e   l o o k u p   e l e m e n t   r e t u r n e d   b e f o r e   i s   a c t u a l l y  
                 / /   i n s i d e   c o n t a i n e r   o r   n o t .  
                 v a r   c h i l d r e n   =   c o n t a i n e r . g e t E l e m e n t s B y T a g N a m e ( ' * ' ) ;  
                 f o r   ( v a r   i   =   0 ;   i   <   c h i l d r e n . l e n g t h ;   i   + =   1 )   {  
                         i f   ( c h i l d r e n [ i ]   = = =   l o o k u p E l e m e n t )   {  
                                 r e t u r n   f a l s e ;  
                         }  
                 }  
                 / /   I f   t h e   l o o k u p E l e m e n t   i s   o u t s i d e / b e f o r e   t h e   c o n t a i n e r ,   i t   i m p l i e s  
                 / /   t h a t   i t   i s   a   d u p l i c a t e .  
                 r e t u r n   t r u e ;  
         } ;  
  
         / /   D e f i n e   a   f u n c t i o n   t h a t   s a v e s   t h e   r e f e r e n c e   t o   t h e   e m b e d d e d   o b j e c t  
         / /   a f t e r   i t   h a s   b e e n   r e n d e r e d .  
         v a r   u p d a t e P o s t R e n d e r   =   f u n c t i o n   ( s t a t u s )   {  
                 / /   C h e c k   w h e t h e r   t h e   r e n d e r   w a s   s u c c e s s f u l .  
                 i f   ( s t a t u s . s u c c e s s   = = =   f a l s e )   {  
                         g l o b a l . r a i s e E r r o r ( g l o b a l . c o r e . i t e m s [ s t a t u s . i d ] ,   ' 2 5 0 8 1 8 5 0 ' ,   ' r u n ' ,   ' : : R e n d e r e r M a n a g e r ' ,  
                                 n e w   E r r o r ( ' T h e r e   w a s   a n   e r r o r   r e n d e r i n g   t h e   c h a r t .   '   +  
                                         ' E n a b l e   F u s i o n C h a r t s   J S   d e b u g M o d e   f o r   m o r e   i n f o r m a t i o n . ' ) ) ;  
                 }  
                  
                 / /   L o o k u p   t h e   F u s i o n C h a r t s   o b j e c t   w i t h i n   i t s   " i t e m s "   r e p o s i t o r y .  
                 g l o b a l . c o r e . i t e m s [ s t a t u s . i d ] . r e f   =   s t a t u s . r e f ;  
                  
                 / /   I f   t h e   r e f   h a s   b e e n   c r e a t e d ,   c r e a t e   a   r e v e r s e   r e f e r e n c e .  
                 i f   ( s t a t u s . r e f )   {  
                         s t a t u s . r e f . F u s i o n C h a r t s   =   g l o b a l . c o r e . i t e m s [ s t a t u s . i d ] ;  
                 }  
  
                 / /   R a i s e   e v e n t   t h a t   t h i s   c h a r t   h a s   a   D O M   e l e m e n t  
                 g l o b a l . r a i s e E v e n t ( ' i n t e r n a l . D O M E l e m e n t C r e a t e d ' ,   s t a t u s ,  
                         g l o b a l . c o r e . i t e m s [ s t a t u s . i d ] ) ;  
  
         } ;  
  
         g l o b a l . e x t e n d ( {  
                 r e n d e r :   f u n c t i o n   ( c o n t a i n e r E l e m e n t )   {  
  
                         / /   C h e c k   I E - S a f e   v a r i a b l e   n a m e   c o l l i s i o n   w i t h i n   G l o b a l   S c o p e  
                         i f   ( w i n d o w [ t h i s . i d ]   ! = =   u n d e f i n e d )   {  
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 2 5 0 8 1 8 4 3 ' ,   ' c o m p ' ,   ' . r e n d e r ' ,  
                                         n e w   E r r o r ( ' # 2 5 0 8 1 8 4 3 : I E C o m p a t i b i l i t y ( )   C h a r t   '   +  
                                         ' I d   i s   s a m e   a s   a   J a v a S c r i p t   v a r i a b l e   n a m e .   V a r i a b l e   n a m i n g   '   +  
                                         ' e r r o r .   P l e a s e   u s e   u n i q u e   n a m e   f o r   c h a r t   J S   v a r i a b l e ,   '   +  
                                         ' c h a r t - i d   a n d   c o n t a i n e r   i d . ' ) ) ;  
                         }  
  
                         / /   C r e a t e   a   b l a n k   e l e m e n t   i n s i d e   t o   m i m i c   a l t e r n a t i v e c o n t e n t  
                         v a r   a l t   =   d o c u m e n t . c r e a t e E l e m e n t ( ' s p a n ' ) ;  
  
                         / /   P r o c u r e   c o n t a i n e r E l e m e n t   f r o m   i n t e r n a l   o b j e c t   o p t i o n s   t h a t   h a s  
                         / /   b e e n   p a s s e d   v i a   p a r a m e t e r s .  
                         i f   ( c o n t a i n e r E l e m e n t   = = =   u n d e f i n e d )   {  
                                 c o n t a i n e r E l e m e n t   =   t h i s . o p t i o n s . c o n t a i n e r E l e m e n t I d ;  
                         }  
  
                         / /   I n   c a s e   u s e r   s e n d s   t h e   e l e m e n t   i d ,   w e   g e t   t h e   o b j e c t   f r o m   i t  
                         i f   ( t y p e o f   c o n t a i n e r E l e m e n t   = = =   ' s t r i n g ' )   {  
                                 c o n t a i n e r E l e m e n t   =   d o c u m e n t . g e t E l e m e n t B y I d ( c o n t a i n e r E l e m e n t ) ;  
                         }  
                         i f   ( c o n t a i n e r E l e m e n t   = = =   u n d e f i n e d   | |   c o n t a i n e r E l e m e n t   = = =   n u l l )   {  
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 0 3 0 9 1 4 5 6 ' ,   ' r u n ' ,   ' . r e n d e r ( ) ' ,  
                                         n e w   E r r o r ( " U n a b l e   t o   f i n d   t h e   c o n t a i n e r   D O M   e l e m e n t . " ) ) ;  
                                 r e t u r n   t h i s ;  
                         }  
  
                         / /   C h e c k   d u p l i c a t e   r e n d e r i n g   w i t h   s a m e   i d  
                         i f   ( i s D u p l i c a t e I d ( t h i s . i d ,   c o n t a i n e r E l e m e n t ) )   {  
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 0 5 1 0 2 1 0 9 ' ,   ' r u n ' ,   ' . r e n d e r ( ) ' ,  
                                         n e w   E r r o r ( " A   d u p l i c a t e   o b j e c t   a l r e a d y   e x i s t s   w i t h   t h e   s p e c i f i c   I d :   "   +   t h i s . i d ) ) ;  
                                 r e t u r n   t h i s ;  
                         }  
  
                         / /   S e t   t h e   a t t r i b u t e   o f   t h i s   e l e m e n t   t h a t   w i l l   b e   r e p l a c e d   b y  
                         / /   s w f o b j e c t  
                         a l t . s e t A t t r i b u t e ( ' i d ' ,   t h i s . i d ) ;  
  
                         / /   C l e a r   t h e   c o n t e n t s   o f   t h e   c o n t a i n e r E l e m e n t   a n d   s u b s e q u e n t l y  
                         / /   a p p e n d   t h e   n e w   a l t   c o n t e n t .  
                         i f   ( t h i s . o p t i o n s . i n s e r t M o d e   = = =   ' r e p l a c e ' )   {  
                                 w h i l e   ( c o n t a i n e r E l e m e n t . h a s C h i l d N o d e s ( ) )   {  
                                         c o n t a i n e r E l e m e n t . r e m o v e C h i l d ( c o n t a i n e r E l e m e n t . f i r s t C h i l d ) ;  
                                 }  
                         }  
                         c o n t a i n e r E l e m e n t . a p p e n d C h i l d ( a l t ) ;  
  
                         / /   U p d a t e   t h e   p r e s e n t   c o n t a i n e r   d e t a i l s   i n   o b j e c t .  
                         t h i s . o p t i o n s . c o n t a i n e r E l e m e n t   =   c o n t a i n e r E l e m e n t ;  
                         t h i s . o p t i o n s . c o n t a i n e r E l e m e n t I d   =   c o n t a i n e r E l e m e n t . i d ;  
  
                         / /   S e t   s t a t e   t h a t   t h e   c h a r t   i s   r e n d e r i n g  
                         t h i s . _ _ s t a t e . r e n d e r i n g   =   t r u e ;  
  
                         / /   C a l l   t h e   c u r r e n t   r e n d e r e r .  
                         g l o b a l . r e n d e r e r . r e n d e r ( t h i s ,   c o n t a i n e r E l e m e n t ,   u p d a t e P o s t R e n d e r ) ;  
  
                         / /   R e t u r n   t h e   f u s i o n c h a r t s   o b j e c t   f o r   c h a i n a b i l i t y  
                         r e t u r n   t h i s ;  
                 } ,  
                  
                 c o n f i g u r e :   f u n c t i o n   ( k e y ,   v a l u e )   {  
                         g l o b a l . r e n d e r e r . c o n f i g ( t h i s ,   ( t y p e o f   k e y   = = =   ' o b j e c t ' )   ?   k e y   :   ( f u n c t i o n   ( )   {  
                                 v a r   i t e m s   =   { } ;  
                                 i t e m s [ k e y ]   =   v a l u e ;  
                                 r e t u r n   i t e m s ;  
                         } ( ) ) ) ;  
                 }  
         } ,   t r u e ) ;  
  
         g l o b a l . e x t e n d ( {  
                 s e t C u r r e n t R e n d e r e r :   g l o b a l . r e n d e r e r . s e t D e f a u l t ,  
  
                 / * *  
                   *   R e n d e r   F u s i o n C h a r t s   d i r e c t l y   u s i n g   t h e   s i m p l e s t   o n e - l i n e   a r g u m e n t  
                   *   p a r a m e t e r .  
                   *   T h i s   f u n c t i o n   d i r e c t l y   r e n d e r s   F u s i o n C h a r t s   i n t o   t h e   c o n t a i n e r  
                   *   s p e c i f i e d   i n   a r g u m e n t s .  
                   * /  
                 r e n d e r :   f u n c t i o n   ( )   {  
  
                         / /   T h e   o r d e r   i n   w h i c h   t o   p a r s e   t h e   l i n e a r   p a r a m e t e r s .  
                         v a r   a r g s T   =   [ ' s w f U r l ' ,   ' i d ' ,   ' w i d t h ' ,   ' h e i g h t ' ,   ' r e n d e r A t ' ,  
                                 ' d a t a S o u r c e ' ,   ' d a t a F o r m a t ' ] ,   p a r a m s   =   { } ,   i ;  
  
                         / /   I f   a   F u s i o n C h a r t s   o b j e c t   i s   s e n t   t o   i t ,   i t   c a l l s   r e n d e r   m e t h o d   o f  
                         / /   i t .  
                         i f   ( a r g u m e n t s [ 0 ]   i n s t a n c e o f   g l o b a l . c o r e )   {  
                                 a r g u m e n t s [ 0 ] . r e n d e r ( ) ;  
                                 r e t u r n   a r g u m e n t s [ 0 ] ;  
                         }  
  
                         / /   I t e r a t e   t h r o u g h   t h e   l i n e a r   p a r a m e t e r s   u s i n g   t h e   a r g u m e n t   t e m p l a t e  
                         / /   a r r a y   d e f i n e d   a b o v e   a n d   c r e a t e   a   p a r a m e t e r   o b j e c t   o u t   o f   i t .  
                         f o r   ( i   =   0 ;   ( i   <   a r g u m e n t s . l e n g t h   & &   i   <   a r g s T . l e n g t h ) ;   i   + =   1 )   {  
                                 p a r a m s [ a r g s T [ i ] ]   =   a r g u m e n t s [ i ] ;  
                         }  
  
                         / /   I n c o r p o r a t e   t h e   t r a i l i n g   o b j e c t   p a r a m e t e r   a s   o b j e c t - s t y l e  
                         / /   p a r a m e t e r   i n p u t   o v e r r i d e s .  
                         i f   ( t y p e o f   a r g u m e n t s [ a r g u m e n t s . l e n g t h   -   1 ]   = = =   ' o b j e c t ' )   {  
                                 d e l e t e   p a r a m s [ a r g s T [ i   -   1 ] ] ;  
                                 g l o b a l . e x t e n d ( p a r a m s ,   a r g u m e n t s [ a r g u m e n t s . l e n g t h   -   1 ] ) ;  
                         }  
  
                         / /   P r e - s p e c i f y   t h e   ' x m l u r l '   f o r m a t  
                         i f   ( p a r a m s . d a t a F o r m a t   = = =   u n d e f i n e d )   {  
                                 p a r a m s . d a t a F o r m a t   =   F u s i o n C h a r t s D a t a F o r m a t s . X M L U R L ;  
                         }  
  
                         / /   R e n d e r   a   n e w   F u s i o n C h a r t s   o u t   o f   t h e   p a r a m e t e r s   a n d   r e t u r n   t h e  
                         / /   o b j e c t .  
                         r e t u r n   n e w   g l o b a l . c o r e ( p a r a m s ) . r e n d e r ( ) ;  
                          
                 }  
         } ,   f a l s e ) ;  
 } ( ) ) ;  
  
  
  
 / * j s l i n t   w h i t e :   t r u e ,   b r o w s e r :   t r u e ,   w i n d o w s :   t r u e ,   f o r i n :   t r u e ,     u n d e f :   t r u e , 
     e q e q e q :   t r u e ,   p l u s p l u s :   t r u e ,   b i t w i s e :   t r u e ,   r e g e x p :   t r u e ,   i m m e d :   t r u e   * / 
 
 / * g l o b a l   w i n d o w :   f a l s e ,   A r r a y ,   F u s i o n C h a r t s ,   E r r o r :   f a l s e   * / 
 
 / * m e m b e r s   A c t i v e X O b j e c t ,   F C _ D a t a L o a d E r r o r ,   F u s i o n C h a r t s D a t a F o r m a t s , 
         X M L H t t p R e q u e s t ,   _ _ s t a t e ,   a b o r t ,   a d d D a t a H a n d l e r ,   a d d E v e n t L i s t e n e r ,   a j a x , 
         a p p l y ,   c a l l ,   c a n c e l D a t a L o a d ,   c a n c e l D a t a L o a d R e q u e s t ,   c a n c e l D a t a U p d a t e , 
         c o r e ,   d a t a ,   d a t a E r r o r ,   d a t a F o r m a t ,   d a t a S o u r c e ,   d e c o d e ,   e n c o d e ,   e r r o r , 
         e x t e n d ,   f o r m a t ,   g e t ,   g e t C h a r t D a t a ,   h t t p S t a t u s ,   i d ,   i s A c t i v e ,   l o c a t i o n , 
         o n r e a d y s t a t e c h a n g e ,   o p e n ,   o p t i o n s ,   o v e r r i d e M i m e T y p e ,   p o l i c i e s ,   p r o t o c o l , 
         p r o t o t y p e ,   p u s h ,   r a i s e E r r o r ,   r a i s e E v e n t ,   r a i s e W a r n i n g ,   r e a d y S t a t e , 
         r e n d e r e r ,   r e n d e r i n g ,   r e s p o n s e T e x t ,   s e n d ,   s e n d e r ,   s e t C h a r t D a t a , 
         s e t C h a r t D a t a U r l ,   s e t R e q u e s t H e a d e r ,   s l i c e ,   s o u r c e ,   s t a t u s ,   t e s t , 
         t o L o w e r C a s e ,   t o S t r i n g ,   t r a n s c o d e D a t a ,   u p d a t e ,   u p d a t e P e n d i n g ,   u r l ,   x , 
         x m l H t t p R e q u e s t O b j e c t 
 * / 
 
 / * * 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
   *   D a t a - H a n d l e r   A b s t r a c t i o n   F r a m e w o r k 
   *   T h i s   a l l o w s   d e v e l o p e r s   t o   d y n a m i c a l l y   i n t e g r a t e   a   d a t a   t r a n s c o d e r   s o   t h a t 
   *   F u s i o n C h a r t s   c o r e   c a n   s e a m l e s s l y   w o r k   w i t h   m u l t i p l e   f o r m a t s   f o r   d a t a 
   *   p r o v i s i o n i n g . 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
   * / 
 
 ( f u n c t i o n   ( )   { 
 
         / /   R e g i s t e r   t h e   m o d u l e   w i t h   F u s i o n C h a r t s . 
         v a r   g l o b a l   =   F u s i o n C h a r t s ( [ ' p r i v a t e ' ,   ' D a t a H a n d l e r M a n a g e r ' ] ) ; 
         / /   C h e c k   w h e t h e r   t h e   m o d u l e   h a s   b e e n   a l r e a d y   r e g i s t e r e d .   I f   t r u e ,   t h e n 
         / /   d o   n o t   b o t h e r   t o   r e - r e g i s t e r . 
         i f   ( g l o b a l   = = =   u n d e f i n e d )   { 
                 r e t u r n ; 
         } 
 
         / /   C o l l e c t i o n   o f   D a t a   F o r m a t s 
         w i n d o w . F u s i o n C h a r t s D a t a F o r m a t s   =   { } ; 
 
         / * * 
           *   G l o b a l   A J A X   f r a m e w o r k   t o   m a n a g e   A J A X   d a t a   r e q u e s t s   f o r   d a t a   t r a n s a c t i o n s . 
           *   @ i d   g l o b a l . a j a x 
           *   @ t y p e   o b j e c t 
           * / 
         g l o b a l . a j a x   =   ( f u n c t i o n   ( )   { 
 
                 / * * 
                   *   F u n c t i o n   t h a t   i n t e r n a l l y   m a n a g e s   A J A X   e r r o r   e v e n t s .   W h e n   c a l l e d ,   i t 
                   *   p a s s e s   o n   e r r o r   d e t a i l s   t o   t h e   u s e r - a s s i g n e d   a j a x . e r r o r   f u n c t i o n . 
                   * 
                   *   @ p a r a m   x   { X M L H t t p R e q u e s t } 
                   *   @ p a r a m   e   { E r r o r } 
                   *   @ p a r a m   a r g s   { a r g u m e n t s } 
                   * 
                   *   @ t y p e   v o i d 
                   * / 
                 v a r   e r r o r   =   f u n c t i o n   ( a j a x A p i ,   x ,   e ,   a r g s )   { 
                         i f   ( t y p e o f   a j a x A p i . e r r o r   = = =   ' f u n c t i o n ' )   { 
                                 / /   R e p l a c e   t h e   ' c a l l B a c k '   f u n c t i o n   r e f e r e n c e   w i t h   x m l H t t p R e q u e s t 
                                 / /   o b j e c t   a s   t h e   e r r o r   e v e n t   n e e d   n o t   k n o w   a b o u t   t h e   c a l l b a c k . 
                                 a r g s [ 1 ]   =   x ; 
                                 / /   A s   t h e   a r g u m e n t s   ( a r g s )   m a y   n o t   b e   a n   a r r a y ,   w e   p a s s   i t   t o 
                                 / /   a r r a y   o b j e c t   p r o t o t y p e   b e f o r e   p u s h i n g   i n   t h e   a r g u m e n t s . 
                                 A r r a y . p r o t o t y p e . p u s h . c a l l ( a r g s ,   e ) ; 
                                 / /   C a l l   t h e   p u b l i c   e r r o r   m e t h o d   w i t h   a r g u m e n t s   i n   t h e   s a m e   o r d e r 
                                 / /   a s   w h a t   w a s   p a s s e d   t o   t h e   ' g e t '   m e t h o d . 
                                 a j a x A p i . e r r o r . a p p l y ( a j a x A p i ,   a r g s ) ; 
                         } 
                 } ; 
 
                 v a r   a p i   =   { 
                         x :   w i n d o w . X M L H t t p R e q u e s t   & &   ( w i n d o w . l o c a t i o n . p r o t o c o l   ! = =   " f i l e : "   | |   ! w i n d o w . A c t i v e X O b j e c t )   ?   f u n c t i o n   ( )   { 
                                 r e t u r n   n e w   w i n d o w . X M L H t t p R e q u e s t ( ) ; 
                         }   :   f u n c t i o n   ( )   { 
                                 t r y   { 
                                         r e t u r n   n e w   w i n d o 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 " ) ; 
                                 } 
                                 c a t c h   ( e )   { 
                                         t h r o w   " C h a r t s   c a n n o t   r e n d e r   d u e   t o   l a c k   o f   A J A X   s u p p o r t .   U s e   s e t D a t a U R L   f o r   f a l l b a c k " ; 
                                 } 
                         } , 
 
                         g e t :   f u n c t i o n   ( u ,   f )   { 
 
                                 v a r   x   =   a p i . x ( ) ,   a r g s   =   a r g u m e n t s ; 
                                 x . 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   ( )   { 
                                         t r y   { 
                                                 i f   ( x . r e a d y S t a t e   = = =   4 )   { 
                                                         i f   ( x . s t a t u s   = = =   2 0 0   | |   x . s t a t u s   = = =   0 )   { 
                                                                 f ( x . r e s p o n s e T e x t ,   x ) ; 
                                                         } 
                                                         e l s e   { 
                                                                 e r r o r ( a p i ,   x ,   n e w   E r r o r ( ' X M L H t t p R e q u e s t   E r r o r ' ) ,   a r g s ) ; 
                                                         } 
                                                 } 
                                         } 
                                         c a t c h   ( e )   { 
                                                 e r r o r ( a p i ,   x ,   e ,   a r g s ) ; 
                                         } 
                                 } ; 
 
                                 t r y   { 
                                         i f   ( x . o v e r r i d e M i m e T y p e )   { 
                                                 x . o v e r r i d e M i m e T y p e ( ' t e x t / p l a i n ' ) ; 
                                         } 
                                         x . o p e n ( ' G E T ' ,   u ,   t r u e ) ; 
                                         x . s e t R e q u e s t H e a d e r ( ' I f - M o d i f i e d - S i n c e ' ,   ' S a t ,   2 9   O c t   1 9 9 4   1 9 : 4 3 : 3 1   G M T ' ) ; 
                                         x . s e t R e q u e s t H e a d e r ( ' X - R e q u e s t e d - W i t h ' ,   ' X M L H t t p R e q u e s t ' ) ; 
                                         x . s e t R e q u e s t H e a d e r ( ' A c c e p t ' ,   ' t e x t / p l a i n ,   * / * ' ) ; 
                                         x . s e n d ( n u l l ) ; 
                                 } 
                                 c a t c h   ( e )   { 
                                         e r r o r ( a p i ,   x ,   e ,   a r g s ) ; 
                                 } 
 
                                 / /   R e t u r n   t h e   x m l h t t p   o b j e c t 
                                 r e t u r n   x ; 
                         } 
                 } ; 
 
                 r e t u r n   a p i ; 
 
         } ( ) ) ; 
 
         / /   F u n c t i o n   t o   m a n a g e   a j a x   e r r o r   e v e n t s 
         g l o b a l . a j a x . e r r o r   =   f u n c t i o n   ( u r l ,   x ,   m e t h o d ,   o b j ,   e )   { 
 
                 / /   C o m p i l e   a r g u m e n t   f o r   e v e n t . 
                 v a r   e v e n t A r g s   =   { 
                         s o u r c e :   m e t h o d , 
                         u r l :   u r l , 
                         x m l H t t p R e q u e s t O b j e c t :   x , 
                         e r r o r :   e , 
                         h t t p S t a t u s :   ( x   & &   x . s t a t u s )   ?   x . s t a t u s   :   - 1 
                 } ; 
 	 
                 / /   R a i s e   d a t a   l o a d   e r r o r   m e s s a g e . 
                 g l o b a l . r a i s e E v e n t ( ' D a t a L o a d E r r o r ' ,   e v e n t A r g s ,   o b j ) ; 
 
                 / /   C a l l   l e g a c y   e v e n t   h a n d l e r . 
                 i f   ( t y p e o f   w i n d o w . F C _ D a t a L o a d E r r o r   = = =   ' f u n c t i o n ' )   { 
                         w i n d o w . F C _ D a t a L o a d E r r o r ( o b j . i d ,   e v e n t A r g s ) ; 
                 } 
         } ; 
 
         / /   S t o r e   a l l   d a t a   h a n d l e r s   h e r e   i n   a   c o l l e c t i o n   a n d   a l s o   s t o r e   a l l   ' d a t a '   o f 
         / /   e v e r y   c h a r t   i n   a n   o b j e c t . 
         / * * 
           *   @ v a r   { o b j e c t }   c a c h e   s t o r e s   t h e   p a r s e d   J S O N   d a t a   a s   a   c a c h e   l o c a t i o n ,   s o 
           *   t h a t   m u l t i p l e   c a l l s   t o   d e c o d e   J S O N   d o e s   n o t   i n v o l v e   r e d u n d a n t   c o n v e r s i o n . 
           * / 
         v a r   h a n d l e r s   =   { } ,   d a t a S t o r e   =   { } ,   x S t o r e   =   { } ,   c a c h e   =   { } ,   i s U r l   =     / u r l $ / i ; 
 
 
         / /   F u n c t i o n   t o   a b o r t   a j a x   r e q u e s t   f r o m   h t t p R e q u e s t   c a c h e 
         v a r   a b o r t A j a x O f   =   f u n c t i o n   ( i d )   { 
                 / /   C l e a r   a n y   p r e v i o u s   x m l H t t p R e q u e s t . 
                 i f   ( x S t o r e [ i d ]   & &   t y p e o f   x S t o r e [ i d ] . a b o r t   = = =   ' f u n c t i o n '   & & 
                         x S t o r e [ i d ] . r e a d y S t a t e   & &   x S t o r e [ i d ] . r e a d y S t a t e   ! = =   0 )   { 
                         x S t o r e [ i d ] . a b o r t ( ) ; 
                         r e t u r n   t r u e ; 
                 } 
                 r e t u r n   f a l s e ; 
         } ; 
         
         / /   A l l o w   d a t a - r e l a t e d   p a r a m e t e r s   t o   b e   p a s s e d   i n   c o n s t r u c t o r 
         g l o b a l . p o l i c i e s . o p t i o n s . d a t a S o u r c e   =   [ ' d a t a S o u r c e ' ,   u n d e f i n e d ] ; 
         g l o b a l . p o l i c i e s . o p t i o n s . d a t a F o r m a t   =   [ ' d a t a F o r m a t ' ,   u n d e f i n e d ] ; 
 
         / /   E x p o s e   D a t a   h a n d l e r   a n d   r e l a t e d   m a n a g e m e n t   A P I . 
         g l o b a l . a d d D a t a H a n d l e r   =   f u n c t i o n   ( n a m e ,   o b j )   { 
                 i f   ( t y p e o f   n a m e   ! = =   ' s t r i n g '   | |   h a n d l e r s [ n a m e . t o L o w e r C a s e ( ) ]   ! = =   u n d e f i n e d )   { 
                         g l o b a l . r a i s e E r r o r ( g l o b a l . c o r e ,   ' 0 3 0 9 1 6 0 6 ' ,   ' p a r a m ' , 
                                 ' : : D a t a M a n a g e r . a d d D a t a H a n d l e r ' ,   n e w   E r r o r ( ' I n v a l i d   D a t a   H a n d l e r   N a m e ' ) ) ; 
                         r e t u r n ; 
                 } 
                 v a r   a p i   =   { } ,   l c a s e N a m e   =   n a m e . t o L o w e r C a s e ( ) ; 
 
                 / /   A d d   h a n d l e r   t o   c o l l e c t i o n 
                 h a n d l e r s [ l c a s e N a m e ]   =   o b j ; 
 
                 / /   C r e a t e   H a n d l e r   D i r e c t   A c c e s s   A P I .   T h i s   a d d s   c o m m o n   f u c t i o n s   f o r   t h e 
                 / /   h a n d l e r . 
                 a p i [ ' s e t '   +   n a m e   +   ' U r l ' ]   =   f u n c t i o n   ( u r l )   { 
                         r e t u r n   t h i s . s e t C h a r t D a t a U r l ( u r l ,   n a m e ) ; 
                 } ; 
 
                 a p i [ ' s e t '   +   n a m e   +   ' D a t a ' ]   =   f u n c t i o n   ( d a t a )   { 
                         r e t u r n   t h i s . s e t C h a r t D a t a ( d a t a ,   n a m e ) ; 
                 } ; 
 
                 a p i [ ' g e t '   +   n a m e   +   ' D a t a ' ]   =   f u n c t i o n   ( )   { 
                         r e t u r n   t h i s . g e t C h a r t D a t a ( n a m e ) ; 
                 } ; 
 
                 / /   A d d   d a t a   f o r m a t s   t o   g l o b a l   f o r m a t s   c o l l e c t i o n 
                 w i n d o w . F u s i o n C h a r t s D a t a F o r m a t s [ n a m e ]   =   l c a s e N a m e ; 
                 w i n d o w . F u s i o n C h a r t s D a t a F o r m a t s [ n a m e   +   ' U R L ' ]   =   l c a s e N a m e   +   ' U R L ' ; 
 
                 / /   E x t e n d   F u s i o n C h a r t s   o b j e c t s 
                 g l o b a l . e x t e n d ( a p i ,   t r u e ) ; 
         } ; 
 
         / /   A d d   c o n s t r u c t o r   t o   i n i t i a l i z e   d a t a s t o r e   o r   t o   c l e a r   a n y   g a r b a g e . 
         g l o b a l . a d d E v e n t L i s t e n e r ( ' B e f o r e I n i t i a l i z e ' ,   f u n c t i o n   ( e v e n t )   { 
 
                 / /   G e t   s h o r t   r e f e r e n c e   t o   t h e   e v e n t   s e n d e r . 
                 v a r   o b j   =   e v e n t . s e n d e r ; 
 
                 / /   C l e a r   t h e   d a t a S t o r e ,   c a c h e   a n d   x S t o r e   w h e n   n e w   c h a r t   i s   c r e a t e d . 
                 d a t a S t o r e [ o b j . i d ]   =   ' ' ; 
                 c a c h e [ o b j . i d ]   =   { } ; 
 
 
                 / /   S e t   i n t i t i a l   d a t a   i f   p r e s e n t 
                 i f   ( o b j . o p t i o n s . d a t a S o u r c e   ! = =   u n d e f i n e d   & & 
                         t y p e o f   o b j . o p t i o n s . d a t a F o r m a t   = = =   ' s t r i n g ' )   { 
                         o b j . s e t C h a r t D a t a ( o b j . o p t i o n s . d a t a S o u r c e ,   o b j . o p t i o n s . d a t a F o r m a t ) ; 
                 } 
         } ) ; 
 
         / /   A d d   m e t h o d   t o   m a k e   s u r e   t o   d e l e t e   a l l   f u s i o n c h a r t s   o b j e c t s   w h e n 
         / /   d i s p o s e   m e t h o d   i s   i n v o k e d 
         g l o b a l . a d d E v e n t L i s t e n e r ( ' B e f o r e D i s p o s e ' ,   f u n c t i o n   ( e )   { 
                 d e l e t e   d a t a S t o r e [ e . s e n d e r . i d ] ; 
                 d e l e t e   c a c h e [ e . s e n d e r . i d ] ; 
                 a b o r t A j a x O f ( e . s e n d e r . i d ) ; 
         } ) ; 
 
         / /   A d d   g e t t e r   a n d   s e t t e r   t o   F u s i o n C h a r t s   O b j e c t s 
         g l o b a l . e x t e n d ( { 
                 s e t C h a r t D a t a U r l :   f u n c t i o n   ( u r l ,   f o r m a t ,   s i l e n t )   { 
                         i f   ( f o r m a t   = = =   u n d e f i n e d   | |   f o r m a t   = = =   n u l l   | |   t y p e o f   f o r m a t . t o S t r i n g   ! = =   ' f u n c t i o n ' )   { 
                                 g l o b a l . r a i s e E r r o r ( g l o b a l . c o r e ,   ' 0 3 0 9 1 6 0 9 ' ,   ' p a r a m ' , 
                                         ' . s e t C h a r t D a t a U r l ' ,   n e w   E r r o r ( ' I n v a l i d   D a t a   F o r m a t ' ) ) ; 
                                 r e t u r n ; 
                         } 
 
                         / /   D e s e n s i t i z e   c a s e   o f   p a r a m e t e r . 
                         f o r m a t   =   f o r m a t . t o S t r i n g ( ) . t o L o w e r C a s e ( ) ; 
 
                         / * * 
                           *   @ v a r   { B o o l e a n }   c a n c e l D L R F l a g   i s   t o   a l l o w   u s e r s   t o   f l a g   t h a t   
                           *   d a t a - l o a d   r e q u e s t   h a s   t o   b e   c a n c e l l e d . 
                           * / 
                         v a r   b a s e F o r m a t ,   o b j   =   t h i s ,   c a n c e l D L R F l a g   =   f a l s e ; 
 
                         / /   C h e c k   w h e t h e r   t h e   d a t a - f o r m a t   h a s   " u r l "   a t   t h e   e n d   o f   i t . 
                         / /   W e   c o m p u t e   t h e   b a s e   f o r m a t   a n d   u p d a t e   t h e   f o r m a t   a c c o r d i n g l y   s o 
                         / /   t h a t   f o r m a t   a l w a y s   e n d s   w i t h   ' u r l '   a n d   t h e   b a s e F o r m a t   c o n t a i n s   r e a l 
                         / /   f o r m a t   n a m e . 
                         i f   ( i s U r l . t e s t ( f o r m a t ) )   { 
                                 b a s e F o r m a t   =   f o r m a t . s l i c e ( 0 ,   - 3 ) ; 
                         } 
                         e l s e   { 
                                 b a s e F o r m a t   =   f o r m a t ; 
                                 f o r m a t   =   f o r m a t   +   ' u r l ' ; 
                         } 
                         
                         / /   R a i s e   e v e n t   t o   n o t i f y   x m l h t t p r e q u e s t   t r a n s a c t i o n   s t a r t . 
                         g l o b a l . r a i s e E v e n t ( ' D a t a L o a d R e q u e s t e d ' ,   { 
                                 s o u r c e :   ' X m l H t t p R e q u e s t ' , 
                                 u r l :   u r l , 
                                 d a t a F o r m a t :   b a s e F o r m a t , 
                                 c a n c e l D a t a L o a d R e q u e s t :   f u n c t i o n   ( )   { 
                                         c a n c e l D L R F l a g   =   t r u e ; 
                                         t h i s . c a n c e l D a t a L o a d R e q u e s t   =   f u n c t i o n   ( )   { 
                                                 r e t u r n   f a l s e ; 
                                         } ; 
                                         r e t u r n   t r u e ; 
                                 } 
                         } ,   o b j ) ; 
 
                         / /   C h e c k   i f   u s e r   c a n c e l l e d   d a t a l o a d   r e q u e s t . 
                         i f   ( c a n c e l D L R F l a g   = = =   t r u e )   { 
                                 g l o b a l . r a i s e E v e n t ( ' D a t a L o a d R e q u e s t C a n c e l l e d ' ,   { 
                                         s o u r c e :   ' X m l H t t p R e q u e s t ' , 
                                         u r l :   u r l , 
                                         d a t a F o r m a t :   b a s e F o r m a t 
                                 } ,   o b j ) ; 
 
                                 / /   E x i t   f r o m   t h i s   f u n c t i o n 
                                 r e t u r n ; 
                         } 
 
                         / /   U p d a t e   r e f e r e n c e   t o   d a t a - s o u r c e . 
                         t h i s . o p t i o n s . d a t a S o u r c e   =   u r l ; 
 
                         / /   I n i t i a t e   X m l H t t p R e q u e s t . 
                         x S t o r e [ t h i s . i d ]   =   g l o b a l . a j a x . g e t ( d e c o d e U R I C o m p o n e n t ( u r l ) ,   f u n c t i o n   ( r e s p o n s e T e x t ,   x )   { 
                                 / /   A l l o w   c a n c e l l a t i o n   o f   d a t a   l o a i n g 
                                 v a r   c a n c e l D L F l a g   =   f a l s e ; 
 
                                 / /   R a i s e   p r e   d a t a - l o a d   e v e n t 
                                 g l o b a l . r a i s e E v e n t ( ' D a t a L o a d R e q u e s t C o m p l e t e d ' ,   { 
                                         s o u r c e :   ' X m l H t t p R e q u e s t ' , 
                                         u r l :   u r l , 
                                         d a t a :   r e s p o n s e T e x t , 
                                         d a t a F o r m a t :   b a s e F o r m a t , 
                                         c a n c e l D a t a L o a d :   f u n c t i o n   ( )   { 
                                                 c a n c e l D L F l a g   =   t r u e ; 
                                                 t h i s . c a n c e l D a t a L o a d   =   f u n c t i o n   ( )   { 
                                                         r e t u r n   f a l s e ; 
                                                 } ; 
                                                 r e t u r n   t r u e ; 
                                         } , 
                                         x m l H t t p R e q u e s t O b j e c t :   x 
                                 } ,   o b j ) ; 
 
                                 / /   U p d a t e   t h e   c h a r t ' s   d a t a S t o r e   w i t h   d a t a   r e c e i v e d 
                                 / /   f r o m   u r l . 
                                 i f   ( c a n c e l D L F l a g   ! = =   t r u e )   { 
                                         / /   S e t   t h e   c h a r t ' s   d a t a   r e c e i v e d   f r o m   u r l . 
                                         o b j . s e t C h a r t D a t a ( r e s p o n s e T e x t ,   b a s e F o r m a t ,   s i l e n t ) ; 
                                 } 
                                 e l s e   { 
                                         / /   R a i s e   p o s t   d a t a   l o a d   e v e n t   . 
                                         g l o b a l . r a i s e E v e n t ( ' D a t a L o a d C a n c e l l e d ' ,   { 
                                                 s o u r c e :   ' X m l H t t p R e q u e s t ' , 
                                                 u r l :   u r l , 
                                                 d a t a F o r m a t :   b a s e F o r m a t , 
                                                 x m l H t t p R e q u e s t O b j e c t :   x 
                                         } ,   o b j ) ; 
                                 } 
 
                                 / /   D e l e t e   t h e   x m l h t t p   o b j e c t . 
                                 d e l e t e   x S t o r e [ t h i s . i d ] ; 
 
                         } ,   ' X m l H t t p R e q u e s t ' ,   t h i s ) ; 
 
                 } , 
 
                 s e t C h a r t D a t a :   f u n c t i o n   ( d a t a ,   f o r m a t ,   s i l e n t )   { 
                         / /   I n   c a s e   f o r m a t   i s   n o t   a   s t r i n g ,   w e   r a i s e   a n   e r r o r 
                         i f   ( f o r m a t   = = =   u n d e f i n e d   | |   f o r m a t   = = =   n u l l   | |   t y p e o f   f o r m a t . t o S t r i n g   ! = =   ' f u n c t i o n ' )   { 
                                 g l o b a l . r a i s e E r r o r ( g l o b a l . c o r e ,   ' 0 3 0 9 1 6 1 0 ' ,   ' p a r a m ' , 
                                         ' . s e t C h a r t D a t a ' ,   n e w   E r r o r ( ' I n v a l i d   D a t a   F o r m a t ' ) ) ; 
                         } 
                         / /   D e s e n s i t i z e   c a s e   o f   p a r a m e t e r . 
                         f o r m a t   =   f o r m a t . t o S t r i n g ( ) . t o L o w e r C a s e ( ) ; 
 
                         / /   T h e b a s e   f o r m a t   i s   s e t   b y   t r u n c a t i n g   f e t c h i n g   m e t h o d   f r o m   t h e 
                         / /   f o r m a t g - s t r i n g   a n d   t h e n   s t o r e d   i n   ' b a s e F o r m a t '   v a r i a b l e . 
                         v a r   b a s e F o r m a t ; 
 
                         / /   C h e c k   w h e t h e r   t h e   d a t a - f o r m a t   h a s   " u r l "   a t   t h e   e n d   o f   i t .   I f   t r u e , 
                         / /   t h e n   w e   c a l l   t h e   s e t C h a r t D a t a U r l   m e t h o d   a n d   t h a t   i n   t u r n   c a l l s   t h i s 
                         / /   m e t h o d   a s   c a l l b a c k   ( m a r k e d   a s   _ r e c u r s e d . ) 
                         i f   ( i s U r l . t e s t ( f o r m a t ) )   { 
                                 t h i s . s e t C h a r t D a t a U r l ( d a t a ,   f o r m a t ,   s i l e n t ) ; 
                                 r e t u r n ; 
                         } 
                         / /   W h e n   t h e r e   i s   n o   t r a i l i n g   " u r l "   i n   d a t a - f o r m a t ,   w e   a s s u m e   t h a t 
                         / /   t h e   f o r m a t   p r o v i d e d   i s   b a s e F o r m a t   i t s e l f . 
                         e l s e   { 
                                 / /   U p d a t e   t h e   d a t a S o u r c e   h e r e   o n l y   w h e n   w e   k n o w   t h a t   t h i s   c a l l 
                                 / /   w a s   n o t   r e c u r s e d   f o r   d a t a u r l   p u r p o s e 
                                 t h i s . o p t i o n s . d a t a S o u r c e   =   d a t a ; 
                                 b a s e F o r m a t   =   f o r m a t ; 
                         } 
                         / /   U p d a t e   c h a r t ' s   i n t e r n a l   d a t a - f o r m a t   o p t i o n s 
                         t h i s . o p t i o n s . d a t a F o r m a t   =   f o r m a t ; 
 
                         / /   F e t c h   t h e   d a t a - h a n d l e r   f u n c t i o n   f r o m   t h e   d a t a H a n d l e r   c o l l e c t i o n . 
                         v a r   h a n d l e r   =   h a n d l e r s [ b a s e F o r m a t ] ,   p a r s e R e s u l t ,   e v e n t A r g s , 
                                 c a n c e l D U F l a g   =   f a l s e ; 
 
                         / /   I f   t h e   h a n d l e r   h a s   b e e n   s u c c e s s f u l l y   f e t c h e d ,   e x e c u t e   i t . 
                         i f   ( t y p e o f   h a n d l e r   = = =   ' u n d e f i n e d ' )   { 
                                 g l o b a l . r a i s e E r r o r ( g l o b a l . c o r e ,   ' 0 3 0 9 1 6 1 1 ' ,   ' p a r a m ' , 
                                         ' . s e t C h a r t D a t a ' ,   n e w   E r r o r ( ' D a t a   F o r m a t   n o t   r e c o g n i z e d ' ) ) ; 
                                 r e t u r n ; 
                         } 
 
                         / /   E x e c u t e   t h e   p a r s e r   a n d   f e t c h   t h e   p a r s i n g   r e s u l t . 
                         p a r s e R e s u l t   =   h a n d l e r . e n c o d e ( d a t a ,   t h i s ) ; 
                         / /   U p d a t e d   t h e   r e s u l t   s o   t h a t   i t   c a n   b e   p a s s e d   a s   e v e n t   a r g u m e n t . 
                         p a r s e R e s u l t . f o r m a t   =   b a s e F o r m a t ; 
 
                         / /   C r e a t e   a r g u m e n t   f o r   e v e n t s 
                         e v e n t A r g s   =   { 
                                 d a t a F o r m a t :   b a s e F o r m a t , 
                                 d a t a S o u r c e :   d a t a , 
                                 d a t a E r r o r :   p a r s e R e s u l t . e r r o r , 
                                 d a t a :   p a r s e R e s u l t . d a t a , 
                                 c a n c e l D a t a U p d a t e :   f u n c t i o n   ( )   { 
                                         c a n c e l D U F l a g   =   t r u e ; 
                                         t h i s . c a n c e l D a t a U p d a t e   =   f u n c t i o n   ( )   { 
                                                 r e t u r n   f a l s e ; 
                                         } ; 
                                         r e t u r n   t r u e ; 
                                 } 
                         } ; 
 
                         g l o b a l . r a i s e E v e n t ( ' B e f o r e D a t a U p d a t e ' ,   e v e n t A r g s ,   t h i s ) ; 
                         d e l e t e   e v e n t A r g s . c a n c e l D a t a U p d a t e ;   / /   R e m o v e   c a n c e l l a t i o n   f n . 
 
                         / /   U p d a t e   e v e n t   o n l y   i f   i t   i s   n o t   m a r k e d   t o   b e   c a n c e l l e d   b y   u s e r . 
                         i f   ( c a n c e l D U F l a g   = = =   t r u e )   { 
                                 g l o b a l . r a i s e E v e n t ( ' D a t a U p d a t e C a n c e l l e d ' ,   e v e n t A r g s ,   t h i s ) ; 
                                 r e t u r n ; 
                         } 
 
                         / /   S a v e   d a t a   w i t h i n   d a t a S t o r e 
                         d a t a S t o r e [ t h i s . i d ]   =   ( p a r s e R e s u l t . d a t a   =   e v e n t A r g s . d a t a )   | |   ' ' ; 
                         / /   C l e a r   c a c h e 
                         c a c h e [ t h i s . i d ]   =   { } ; 
                         
                         / /   R a i s e   d a t a   u p d a t i o n   e v e n t   i f   i t   i s   n o t   m a r k e d   a s   s i l e n t   d a t a 
                         / /   u p d a t i n g . 
                         i f   ( s i l e n t   ! = =   t r u e )   { 
                                 / /   s t a l l   t h i s   u p d a t e   i f   t h i s   i s   s t u c k   i n   b e t w e e n   a   r e n d e r   a n d   l o a d i n g 
                                 i f   ( t h i s . o p t i o n s . s a f e M o d e   = = =   t r u e   & & 
                                         t h i s . _ _ s t a t e . r e n d e r i n g   = = =   t r u e   & &   ! t h i s . i s A c t i v e ( ) )   { 
                                         t h i s . _ _ s t a t e . u p d a t e P e n d i n g   =   p a r s e R e s u l t ; 
                                         g l o b a l . r a i s e W a r n i n g ( t h i s ,   ' 2 3 0 9 1 2 5 5 ' ,   ' r u n ' ,   ' : : D a t a H a n d l e r ~ u p d a t e ' , 
                                         ' R e n d e r e r   u p d a t e   w a s   p o s t p o n e d   d u e   t o   a s y n c   l o a d i n g . ' ) ; 
                                 } 
                                 e l s e   { 
                                         d e l e t e   t h i s . _ _ s t a t e . u p d a t e P e n d i n g ; 
                                         g l o b a l . r e n d e r e r . u p d a t e ( t h i s ,   p a r s e R e s u l t ) ; 
                                 } 
                         } 
                         
                         / /   D e v N o t e :   T h i s   e v e n t   m u s t   n o t   b e   r a i s e d   a s y n c h r o n o u s l y   i n   o r d e r 
                         / /   t o   m a i n t a i n   i n t e g r i t y   a n d   t i m i n g   o f   r e l a t e d   c o d e s . 
                         g l o b a l . r a i s e E v e n t ( ' D a t a U p d a t e d ' ,   e v e n t A r g s ,   t h i s ) ; 
                 } , 
 
                 g e t C h a r t D a t a :   f u n c t i o n   ( f o r m a t ,   a d v a n c e d )   { 
 
                         / /   V a r i a b l e   t o   s t o r e   a   r e f e r e n c e   t o   t h e   d a t a - h a n d l e r . 
                         v a r   h a n d l e r ,   p a r s e R e s u l t ; 
                         / /   D e s e n s i t i z e   c a s e   o f   p a r a m e t e r   a n d   f e t c h   t h e   d a t a - h a n d l e r 
                         / /   f u n c t i o n   f r o m   t h e   d a t a H a n d l e r   c o l l e c t i o n   w i t h i n   t h e   v a l i d a t i o n 
                         / /   c h e c k   i t s e l f . 
 
                         i f   ( f o r m a t   = = =   u n d e f i n e d   | |   t y p e o f   f o r m a t . t o S t r i n g   ! = =   ' f u n c t i o n '   | | 
                                 ( h a n d l e r   =   h a n d l e r s [ f o r m a t   =   f o r m a t . t o S t r i n g ( ) . t o L o w e r C a s e ( ) ] )   = = =   u n d e f i n e d )   { 
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 2 5 0 8 1 5 4 3 ' ,   ' p a r a m ' ,   ' ~ g e t C h a r t D a t a ( ) ' , 
                                         n e w   E r r o r ( ' U n r e c o g n i z e d   d a t a - f o r m a t   s p e c i f i e d   i n   " f o r m a t " ' ) ) ; 
                                 r e t u r n   u n d e f i n e d ; 
                         } 
 
                         / /   C h e c k   p r e s e n c e   o f   c a c h e d   d a t a   o r   c a l l   t h e   d e c o d e r   r o u t i n e   o f 
                         / /   t h e   d a t a - h a n d l e r   a n d   r e t u r n   t h e   d e c o d e d   d a t a . 
                         p a r s e R e s u l t   =   ( t y p e o f   c a c h e [ t h i s . i d ] [ f o r m a t ]   = = =   ' o b j e c t ' )   ? 
                                 c a c h e [ t h i s . i d ] [ f o r m a t ]   : 
                                 c a c h e [ t h i s . i d ] [ f o r m a t ]   =   h a n d l e r . d e c o d e ( d a t a S t o r e [ t h i s . i d ] ,   t h i s ) ; 
 
                         / /   R e t u r n   t h e   e m i n e n t   d a t a   ( i n   a d v a n c e d   m o d e   i f   n e e d e d . 
                         r e t u r n   B o o l e a n ( a d v a n c e d )   = = =   t r u e   ?   p a r s e R e s u l t   :   p a r s e R e s u l t . d a t a ; 
                 } 
         } ,   t r u e ) ; 
 
         g l o b a l . e x t e n d ( { 
                 t r a n s c o d e D a t a :   f u n c t i o n   ( d a t a ,   f r o m ,   t o ,   a d v a n c e d )   { 
                         
                         / /   V a l i d a t e   p a r a m e t e r s . 
                         i f   ( ! f r o m   | |   t y p e o f   f r o m . t o S t r i n g   ! = =   ' f u n c t i o n '   | |   ! t o   | | 
                                 t y p e o f   t o . t o S t r i n g   ! = =   ' f u n c t i o n '   | |   
                                 h a n d l e r s [ ( t o   =   t o . t o S t r i n g ( ) . t o L o w e r C a s e ( ) ) ]   = = =   u n d e f i n e d   | | 
                                 h a n d l e r s [ ( f r o m   =   f r o m . t o S t r i n g ( ) . t o L o w e r C a s e ( ) ) ]   = = =   u n d e f i n e d )   { 
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 1 4 0 9 0 2 1 7 ' ,   ' p a r a m ' ,   ' t r a n s c o d e D a t a ( ) ' , 
                                         n e w   E r r o r ( ' U n r e c o g n i z e d   d a t a - f o r m a t   s p e c i f i e d   d u r i n g   t r a n s c o d i n g . ' ) ) ; 
                                 r e t u r n   u n d e f i n e d ; 
                         } 
 
                         / /   C h a i n   t h e   d e c o d e r   a n d   e n c o d e r . 
                         v a r   l 1   =   h a n d l e r s [ f r o m ] . e n c o d e ( d a t a ,   t h i s ) ,   
                                 l 2   =   h a n d l e r s [ t o ] . d e c o d e ( l 1 . d a t a ,   t h i s ) ; 
 
                         / /   C a r r y   t h e   e r r o r . 
                         i f   ( ! ( l 2 . e r r o r   i n s t a n c e o f   E r r o r ) )   { 
                                 l 2 . e r r o r   =   l 1 . e r r o r ; 
                         } 
                         r e t u r n   a d v a n c e d   ?   l 2   :   l 2 . d a t a ; 
                 } 
         } ,   f a l s e ) ; 
 
         / /   A t t a c h   a n   e v e n t   h a n d l e r   t o   c l e a r   t h e   d a t a   c a c h e   w h e n   c h a r t   i s   d i s p o s e d . 
         g l o b a l . c o r e . a d d E v e n t L i s t e n e r ( ' D i s p o s e d ' ,   f u n c t i o n   ( e )   { 
                 d e l e t e   c a c h e [ e . s e n d e r . i d ] ; 
         } ) ; 
 
         / /   C h e c k   f o r   p e n d i n g   d a t a   u p d a t e s 
         g l o b a l . c o r e . a d d E v e n t L i s t e n e r ( ' L o a d e d ' ,   f u n c t i o n   ( e )   { 
                 v a r   o b j   =   e . s e n d e r ; 
                 i f   ( o b j   i n s t a n c e o f   g l o b a l . c o r e   & &   o b j . _ _ s t a t e . u p d a t e P e n d i n g   ! = =   u n d e f i n e d )   { 
                         g l o b a l . r e n d e r e r . u p d a t e ( o b j ,   o b j . _ _ s t a t e . u p d a t e P e n d i n g ) ; 
                         d e l e t e   o b j . _ _ s t a t e . u p d a t e P e n d i n g ; 
                 } 
         } ) ; 
 
 
 } ( ) ) ; 
 
 
 / * j s l i n t   w h i t e :   t r u e ,   b r o w s e r :   t r u e ,   w i n d o w s :   t r u e ,   f o r i n :   t r u e ,     u n d e f :   t r u e , 
         e q e q e q :   t r u e ,   p l u s p l u s :   t r u e ,   b i t w i s e :   t r u e ,   i m m e d :   t r u e   * / 
 
 / * g l o b a l   w i n d o w :   f a l s e ,   A r r a y :   f a l s e ,   F u s i o n C h a r t s :   f a l s e , 
         F u s i o n C h a r t s E v e n t s :   f a l s e ,   F u s i o n C h a r t s D a t a F o r m a t s :   f a l s e * / 
 
 / * m e m b e r s   X M L ,   X M L U R L ,   a d d E v e n t L i s t e n e r ,   a n i m a t e ,   a p p l y ,   a r g s , 
         a t t r i b u t e s ,   c h a r t T y p e ,   c l o n e ,   c o n s t r u c t o r ,   c o r e ,   d i s p o s e ,   e x p o r t C h a r t , 
         e x t e n d ,   g e t A t t r i b u t e ,   g e t C h a r t F r o m I d ,   g e t D a t a A s C S V ,   g e t E l e m e n t B y I d , 
         g e t E l e m e n t s B y T a g N a m e ,   g e t O b j e c t B y I d ,   g e t R e n d e r e r P o l i c y ,   g e t X M L , 
         h a s R e n d e r e d ,   h e i g h t ,   i d ,   i n d e x O f ,   i s A c t i v e ,   i t e m s ,   l a s t I n d e x O f ,   l e n g t h , 
         l i n k ,   o p t i o n s ,   p a r a m s ,   p o l i c i e s ,   p r i n t ,   r a i s e E r r o r ,   r a i s e E v e n t ,   r e f , 
         r e n d e r e r ,   r e p l a c e ,   r e s i z e ,   r e s i z e T o ,   s c r i p t B a s e U r i ,   s e n d e r , 
         s e t C h a r t D a t a ,   s e t D a t a U R L ,   s e t D a t a X M L ,   s i g n a t u r e ,   s p l i t ,   s r c ,   s t a l l L o a d , 
         s u b s t r i n g ,   s u c c e s s ,   s w f o b j e c t ,   t e s t ,   t o L o w e r C a s e ,   t o S t r i n g ,   v a r s ,   v l e d , 
         w i d t h 
 * / 
 
 / * * 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
   *   G e n e r i c   R u n t i m e   M o d u l e 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
   * / 
 ( f u n c t i o n   ( )   { 
 
         / /   R e g i s t e r   t h e   m o d u l e   w i t h   F u s i o n C h a r t s . 
         v a r   g l o b a l   =   F u s i o n C h a r t s ( [ ' p r i v a t e ' ,   ' G e n e r i c R u n t i m e ' ] ) ; 
         / /   C h e c k   w h e t h e r   t h e   m o d u l e   h a s   b e e n   a l r e a d y   r e g i s t e r e d .   I f   t r u e ,   t h e n 
         / /   d o   n o t   b o t h e r   t o   r e - r e g i s t e r . 
         i f   ( g l o b a l   = = =   u n d e f i n e d )   { 
                 r e t u r n ; 
         } 
 
         / /   S e t   t h e   F u s i o n C h a r t s   f i l e n a m e   p o s s i b i l i t i e s   a s   r e g u l a r   e x p r e s s i o n . 
         v a r   S C R I P T _ N A M E _ R E G E X   =   / ( f u s i o n c h a r t s \ . j s | f u s i o n c h a r t s \ . d e b u g \ . j s | f u s i o n c h a r t s \ . c o r e \ . j s | f u s i o n c h a r t s \ . m i n \ . j s | f u s i o n c h a r t s \ . p a c k e d \ . j s ) ( \ ? . * ) ? $ / i ; 
 
         / /   C o l l e c t i o n   o f   c h a r t   a l i a s   t h a t   a r e   n o t   s a m e   a s   s w f   f i l e n a m e 
         v a r   a l i a s   =   { 
                 v l e d :   ' r e a l t i m e v e r t i c a l l e d ' 
         } ; 
 
         / /   G e t   t h e   s c r i p t   b a s e   u r i . 
         g l o b a l . c o r e . o p t i o n s . s c r i p t B a s e U r i   =   ( f u n c t i o n   ( )   { 
                 / /   G e t   a   c o l l e c t i o n   o f   a l l   s c r i p t   n o d e s . 
                 v a r   s c r i p t s   =   d o c u m e n t . g e t E l e m e n t s B y T a g N a m e ( ' s c r i p t ' ) , 
                         l   =   s c r i p t s . l e n g t h ,   s c r i p t B a s e U r i   =   ' ' ,   i ; 
 
                 / /   I t e r a t e   t h r o u g h   t h e   s c r i p t   n o d e   c o l l e c t i o n   a n d   m a t c h   w h e t h e r   i t s 
                 / /   ' s r c '   a t t r i b u t e   c o n t a i n s   f u s i o n c h a r t s   f i l e   n a m e . 
                 f o r   ( i   =   0 ;   i   <   l ;   i   + =   1 )   { 
                         / /   I n   c a s e   t h e   s c r i p t   n a m e   r e g e x   m a t c h e s   w i t h   a n   s r c ,   w e   u s e   t h a t 
                         / /   s r c   t o   r e t r i e v e   t h e   b a s e   u r i . 
                         i f   ( S C R I P T _ N A M E _ R E G E X . t e s t ( s c r i p t s [ i ] . g e t A t t r i b u t e ( ' s r c ' ) ) )   { 
                                 / /   T o   r e t r i e v e   t h e   b a s e   p a t h   o f   t h e   s r c ,   w e   s i m p l y   d o   a   s t r i n g 
                                 / /   s p l i t   w i t h g   t h e   f u s i o n c h a r t s   f i l e n a m e   a n d   g e t   t h e   f i r s t   i t e m 
                                 / /   o f   s c r i p t   b a s e   u r i . 
                                 s c r i p t B a s e U r i   =   s c r i p t s [ i ] . g e t A t t r i b u t e ( ' s r c ' ) . s p l i t ( S C R I P T _ N A M E _ R E G E X ) [ 0 ] ; 
                                 b r e a k ; 
                         } 
                 } 
 
                 r e t u r n   s c r i p t B a s e U r i ; 
 
         } ( ) ) ; 
 
         / /   D e c o n s t r u c t   p o l i c i e s . 
         / /   U p d a t e   t h e   a r g u m e n t s   w i t h   l a t e s t   c o p y   o f   a l l   v a r i a b l e s   b y 
         / /   r e v e r s e   e n g i n e e r i n g   t h e   p o l i c i e s . 
         v a r   d e c o n s t r u c t P o l i c y S e t   =   f u n c t i o n   ( p o l i c i e s ,   o p t i o n s ,   o b j )   { 
                 f o r   ( v a r   p o l i c y   i n   p o l i c i e s )   { 
                         / /   S e t   j u s t   t h e   p o l i c y   o b j e c t   i n   c a s e   o f   s i n g l e - l e v e l   p o l i c y . 
                         i f   ( p o l i c i e s [ p o l i c y ]   i n s t a n c e o f   A r r a y )   { 
                                 o p t i o n s [ p o l i c i e s [ p o l i c y ] [ 0 ] ]   =   o b j [ p o l i c y ] ; 
                                 c o n t i n u e ; 
                         } 
                         / /   C o p y   t h e   s o u r c e   o f   m u l t i - l e v e l   p o l i c i e s 
                         f o r   ( v a r   p r o p   i n   p o l i c i e s [ p o l i c y ] )   { 
                                 o p t i o n s [ p o l i c i e s [ p o l i c y ] [ p r o p ] [ 0 ] ]   =   o b j [ p o l i c y ] [ p r o p ] ; 
                         } 
                 } 
         } ,   l e n g t h C l e a n u p R e g e x   =   / [ ^ \ % \ d ] * $ / g ,   s i g n a t u r e M a t c h R e g e x   =   / ^ F u s i o n C h a r t s / ; 
 
         g l o b a l . e x t e n d ( { 
                 / /   A d d   d e f a u l t   o b j e c t   m a n a g e m e n t   p r o t o t y p e   m e t h o d   t o   r a i s e   d e l e t i o n 
                 / /   e v e n t . 
                 d i s p o s e :   f u n c t i o n   ( )   { 
                         / /   T h e   e v e n t   m u s t   b e   a s y n c   i n   o r d e r   t o   p r e v e n t   i n t e g r i t y . 
                         g l o b a l . r a i s e E v e n t ( ' B e f o r e D i s p o s e ' ,   { } ,   t h i s ) ; 
                         / /   D e l e t e   t h e   r e f e r e n c e   o f   t h e   i t e m 
                         d e l e t e   g l o b a l . c o r e . i t e m s [ t h i s . i d ] ; 
                         / /   R a i s e   a   p o s t - d i s p o s a l   e v e n t 
                         g l o b a l . r a i s e E v e n t ( ' D i s p o s e d ' ,   { } ,   t h i s ) ; 
                 } , 
 
                 c l o n e :   f u n c t i o n   ( p a r a m s ,   n o C r e a t e )   { 
 
                         / /   C r e a t e   a   c o p y   o f   a r g u m e n t s   o f   t h i s   o b j e c t . 
                         v a r   o p t i o n s   =   g l o b a l . e x t e n d ( { } ,   t h i s . a r g s ) ; 
 
                         / /   R e c r e a t e   c o n s t r u c t i o n   p a r a m e t e r s   b y   r e v e r s e   c a l c u l a t i n g   t h e   g l o b a l 
                         / /   p o l i c i e s . 
                         d e c o n s t r u c t P o l i c y S e t ( g l o b a l . p o l i c i e s ,   o p t i o n s ,   t h i s ) ; 
                         / /   A l s o   d e c o n s t r u c t   t h e   r e n d e r e   s p e c i f i c   p o l i c i e s . 
                         d e c o n s t r u c t P o l i c y S e t ( g l o b a l . r e n d e r e r . g e t R e n d e r e r P o l i c y ( t h i s . o p t i o n s . r e n d e r e r ) , 
                                 o p t i o n s ,   t h i s ) ; 
 
                         / /   R e m o v e   a n y   s p e c i f i c   p a r a m e t e r s   t h a t   i f   c l o n e d   w i l l   c r e a t e   i s s u e s . 
                         d e l e t e   o p t i o n s . i d ; 
                         d e l e t e   o p t i o n s . a n i m a t e ; 
                         d e l e t e   o p t i o n s . s t a l l L o a d ; 
 
                         / /   O v e r r i d e   a n y   o f   t h e   o p t i o n s   b y   p a r a m e t e r s   s e n t   b y   u s e r 
                         i f   ( t y p e o f   p a r a m s   = = =   ' o b j e c t ' )   { 
                                 g l o b a l . e x t e n d ( o p t i o n s ,   p a r a m s ) ; 
                         } 
 
                         / /   C r e a t e   n e w   F u s i o n C h a r t s   o b j e c t   f r o m   t h e   c o m p u t e d   o p t i o n s 
                         r e t u r n   n o C r e a t e   ?   o p t i o n s   :   n e w   g l o b a l . c o r e ( o p t i o n s ) ; 
 
                 } , 
                 
                 / * * 
                   *   L e g a c y   f u n c t i o n   t h a t   s i m p l y   c a l l s   s e t D a t a X M L   o n   J S   o b j e c t . 
                   *   @ i d   F u s i o n C h a r t s . s e t D a t a X M L 
                   * 
                   *   @ p a r a m   { s t r i n g }   x m l   T h e   d a t a   a s   s t r i n g   i n   F u s i o n C h a r t s   c o m p a t i b l e   X M L 
                   *   f o r m a t . 
                   * 
                   *   @ t y p e   v o i d 
                   *   @ d e p r e c a t e d 
                   * / 
                 s e t D a t a X M L :   f u n c t i o n   ( x m l )   { 
                         / /   C h e c k   w h e t h e r   t h e   X M L   a s   p a r a m e t e r   c a n   b e   c o n v e r t e d   t o 
                         / /   s t r i n g   o r   n o t   a n d   t h e n   s e n d   d a t a   t o   c h a r t . 
                         i f   ( x m l   = = =   u n d e f i n e d   | |   x m l   = = =   n u l l   | | 
                                 t y p e o f   x m l . t o S t r i n g   ! = =   ' f u n c t i o n ' )   { 
                                 / /   N o t i f y   u s i n g   e r r o r   e v e n t   t h a t   i n v a l i d   d a t a   w a s   p r o v i d e d   a s   x m l . 
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 2 5 0 8 1 6 2 7 ' ,   ' p a r a m ' ,   ' ~ s e t D a t a X M L ' , 
                                         ' I n v a l i d   d a t a   t y p e   f o r   p a r a m e t e r   " x m l " ' ) ; 
                                 r e t u r n ; 
                         } 
 
                         / /   W e   c h e c k   w h e t h e r   t h e   r e n d e r e r   h a s   s e t D a t a X M L   f u n c t i o n ,   w e   s e t   i t . 
                         i f   ( t h i s . r e f   = = =   u n d e f i n e d   | |   t h i s . r e f   = = =   n u l l   | | 
                                 t y p e o f   t h i s . r e f . s e t D a t a X M L   ! = =   ' f u n c t i o n ' )   { 
                                 t h i s . s e t C h a r t D a t a ( x m l . t o S t r i n g ( ) ,   F u s i o n C h a r t s D a t a F o r m a t s . X M L ) ; 
                         } 
                         e l s e   { 
                                 / /   W h e n   d i r e c t   X M L   u p d a t e d   A P I   i s   a v a i l a b l e   w e   u s e   i t   t o   d i r e c t l y 
                                 / /   d o   r e m o t e   u p d a t e   o f   X M L . 
                                 t h i s . r e f . s e t D a t a X M L ( x m l . t o S t r i n g ( ) ) ; 
                         } 
 
                 } , 
 
                 / * * 
                   *   @ i d   F u s i o n C h a r t s . s e t D a t a U R L 
                   * 
                   *   @ p a r a m   { s t r i n g }   u r l   
                   * 
                   *   @ t y p e   v o i d 
                   *   @ d e p r e c a t e d 
                   * / 
                 s e t D a t a U R L :   f u n c t i o n   ( u r l )   { 
                         / /   C h e c k   w h e t h e r   t h e   U R L   a s   p a r a m e t e r   c a n   b e   c o n v e r t e d   t o 
                         / /   s t r i n g   o r   n o t . 
                         i f   ( u r l   = = =   u n d e f i n e d   | |   u r l   = = =   n u l l   | | 
                                 t y p e o f   u r l . t o S t r i n g   ! = =   ' f u n c t i o n ' )   { 
                                 / /   N o t i f y   u s i n g   e r r o r   e v e n t   t h a t   i n v a l i d   d a t a   w a s   p r o v i d e d   a s   x m l . 
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 2 5 0 8 1 7 2 4 ' ,   ' p a r a m ' ,   ' ~ s e t D a t a U R L ' , 
                                         ' I n v a l i d   d a t a   t y p e   f o r   p a r a m e t e r   " u r l " ' ) ; 
                                 r e t u r n ; 
                         } 
 
                         / /   W e   c h e c k   w h e t h e r   t h e   r e n d e r e r   h a s   s e t D a t a U R L   f u n c t i o n ,   w e   s e t   i t . 
                         i f   ( t h i s . r e f   = = =   u n d e f i n e d   | |   t h i s . r e f   = = =   n u l l   | | 
                                 t y p e o f   t h i s . r e f . s e t D a t a U R L   ! = =   ' f u n c t i o n ' )   { 
                                 / /   F o r   f l a s h   r e n d e r e r ,   w e   s e t   t h e   f l a s h V a r s ,   s o   t h a t   i t   i s   p i c k e d 
                                 / /   u p   w h e n   c h a r t   r e n d e r s . 
                                 t h i s . s e t C h a r t D a t a ( u r l . t o S t r i n g ( ) ,   F u s i o n C h a r t s D a t a F o r m a t s . X M L U R L ) ; 
                         } 
                         e l s e   { 
                                 / /   W h e n   d i r e c t   X M L   u p d a t e d   A P I   i s   a v a i l a b l e   w e   u s e   i t   t o   d i r e c t l y 
                                 / /   d o   r e m o t e   u p d a t e   o f   X M L . 
                                 t h i s . r e f . s e t D a t a U R L ( u r l . t o S t r i n g ( ) ) ; 
                         } 
                 } , 
 
                 i s A c t i v e :   f u n c t i o n   ( )   { 
                         i f   ( ! t h i s . r e f   | |   d o c u m e n t . g e t E l e m e n t B y I d ( t h i s . i d )   ! = = 
                                 t h i s . r e f   | |   t y p e o f   t h i s . r e f . s i g n a t u r e   ! = =   ' f u n c t i o n ' )   { 
                                 r e t u r n   f a l s e ; 
                         } 
                         
                         t r y   { 
                                 r e t u r n   s i g n a t u r e M a t c h R e g e x . t e s t ( t h i s . r e f . s i g n a t u r e ( ) ) ; 
                         } 
                         c a t c h   ( e )   { 
                                 r e t u r n   f a l s e ; 
                         } 
                 } , 
 
                 r e s i z e T o :   f u n c t i o n   ( w ,   h ,   n o U p d a t e )   { 
                         v a r   d i m e n s i o n   =   { 
                                 w i d t h :   w , 
                                 h e i g h t :   h 
                         } ; 
 
                         i f   ( t y p e o f   a r g u m e n t s [ 0 ]   = = =   ' o b j e c t ' )   { 
                                 d i m e n s i o n . w i d t h   =   a r g u m e n t s [ 0 ] . w i d t h ; 
                                 d i m e n s i o n . h e i g h t   =   a r g u m e n t s [ 0 ] . h e i g h t ; 
                                 n o U p d a t e   =   h ; 
                         } 
 
                         i f   ( d i m e n s i o n . w i d t h   & &   t y p e o f   d i m e n s i o n . w i d t h . t o S t r i n g   = = =   ' f u n c t i o n ' )   { 
                                 t h i s . w i d t h   =   d i m e n s i o n . w i d t h . t o S t r i n g ( ) . r e p l a c e ( l e n g t h C l e a n u p R e g e x ,   ' ' ) ; 
                         } 
                         i f   ( d i m e n s i o n . h e i g h t   & &   t y p e o f   d i m e n s i o n . h e i g h t . t o S t r i n g   = = =   ' f u n c t i o n ' )   { 
                                 t h i s . h e i g h t   =   d i m e n s i o n . h e i g h t . t o S t r i n g ( ) . r e p l a c e ( l e n g t h C l e a n u p R e g e x ,   ' ' ) ; 
                         } 
 
                         i f   ( n o U p d a t e   ! = =   t r u e )   { 
                                 g l o b a l . r e n d e r e r . r e s i z e ( t h i s ,   d i m e n s i o n ) ; 
                         } 
                 } , 
                 
                 / /   A d d   f u n c t i o n   t o   g e t   c h a r t   t y p e   n a m e   f r o m   S W F 
                 c h a r t T y p e :   f u n c t i o n   ( )   { 
                         v a r   u r l   =   t h i s . s r c . s u b s t r i n g ( t h i s . s r c . i n d e x O f ( ' . s w f ' ) ,   0 ) , 
                                 f i l e   =   u r l . s u b s t r i n g ( u r l . l a s t I n d e x O f ( ' / ' )   +   1 ) . t o L o w e r C a s e ( ) ; 
                         r e t u r n   a l i a s [ f i l e ]   = = =   u n d e f i n e d   ?   f i l e   :   a l i a s [ f i l e ] ; 
                 } 
 
         } ,   t r u e ) ; 
 
         / /   G l o b a l l y   e x p o s e   g e t C h a r t F r o m I d   m e t h o d . 
         w i n d o w . g e t C h a r t F r o m I d   =   f u n c t i o n   ( i d )   { 
                 r e t u r n   g l o b a l . c o r e . i t e m s [ i d ]   i n s t a n c e o f   g l o b a l . c o r e   ? 
                         g l o b a l . c o r e . i t e m s [ i d ] . r e f   :   g l o b a l . s w f o b j e c t . g e t O b j e c t B y I d ( i d ) ; 
         } ; 
 
 
         / /   T h i s   f u n c t i o n   a l l o w s   u s e r s   t o   m a k e   a   g e n e r i c   c a l l   f r o m   r e n d e r e r 
         / /   o f   t h e   c h a r t   t o   m a i n   F u s i o n C h a r t s   o b j e c t . 
         v a r   j s C a l l   =   f u n c t i o n   ( o b j ,   p r o p )   { 
                 / /   C h e c k   w h e t h e r   m e 
                 i f   ( t y p e o f   o b j [ p r o p ]   = = =   ' f u n c t i o n ' )   { 
                         r e t u r n   f u n c t i o n   ( )   { 
                                 r e t u r n   o b j [ p r o p ] . a p p l y ( o b j ,   a r g u m e n t s ) ; 
                         } ; 
                 } 
                 r e t u r n   o b j [ p r o p ] ; 
         } ; 
 
         / * * 
           *   E x t e n d   F u s i o n C h a r t s   c a p a b i l i t i e s   t o   s w f   H T M L N o d e   o b j e c t 
           * / 
         g l o b a l . a d d E v e n t L i s t e n e r ( ' i n t e r n a l . D O M E l e m e n t C r e a t e d ' ,   f u n c t i o n   ( e v e n t ,   a r g s )   { 
                 / /   C h e c k   w h e t h e r   t h e   o b j e c t   w a s   a d d e d   t o   D O M   o r   n o t . 
                 i f   ( a r g s . r e f   = = =   u n d e f i n e d   | |   a r g s . s u c c e s s   ! = =   t r u e )   { 
                         r e t u r n ; 
                 } 
 
                 / /   L i s t   t h e   p r o p e r t i e s   t h a t   a r e   n o t   t o   b e   e x t e n d e d . 
                 v a r   i g n o r e   =   { 
                         o p t i o n s :   t r u e , 
                         v a r s :   t r u e , 
                         a t t r i b u t e s :   t r u e , 
                         p a r a m s :   t r u e , 
                         s r c :   t r u e , 
                         r e f :   t r u e , 
                         c o n s t r u c t o r :   t r u e , 
                         s e t D a t a X M L :   t r u e , 
                         s e t D a t a U R L :   t r u e , 
                         h a s R e n d e r e d :   t r u e , 
                         g e t X M L :   t r u e , 
                         g e t D a t a A s C S V :   t r u e , 
                         p r i n t :   t r u e , 
                         e x p o r t C h a r t :   t r u e , 
                         s i g n a t u r e :   t r u e , 
                         l i n k :   t r u e 
                 } ; 
 
                 / /   I t e r a t e   t h r o u g h   t h e   F u s i o n C h a r t s   o b j e c t   a n d   a d d   i t s   v a r i a b l e s   t o   t h e 
                 / /   H T M L N o d e   o b j e c t . 
                 f o r   ( v a r   p r o p   i n   e v e n t . s e n d e r )   { 
                         / /   D i s c o n t i n u e   a d d i n g   t h i s   o b j e c t   i n   c a s e   t h e   p r o p e r t y   i s   m a r k e d   t o 
                         / /   b e   i g n o r e d . 
                         i f   ( i g n o r e [ p r o p ]   = = =   t r u e   | |   a r g s . r e f [ p r o p ]   ! = =   u n d e f i n e d )   { 
                                 c o n t i n u e ; 
                         } 
                         t r y   { 
                                 a r g s . r e f [ p r o p ]   =   j s C a l l ( e v e n t . s e n d e r ,   p r o p ) ; 
                         } 
                         / /   S u p p r e s s   e r r o r   w h i l e   u p d a t i n g   D O M   e v e n t s . 
                         c a t c h   ( e )   {   } 
                 } 
         } ) ; 
 
 } ( ) ) ; 
 
 
 
 / * j s l i n t   w h i t e :   t r u e ,   b r o w s e r :   t r u e ,   w i n d o w s :   t r u e ,   f o r i n :   t r u e ,     u n d e f :   t r u e , 
     e q e q e q :   t r u e ,   p l u s p l u s :   t r u e ,   b i t w i s e :   t r u e ,   r e g e x p :   t r u e ,   i m m e d :   t r u e   * / 
 
 / * g l o b a l   A r r a y :   f a l s e ,   F u s i o n C h a r t s ,   R e g E x p :   f a l s e ,   F u s i o n C h a r t s D a t a F o r m a t s :   f a l s e   * / 
 
 / * m e m b e r s   J S O N ,   a n i m a t i o n ,   c h a r t ,   e x t e n d ,   g e t C h a r t A t t r i b u t e , 
         g e t C h a r t D a t a ,   g r a p h ,   l e n g t h ,   r a i s e E r r o r ,   s e t C h a r t A t t r i b u t e , 
         s e t C h a r t D a t a ,   t o L o w e r C a s e ,   t o S t r i n g 
 * / 
 
 / * * 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
   *   D y n a m i c   C h a r t   A t t r i b u t e s   M o d u l e 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
   *   T h i s   m o d u l e   c o n t a i n s   c o d e s   r e q u i r e d   t o   g e t   a n d   s e t   c h a r t   a t t r i b u t e s   f r o m   a 
   *   F u s i o n C h a r t s   o b j e c t   u s i n g   s i m p l e   g e t t e r   a n d   s e t t e r   f u n c t i o n s .   T h e s e   m e t h o d 
   *   c o m p l e t e l y   b y p a s s e s   t h e   d a t a   t r a n s f e r   f r o m   t h e   S W F   a n d   c o m p u t e s   c h a r t 
   *   a t t r i b u t e s   b a s e d   o n   t h e   l a s t   s e t   d a t a . 
   * / 
 ( f u n c t i o n   ( )   { 
 
         / /   R e g i s t e r   t h e   m o d u l e   w i t h   F u s i o n C h a r t s . 
         v a r   g l o b a l   =   F u s i o n C h a r t s ( [ ' p r i v a t e ' ,   ' D y n a m i c C h a r t A t t r i b u t e s ' ] ) ; 
         / /   C h e c k   w h e t h e r   t h e   m o d u l e   h a s   b e e n   a l r e a d y   r e g i s t e r e d .   I f   t r u e ,   t h e n 
         / /   d o   n o t   b o t h e r   t o   r e - r e g i s t e r . 
         i f   ( g l o b a l   = = =   u n d e f i n e d )   { 
                 r e t u r n ; 
         } 
 
         g l o b a l . e x t e n d ( { 
                 / * * 
                   *   U p d a t e s   a   F u s i o n C h a r t s   o b j e c t ' s   X M L   r o o t ' s   a t t r i b u t e   w i t h   t h e   n e w 
                   *   a t t r i b u t e - v a l u e   p a i r .   I n   c a s e   t h e   a t t r i b u t e   d o e s   n o t   e x i s t ,   i t   a d d s 
                   *   i t . 
                   * 
                   *   @ p a r a m   a t t r i b u t e s   { o b j e c t }   T h e   a t t r i b u t e s   t o   b e   u p d a t e d . 
                   * 
                   *   @ t y p e   s t r i n g 
                   *   @ r e t u r n   U p d a t e d   F u s i o n C h a r t s   D a t a X M L   w i t h   t h e   n e w   a t t r i b u t e   a d d e d   o r 
                   *   u p d a t e d 
                   * / 
                 s e t C h a r t A t t r i b u t e :   f u n c t i o n   ( a t t r i b u t e s )   { 
 
                         / /   I n   c a s e   a t t r i b u t e   i s   s e n t   a s   s e p a r a t e   a r g u m e n t s ,   c o m b i n e   t h e m 
                         / /   t o   o n e   o b j e c t . 
                         i f   ( a r g u m e n t s . l e n g t h   >   1   & &   t y p e o f   a t t r i b u t e s   = = =   ' s t r i n g ' )   { 
                                 v a r   t e m p   =   a r g u m e n t s [ 0 ] ; 
                                 a t t r i b u t e s   =   { } ; 
                                 a t t r i b u t e s [ t e m p ]   =   a r g u m e n t s [ 1 ] ; 
                         } 
                         / /   I n   c a s e   u s e r   s e n d s   i n v a l i d   p a r a m e t e r s   f o r   a t t r i b u t e s . 
                         e l s e   i f   ( a t t r i b u t e s   = = =   n u l l   | |   t y p e o f   a t t r i b u t e s   ! = =   ' o b j e c t ' )   { 
                                 r e t u r n ; 
                         } 
 
                         / /   G e t   c h a r t   a t t r i b u t e s . 
                         v a r   i   =   0 ,   j s o n   =   t h i s . g e t C h a r t D a t a ( F u s i o n C h a r t s D a t a F o r m a t s . J S O N ) ,   p r o p , 
                                 a t t L i s t   =   j s o n . c h a r t   | |   j s o n . g r a p h   | |   { } ; 
 
                         / /   I t e r a t e   t h r o u g h   a t t r i b u t e s   a n d   u p d a t e   t h e m . 
                         f o r   ( p r o p   i n   a t t r i b u t e s )   { 
                                 i   + =   1 ; 
                                 a t t L i s t [ p r o p . t o L o w e r C a s e ( ) ]   =   a t t r i b u t e s [ p r o p ] ; 
                         } 
                         / /   U p d a t e   c h a r t ' s   X M L . 
                         i f   ( i   >   0 )   { 
                                 / /   I n   c a s e   a n i m a t i o n   i s   n o t   s p e c i f i e d ,   t h e n   t u r n   i t   o f f . 
                                 i f   ( t y p e o f   a t t L i s t . a n i m a t i o n   = = =   ' u n d e f i n e d ' )   { 
                                         a t t L i s t . a n i m a t i o n   =   ' 0 ' ; 
                                 } 
                                 t h i s . s e t C h a r t D a t a ( j s o n ,   F u s i o n C h a r t s D a t a F o r m a t s . J S O N ) ; 
                         } 
                 } , 
 
                 / * * 
                   *   R e t u r n s   t h e   v a l u e   o f   a   s p e c i f i c   c h a r t   a t t r i b u t e . 
                   * 
                   *   @ p a r a m   a t t r i b u t e   { s t r i n g }   T h e   a t t r i b u t e s   t o   b e   f e t c h e d . 
                   * 
                   *   @ t y p e   s t r i n g 
                   *   @ r e t u r n   T h e   v a l u e   o f   t h e   a t t r i b u t e . 
                   * / 
                 g e t C h a r t A t t r i b u t e :   f u n c t i o n   ( a t t r i b u t e )   { 
 
                         / /   G e t   c h a r t   a t t r i b u t e s . 
                         v a r   a t t L i s t   =   ( a t t L i s t   =   
                                 t h i s . g e t C h a r t D a t a ( F u s i o n C h a r t s D a t a F o r m a t s . J S O N ) ) . c h a r t   | |   a t t L i s t . g r a p h ; 
                         
                         / /   I n   c a s e   n o   a r g u m e n t   i s   p a s s e d ,   w e   r e t u r n   t h e   e n t i r e   s e t   o f 
                         / /   c h a r t   a t t r i b u t e s   o b j e c t . 
                         i f   ( a r g u m e n t s . l e n g t h   = = =   0   | |   a t t r i b u t e   = = =   u n d e f i n e d   | |   a t t L i s t   = = =   u n d e f i n e d )   { 
                                 r e t u r n   a t t L i s t ; 
                         } 
 
                         / /   C r e a t e   a   v a r i a b l e   t h a t   w i l l   s t o r e   r e f e r e n c e   t o   t h e   p a r a m e t e r   t h a t 
                         / /   c o n t a i n s   a t t r i b u t e s .   T h i s   h e l p s   i n   c a s e   u s e r   s e n d s   o n e   a t t r i b u t e 
                         / /   a s   s t r i n g ,   w e   c o v e r t   i t   t o   a n   a r r a y   w i t j   o n e   e l e m e n t . 
                         v a r   v a l u e ,   i ; 
 
                         / /   C o n v e r t   s i n g l e   a t t r i b u t e   t o   a r r a y   w i t h   o n e   e l e m e n t   o r   d i r e c t l y 
                         / /   s e n d   t h e   v a l u e   a s   r e t u r n . 
                         i f   ( t y p e o f   a t t r i b u t e   = = =   ' s t r i n g ' )   { 
                                 v a l u e   =   a t t L i s t [ a t t r i b u t e . t o S t r i n g ( ) . t o L o w e r C a s e ( ) ] ; 
                         } 
 
                         / /   I n   c a s e   u s e r   s e n d s   a n   a r r a y   o f   a t t r i b u t e s ,   w e   c o m p i l e   a n   o b j e c t 
                         / /   f o r   t h e   s a m e   a n d   r e t u r n . 
                         e l s e   i f   ( a t t r i b u t e   i n s t a n c e o f   A r r a y )   { 
                                 v a l u e   =   { } ; 
                                 f o r   ( i   =   0 ;   i   <   a t t r i b u t e . l e n g t h ;   i   + =   1 )   { 
                                         v a l u e [ a t t r i b u t e [ i ] ]   = 
                                                 a t t L i s t [ a t t r i b u t e [ i ] . t o S t r i n g ( ) . t o L o w e r C a s e ( ) ] ; 
                                 } 
                         } 
 
                         / /   I f   a l l   a b o v e   c o n d i t i o n s   f a i l ,   t h e r e   m u s t   b e   s o m e   i s s u e   w i t h   t h e 
                         / /   p a r a m e t e r s . 
                         e l s e   { 
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 2 5 0 8 1 4 2 9 ' ,   ' p a r a m ' ,   ' ~ g e t C h a r t A t t r i b u t e ( ) ' , 
                                         ' U n e x p e c t e d   v a l u e   o f   " a t t r i b u t e " ' ) ; 
                         } 
 
                         / /   W e   r e t u r n   ' v a l u e '   v a r i a b l e   h e r e   a s   b e c a u s e   i t   i s   e q u i v a l e n t   t o 
                         / /   s e n d i n g   ' { } '   i n   c a s e   a b o v e   c o n d i t i o n s   f a i l . 
                         r e t u r n   v a l u e ; 
                 } 
         } ,   t r u e ) ; 
 } ( ) ) ; 
 
 
 
 / * j s l i n t   w h i t e :   t r u e ,   b r o w s e r :   t r u e ,   w i n d o w s :   t r u e ,   f o r i n :   t r u e ,     u n d e f :   t r u e , 
     e q e q e q :   t r u e ,   p l u s p l u s :   t r u e ,   b i t w i s e :   t r u e ,   i m m e d :   t r u e   * / 
 
 / * g l o b a l   A r r a y :   f a l s e ,   F u s i o n C h a r t s ,   w i n d o w :   f a l s e , 
         F u s i o n C h a r t s D a t a F o r m a t s :   f a l s e   * / 
 
 / * m e m b e r s   D O M I d ,   I n v a l i d X M L T e x t ,   X M L ,   X M L U R L ,   _ _ f u s i o n c h a r t s _ d i m e n s i o n , 
         _ _ f u s i o n c h a r t s _ e v e n t ,   _ _ f u s i o n c h a r t s _ v a r s ,   a d d E v e n t L i s t e n e r , 
         a d d V a r i a b l e ,   a l i g n ,   a l l o w S c r i p t A c c e s s ,   a n i m a t i o n ,   a p p e n d C h i l d , 
         a t t r i b u t e s ,   a t t r s ,   a u t o I n s t a l l R e d i r e c t ,   b a s e ,   b g C o l o r , 
         c a n c e l D a t a L o a d R e q u e s t ,   c h a r t H e i g h t ,   c h a r t W i d t h ,   c o n f i g ,   c o n f i g u r e , 
         c o n f i r m ,   c o r e ,   c r e a t e E l e m e n t ,   d a t a F o r m a t ,   d a t a I n v o k e d O n S W F ,   d a t a S o u r c e , 
         d a t a U R L ,   d a t a X M L ,   d e b u g M o d e ,   d i s p l a y ,   e m b e d S W F ,   e n c o d e U R I C o m p o n e n t , 
         e r r o r ,   e s c a p e d ,   e x e c ,   e x t e n d ,   f l a s h V a r s ,   f o r m a t ,   g e t C h a r t D a t a , 
         g e t E l e m e n t s B y T a g N a m e ,   g e t S W F H T M L ,   g e t T i m e ,   g e t X M L , 
         h a s F l a s h P l a y e r V e r s i o n ,   h e i g h t ,   h r e f ,   i d ,   i n i t ,   i n n e r H T M L , 
         i n s t a l l R e d i r e c t M e s s a g e ,   i s A c t i v e ,   i t e m s ,   l a n g ,   l o c a t i o n ,   m e n u , 
         o f f s e t H e i g h t ,   o f f s e t W i d t h ,   o p t i o n s ,   p a r a m s ,   p a r e n t N o d e ,   p o l i c i e s , 
         p r o t o c o l ,   p r o t o t y p e ,   q u a l i t y ,   r a i s e E r r o r ,   r a i s e E v e n t ,   r a i s e W a r n i n g ,   r e f , 
         r e g i s t e r ,   r e g i s t e r W i t h J S ,   r e m o v e C h i l d ,   r e m o v e E v e n t L i s t e n e r ,   r e m o v e S W F , 
         r e n d e r ,   r e n d e r e r ,   r e p l a c e ,   r e q u i r e d F l a s h P l a y e r V e r s i o n ,   r e s i z e ,   s a f e M o d e , 
         s a l i g n ,   s c a l e ,   s c a l e M o d e ,   s e n d e r ,   s e t A t t r i b u t e ,   s e t C h a r t D a t a , 
         s e t D a t a U R L ,   s e t D a t a X M L ,   s e t D e f a u l t ,   s e t T r a n s p a r e n t ,   s h o w C h a r t M e s s a g e , 
         s o u r c e ,   s r c ,   s t a l l L o a d ,   s t o p P r o p a g a t i o n ,   s t y l e ,   s w L i v e C o n n e c t , 
         s w f o b j e c t ,   t e s t ,   t o S t r i n g ,   t o U p p e r C a s e ,   t y p e ,   u n e s c a p e ,   u p d a t e ,   u r l , 
         u s e r A g e n t ,   w M o d e ,   w i d t h ,   d a t a 
 * / 
 
 / * * 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
   *   F l a s h   R e n d e r e r   M o d u l e 
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
   * / 
 ( f u n c t i o n   ( )   { 
 
         / /   R e g i s t e r   t h e   m o d u l e   w i t h   F u s i o n C h a r t s   a n d   a l s   o g e t   a c c e s s   t o   a   g l o b a l 
         / /   v a r i a b l e   w i t h i n   t h e   c o r e ' s   s c o p e . 
         v a r   g l o b a l   =   F u s i o n C h a r t s ( [ ' p r i v a t e ' ,   ' F l a s h _ R e n d e r e r ' ] ) ; 
         / /   C h e c k   w h e t h e r   t h e   m o d u l e   h a s   b e e n   a l r e a d y   r e g i s t e r e d .   I f   t r u e ,   t h e n 
         / /   d o   n o t   b o t h e r   t o   r e - r e g i s t e r . 
         i f   ( g l o b a l   = = =   u n d e f i n e d )   { 
                 r e t u r n ; 
         } 
 
         / /   I n c l u d e   s w f o b j e c t   i n   l o c a l   s c o p e   i f   n o t   a l r e a d y   p r e s e n t   i n   t h e   g l o b a l 
         / /   s c o p e .   M a k e   s u r e   t o   d o u b l e   t e s t   o r i g i n a l   s w f o b j e c t   b y   t e s t i n g   e x p e c t e d 
         / /   p r o p e r t i e s   o f   s w f o b j e c t . 
         v a r   s w f o b j e c t   =   g l o b a l . s w f o b j e c t   =   f u n c t i o n   ( )   { 
 
                         v a r   U N D E F   =   " u n d e f i n e d " , 
                                         O B J E C T   =   " o b j e c t " , 
                                         S H O C K W A V E _ F L A S H   =   " S h o c k w a v e   F l a s h " , 
                                         S H O C K W A V E _ F L A S H _ A X   =   " S h o c k w a v e F l a s h . S h o c k w a v e F l a s h " , 
                                         F L A S H _ M I M E _ T Y P E   =   " a p p l i c a t i o n / x - s h o c k w a v e - f l a s h " , 
                                         E X P R E S S _ I N S T A L L _ I D   =   " S W F O b j e c t E x p r I n s t " , 
                                         O N _ R E A D Y _ S T A T E _ C H A N G E   =   " o n r e a d y s t a t e c h a n g e " , 
 
                                         w i n   =   w i n d o w , 
                                         d o c   =   d o c u m e n t , 
                                         n a v   =   n a v i g a t o r , 
 
                                         p l u g i n   =   f a l s e , 
                                         d o m L o a d F n A r r   =   [ m a i n ] , 
                                         r e g O b j A r r   =   [ ] , 
                                         o b j I d A r r   =   [ ] , 
                                         l i s t e n e r s A r r   =   [ ] , 
                                         s t o r e d A l t C o n t e n t , 
                                         s t o r e d A l t C o n t e n t I d , 
                                         s t o r e d C a l l b a c k F n , 
                                         s t o r e d C a l l b a c k O b j , 
                                         i s D o m L o a d e d   =   f a l s e , 
                                         i s E x p r e s s I n s t a l l A c t i v e   =   f a l s e , 
                                         d y n a m i c S t y l e s h e e t , 
                                         d y n a m i c S t y l e s h e e t M e d i a , 
                                         a u t o H i d e S h o w   =   t r u e , 
 
                         / *   C e n t r a l i z e d   f u n c t i o n   f o r   b r o w s e r   f e a t u r e   d e t e c t i o n 
                                         -   U s e r   a g e n t   s t r i n g   d e t e c t i o n   i s   o n l y   u s e d   w h e n   n o   g o o d   a l t e r n a t i v e   i s   p o s s i b l e 
                                         -   I s   e x e c u t e d   d i r e c t l y   f o r   o p t i m a l   p e r f o r m a n c e 
                         * / 
                         u a   =   f u n c t i o n ( )   { 
                                         v a r   w 3 c d o m   =   t y p e o f   d o c . g e t E l e m e n t B y I d   ! =   U N D E F   & &   t y p e o f   d o c . g e t E l e m e n t s B y T a g N a m e   ! =   U N D E F   & &   t y p e o f   d o c . c r e a t e E l e m e n t   ! =   U N D E F , 
                                                         u   =   n a v . u s e r A g e n t . t o L o w e r C a s e ( ) , 
                                                         p   =   n a v . p l a t f o r m . t o L o w e r C a s e ( ) , 
                                                         w i n d o w s   =   p   ?   / w i n / . t e s t ( p )   :   / w i n / . t e s t ( u ) , 
                                                         m a c   =   p   ?   / m a c / . t e s t ( p )   :   / m a c / . t e s t ( u ) , 
                                                         w e b k i t   =   / w e b k i t / . t e s t ( u )   ?   p a r s e F l o a t ( u . r e p l a c e ( / ^ . * w e b k i t \ / ( \ d + ( \ . \ d + ) ? ) . * $ / ,   " $ 1 " ) )   :   f a l s e ,   / /   r e t u r n s   e i t h e r   t h e   w e b k i t   v e r s i o n   o r   f a l s e   i f   n o t   w e b k i t 
                                                         i e   =   ! + " \ v 1 " ,   / /   f e a t u r e   d e t e c t i o n   b a s e d   o n   A n d r e a   G i a m m a r c h i ' s   s o l u t i o n :   h t t p : / / w e b r e f l e c t i o n . b l o g s p o t . c o m / 2 0 0 9 / 0 1 / 3 2 - b y t e s - t o - k n o w - i f - y o u r - b r o w s e r - i s - i e . h t m l 
                                                         p l a y e r V e r s i o n   =   [ 0 , 0 , 0 ] , 
                                                         d   =   n u l l ; 
                                         i f   ( t y p e o f   n a v . p l u g i n s   ! =   U N D E F   & &   t y p e o f   n a v . p l u g i n s [ S H O C K W A V E _ F L A S H ]   = =   O B J E C T )   { 
                                                         d   =   n a v . p l u g i n s [ S H O C K W A V E _ F L A S H ] . d e s c r i p t i o n ; 
                                                         i f   ( d   & &   ! ( t y p e o f   n a v . m i m e T y p e s   ! =   U N D E F   & &   n a v . m i m e T y p e s [ F L A S H _ M I M E _ T Y P E ]   & &   ! n a v . m i m e T y p e s [ F L A S H _ M I M E _ T Y P E ] . e n a b l e d P l u g i n ) )   {   / /   n a v i g a t o r . m i m e T y p e s [ " a p p l i c a t i o n / x - s h o c k w a v e - f l a s h " ] . e n a b l e d P l u g i n   i n d i c a t e s   w h e t h e r   p l u g - i n s   a r e   e n a b l e d   o r   d i s a b l e d   i n   S a f a r i   3 + 
                                                                         p l u g i n   =   t r u e ; 
                                                                         i e   =   f a l s e ;   / /   c a s c a d e d   f e a t u r e   d e t e c t i o n   f o r   I n t e r n e t   E x p l o r e r 
                                                                         d   =   d . r e p l a c e ( / ^ . * \ s + ( \ S + \ s + \ S + $ ) / ,   " $ 1 " ) ; 
                                                                         p l a y e r V e r s i o n [ 0 ]   =   p a r s e I n t ( d . r e p l a c e ( / ^ ( . * ) \ . . * $ / ,   " $ 1 " ) ,   1 0 ) ; 
                                                                         p l a y e r V e r s i o n [ 1 ]   =   p a r s e I n t ( d . r e p l a c e ( / ^ . * \ . ( . * ) \ s . * $ / ,   " $ 1 " ) ,   1 0 ) ; 
                                                                         p l a y e r V e r s i o n [ 2 ]   =   / [ a - z A - Z ] / . t e s t ( d )   ?   p a r s e I n t ( d . r e p l a c e ( / ^ . * [ a - z A - Z ] + ( . * ) $ / ,   " $ 1 " ) ,   1 0 )   :   0 ; 
                                                         } 
                                         } 
                                         e l s e   i f   ( t y p e o f   w i n . A c t i v e X O b j e c t   ! =   U N D E F )   { 
                                                         t r y   { 
                                                                         v a r   a   =   n e w   A c t i v e X O b j e c t ( S H O C K W A V E _ F L A S H _ A X ) ; 
                                                                         i f   ( a )   {   / /   a   w i l l   r e t u r n   n u l l   w h e n   A c t i v e X   i s   d i s a b l e d 
                                                                                         / /   F i x   f o r   / b u g # 4 6 2 
                                                                                         / / ! / /   d   =   a . G e t V a r i a b l e ( " $ v e r s i o n " ) ; 
                                                                                         t r y   { 
                                                                                                 d   =   a . G e t V a r i a b l e ( " $ v e r s i o n " ) ; 
                                                                                         } 
                                                                                         c a t c h   ( e )   {   } 
                                                                                         / /   E n d   f i x   f o r   / b u g # 4 6 2 
                                                                                         i f   ( d )   { 
                                                                                                         i e   =   t r u e ;   / /   c a s c a d e d   f e a t u r e   d e t e c t i o n   f o r   I n t e r n e t   E x p l o r e r 
                                                                                                         d   =   d . s p l i t ( "   " ) [ 1 ] . s p l i t ( " , " ) ; 
                                                                                                         p l a y e r V e r s i o n   =   [ p a r s e I n t ( d [ 0 ] ,   1 0 ) ,   p a r s e I n t ( d [ 1 ] ,   1 0 ) ,   p a r s e I n t ( d [ 2 ] ,   1 0 ) ] ; 
                                                                                         } 
                                                                         } 
                                                         } 
                                                         c a t c h ( e )   { } 
                                         } 
                                         r e t u r n   { w 3 : w 3 c d o m ,   p v : p l a y e r V e r s i o n ,   w k : w e b k i t ,   i e : i e ,   w i n : w i n d o w s ,   m a c : m a c } ; 
                         } ( ) , 
 
                         / *   C r o s s - b r o w s e r   o n D o m L o a d 
                                         -   W i l l   f i r e   a n   e v e n t   a s   s o o n   a s   t h e   D O M   o f   a   w e b   p a g e   i s   l o a d e d 
                                         -   I n t e r n e t   E x p l o r e r   w o r k a r o u n d   b a s e d   o n   D i e g o   P e r i n i ' s   s o l u t i o n :   h t t p : / / j a v a s c r i p t . n w b o x . c o m / I E C o n t e n t L o a d e d / 
                                         -   R e g u l a r   o n l o a d   s e r v e s   a s   f a l l b a c k 
                         * / 
                         o n D o m L o a d   =   f u n c t i o n ( )   { 
                                         i f   ( ! u a . w 3 )   { r e t u r n ; } 
                                         i f   ( ( t y p e o f   d o c . r e a d y S t a t e   ! =   U N D E F   & &   d o c . r e a d y S t a t e   = =   " c o m p l e t e " )   | |   ( t y p e o f   d o c . r e a d y S t a t e   = =   U N D E F   & &   ( d o c . g e t E l e m e n t s B y T a g N a m e ( " b o d y " ) [ 0 ]   | |   d o c . b o d y ) ) )   {   / /   f u n c t i o n   i s   f i r e d   a f t e r   o n l o a d ,   e . g .   w h e n   s c r i p t   i s   i n s e r t e d   d y n a m i c a l l y 
                                                         c a l l D o m L o a d F u n c t i o n s ( ) ; 
                                         } 
                                         i f   ( ! i s D o m L o a d e d )   { 
                                                         i f   ( t y p e o f   d o c . a d d E v e n t L i s t e n e r   ! =   U N D E F )   { 
                                                                         d o c . a d d E v e n t L i s t e n e r ( " D O M C o n t e n t L o a d e d " ,   c a l l D o m L o a d F u n c t i o n s ,   f a l s e ) ; 
                                                         } 
                                                         i f   ( u a . i e   & &   u a . w i n )   { 
                                                                         d o c . a t t a c h E v 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   ( d o c . r e a d y S t a t e   = =   " c o m p l e t e " )   { 
                                                                                                         d o c . d e t a c h E v e n t ( O N _ R E A D Y _ S T A T E _ C H A N G E ,   a r g u m e n t s . c a l l e e ) ; 
                                                                                                         c a l l D o m L o a d F u n c t i o n s ( ) ; 
                                                                                         } 
                                                                         } ) ; 
                                                                         i f   ( w i n   = =   t o p )   {   / /   i f   n o t   i n s i d e   a n   i f r a m e 
                                                                                         ( f u n c t i o n ( ) { 
                                                                                                         i f   ( i s D o m L o a d e d )   { r e t u r n ; } 
                                                                                                         t r y   { 
                                                                                                                         d o c . d o c u m e n t E l e m e n t . d o S c r o l l ( " l e f t " ) ; 
                                                                                                         } 
                                                                                                         c a t c h ( e )   { 
                                                                                                                         s e t T i m e o u t ( a r g u m e n t s . c a l l e e ,   0 ) ; 
                                                                                                                         r e t u r n ; 
                                                                                                         } 
                                                                                                         c a l l D o m L o a d F u n c t i o n s ( ) ; 
                                                                                         } ) ( ) ; 
                                                                         } 
                                                         } 
                                                         i f   ( u a . w k )   { 
                                                                         ( f u n c t i o n ( ) { 
                                                                                         i f   ( i s D o m L o a d e d )   { r e t u r n ; } 
                                                                                         i f   ( ! / l o a d e d | c o m p l e t e / . t e s t ( d o c . r e a d y S t a t e ) )   { 
                                                                                                         s e t T i m e o u t ( a r g u m e n t s . c a l l e e ,   0 ) ; 
                                                                                                         r e t u r n ; 
                                                                                         } 
                                                                                         c a l l D o m L o a d F u n c t i o n s ( ) ; 
                                                                         } ) ( ) ; 
                                                         } 
                                                         a d d L o a d E v e n t ( c a l l D o m L o a d F u n c t i o n s ) ; 
                                         } 
                         } ( ) ; 
 
                         f u n c t i o n   c a l l D o m L o a d F u n c t i o n s ( )   { 
                                         i f   ( i s D o m L o a d e d )   { r e t u r n ; } 
                                         t r y   {   / /   t e s t   i f   w e   c a n   r e a l l y   a d d / r e m o v e   e l e m e n t s   t o / f r o m   t h e   D O M ;   w e   d o n ' t   w a n t   t o   f i r e   i t   t o o   e a r l y 
                                                         v a r   t   =   d o c . g e t E l e m e n t s B y T a g N a m e ( " b o d y " ) [ 0 ] . a p p e n d C h i l d ( c r e a t e E l e m e n t ( " s p a n " ) ) ; 
                                                         t . p a r e n t N o d e . r e m o v e C h i l d ( t ) ; 
                                         } 
                                         c a t c h   ( e )   { r e t u r n ; } 
                                         i s D o m L o a d e d   =   t r u e ; 
                                         v a r   d l   =   d o m L o a d F n A r r . l e n g t h ; 
                                         f o r   ( v a r   i   =   0 ;   i   <   d l ;   i + + )   { 
                                                         d o m L o a d F n A r r [ i ] ( ) ; 
                                         } 
                         } 
 
                         f u n c t i o n   a d d D o m L o a d E v e n t ( f n )   { 
                                         i f   ( i s D o m L o a d e d )   { 
                                                         f n ( ) ; 
                                         } 
                                         e l s e   { 
                                                         d o m L o a d F n A r r [ d o m L o a d F n A r r . l e n g t h ]   =   f n ;   / /   A r r a y . p u s h ( )   i s   o n l y   a v a i l a b l e   i n   I E 5 . 5 + 
                                         } 
                         } 
 
                         / *   C r o s s - b r o w s e r   o n l o a d 
                                         -   B a s e d   o n   J a m e s   E d w a r d s '   s o l u t i o n :   h t t p : / / b r o t h e r c a k e . c o m / s i t e / r e s o u r c e s / s c r i p t s / o n l o a d / 
                                         -   W i l l   f i r e   a n   e v e n t   a s   s o o n   a s   a   w e b   p a g e   i n c l u d i n g   a l l   o f   i t s   a s s e t s   a r e   l o a d e d 
                           * / 
                         f u n c t i o n   a d d L o a d E v e n t ( f n )   { 
                                         i f   ( t y p e o f   w i n . a d d E v e n t L i s t e n e r   ! =   U N D E F )   { 
                                                         w i n . a d d E v e n t L i s t e n e r ( " l o a d " ,   f n ,   f a l s e ) ; 
                                         } 
                                         e l s e   i f   ( t y p e o f   d o c . a d d E v e n t L i s t e n e r   ! =   U N D E F )   { 
                                                         d o c . a d d E v e n t L i s t e n e r ( " l o a d " ,   f n ,   f a l s e ) ; 
                                         } 
                                         e l s e   i f   ( t y p e o f   w i n . a t t a c h E v e n t   ! =   U N D E F )   { 
                                                         a d d L i s t e n e r ( w i n ,   " o n l o a d " ,   f n ) ; 
                                         } 
                                         e l s e   i f   ( t y p e o f   w i n . o n l o a d   = =   " f u n c t i o n " )   { 
                                                         v a r   f n O l d   =   w i n . o n l o a d ; 
                                                         w i n . o n l o a d   =   f u n c t i o n ( )   { 
                                                                         f n O l d ( ) ; 
                                                                         f n ( ) ; 
                                                         } ; 
                                         } 
                                         e l s e   { 
                                                         w i n . o n l o a d   =   f n ; 
                                         } 
                         } 
 
                         / *   M a i n   f u n c t i o n 
                                         -   W i l l   p r e f e r a b l y   e x e c u t e   o n D o m L o a d ,   o t h e r w i s e   o n l o a d   ( a s   a   f a l l b a c k ) 
                         * / 
                         f u n c t i o n   m a i n ( )   { 
                                         i f   ( p l u g i n )   { 
                                                         t e s t P l a y e r V e r s i o n ( ) ; 
                                         } 
                                         e l s e   { 
                                                         m a t c h V e r s i o n s ( ) ; 
                                         } 
                         } 
 
                         / *   D e t e c t   t h e   F l a s h   P l a y e r   v e r s i o n   f o r   n o n - I n t e r n e t   E x p l o r e r   b r o w s e r s 
                                         -   D e t e c t i n g   t h e   p l u g - i n   v e r s i o n   v i a   t h e   o b j e c t   e l e m e n t   i s   m o r e   p r e c i s e   t h a n   u s i n g   t h e   p l u g i n s   c o l l e c t i o n   i t e m ' s   d e s c r i p t i o n : 
                                             a .   B o t h   r e l e a s e   a n d   b u i l d   n u m b e r s   c a n   b e   d e t e c t e d 
                                             b .   A v o i d   w r o n g   d e s c r i p t i o n s   b y   c o r r u p t   i n s t a l l e r s   p r o v i d e d   b y   A d o b e 
                                             c .   A v o i d   w r o n g   d e s c r i p t i o n s   b y   m u l t i p l e   F l a s h   P l a y e r   e n t r i e s   i n   t h e   p l u g i n   A r r a y ,   c a u s e d   b y   i n c o r r e c t   b r o w s e r   i m p o r t s 
                                         -   D i s a d v a n t a g e   o f   t h i s   m e t h o d   i s   t h a t   i t   d e p e n d s   o n   t h e   a v a i l a b i l i t y   o f   t h e   D O M ,   w h i l e   t h e   p l u g i n s   c o l l e c t i o n   i s   i m m e d i a t e l y   a v a i l a b l e 
                         * / 
                         f u n c t i o n   t e s t P l a y e r V e r s i o n ( )   { 
                                         v a r   b   =   d o c . g e t E l e m e n t s B y T a g N a m e ( " b o d y " ) [ 0 ] ; 
                                         v a r   o   =   c r e a t e E l e m e n t ( O B J E C T ) ; 
                                         o . s e t A t t r i b u t e ( " t y p e " ,   F L A S H _ M I M E _ T Y P E ) ; 
                                         v a r   t   =   b . a p p e n d C h i l d ( o ) ; 
                                         i f   ( t )   { 
                                                         v a r   c o u n t e r   =   0 ; 
                                                         ( f u n c t i o n ( ) { 
                                                                         i f   ( t y p e o f   t . G e t V a r i a b l e   ! =   U N D E F )   { 
                                                                                         / /   F i x   f o r   / b u g # 4 6 2 
                                                                                         / / ! / /   v a r   d   =   t . G e t V a r i a b l e ( " $ v e r s i o n " ) ; 
                                                                                         v a r   d ; 
                                                                                         t r y   { 
                                                                                                 d   =   t . G e t V a r i a b l e ( " $ v e r s i o n " ) ; 
                                                                                         } 
                                                                                         c a t c h   ( e )   {   } 
                                                                                         / /   E n d   f i x   f o r   / b u g # 4 6 2 
                                                                                         i f   ( d )   { 
                                                                                                         d   =   d . s p l i t ( "   " ) [ 1 ] . s p l i t ( " , " ) ; 
                                                                                                         u a . p v   =   [ p a r s e I n t ( d [ 0 ] ,   1 0 ) ,   p a r s e I n t ( d [ 1 ] ,   1 0 ) ,   p a r s e I n t ( d [ 2 ] ,   1 0 ) ] ; 
                                                                                         } 
                                                                         } 
                                                                         e l s e   i f   ( c o u n t e r   <   1 0 )   { 
                                                                                         c o u n t e r + + ; 
                                                                                         s e t T i m e o u t ( a r g u m e n t s . c a l l e e ,   1 0 ) ; 
                                                                                         r e t u r n ; 
                                                                         } 
                                                                         b . r e m o v e C h i l d ( o ) ; 
                                                                         t   =   n u l l ; 
                                                                         m a t c h V e r s i o n s ( ) ; 
                                                         } ) ( ) ; 
                                         } 
                                         e l s e   { 
                                                         m a t c h V e r s i o n s ( ) ; 
                                         } 
                         } 
 
                         / *   P e r f o r m   F l a s h   P l a y e r   a n d   S W F   v e r s i o n   m a t c h i n g ;   s t a t i c   p u b l i s h i n g   o n l y 
                         * / 
                         f u n c t i o n   m a t c h V e r s i o n s ( )   { 
                                         v a r   r l   =   r e g O b j A r r . l e n g t h ; 
                                         i f   ( r l   >   0 )   { 
                                                         f o r   ( v a r   i   =   0 ;   i   <   r l ;   i + + )   {   / /   f o r   e a c h   r e g i s t e r e d   o b j e c t   e l e m e n t 
                                                                         v a r   i d   =   r e g O b j A r r [ i ] . i d ; 
                                                                         v a r   c b   =   r e g O b j A r r [ i ] . c a l l b a c k F n ; 
                                                                         v a r   c b O b j   =   { s u c c e s s : f a l s e ,   i d : i d } ; 
                                                                         i f   ( u a . p v [ 0 ]   >   0 )   { 
                                                                                         v a r   o b j   =   g e t E l e m e n t B y I d ( i d ) ; 
                                                                                         i f   ( o b j )   { 
                                                                                                         i f   ( h a s P l a y e r V e r s i o n ( r e g O b j A r r [ i ] . s w f V e r s i o n )   & &   ! ( u a . w k   & &   u a . w k   <   3 1 2 ) )   {   / /   F l a s h   P l a y e r   v e r s i o n   > =   p u b l i s h e d   S W F   v e r s i o n :   H o u s t o n ,   w e   h a v e   a   m a t c h ! 
                                                                                                                         s e t V i s i b i l i t y ( i d ,   t r u e ) ; 
                                                                                                                         i f   ( c b )   { 
                                                                                                                                         c b O b j . s u c c e s s   =   t r u e ; 
                                                                                                                                         c b O b j . r e f   =   g e t O b j e c t B y I d ( i d ) ; 
                                                                                                                                         c b ( c b O b j ) ; 
                                                                                                                         } 
                                                                                                         } 
                                                                                                         e l s e   i f   ( r e g O b j A r r [ i ] . e x p r e s s I n s t a l l   & &   c a n E x p r e s s I n s t a l l ( ) )   {   / /   s h o w   t h e   A d o b e   E x p r e s s   I n s t a l l   d i a l o g   i f   s e t   b y   t h e   w e b   p a g e   a u t h o r   a n d   i f   s u p p o r t e d 
                                                                                                                         v a r   a t t   =   { } ; 
                                                                                                                         a t t . d a t a   =   r e g O b j A r r [ i ] . e x p r e s s I n s t a l l ; 
                                                                                                                         a t t . w i d t h   =   o b j . g e t A t t r i b u t e ( " w i d t h " )   | |   " 0 " ; 
                                                                                                                         a t t . h e i g h t   =   o b j . g e t A t t r i b u t e ( " h e i g h t " )   | |   " 0 " ; 
                                                                                                                         i f   ( o b j . g e t A t t r i b u t e ( " c l a s s " ) )   { a t t . s t y l e c l a s s   =   o b j . g e t A t t r i b u t e ( " c l a s s " ) ; } 
                                                                                                                         i f   ( o b j . g e t A t t r i b u t e ( " a l i g n " ) )   { a t t . a l i g n   =   o b j . g e t A t t r i b u t e ( " a l i g n " ) ; } 
                                                                                                                         / /   p a r s e   H T M L   o b j e c t   p a r a m   e l e m e n t ' s   n a m e - v a l u e   p a i r s 
                                                                                                                         v a r   p a r   =   { } ; 
                                                                                                                         v a r   p   =   o b j . g e t E l e m e n t s B y T a g N a m e ( " p a r a m " ) ; 
                                                                                                                         v a r   p l   =   p . l e n g t h ; 
                                                                                                                         f o r   ( v a r   j   =   0 ;   j   <   p l ;   j + + )   { 
                                                                                                                                         i f   ( p [ j ] . g e t A t t r i b u t e ( " n a m e " ) . t o L o w e r C a s e ( )   ! =   " m o v i e " )   { 
                                                                                                                                                         p a r [ p [ j ] . g e t A t t r i b u t e ( " n a m e " ) ]   =   p [ j ] . g e t A t t r i b u t e ( " v a l u e " ) ; 
                                                                                                                                         } 
                                                                                                                         } 
                                                                                                                         s h o w E x p r e s s I n s t a l l ( a t t ,   p a r ,   i d ,   c b ) ; 
                                                                                                         } 
                                                                                                         e l s e   {   / /   F l a s h   P l a y e r   a n d   S W F   v e r s i o n   m i s m a t c h   o r   a n   o l d e r   W e b k i t   e n g i n e   t h a t   i g n o r e s   t h e   H T M L   o b j e c t   e l e m e n t ' s   n e s t e d   p a r a m   e l e m e n t s :   d i s p l a y   a l t e r n a t i v e   c o n t e n t   i n s t e a d   o f   S W F 
                                                                                                                         d i s p l a y A l t C o n t e n t ( o b j ) ; 
                                                                                                                         i f   ( c b )   { c b ( c b O b j ) ; } 
                                                                                                         } 
                                                                                         } 
                                                                         } 
                                                                         e l s e   { 	 / /   i f   n o   F l a s h   P l a y e r   i s   i n s t a l l e d   o r   t h e   f p   v e r s i o n   c a n n o t   b e   d e t e c t e d   w e   l e t   t h e   H T M L   o b j e c t   e l e m e n t   d o   i t s   j o b   ( e i t h e r   s h o w   a   S W F   o r   a l t e r n a t i v e   c o n t e n t ) 
                                                                                         s e t V i s i b i l i t y ( i d ,   t r u e ) ; 
                                                                                         i f   ( c b )   { 
                                                                                                         v a r   o   =   g e t O b j e c t B y I d ( i d ) ;   / /   t e s t   w h e t h e r   t h e r e   i s   a n   H T M L   o b j e c t   e l e m e n t   o r   n o t 
                                                                                                         i f   ( o   & &   t y p e o f   o . S e t V a r i a b l e   ! =   U N D E F )   { 
                                                                                                                         c b O b j . s u c c e s s   =   t r u e ; 
                                                                                                                         c b O b j . r e f   =   o ; 
                                                                                                         } 
                                                                                                         c b ( c b O b j ) ; 
                                                                                         } 
                                                                         } 
                                                         } 
                                         } 
                         } 
 
                         f u n c t i o n   g e t O b j e c t B y I d ( o b j e c t I d S t r )   { 
                                         v a r   r   =   n u l l ; 
                                         v a r   o   =   g e t E l e m e n t B y I d ( o b j e c t I d S t r ) ; 
                                         i f   ( o   & &   o . n o d e N a m e   = =   " O B J E C T " )   { 
                                                         i f   ( t y p e o f   o . S e t V a r i a b l e   ! =   U N D E F )   { 
                                                                         r   =   o ; 
                                                         } 
                                                         e l s e   { 
                                                                         v a r   n   =   o . g e t E l e m e n t s B y T a g N a m e ( O B J E C T ) [ 0 ] ; 
                                                                         i f   ( n )   { 
                                                                                         r   =   n ; 
                                                                         } 
                                                         } 
                                         } 
                                         r e t u r n   r ; 
                         } 
 
                         / *   R e q u i r e m e n t s   f o r   A d o b e   E x p r e s s   I n s t a l l 
                                         -   o n l y   o n e   i n s t a n c e   c a n   b e   a c t i v e   a t   a   t i m e 
                                         -   f p   6 . 0 . 6 5   o r   h i g h e r 
                                         -   W i n / M a c   O S   o n l y 
                                         -   n o   W e b k i t   e n g i n e s   o l d e r   t h a n   v e r s i o n   3 1 2 
                         * / 
                         f u n c t i o n   c a n E x p r e s s I n s t a l l ( )   { 
                                         r e t u r n   ! i s E x p r e s s I n s t a l l A c t i v e   & &   h a s P l a y e r V e r s i o n ( " 6 . 0 . 6 5 " )   & &   ( u a . w i n   | |   u a . m a c )   & &   ! ( u a . w k   & &   u a . w k   <   3 1 2 ) ; 
                         } 
 
                         / *   S h o w   t h e   A d o b e   E x p r e s s   I n s t a l l   d i a l o g 
                                         -   R e f e r e n c e :   h t t p : / / w w w . a d o b e . c o m / c f u s i o n / k n o w l e d g e b a s e / i n d e x . c f m ? i d = 6 a 2 5 3 b 7 5 
                         * / 
                         f u n c t i o n   s h o w E x p r e s s I n s t a l l ( a t t ,   p a r ,   r e p l a c e E l e m I d S t r ,   c a l l b a c k F n )   { 
                                         i s E x p r e s s I n s t a l l A c t i v e   =   t r u e ; 
                                         s t o r e d C a l l b a c k F n   =   c a l l b a c k F n   | |   n u l l ; 
                                         s t o r e d C a l l b a c k O b j   =   { s u c c e s s : f a l s e ,   i d : r e p l a c e E l e m I d S t r } ; 
                                         v a r   o b j   =   g e t E l e m e n t B y I d ( r e p l a c e E l e m I d S t r ) ; 
                                         i f   ( o b j )   { 
                                                         i f   ( o b j . n o d e N a m e   = =   " O B J E C T " )   {   / /   s t a t i c   p u b l i s h i n g 
                                                                         s t o r e d A l t C o n t e n t   =   a b s t r a c t A l t C o n t e n t ( o b j ) ; 
                                                                         s t o r e d A l t C o n t e n t I d   =   n u l l ; 
                                                         } 
                                                         e l s e   {   / /   d y n a m i c   p u b l i s h i n g 
                                                                         s t o r e d A l t C o n t e n t   =   o b j ; 
                                                                         s t o r e d A l t C o n t e n t I d   =   r e p l a c e E l e m I d S t r ; 
                                                         } 
                                                         a t t . i d   =   E X P R E S S _ I N S T A L L _ I D ; 
                                                         i f   ( t y p e o f   a t t . w i d t h   = =   U N D E F   | |   ( ! / % $ / . t e s t ( a t t . w i d t h )   & &   p a r s e I n t ( a t t . w i d t h ,   1 0 )   <   3 1 0 ) )   { a t t . w i d t h   =   " 3 1 0 " ; } 
                                                         i f   ( t y p e o f   a t t . h e i g h t   = =   U N D E F   | |   ( ! / % $ / . t e s t ( a t t . h e i g h t )   & &   p a r s e I n t ( a t t . h e i g h t ,   1 0 )   <   1 3 7 ) )   { a t t . h e i g h t   =   " 1 3 7 " ; } 
                                                         d o c . t i t l e   =   d o c . t i t l e . s l i c e ( 0 ,   4 7 )   +   "   -   F l a s h   P l a y e r   I n s t a l l a t i o n " ; 
                                                         v a r   p t   =   u a . i e   & &   u a . w i n   ?   " A c t i v e X "   :   " P l u g I n " , 
                                                                         f v   =   " M M r e d i r e c t U R L = "   +   w i n . l o c a t i o n . t o S t r i n g ( ) . r e p l a c e ( / & / g , " % 2 6 " )   +   " & M M p l a y e r T y p e = "   +   p t   +   " & M M d o c t i t l e = "   +   d o c . t i t l e ; 
                                                         i f   ( t y p e o f   p a r . f l a s h v a r s   ! =   U N D E F )   { 
                                                                         p a r . f l a s h v a r s   + =   " & "   +   f v ; 
                                                         } 
                                                         e l s e   { 
                                                                         p a r . f l a s h v a r s   =   f v ; 
                                                         } 
                                                         / /   I E   o n l y :   w h e n   a   S W F   i s   l o a d i n g   ( A N D :   n o t   a v a i l a b l e   i n   c a c h e )   w a i t   f o r   t h e   r e a d y S t a t e   o f   t h e   o b j e c t   e l e m e n t   t o   b e c o m e   4   b e f o r e   r e m o v i n g   i t , 
                                                         / /   b e c a u s e   y o u   c a n n o t   p r o p e r l y   c a n c e l   a   l o a d i n g   S W F   f i l e   w i t h o u t   b r e a k i n g   b r o w s e r   l o a d   r e f e r e n c e s ,   a l s o   o b j . o n r e a d y s t a t e c h a n g e   d o e s n ' t   w o r k 
                                                         i f   ( u a . i e   & &   u a . w i n   & &   o b j . r e a d y S t a t e   ! =   4 )   { 
                                                                         v a r   n e w O b j   =   c r e a t e E l e m e n t ( " d i v " ) ; 
                                                                         r e p l a c e E l e m I d S t r   + =   " S W F O b j e c t N e w " ; 
                                                                         n e w O b j . s e t A t t r i b u t e ( " i d " ,   r e p l a c e E l e m I d S t r ) ; 
                                                                         o b j . p a r e n t N o d e . i n s e r t B e f o r e ( n e w O b j ,   o b j ) ;   / /   i n s e r t   p l a c e h o l d e r   d i v   t h a t   w i l l   b e   r e p l a c e d   b y   t h e   o b j e c t   e l e m e n t   t h a t   l o a d s   e x p r e s s i n s t a l l . s w f 
                                                                         o b j . s t y l e . d i s p l a y   =   " n o n e " ; 
                                                                         ( f u n c t i o n ( ) { 
                                                                                         i f   ( o b j . r e a d y S t a t e   = =   4 )   { 
                                                                                                         o b j . p a r e n t N o d e . r e m o v e C h i l d ( o b j ) ; 
                                                                                         } 
                                                                                         e l s e   { 
                                                                                                         s e t T i m e o u t ( a r g u m e n t s . c a l l e e ,   1 0 ) ; 
                                                                                         } 
                                                                         } ) ( ) ; 
                                                         } 
                                                         c r e a t e S W F ( a t t ,   p a r ,   r e p l a c e E l e m I d S t r ) ; 
                                         } 
                         } 
 
                         / *   F u n c t i o n s   t o   a b s t r a c t   a n d   d i s p l a y   a l t e r n a t i v e   c o n t e n t 
                         * / 
                         f u n c t i o n   d i s p l a y A l t C o n t e n t ( o b j )   { 
                                         i f   ( u a . i e   & &   u a . w i n   & &   o b j . r e a d y S t a t e   ! =   4 )   { 
                                                         / /   I E   o n l y :   w h e n   a   S W F   i s   l o a d i n g   ( A N D :   n o t   a v a i l a b l e   i n   c a c h e )   w a i t   f o r   t h e   r e a d y S t a t e   o f   t h e   o b j e c t   e l e m e n t   t o   b e c o m e   4   b e f o r e   r e m o v i n g   i t , 
                                                         / /   b e c a u s e   y o u   c a n n o t   p r o p e r l y   c a n c e l   a   l o a d i n g   S W F   f i l e   w i t h o u t   b r e a k i n g   b r o w s e r   l o a d   r e f e r e n c e s ,   a l s o   o b j . o n r e a d y s t a t e c h a n g e   d o e s n ' t   w o r k 
                                                         v a r   e l   =   c r e a t e E l e m e n t ( " d i v " ) ; 
                                                         o b j . p a r e n t N o d e . i n s e r t B e f o r e ( e l ,   o b j ) ;   / /   i n s e r t   p l a c e h o l d e r   d i v   t h a t   w i l l   b e   r e p l a c e d   b y   t h e   a l t e r n a t i v e   c o n t e n t 
                                                         e l . p a r e n t N o d e . r e p l a c e C h i l d ( a b s t r a c t A l t C o n t e n t ( o b j ) ,   e l ) ; 
                                                         o b j . s t y l e . d i s p l a y   =   " n o n e " ; 
                                                         ( f u n c t i o n ( ) { 
                                                                         i f   ( o b j . r e a d y S t a t e   = =   4 )   { 
                                                                                         o b j . p a r e n t N o d e . r e m o v e C h i l d ( o b j ) ; 
                                                                         } 
                                                                         e l s e   { 
                                                                                         s e t T i m e o u t ( a r g u m e n t s . c a l l e e ,   1 0 ) ; 
                                                                         } 
                                                         } ) ( ) ; 
                                         } 
                                         e l s e   { 
                                                         o b j . p a r e n t N o d e . r e p l a c e C h i l d ( a b s t r a c t A l t C o n t e n t ( o b j ) ,   o b j ) ; 
                                         } 
                         } 
 
                         f u n c t i o n   a b s t r a c t A l t C o n t e n t ( o b j )   { 
                                         v a r   a c   =   c r e a t e E l e m e n t ( " d i v " ) ; 
                                         i f   ( u a . w i n   & &   u a . i e )   { 
                                                         a c . i n n e r H T M L   =   o b j . i n n e r H T M L ; 
                                         } 
                                         e l s e   { 
                                                         v a r   n e s t e d O b j   =   o b j . g e t E l e m e n t s B y T a g N a m e ( O B J E C T ) [ 0 ] ; 
                                                         i f   ( n e s t e d O b j )   { 
                                                                         v a r   c   =   n e s t e d O b j . c h i l d N o d e s ; 
                                                                         i f   ( c )   { 
                                                                                         v a r   c l   =   c . l e n g t h ; 
                                                                                         f o r   ( v a r   i   =   0 ;   i   <   c l ;   i + + )   { 
                                                                                                         i f   ( ! ( c [ i ] . n o d e T y p e   = =   1   & &   c [ i ] . n o d e N a m e   = =   " P A R A M " )   & &   ! ( c [ i ] . n o d e T y p e   = =   8 ) )   { 
                                                                                                                         a c . a p p e n d C h i l d ( c [ i ] . c l o n e N o d e ( t r u e ) ) ; 
                                                                                                         } 
                                                                                         } 
                                                                         } 
                                                         } 
                                         } 
                                         r e t u r n   a c ; 
                         } 
 
                         / *   C r o s s - b r o w s e r   d y n a m i c   S W F   c r e a t i o n 
                         * / 
                         f u n c t i o n   c r e a t e S W F ( a t t O b j ,   p a r O b j ,   i d )   { 
                                         v a r   r ,   e l   =   g e t E l e m e n t B y I d ( i d ) ; 
                                         i f   ( u a . w k   & &   u a . w k   <   3 1 2 )   { r e t u r n   r ; } 
                                         i f   ( e l )   { 
                                                         i f   ( t y p e o f   a t t O b j . i d   = =   U N D E F )   {   / /   i f   n o   ' i d '   i s   d e f i n e d   f o r   t h e   o b j e c t   e l e m e n t ,   i t   w i l l   i n h e r i t   t h e   ' i d '   f r o m   t h e   a l t e r n a t i v e   c o n t e n t 
                                                                         a t t O b j . i d   =   i d ; 
                                                         } 
                                                         i f   ( u a . i e   & &   u a . w i n )   {   / /   I n t e r n e t   E x p l o r e r   +   t h e   H T M L   o b j e c t   e l e m e n t   +   W 3 C   D O M   m e t h o d s   d o   n o t   c o m b i n e :   f a l l   b a c k   t o   o u t e r H T M L 
                                                                         v a r   a t t   =   " " ; 
                                                                         f o r   ( v a r   i   i n   a t t O b j )   { 
                                                                                         i f   ( a t t O b j [ i ]   ! =   O b j e c t . p r o t o t y p e [ i ] )   {   / /   f i l t e r   o u t   p r o t o t y p e   a d d i t i o n s   f r o m   o t h e r   p o t e n t i a l   l i b r a r i e s 
                                                                                                         i f   ( i . t o L o w e r C a s e ( )   = =   " d a t a " )   { 
                                                                                                                         p a r O b j . m o v i e   =   a t t O b j [ i ] ; 
                                                                                                         } 
                                                                                                         e l s e   i f   ( i . t o L o w e r C a s e ( )   = =   " s t y l e c l a s s " )   {   / /   ' c l a s s '   i s   a n   E C M A 4   r e s e r v e d   k e y w o r d 
                                                                                                                         a t t   + =   '   c l a s s = " '   +   a t t O b j [ i ]   +   ' " ' ; 
                                                                                                         } 
                                                                                                         e l s e   i f   ( i . t o L o w e r C a s e ( )   ! =   " c l a s s i d " )   { 
                                                                                                                         a t t   + =   '   '   +   i   +   ' = " '   +   a t t O b j [ i ]   +   ' " ' ; 
                                                                                                         } 
                                                                                         } 
                                                                         } 
                                                                         v a r   p a r   =   " " ; 
                                                                         f o r   ( v a r   j   i n   p a r O b j )   { 
                                                                                         i f   ( p a r O b j [ j ]   ! =   O b j e c t . p r o t o t y p e [ j ] )   {   / /   f i l t e r   o u t   p r o t o t y p e   a d d i t i o n s   f r o m   o t h e r   p o t e n t i a l   l i b r a r i e s 
                                                                                                         p a r   + =   ' < p a r a m   n a m e = " '   +   j   +   ' "   v a l u e = " '   +   p a r O b j [ j ]   +   ' "   / > ' ; 
                                                                                         } 
                                                                         } 
                                                                         e l . o u t e r H T M L   =   ' < o b j e c t   c l a s s i d = " c l s i d : D 2 7 C D B 6 E - A E 6 D - 1 1 c f - 9 6 B 8 - 4 4 4 5 5 3 5 4 0 0 0 0 " '   +   a t t   +   ' > '   +   p a r   +   ' < / o b j e c t > ' ; 
                                                                         o b j I d A r r [ o b j I d A r r . l e n g t h ]   =   a t t O b j . i d ;   / /   s t o r e d   t o   f i x   o b j e c t   ' l e a k s '   o n   u n l o a d   ( d y n a m i c   p u b l i s h i n g   o n l y ) 
                                                                         r   =   g e t E l e m e n t B y I d ( a t t O b j . i d ) ; 
                                                         } 
                                                         e l s e   {   / /   w e l l - b e h a v i n g   b r o w s e r s 
                                                                         v a r   o   =   c r e a t e E l e m e n t ( O B J E C T ) ; 
                                                                         o . s e t A t t r i b u t e ( " t y p e " ,   F L A S H _ M I M E _ T Y P E ) ; 
                                                                         f o r   ( v a r   m   i n   a t t O b j )   { 
                                                                                         i f   ( a t t O b j [ m ]   ! =   O b j e c t . p r o t o t y p e [ m ] )   {   / /   f i l t e r   o u t   p r o t o t y p e   a d d i t i o n s   f r o m   o t h e r   p o t e n t i a l   l i b r a r i e s 
                                                                                                         i f   ( m . t o L o w e r C a s e ( )   = =   " s t y l e c l a s s " )   {   / /   ' c l a s s '   i s   a n   E C M A 4   r e s e r v e d   k e y w o r d 
                                                                                                                         o . s e t A t t r i b u t e ( " c l a s s " ,   a t t O b j [ m ] ) ; 
                                                                                                         } 
                                                                                                         e l s e   i f   ( m . t o L o w e r C a s e ( )   ! =   " c l a s s i d " )   {   / /   f i l t e r   o u t   I E   s p e c i f i c   a t t r i b u t e 
                                                                                                                         o . s e t A t t r i b u t e ( m ,   a t t O b j [ m ] ) ; 
                                                                                                         } 
                                                                                         } 
                                                                         } 
                                                                         f o r   ( v a r   n   i n   p a r O b j )   { 
                                                                                         i f   ( p a r O b j [ n ]   ! =   O b j e c t . p r o t o t y p e [ n ]   & &   n . t o L o w e r C a s e ( )   ! =   " m o v i e " )   {   / /   f i l t e r   o u t   p r o t o t y p e   a d d i t i o n s   f r o m   o t h e r   p o t e n t i a l   l i b r a r i e s   a n d   I E   s p e c i f i c   p a r a m   e l e m e n t 
                                                                                                         c r e a t e O b j P a r a m ( o ,   n ,   p a r O b j [ n ] ) ; 
                                                                                         } 
                                                                         } 
                                                                         e l . p a r e n t N o d e . r e p l a c e C h i l d ( o ,   e l ) ; 
                                                                         r   =   o ; 
                                                         } 
                                         } 
                                         r e t u r n   r ; 
                         } 
 
                         f u n c t i o n   c r e a t e O b j P a r a m ( e l ,   p N a m e ,   p V a l u e )   { 
                                         v a r   p   =   c r e a t e E l e m e n t ( " p a r a m " ) ; 
                                         p . s e t A t t r i b u t e ( " n a m e " ,   p N a m e ) ; 
                                         p . s e t A t t r i b u t e ( " v a l u e " ,   p V a l u e ) ; 
                                         e l . a p p e n d C h i l d ( p ) ; 
                         } 
 
                         / *   C r o s s - b r o w s e r   S W F   r e m o v a l 
                                         -   E s p e c i a l l y   n e e d e d   t o   s a f e l y   a n d   c o m p l e t e l y   r e m o v e   a   S W F   i n   I n t e r n e t   E x p l o r e r 
                         * / 
                         f u n c t i o n   r e m o v e S W F ( i d )   { 
                                         v a r   o b j   =   g e t E l e m e n t B y I d ( i d ) ; 
                                         i f   ( o b j   & &   o b j . n o d e N a m e   = =   " O B J E C T " )   { 
                                                         i f   ( u a . i e   & &   u a . w i n )   { 
                                                                         o b j . s t y l e . d i s p l a y   =   " n o n e " ; 
                                                                         ( f u n c t i o n ( ) { 
                                                                                         i f   ( o b j . r e a d y S t a t e   = =   4 )   { 
                                                                                                         r e m o v e O b j e c t I n I E ( i d ) ; 
                                                                                         } 
                                                                                         e l s e   { 
                                                                                                         s e t T i m e o u t ( a r g u m e n t s . c a l l e e ,   1 0 ) ; 
                                                                                         } 
                                                                         } ) ( ) ; 
                                                         } 
                                                         e l s e   { 
                                                                         o b j . p a r e n t N o d e . r e m o v e C h i l d ( o b j ) ; 
                                                         } 
                                         } 
                         } 
 
                         f u n c t i o n   r e m o v e O b j e c t I n I E ( i d )   { 
                                         v a r   o b j   =   g e t E l e m e n t B y I d ( i d ) ; 
                                         i f   ( o b j )   { 
                                                         f o r   ( v a r   i   i n   o b j )   { 
                                                                         i f   ( t y p e o f   o b j [ i ]   = =   " f u n c t i o n " )   { 
                                                                                         o b j [ i ]   =   n u l l ; 
                                                                         } 
                                                         } 
                                                         o b j . p a r e n t N o d e . r e m o v e C h i l d ( o b j ) ; 
                                         } 
                         } 
 
                         / *   F u n c t i o n s   t o   o p t i m i z e   J a v a S c r i p t   c o m p r e s s i o n 
                         * / 
                         f u n c t i o n   g e t E l e m e n t B y I d ( i d )   { 
                                         v a r   e l   =   n u l l ; 
                                         t r y   { 
                                                         e l   =   d o c . g e t E l e m e n t B y I d ( i d ) ; 
                                         } 
                                         c a t c h   ( e )   { } 
                                         r e t u r n   e l ; 
                         } 
 
                         f u n c t i o n   c r e a t e E l e m e n t ( e l )   { 
                                         r e t u r n   d o c . c r e a t e E l e m e n t ( e l ) ; 
                         } 
 
                         / *   U p d a t e d   a t t a c h E v e n t   f u n c t i o n   f o r   I n t e r n e t   E x p l o r e r 
                                         -   S t o r e s   a t t a c h E v e n t   i n f o r m a t i o n   i n   a n   A r r a y ,   s o   o n   u n l o a d   t h e   d e t a c h E v e n t   f u n c t i o n s   c a n   b e   c a l l e d   t o   a v o i d   m e m o r y   l e a k s 
                         * / 
                         f u n c t i o n   a d d L i s t e n e r ( t a r g e t ,   e v e n t T y p e ,   f n )   { 
                                         t a r g e t . a t t a c h E v e n t ( e v e n t T y p e ,   f n ) ; 
                                         l i s t e n e r s A r r [ l i s t e n e r s A r r . l e n g t h ]   =   [ t a r g e t ,   e v e n t T y p e ,   f n ] ; 
                         } 
 
                         / *   F l a s h   P l a y e r   a n d   S W F   c o n t e n t   v e r s i o n   m a t c h i n g 
                         * / 
                         f u n c t i o n   h a s P l a y e r V e r s i o n ( r v )   { 
                                         v a r   p v   =   u a . p v ,   v   =   r v . s p l i t ( " . " ) ; 
                                         v [ 0 ]   =   p a r s e I n t ( v [ 0 ] ,   1 0 ) ; 
                                         v [ 1 ]   =   p a r s e I n t ( v [ 1 ] ,   1 0 )   | |   0 ;   / /   s u p p o r t s   s h o r t   n o t a t i o n ,   e . g .   " 9 "   i n s t e a d   o f   " 9 . 0 . 0 " 
                                         v [ 2 ]   =   p a r s e I n t ( v [ 2 ] ,   1 0 )   | |   0 ; 
                                         r e t u r n   ( p v [ 0 ]   >   v [ 0 ]   | |   ( p v [ 0 ]   = =   v [ 0 ]   & &   p v [ 1 ]   >   v [ 1 ] )   | |   ( p v [ 0 ]   = =   v [ 0 ]   & &   p v [ 1 ]   = =   v [ 1 ]   & &   p v [ 2 ]   > =   v [ 2 ] ) )   ?   t r u e   :   f a l s e ; 
                         } 
 
                         / *   C r o s s - b r o w s e r   d y n a m i c   C S S   c r e a t i o n 
                                         -   B a s e d   o n   B o b b y   v a n   d e r   S l u i s '   s o l u t i o n :   h t t p : / / w w w . b o b b y v a n d e r s l u i s . c o m / a r t i c l e s / d y n a m i c C S S . p h p 
                         * / 
                         f u n c t i o n   c r e a t e C S S ( s e l ,   d e c l ,   m e d i a ,   n e w S t y l e )   { 
                                         i f   ( u a . i e   & &   u a . m a c )   { r e t u r n ; } 
                                         v a r   h   =   d o c . g e t E l e m e n t s B y T a g N a m e ( " h e a d " ) [ 0 ] ; 
                                         i f   ( ! h )   { r e t u r n ; }   / /   t o   a l s o   s u p p o r t   b a d l y   a u t h o r e d   H T M L   p a g e s   t h a t   l a c k   a   h e a d   e l e m e n t 
                                         v a r   m   =   ( m e d i a   & &   t y p e o f   m e d i a   = =   " s t r i n g " )   ?   m e d i a   :   " s c r e e n " ; 
                                         i f   ( n e w S t y l e )   { 
                                                         d y n a m i c S t y l e s h e e t   =   n u l l ; 
                                                         d y n a m i c S t y l e s h e e t M e d i a   =   n u l l ; 
                                         } 
                                         i f   ( ! d y n a m i c S t y l e s h e e t   | |   d y n a m i c S t y l e s h e e t M e d i a   ! =   m )   { 
                                                         / /   c r e a t e   d y n a m i c   s t y l e s h e e t   +   g e t   a   g l o b a l   r e f e r e n c e   t o   i t 
                                                         v a r   s   =   c r e a t e E l e m e n t ( " s t y l e " ) ; 
                                                         s . s e t A t t r i b u t e ( " t y p e " ,   " t e x t / c s s " ) ; 
                                                         s . s e t A t t r i b u t e ( " m e d i a " ,   m ) ; 
                                                         d y n a m i c S t y l e s h e e t   =   h . a p p e n d C h i l d ( s ) ; 
                                                         i f   ( u a . i e   & &   u a . w i n   & &   t y p e o f   d o c . s t y l e S h e e t s   ! =   U N D E F   & &   d o c . s t y l e S h e e t s . l e n g t h   >   0 )   { 
                                                                         d y n a m i c S t y l e s h e e t   =   d o c . s t y l e S h e e t s [ d o c . s t y l e S h e e t s . l e n g t h   -   1 ] ; 
                                                         } 
                                                         d y n a m i c S t y l e s h e e t M e d i a   =   m ; 
                                         } 
                                         / /   a d d   s t y l e   r u l e 
                                         i f   ( u a . i e   & &   u a . w i n )   { 
                                                         i f   ( d y n a m i c S t y l e s h e e t   & &   t y p e o f   d y n a m i c S t y l e s h e e t . a d d R u l e   = =   O B J E C T )   { 
                                                                         d y n a m i c S t y l e s h e e t . a d d R u l e ( s e l ,   d e c l ) ; 
                                                         } 
                                         } 
                                         e l s e   { 
                                                         i f   ( d y n a m i c S t y l e s h e e t   & &   t y p e o f   d o c . c r e a t e T e x t N o d e   ! =   U N D E F )   { 
                                                                         d y n a m i c S t y l e s h e e t . a p p e n d C h i l d ( d o c . c r e a t e T e x t N o d e ( s e l   +   "   { "   +   d e c l   +   " } " ) ) ; 
                                                         } 
                                         } 
                         } 
 
                         f u n c t i o n   s e t V i s i b i l i t y ( i d ,   i s V i s i b l e )   { 
                                         i f   ( ! a u t o H i d e S h o w )   { r e t u r n ; } 
                                         v a r   v   =   i s V i s i b l e   ?   " v i s i b l e "   :   " h i d d e n " ; 
                                         i f   ( i s D o m L o a d e d   & &   g e t E l e m e n t B y I d ( i d ) )   { 
                                                         g e t E l e m e n t B y I d ( i d ) . s t y l e . v i s i b i l i t y   =   v ; 
                                         } 
                                         e l s e   { 
                                                         c r e a t e C S S ( " # "   +   i d ,   " v i s i b i l i t y : "   +   v ) ; 
                                         } 
                         } 
 
                         / *   F i l t e r   t o   a v o i d   X S S   a t t a c k s 
                         * / 
                         f u n c t i o n   u r l E n c o d e I f N e c e s s a r y ( s )   { 
                                         v a r   r e g e x   =   / [ \ \ \ " < > \ . ; ] / ; 
                                         v a r   h a s B a d C h a r s   =   r e g e x . e x e c ( s )   ! =   n u l l ; 
                                         r e t u r n   h a s B a d C h a r s   & &   t y p e o f   e n c o d e U R I C o m p o n e n t   ! =   U N D E F   ?   e n c o d e U R I C o m p o n e n t ( s )   :   s ; 
                         } 
 
                         / *   R e l e a s e   m e m o r y   t o   a v o i d   m e m o r y   l e a k s   c a u s e d   b y   c l o s u r e s ,   f i x   h a n g i n g   a u d i o / v i d e o   t h r e a d s   a n d   f o r c e   o p e n   s o c k e t s / N e t C o n n e c t i o n s   t o   d i s c o n n e c t   ( I n t e r n e t   E x p l o r e r   o n l y ) 
                         * / 
                         v a r   c l e a n u p   =   f u n c t i o n ( )   { 
                                         i f   ( u a . i e   & &   u a . w i n )   { 
                                                         w i n d o w . a t t a c h E v e n t ( " o n u n l o a d " ,   f u n c t i o n ( )   { 
                                                                         / /   r e m o v e   l i s t e n e r s   t o   a v o i d   m e m o r y   l e a k s 
                                                                         v a r   l l   =   l i s t e n e r s A r r . l e n g t h ; 
                                                                         f o r   ( v a r   i   =   0 ;   i   <   l l ;   i + + )   { 
                                                                                         l i s t e n e r s A r r [ i ] [ 0 ] . d e t a c h E v e n t ( l i s t e n e r s A r r [ i ] [ 1 ] ,   l i s t e n e r s A r r [ i ] [ 2 ] ) ; 
                                                                         } 
                                                                         / /   c l e a n u p   d y n a m i c a l l y   e m b e d d e d   o b j e c t s   t o   f i x   a u d i o / v i d e o   t h r e a d s   a n d   f o r c e   o p e n   s o c k e t s   a n d   N e t C o n n e c t i o n s   t o   d i s c o n n e c t 
                                                                         v a r   i l   =   o b j I d A r r . l e n g t h ; 
                                                                         f o r   ( v a r   j   =   0 ;   j   <   i l ;   j + + )   { 
                                                                                         r e m o v e S W F ( o b j I d A r r [ j ] ) ; 
                                                                         } 
                                                                         / /   c l e a n u p   l i b r a r y ' s   m a i n   c l o s u r e s   t o   a v o i d   m e m o r y   l e a k s 
                                                                         f o r   ( v a r   k   i n   u a )   { 
                                                                                         u a [ k ]   =   n u l l ; 
                                                                         } 
                                                                         u a   =   n u l l ; 
                                                                         f o r   ( v a r   l   i n   s w f o b j e c t )   { 
                                                                                         s w f o b j e c t [ l ]   =   n u l l ; 
                                                                         } 
                                                                         s w f o b j e c t   =   n u l l ; 
                                                         } ) ; 
                                         } 
                         } ( ) ; 
 
                         r e t u r n   { 
                                         / *   P u b l i c   A P I 
                                                         -   R e f e r e n c e :   h t t p : / / c o d e . g o o g l e . c o m / p / s w f o b j e c t / w i k i / d o c u m e n t a t i o n 
                                         * / 
                                         r e g i s t e r O b j e c t :   f u n c t i o n ( o b j e c t I d S t r ,   s w f V e r s i o n S t r ,   x i S w f U r l S t r ,   c a l l b a c k F n )   { 
                                                         i f   ( u a . w 3   & &   o b j e c t I d S t r   & &   s w f V e r s i o n S t r )   { 
                                                                         v a r   r e g O b j   =   { } ; 
                                                                         r e g O b j . i d   =   o b j e c t I d S t r ; 
                                                                         r e g O b j . s w f V e r s i o n   =   s w f V e r s i o n S t r ; 
                                                                         r e g O b j . e x p r e s s I n s t a l l   =   x i S w f U r l S t r ; 
                                                                         r e g O b j . c a l l b a c k F n   =   c a l l b a c k F n ; 
                                                                         r e g O b j A r r [ r e g O b j A r r . l e n g t h ]   =   r e g O b j ; 
                                                                         s e t V i s i b i l i t y ( o b j e c t I d S t r ,   f a l s e ) ; 
                                                         } 
                                                         e l s e   i f   ( c a l l b a c k F n )   { 
                                                                         c a l l b a c k F n ( { s u c c e s s : f a l s e ,   i d : o b j e c t I d S t r } ) ; 
                                                         } 
                                         } , 
 
                                         g e t O b j e c t B y I d :   f u n c t i o n ( o b j e c t I d S t r )   { 
                                                         i f   ( u a . w 3 )   { 
                                                                         r e t u r n   g e t O b j e c t B y I d ( o b j e c t I d S t r ) ; 
                                                         } 
                                         } , 
 
                                         e m b e d S W F :   f u n c t i o n ( s w f U r l S t r ,   r e p l a c e E l e m I d S t r ,   w i d t h S t r ,   h e i g h t S t r ,   s w f V e r s i o n S t r ,   x i S w f U r l S t r ,   f l a s h v a r s O b j ,   p a r O b j ,   a t t O b j ,   c a l l b a c k F n )   { 
                                                         v a r   c a l l b a c k O b j   =   { s u c c e s s : f a l s e ,   i d : r e p l a c e E l e m I d S t r } ; 
                                                         i f   ( u a . w 3   & &   ! ( u a . w k   & &   u a . w k   <   3 1 2 )   & &   s w f U r l S t r   & &   r e p l a c e E l e m I d S t r   & &   w i d t h S t r   & &   h e i g h t S t r   & &   s w f V e r s i o n S t r )   { 
                                                                         s e t V i s i b i l i t y ( r e p l a c e E l e m I d S t r ,   f a l s e ) ; 
                                                                         a d d D o m L o a d E v e n t ( f u n c t i o n ( )   { 
                                                                                         w i d t h S t r   + =   " " ;   / /   a u t o - c o n v e r t   t o   s t r i n g 
                                                                                         h e i g h t S t r   + =   " " ; 
                                                                                         v a r   a t t   =   { } ; 
                                                                                         i f   ( a t t O b j   & &   t y p e o f   a t t O b j   = = =   O B J E C T )   { 
                                                                                                         f o r   ( v a r   i   i n   a t t O b j )   {   / /   c o p y   o b j e c t   t o   a v o i d   t h e   u s e   o f   r e f e r e n c e s ,   b e c a u s e   w e b   a u t h o r s   o f t e n   r e u s e   a t t O b j   f o r   m u l t i p l e   S W F s 
                                                                                                                         a t t [ i ]   =   a t t O b j [ i ] ; 
                                                                                                         } 
                                                                                         } 
                                                                                         a t t . d a t a   =   s w f U r l S t r ; 
                                                                                         a t t . w i d t h   =   w i d t h S t r ; 
                                                                                         a t t . h e i g h t   =   h e i g h t S t r ; 
                                                                                         v a r   p a r   =   { } ; 
                                                                                         i f   ( p a r O b j   & &   t y p e o f   p a r O b j   = = =   O B J E C T )   { 
                                                                                                         f o r   ( v a r   j   i n   p a r O b j )   {   / /   c o p y   o b j e c t   t o   a v o i d   t h e   u s e   o f   r e f e r e n c e s ,   b e c a u s e   w e b   a u t h o r s   o f t e n   r e u s e   p a r O b j   f o r   m u l t i p l e   S W F s 
                                                                                                                         p a r [ j ]   =   p a r O b j [ j ] ; 
                                                                                                         } 
                                                                                         } 
                                                                                         i f   ( f l a s h v a r s O b j   & &   t y p e o f   f l a s h v a r s O b j   = = =   O B J E C T )   { 
                                                                                                         f o r   ( v a r   k   i n   f l a s h v a r s O b j )   {   / /   c o p y   o b j e c t   t o   a v o i d   t h e   u s e   o f   r e f e r e n c e s ,   b e c a u s e   w e b   a u t h o r s   o f t e n   r e u s e   f l a s h v a r s O b j   f o r   m u l t i p l e   S W F s 
                                                                                                                         i f   ( t y p e o f   p a r . f l a s h v a r s   ! =   U N D E F )   { 
                                                                                                                                         p a r . f l a s h v a r s   + =   " & "   +   k   +   " = "   +   f l a s h v a r s O b j [ k ] ; 
                                                                                                                         } 
                                                                                                                         e l s e   { 
                                                                                                                                         p a r . f l a s h v a r s   =   k   +   " = "   +   f l a s h v a r s O b j [ k ] ; 
                                                                                                                         } 
                                                                                                         } 
                                                                                         } 
                                                                                         i f   ( h a s P l a y e r V e r s i o n ( s w f V e r s i o n S t r ) )   {   / /   c r e a t e   S W F 
                                                                                                         v a r   o b j   =   c r e a t e S W F ( a t t ,   p a r ,   r e p l a c e E l e m I d S t r ) ; 
                                                                                                         i f   ( a t t . i d   = =   r e p l a c e E l e m I d S t r )   { 
                                                                                                                         s e t V i s i b i l i t y ( r e p l a c e E l e m I d S t r ,   t r u e ) ; 
                                                                                                         } 
                                                                                                         c a l l b a c k O b j . s u c c e s s   =   t r u e ; 
                                                                                                         c a l l b a c k O b j . r e f   =   o b j ; 
                                                                                         } 
                                                                                         e l s e   i f   ( x i S w f U r l S t r   & &   c a n E x p r e s s I n s t a l l ( ) )   {   / /   s h o w   A d o b e   E x p r e s s   I n s t a l l 
                                                                                                         a t t . d a t a   =   x i S w f U r l S t r ; 
                                                                                                         s h o w E x p r e s s I n s t a l l ( a t t ,   p a r ,   r e p l a c e E l e m I d S t r ,   c a l l b a c k F n ) ; 
                                                                                                         r e t u r n ; 
                                                                                         } 
                                                                                         e l s e   {   / /   s h o w   a l t e r n a t i v e   c o n t e n t 
                                                                                                         s e t V i s i b i l i t y ( r e p l a c e E l e m I d S t r ,   t r u e ) ; 
                                                                                         } 
                                                                                         i f   ( c a l l b a c k F n )   { c a l l b a c k F n ( c a l l b a c k O b j ) ; } 
                                                                         } ) ; 
                                                         } 
                                                         e l s e   i f   ( c a l l b a c k F n )   { c a l l b a c k F n ( c a l l b a c k O b j ) ; } 
                                         } , 
 
                                         s w i t c h O f f A u t o H i d e S h o w :   f u n c t i o n ( )   { 
                                                         a u t o H i d e S h o w   =   f a l s e ; 
                                         } , 
 
                                         u a :   u a , 
 
                                         g e t F l a s h P l a y e r V e r s i o n :   f u n c t i o n ( )   { 
                                                         r e t u r n   { m a j o r : u a . p v [ 0 ] ,   m i n o r : u a . p v [ 1 ] ,   r e l e a s e : u a . p v [ 2 ] } ; 
                                         } , 
 
                                         h a s F l a s h P l a y e r V e r s i o n :   h a s P l a y e r V e r s i o n , 
 
                                         c r e a t e S W F :   f u n c t i o n ( a t t O b j ,   p a r O b j ,   r e p l a c e E l e m I d S t r )   { 
                                                         i f   ( u a . w 3 )   { 
                                                                         r e t u r n   c r e a t e S W F ( a t t O b j ,   p a r O b j ,   r e p l a c e E l e m I d S t r ) ; 
                                                         } 
                                                         e l s e   { 
                                                                         r e t u r n   u n d e f i n e d ; 
                                                         } 
                                         } , 
 
                                         s h o w E x p r e s s I n s t a l l :   f u n c t i o n ( a t t ,   p a r ,   r e p l a c e E l e m I d S t r ,   c a l l b a c k F n )   { 
                                                         i f   ( u a . w 3   & &   c a n E x p r e s s I n s t a l l ( ) )   { 
                                                                         s h o w E x p r e s s I n s t a l l ( a t t ,   p a r ,   r e p l a c e E l e m I d S t r ,   c a l l b a c k F n ) ; 
                                                         } 
                                         } , 
 
                                         r e m o v e S W F :   f u n c t i o n ( o b j E l e m I d S t r )   { 
                                                         i f   ( u a . w 3 )   { 
                                                                         r e m o v e S W F ( o b j E l e m I d S t r ) ; 
                                                         } 
                                         } , 
 
                                         c r e a t e C S S :   f u n c t i o n ( s e l S t r ,   d e c l S t r ,   m e d i a S t r ,   n e w S t y l e B o o l e a n )   { 
                                                         i f   ( u a . w 3 )   { 
                                                                         c r e a t e C S S ( s e l S t r ,   d e c l S t r ,   m e d i a S t r ,   n e w S t y l e B o o l e a n ) ; 
                                                         } 
                                         } , 
 
                                         a d d D o m L o a d E v e n t :   a d d D o m L o a d E v e n t , 
 
                                         a d d L o a d E v e n t :   a d d L o a d E v e n t , 
 
                                         g e t Q u e r y P a r a m V a l u e :   f u n c t i o n ( p a r a m )   { 
                                                         v a r   q   =   d o c . l o c a t i o n . s e a r c h   | |   d o c . l o c a t i o n . h a s h ; 
                                                         i f   ( q )   { 
                                                                         i f   ( / \ ? / . t e s t ( q ) )   { q   =   q . s p l i t ( " ? " ) [ 1 ] ; }   / /   s t r i p   q u e s t i o n   m a r k 
                                                                         i f   ( p a r a m   = =   n u l l )   { 
                                                                                         r e t u r n   u r l E n c o d e I f N e c e s s a r y ( q ) ; 
                                                                         } 
                                                                         v a r   p a i r s   =   q . s p l i t ( " & " ) ; 
                                                                         f o r   ( v a r   i   =   0 ;   i   <   p a i r s . l e n g t h ;   i + + )   { 
                                                                                         i f   ( p a i r s [ i ] . s u b s t r i n g ( 0 ,   p a i r s [ i ] . i n d e x O f ( " = " ) )   = =   p a r a m )   { 
                                                                                                         r e t u r n   u r l E n c o d e I f N e c e s s a r y ( p a i r s [ i ] . s u b s t r i n g ( ( p a i r s [ i ] . i n d e x O f ( " = " )   +   1 ) ) ) ; 
                                                                                         } 
                                                                         } 
                                                         } 
                                                         r e t u r n   " " ; 
                                         } , 
 
                                         / /   F o r   i n t e r n a l   u s a g e   o n l y 
                                         e x p r e s s I n s t a l l C a l l b a c k :   f u n c t i o n ( )   { 
                                                         i f   ( i s E x p r e s s I n s t a l l A c t i v e )   { 
                                                                         v a r   o b j   =   g e t E l e m e n t B y I d ( E X P R E S S _ I N S T A L L _ I D ) ; 
                                                                         i f   ( o b j   & &   s t o r e d A l t C o n t e n t )   { 
                                                                                         o b j . p a r e n t N o d e . r e p l a c e C h i l d ( s t o r e d A l t C o n t e n t ,   o b j ) ; 
                                                                                         i f   ( s t o r e d A l t C o n t e n t I d )   { 
                                                                                                         s e t V i s i b i l i t y ( s t o r e d A l t C o n t e n t I d ,   t r u e ) ; 
                                                                                                         i f   ( u a . i e   & &   u a . w i n )   { s t o r e d A l t C o n t e n t . s t y l e . d i s p l a y   =   " b l o c k " ; } 
                                                                                         } 
                                                                                         i f   ( s t o r e d C a l l b a c k F n )   { s t o r e d C a l l b a c k F n ( s t o r e d C a l l b a c k O b j ) ; } 
                                                                         } 
                                                                         i s E x p r e s s I n s t a l l A c t i v e   =   f a l s e ; 
                                                         } 
                                         } 
                         } ; 
         } ( ) ; 
 
 
         / /   S e t   f l a g s   f o r   m i n i m u m   v e r s i o n   o f   f l a s h - p l a y e r   n e e d e d . 
         g l o b a l . c o r e . o p t i o n s . r e q u i r e d F l a s h P l a y e r V e r s i o n   =   ' 8 ' ; 
         / /   M e s s a g e   t o   s h o w   u p o n   a u t o   i n s t a l l   r e d i r e c t . 
         g l o b a l . c o r e . o p t i o n s . i n s t a l l R e d i r e c t M e s s a g e   =   ' Y o u   n e e d   A d o b e   F l a s h   '   + 
                 ' P l a y e r   8   ( o r   a b o v e )   t o   v i e w   t h e   c h a r t s   o n   t h i s   p a g e .   I t   i s   a   f r e e ,   '   + 
                 ' l i g h t w e i g h t   a n d   s a f e   i n s t a l l a t i o n   f r o m   A d o b e   S y s t e m s   I n c o r p o r a t e d . '   + 
                 ' \ n \ n W o u l d   y o u   l i k e   t o   g o   t o   A d o b e \ ' s   w e b s i t e   a n d   i n s t a l l   F l a s h   P l a y e r ? ' ; 
 
         v a r   n o F l a s h R e d i r e c t N o t i f i e d   =   f a l s e ; 
 
         / /   T o   a v o i d   X S S   a t t a c k s ,   w e   U R L E n c o d e   F l a s h V a r s . 
         v a r   c h e c k B a d C h a r s   =   / [ \ \ \ " < > ; ] / ; 
         v a r   u r l E n c o d e I f N e c e s s a r y   =   f u n c t i o n   ( s )   { 
                 r e t u r n   ( c h e c k B a d C h a r s . e x e c ( s )   ! = =   n u l l )   & & 
                         t y p e o f   w i n d o w . e n c o d e U R I C o m p o n e n t   ! = =   u n d e f i n e d   ? 
                         w i n d o w . e n c o d e U R I C o m p o n e n t ( s )   :   s ; 
         } ; 
 
                 / * * 
           *   E v e n t   l i s t e n e r   t h a t   u p d a t e s   l o c a l   c h a r t   d a t a   w h e n   t h e r e   h a s 
           *   b e e n   a   r e m o t e   d a t a   u p d a t e   o n   r e n d e r e r . 
           * / 
         v a r   s y n c D a t a S t o r e   =     f u n c t i o n   ( e ,   a )   { 
 
                 / /   V e r i f y   w h e t h e r   t h e   e v e n t   h a s   b e e n   r a i s e d   b y   J S   o r   b y   F l a s h . 
                 / /   I f   e v e n t   h a s   b e e n   r a i s e d   b y   J S ,   w e   d o   n o t   n e e d   t o   d o 
                 / /   a n y t h i n g   f u r t h e r . 
 
                 i f   ( a   & &   a . s o u r c e   = = =   ' X m l H t t p R e q u e s t ' )   { 
                         r e t u r n ; 
                 } 
 
                 / /   R e f e r e n c e   t o   c h a r t O b j . 
                 v a r   o b j   =   e . s e n d e r ; 
 
                 / /   T e s t   w h e t h e r   t h e   r e q u i r e d   f u n c t i o n s   a r e   a v a i l a b l e . 
                 i f   ( o b j . r e f   & &   t y p e o f   o b j . r e f . d a t a I n v o k e d O n S W F   = = =   ' f u n c t i o n '   & & 
                         o b j . r e f . d a t a I n v o k e d O n S W F ( )   & &   t y p e o f   o b j . r e f . g e t X M L   = = =   ' f u n c t i o n ' )   { 
 
                         / /   R a i s e   a   w a r n i n g   f o r   t h e   s a m e . 
                         g l o b a l . r a i s e W a r n i n g ( o b j ,   ' 0 8 3 0 0 1 1 6 ' ,   ' r u n ' , 
                                 ' : : D a t a H a n d l e r ~ _ _ f u s i o n c h a r t s _ v a r s ' , 
                                 ' D a t a   w a s   s e t   i n   U T F   u n s a f e   m a n n e r ' ) ; 
 
                         / /   S i l e n t l y   u p d a t e / s y n c   t h e   i n t e r n a l   d a t a   o f   F u s i o n C h a r t s   J S 
                         / /   o b j e c t s   w i t h   t h e   n e w   d a t a   t h a t   w a s   d i r e c t l y   s e n t   t o   f l a s h . 
                         o b j . s e t C h a r t D a t a ( w i n d o w . u n e s c a p e ( e . s e n d e r . r e f . g e t X M L ( { 
                                 e s c a p e d :   t r u e 
                         } ) ) ,   F u s i o n C h a r t s D a t a F o r m a t s . X M L ,   t r u e ) ; 
 
                         / /   U p d a t e   t h e   f l a s h V a r s   a s   w e l l . 
                         o b j . f l a s h V a r s . d a t a X M L   =   o b j . g e t C h a r t D a t a ( F u s i o n C h a r t s D a t a F o r m a t s . X M L ) ; 
 
                         / /   S i n c e   f u r t h e r   d a t a   c o m m u n i c a t i o n   i n v o l v e s   t h e   p r e s e n c e   o f 
                         / /   d a t a - x m l   i n   s t a t e ,   w e   r e m o v e   t h e   d a t a U R L   f r o m   f l a s h V a r s   a n d 
                         / /   k e e p   X M L   f e t c h e d   f r o m   c h a r t . 
                         d e l e t e   o b j . f l a s h V a r s . d a t a U R L ; 
                 } 
 
                 / /   R e m o v e   e b e n t   h a n d l e r   a s s o c i a t i o n   s o   t h a t   n o r m a l   d a t a L o a d   i s   n o t 
                 / /   i n t e r c e p t e d . 
                 e . s e n d e r . r e m o v e E v e n t L i s t e n e r ( ' D a t a L o a d e d ' ,   s y n c D a t a S t o r e ) ; 
         } ; 
 
 
         / /   T h i s   c o d e - b l o c k   e x p o s e s   a   f u n c t i o n   t h a t   a s s i s t s   F u s i o n C h a r t s   s w f   o b j e c t s 
         / /   t o   r e c e i v e   u p d a t e d   a n d   a c c u r a t e   d i m e n s i o n   i n f o r m a t i o n   i n   c a s e   o f 
         / /   p e r c e n t a g e   s i z e . 
         w i n d o w . _ _ f u s i o n c h a r t s _ d i m e n s i o n   =   ( f u n c t i o n   ( )   { 
 
                 / /   R e g u l a r   e x p r e s s i o n   t o   m a t c h   w h e t h e r   a   r i g h t   t r i m m e d s t r i n g   e n d s   w i t h 
                 / /   p e r c e n t a g e   s i g n   o r   n o t . 
                 v a r   i s P e r c e n t R e g e x   =   / . * ? \ % \ s * ? $ / g ; 
 
                 / /   N o   p o i n t   d o c u m e n t i n g   t h i s   p i e c e   o f   u n r e a d a b l e   c o d e !   I n   s h o r t ,   i t 
                 / /   s i m p l y   c a l c u l a t e s   t h e   w i d t h   o f   t h e   c h a r t   b a s e d   o n   t h e   o f f s e t W i d t h   o f 
                 / /   t h e   c o n t a i n e r .   S a m e   i s   f o r   h e i g h t . 
                 r e t u r n   f u n c t i o n   ( i d )   { 
                         v a r   o b j ,   p a r e n t ; 
                         r e t u r n   ! ( ( o b j   =   g l o b a l . c o r e ( i d ) )   i n s t a n c e o f   g l o b a l . c o r e   & & 
                                 o b j . r e f   & &   ( p a r e n t   =   o b j . r e f . p a r e n t N o d e ) )   ?   { }   :   { 
                                 w i d t h :   p a r e n t . o f f s e t W i d t h   *   ( i s P e r c e n t R e g e x . t e s t ( o b j . w i d t h )   ? 
                                         p a r s e I n t ( o b j . w i d t h ,   1 0 )   /   1 0 0   :   1 ) , 
                                 h e i g h t :   p a r e n t . o f f s e t H e i g h t   *   ( i s P e r c e n t R e g e x . t e s t ( o b j . h e i g h t )   ? 
                                         p a r s e I n t ( o b j . h e i g h t ,   1 0 )   /   1 0 0   :   1 ) 
                         } ; 
                 } ; 
         } ( ) ) ; 
 
         / /   R o u t i n e s   t o   m a n a g e   s t a t e   b e t w e e n   S W F   a n d   F u s i o n C h a r t s   J S   O b j e c t 
         w i n d o w . _ _ f u s i o n c h a r t s _ v a r s   =   f u n c t i o n   ( i d ,   v a r s )   { 
 
                 v a r   o b j   =   g l o b a l . c o r e . i t e m s [ i d ] ; 
 
                 / /   V e r i f y   w h e t h e r   c o r r e s p o n d i n g   F u s i o n C h a r t s   o b j e c t   e x i s t s . 
                 i f   ( ! ( o b j   i n s t a n c e o f   g l o b a l . c o r e ) )   { 
                         / /   T h r o w   e r r o r   w h e n   F u s i o n C h a r t s   o b j   n o t   f o u n d . 
                         g l o b a l . r a i s e E r r o r ( g l o b a l . c o r e ,   ' 2 5 0 8 1 6 2 1 ' ,   ' r u n ' ,   ' : : F l a s h R e n d e r e r ' , 
                                 ' F u s i o n C h a r t s   F l a s h   o b j e c t   i s   a c c e s s i n g   f l a s h V a r s   o f   n o n - e x i s t e n t   o b j e c t . ' ) ; 
                         r e t u r n   f a l s e ; 
                 } 
 
                 / /   W h e n   ' v a r s '   p a r a m e t e r   i s   s e n t ,   w e   s y n c   t h e   l o c a l   v a r s   o b j e c t 
                 i f   ( t y p e o f   v a r s   = = =   ' o b j e c t ' )   { 
 
                         / /   W e   c h e c k   w h e t h e r   t h e r e   w a s   a   d i r e c t   u p d a t e   o f   d a t a   o n   S W F .   I n 
                         / /   c a s e   i t   i s   t r u e ,   w e   p r o c e e d   w i t h   d a t a s t o r e   s y n c . 
                         i f   ( o b j . r e f   & &   t y p e o f   o b j . r e f . d a t a I n v o k e d O n S W F   = = =   ' f u n c t i o n '   & & 
                                 o b j . r e f . d a t a I n v o k e d O n S W F ( ) )   { 
 
                                 / /   I n   c a s e   d a t a U R L   h a s   b e e n   u p d a t e d ,   w e   p r o b e   i n t o   a n   e v e n t   t h a t 
                                 / /   u p d a t e s   l o c a l   d a t a S t o r e 
                                 i f   ( v a r s . d a t a U R L   ! = =   u n d e f i n e d )   { 
                                         o b j . a d d E v e n t L i s t e n e r ( ' D a t a L o a d e d ' ,   s y n c D a t a S t o r e ) ; 
                                 } 
                                 / /   S p e c i f i c a l l y   u n e s c a p e   t h e   d a t a X M L   u p d a t e d 
                                 e l s e   i f   ( v a r s . d a t a X M L   ! = =   u n d e f i n e d )   { 
                                         v a r s . d a t a X M L   =   w i n d o w . u n e s c a p e ( v a r s . d a t a X M L ) ; 
                                 } 
                         } 
                         e l s e   { 
                                 / /   C l e a r   d a t a   r e l a t e d   v a r i a b l e s   t o   p r e v e n t   s y n c   w i t h   l o c a l 
                                 / /   s t o r e . 
                                 d e l e t e   v a r s . d a t a U R L ; 
                                 d e l e t e   v a r s . d a t a X M L ; 
                         } 
 
                         / /   I f   c o r r e s p o n d i n g   F u s i o n C h a r t s   o b j e c t   i s   f o u n d ,   w e   u p d a t e   t h e 
                         / /   v a r s . 
                         g l o b a l . e x t e n d ( o b j . f l a s h V a r s ,   v a r s ) ; 
 
                         r e t u r n   t r u e ; 
                 } 
 
                 r e t u r n   o b j . f l a s h V a r s ; 
         } ; 
 
         / /   A d j u s t   f l a s h   d i m e n s i o n   b a s e d   u p o n   f l a s h V a r s 
         g l o b a l . a d d E v e n t L i s t e n e r ( ' B e f o r e I n i t i a l i z e ' ,   f u n c t i o n   ( e v e n t )   { 
                 / /   G e t   s h o r t   r e f e r e n c e   t o   t h e   e v e n t   s e n d e r . 
                 v a r   o b j   =   e v e n t . s e n d e r ; 
 
                 / /   F i l t e r   o b j e c t s   t h a t   a r e   g e n e r a t e d   b y   f l a s h   r e n d e r e r   o n l y . 
                 i f   ( o b j . o p t i o n s . r e n d e r e r   ! = =   ' f l a s h ' )   { 
                         r e t u r n ; 
                 } 
 
                 / /   P r e v e n t i o n   i s   b e t t e r   t h a n   c u r e .   S o   i s   p r e c a u t i o n ! 
                 i f   ( o b j . w i d t h   = = =   u n d e f i n e d )   { 
                         o b j . w i d t h   =   g l o b a l . r e n d e r e r . p o l i c i e s . f l a s h V a r s . c h a r t W i d t h [ 1 ] ; 
                 } 
                 i f   ( o b j . h e i g h t   = = =   u n d e f i n e d )   { 
                         o b j . h e i g h t   =   g l o b a l . r e n d e r e r . p o l i c i e s . f l a s h V a r s . c h a r t H e i g h t [ 1 ] ; 
                 } 
                 i f   ( o b j . f l a s h V a r s . D O M I d   = = =   u n d e f i n e d )   { 
                         o b j . f l a s h V a r s . D O M I d   =   o b j . i d ; 
                 } 
 
                 / /   D e f a u l t   f l a s h V a r s   t h a t   a r e   t o   b e   s e t . 
                 g l o b a l . e x t e n d ( o b j . f l a s h V a r s ,   { 
                         r e g i s t e r W i t h J S :   ' 1 ' , 
                         c h a r t W i d t h :   o b j . w i d t h , 
                         c h a r t H e i g h t :   o b j . h e i g h t , 
                         I n v a l i d X M L T e x t :   ' I n v a l i d   d a t a . ' 
                 } ) ; 
   
                 / /   A u t o I n s t a l l R e d i r e c t   a c t i o n   r o u t i n e . 
                 i f   ( B o o l e a n ( o b j . o p t i o n s . a u t o I n s t a l l R e d i r e c t )   = = =   t r u e   & & 
                         ! g l o b a l . s w f o b j e c t . h a s F l a s h P l a y e r V e r s i o n ( 
                                 g l o b a l . c o r e . o p t i o n s . r e q u i r e d F l a s h P l a y e r V e r s i o n . t o S t r i n g ( ) )   & & 
                         n o F l a s h R e d i r e c t N o t i f i e d   = = =   f a l s e )   { 
                         n o F l a s h R e d i r e c t N o t i f i e d   =   t r u e ; 
                         i f   ( w i n d o w . c o n f i r m ( g l o b a l . c o r e . o p t i o n s . i n s t a l l R e d i r e c t M e s s a g e ) )   { 
                                 w i n d o w . l o c a t i o n . h r e f   =   ' h t t p : / / g e t . a d o b e . c o m / f l a s h p l a y e r / ' ; 
                         } 
                 } 
 
                 / /   S e t   i n i t i a l   s t a t e   o f   c h a r t s 
                 i f   ( o b j . o p t i o n s . d a t a F o r m a t   = = =   u n d e f i n e d   & &   o b j . o p t i o n s . d a t a S o u r c e   = = =   u n d e f i n e d )   { 
                         o b j . o p t i o n s . d a t a F o r m a t   =   F u s i o n C h a r t s D a t a F o r m a t s . X M L U R L ; 
                         o b j . o p t i o n s . d a t a S o u r c e   =   ' D a t a . x m l ' ; 
                 } 
         } ) ; 
 
         
         / /   A d d   m e t h o d   t o   m a k e   s u r e   t o   d e l e t e   a l l   f u s i o n c h a r t s   o b j e c t s   w h e n 
         / /   d i s p o s e   m e t h o d   i s   i n v o k e d 
         g l o b a l . a d d E v e n t L i s t e n e r ( ' D i s p o s e d ' ,   f u n c t i o n   ( e )   { 
                 / /   P r o c e s s   t h e s e   e v e n t s   o n l y   f o r   o b j e c t s   t h a t   h a v e   f l a s h   r e n d e r e r ! 
                 i f   ( e . s e n d e r . o p t i o n s . r e n d e r e r   ! = =   ' f l a s h ' )   { 
                         r e t u r n ; 
                 } 
                 / /   M a n a g e d   r e m o v a l   o f   c h a r t   u s i n g   s w f O b j e c t   l i b r a r y 
                 g l o b a l . s w f o b j e c t . r e m o v e S W F ( e . s e n d e r . i d ) ; 
         } ) ; 
 
         g l o b a l . a d d E v e n t L i s t e n e r ( ' L o a d e d ' ,   f u n c t i o n   ( e )   { 
                 / /   P r o c e s s   t h e s e   e v e n t s   o n l y   f o r   o b j e c t s   t h a t   h a v e   f l a s h   r e n d e r e r ! 
                 i f   ( e . s e n d e r . o p t i o n s . r e n d e r e r   ! = =   ' f l a s h ' )   { 
                         r e t u r n ; 
                 } 
 
                 / /   U p o n   r e n d e r   c o m p l e t i o n ,   d i s a b l e   a n i m a t i o n   o f   t h e   c h a r t   b y   u p d a t i n g   t h e 
                 / /   ' a n i m a t i o n '   f l a g   i n   f l a s h V a r s .   T h i s   f i x e s   t h e   i s s u e   o f   F u s i o n C h a r t s 
                 / /   l o o s i n g   i t s   s t a t e   w h e n   i t   i s   r e - r e n d e r e d   a f t e r   b e i n g   h i d d e n . 
                 / /   S e t   d i s a b l e   a n i m a t i o n   f l a g   f o r   s t a t e   m a n a g e m e n t . 
                 e . s e n d e r . f l a s h V a r s . a n i m a t i o n   =   ' 0 ' ; 
         } ) ; 
 
         g l o b a l . a d d E v e n t L i s t e n e r ( ' D a t a L o a d R e q u e s t e d ' ,   f u n c t i o n   ( e v e n t ,   a r g s )   { 
                 / /   R e f e r e n c e   t o   e v e n t   s e n d e r . 
                 v a r   o b j   =   e v e n t . s e n d e r ; 
 
                 / /   P r o c e s s   t h e s e   e v e n t s   o n l y   f o r   o b j e c t s   t h a t   h a v e   f l a s h   r e n d e r e r ! 
                 i f   ( o b j . o p t i o n s . r e n d e r e r   ! = =   ' f l a s h ' )   { 
                         r e t u r n ; 
                 } 
                 i f   ( w i n d o w . l o c a t i o n . p r o t o c o l   = = =   ' f i l e : '   & &   a r g s . d a t a F o r m a t   = = =   
                         F u s i o n C h a r t s D a t a F o r m a t s . X M L   & &   B o o l e a n ( o b j . o p t i o n s . s a f e M o d e )   = = =   t r u e )   { 
                         i f   ( o b j . r e f   & &   o b j . r e f . s e t D a t a U R L )   { 
                                 o b j . r e f . s e t D a t a U R L ( a r g s . u r l ,   f a l s e ) ; 
                         } 
                         e l s e   { 
                                 o b j . f l a s h V a r s . d a t a U R L   =   a r g s . u r l ; 
                         } 
                         / /   S t o p   f u r t h e r   a c t i v i t i e s   o n   t h i s   e v e n t . 
                         e v e n t . s t o p P r o p a g a t i o n ( ) ; 
                         
                         / /   C a n c e l   t h e   A J A X   d a t a - l o a d   r e q u e s t . 
                         a r g s . c a n c e l D a t a L o a d R e q u e s t ( ) ; 
                         o b j . a d d E v e n t L i s t e n e r ( ' D a t a L o a d e d ' ,   s y n c D a t a S t o r e ) ; 
                 } 
 
                 / /   I n   c a s e   w e   h a v e   a n   a c t i v e   c h a r t ,   w e   s h o w   t h e   l o a d i n g 
                 / /   m e s s a g e   i n   c h a r t   i t s e l f . 
                 i f   ( o b j . r e f   & &   t y p e o f   o b j . s h o w C h a r t M e s s a g e   = = =   ' f u n c t i o n ' )   { 
                         d e l e t e   o b j . f l a s h V a r s . s t a l l L o a d ; 
                         o b j . r e f . s h o w C h a r t M e s s a g e ( ' X M L L o a d i n g T e x t ' ) ; 
                 } 
                 / /   I n   c a s e   c h a r t   o b j e c t   i s   n o t   a v a i l a b l e ,   w e   s e t   a   f l a s h v a r   s a y i n g   t h a t 
                 / /   l o a d i n g   i s   t o   b e   s t a l l e d . 
                 e l s e   { 
                         o b j . f l a s h V a r s . s t a l l L o a d   =   t r u e ; 
                 } 
         } ) ; 
 
         g l o b a l . a d d E v e n t L i s t e n e r ( ' D a t a L o a d R e q u e s t C a n c e l l e d ' ,   f u n c t i o n   ( e v e n t )   { 
                 / /   R e f e r e n c e   t o   e v e n t   s e n d e r . 
                 v a r   o b j   =   e v e n t . s e n d e r ; 
 
                 / /   P r o c e s s   t h e s e   e v e n t s   o n l y   f o r   o b j e c t s   t h a t   h a v e   f l a s h   r e n d e r e r ! 
                 i f   ( o b j . o p t i o n s . r e n d e r e r   ! = =   ' f l a s h ' )   { 
                         r e t u r n ; 
                 } 
 
                 / /   I n   c a s e   w e   h a v e   a n   a c t i v e   c h a r t ,   w e   h i d e   t h e   l o a d i n g   m e s s a g e   i n   c h a r t 
                 / /   i t s e l f . 
                 i f   ( o b j . r e f   & &   t y p e o f   o b j . s h o w C h a r t M e s s a g e   = = =   ' f u n c t i o n ' )   { 
                         o b j . r e f . s h o w C h a r t M e s s a g e ( ) ; 
                 } 
                 / /   I n   c a s e   c h a r t   o b j e c t   i s   n o t   a v a i l a b l e ,   w e   s e t   a   f l a s h v a r   s a y i n g   t h a t 
                 / /   l o a d i n g   i s   t o   b e   s t a l l e d . 
                 d e l e t e   o b j . f l a s h V a r s . s t a l l L o a d ; 
         } ) ; 
 
         g l o b a l . a d d E v e n t L i s t e n e r ( ' D a t a L o a d E r r o r ' ,   f u n c t i o n   ( e v e n t ,   a r g s )   { 
                 / /   R e f e r e n c e   t o   e v e n t   s e n d e r . 
                 v a r   o b j   =   e v e n t . s e n d e r ; 
 
                 / /   P r o c e s s   t h e s e   e v e n t s   o n l y   f o r   o b j e c t s   t h a t   h a v e   f l a s h   r e n d e r e r ! 
                 i f   ( o b j . o p t i o n s . r e n d e r e r   ! = =   ' f l a s h ' )   { 
                         r e t u r n ; 
                 } 
 
                 / /   O n   d a t a   l o a d   e r r o r ,   o n e   n e e d s   t o   d i s p l a y   " N o   D a t a   T o   D i s p l a y "   o n 
                 / /   c h a r t s . 
                 i f   ( o b j . r e f   & &   t y p e o f   o b j . r e f . s h o w C h a r t M e s s a g e   = = =   ' f u n c t i o n '   & & 
                         a r g s . s o u r c e   = = =   ' X m l H t t p R e q u e s t ' )   { 
                         / /   S h o w   D a t a   L o a d   E r r o r   M e s s a g e . 
                         o b j . r e f . s h o w C h a r t M e s s a g e ( ' L o a d D a t a E r r o r T e x t ' ) ; 
                 } 
                 e l s e   { 
                         d e l e t e   o b j . f l a s h V a r s . d a t a U R L ; / /   =   ' X m l H t t p R e q u e s t D a t a L o a d E r r o r :   '   +   a r g s . u r l ; 
                         o b j . f l a s h V a r s . d a t a X M L   =   ' < J S O N   p a r s i n g   e r r o r > ' ; 
                         d e l e t e   o b j . f l a s h V a r s . s t a l l L o a d ; 
                 } 
 
         } ) ; 
 
         g l o b a l . a d d E v e n t L i s t e n e r ( ' D a t a L o a d R e q u e s t C o m p l e t e d ' ,   f u n c t i o n   ( e v e n t ,   a r g s )   { 
                 / /   R e f e r e n c e   t o   e v e n t   s e n d e r . 
                 v a r   o b j   =   e v e n t . s e n d e r ; 
 
                 / /   P r o c e s s   t h e s e   e v e n t s   o n l y   f o r   o b j e c t s   t h a t   h a v e   f l a s h   r e n d e r e r ! 
                 i f   ( o b j . o p t i o n s . r e n d e r e r   ! = =   ' f l a s h '   | |   a r g s . s o u r c e   ! = =   ' X m l H t t p R e q u e s t ' )   { 
                         r e t u r n ; 
                 } 
 
                 / /   C l e a r   l o a d   p r e v e n t i o n   f l a g . 
                 d e l e t e   o b j . f l a s h V a r s . s t a l l L o a d ; 
 
         } ) ; 
         
 
         / /   B i n d   E v e n t T a r g e t   w i t h   t h e   F u s i o n C h a r t s   g l o b a l   e v e n t   h a n d l e r 
         w i n d o w . _ _ f u s i o n c h a r t s _ e v e n t   =   f u n c t i o n   ( e v e n t ,   a r g s )   { 
                 / /   C r e a t e   a n   a b s t r a c t i o n   l a y e r   s o   t h a t   t h e   t r y - c a t c h   /   e r r o r   s u p p r e s s i o n 
                 / /   o f   f l a s h   c a n   b e   a v o i d e d . 
                 s e t T i m e o u t ( f u n c t i o n   ( )   { 
                         g l o b a l . r a i s e E v e n t ( e v e n t . t y p e ,   a r g s ,   g l o b a l . c o r e . i t e m s [ e v e n t . s e n d e r ] ) ; 
                 } ,   0 ) ; 
         } ; 
 
         v a r   r e n d e r e r   =   { 
                 / /   D e f a u l t   d a t a   f o r m a t   s u p p o r t e d   b y   t h i s   r e n d e r e r 
                 d a t a F o r m a t :   ' x m l ' , 
                 
                 i n i t :   f u n c t i o n   ( )   { 
 
                 } , 
                 
                 p o l i c i e s :   { 
                         / /   A d d   c o n s t r u c t i o n   p o l i c i e s   s p e c i f i c   t o   A c t i v e X   p a r a m e t e r s . 
                         p a r a m s :   { 
                                 s c a l e M o d e :   [ ' s c a l e M o d e ' ,   ' n o S c a l e ' ] , 
                                 s c a l e :   [ ' s c a l e M o d e ' ,   ' n o S c a l e ' ] , 
                                 w M o d e :   [ ' w M o d e ' ,   ' o p a q u e ' ] , 
                                 m e n u :   [ ' m e n u ' ,   u n d e f i n e d ] , 
                                 b g C o l o r :   [ ' b g C o l o r ' ,   u n d e f i n e d ] , 
                                 a l l o w S c r i p t A c c e s s :   [ ' a l l o w S c r i p t A c c e s s ' ,   ' a l w a y s ' ] , 
                                 q u a l i t y :   [ ' q u a l i t y ' ,   ' b e s t ' ] , 
                                 s w L i v e C o n n e c t :   [ ' s w L i v e C o n n e c t ' ,   u n d e f i n e d ] , 
                                 b a s e :   [ ' b a s e ' ,   u n d e f i n e d ] , 
                                 a l i g n :   [ ' a l i g n ' ,   u n d e f i n e d ] , 
                                 s a l i g n :   [ ' s A l i g n ' ,   u n d e f i n e d ] 
                         } , 
                         / * * 
                           *   @ v a r   v a r s   { o b j e c t }   C o n t a i n s   a l l   t h e   v e r i a b l e s   t h a t   a r e   l o c a l   t o   e v e r y 
                           *   r e n d e r e r .   T h i s   h a s   a   d i r e c t   i m p l i c a t i o n   t o   t h e   F l a s h V a r s   o f   t h e 
                           *   ' f l a s h '   r e n d e r e r . 
                           * / 
                         f l a s h V a r s :   { 
                                 l a n g :   [ ' l a n g ' ,   ' E N ' ] , 
                                 d e b u g M o d e :   [ ' d e b u g M o d e ' ,   u n d e f i n e d ] , 
                                 / /   @ n o t e :   D e p r e c a t e d   a n d   h a r d c o d e d   i n   b e f o r e i n i t i a l i z e   e v e n t . 
                                 / /   r e g i s t e r W i t h J S :   [ ' r e g i s t e r W i t h J S ' ,   ' 1 ' ] , 
                                 a n i m a t i o n :   [ ' a n i m a t e ' ,   u n d e f i n e d ] 
                         } , 
 
                         o p t i o n s :   { 
                                 a u t o I n s t a l l R e d i r e c t :   [ ' a u t o I n s t a l l R e d i r e c t ' ,   f a l s e ] 
                         } 
                 } , 
 
                 r e n d e r :   f u n c t i o n   ( c o n t a i n e r ,   c a l l B a c k )   { 
 
                         / /   R e m o v e   t h e   ' a n i m a t i o n '   f l a g   o f   t h e   c h a r t . 
                         i f   ( B o o l e a n ( t h i s . f l a s h V a r s . a n i m a t i o n )   = = =   t r u e )   { 
                                 d e l e t e   t h i s . f l a s h V a r s . a n i m a t i o n ; 
                         } 
 
                         / /   C h e c k   f o r   v a l i d   ' s r c '   a t t r i b u t e 
                         i f   ( ! t h i s . s r c )   { 
                                 g l o b a l . r a i s e E r r o r ( t h i s ,   ' 0 3 1 0 2 3 4 8 ' ,   ' r u n ' ,   ' : : F l a s h R e n d e r e r . r e n d e r ' , 
                                         ' C o u l d   n o t   f i n d   a   v a l i d   " s r c "   a t t r i b u t e .   s w f U r l   o r   c h a r t   '   + 
                                         ' t y p e   m i s s i n g . ' ) ; 
                         } 
 
                         / /   C o p y   t h e   f l a s h V a r s   a n d   e n c o d e U R I C o m p o n e n t   a l l   o f   t h e m   b e f o r e 
                         / /   s e n d i n g   t o   s w f O b j e c t 
                         v a r   e n c o d e d V a r s   =   { } ,   d a t a X M L   =   t h i s . f l a s h V a r s . d a t a X M L , 
                                 d a t a U R L   =   t h i s . f l a s h V a r s . d a t a U R L ; 
                         g l o b a l . e x t e n d ( e n c o d e d V a r s ,   t h i s . f l a s h V a r s ) ; 
 
                         / /   F o r   b a c k w a r d   c o m p a t i b i l i t y ,   s e t   t h e   f l a s h V a r   t o   h a v e   r e f e r e n c e 
                         / /   t o   x m l   o r   x m l u r l   i n   c a s e   r e n d e r   i s   c a l l e d   w h i l e   t h e   c h a r t s   a r e 
                         / /   f l a g g e d   t o   b e   s t a l l e d . 
                         i f   ( t h i s . f l a s h V a r s . s t a l l L o a d   = = =   t r u e )   { 
                                 i f   ( t h i s . o p t i o n s . d a t a F o r m a t   = = =   F u s i o n C h a r t s D a t a F o r m a t s . X M L )   { 
                                         d a t a X M L   =   t h i s . o p t i o n s . d a t a S o u r c e ; 
                                 } 
                                 i f   ( t h i s . o p t i o n s . d a t a F o r m a t   = = =   F u s i o n C h a r t s D a t a F o r m a t s . X M L U R L )   { 
                                         d a t a U R L   =   t h i s . o p t i o n s . d a t a S o u r c e ; 
                                 } 
                         } 
 
                         / /   E n c o d e   d a t a X M L   a n d   d a t a U R L 
                         e n c o d e d V a r s . d a t a X M L   =   w i n d o w . e n c o d e U R I C o m p o n e n t ( d a t a X M L   | |   ' ' ) ; 
                         e n c o d e d V a r s . d a t a U R L   =   u r l E n c o d e I f N e c e s s a r y ( d a t a U R L   | |   ' ' ) ; 
 
                         / /   C a l l   s w f o b j e c t   A P I   t o   r e n d e r   t h e   c h a r t 
                         g l o b a l . s w f o b j e c t . e m b e d S W F ( t h i s . s r c ,   t h i s . i d ,   t h i s . w i d t h , 
                                 t h i s . h e i g h t ,   ' 8 . 0 . 0 ' ,   u n d e f i n e d ,   e n c o d e d V a r s ,   t h i s . p a r a m s , 
                                 t h i s . a t t r i b u t e s ,   c a l l B a c k ) ; 
 
                 } , 
 
                 / /   L i s t e n   t o   t h e   d a t a U p d a t e d   e v e n t ,   s o   t h a t   c h a r t s   c a n   b e   r e - r e n d e r e d   w i t h 
                 / /   n e w   d a t a ,   w h e n   d a t a   i s   u p d a t e d   o n   J S   v a r i a b l e   p o s t   r e n d e r 
                 u p d a t e :   f u n c t i o n   ( v a r s )   { 
                         / /   P o i n t   t o   d i r e c t   S W F O b j e c t   a n d   a l s o   g e t   t h e   l a t e s t   d a t a 
                         v a r   c h a r t   =   t h i s . r e f ,   d a t a   =   v a r s . d a t a ; 
 
                         / /   W h e n   u p d a t i n g   s t a t e s   t h a t   d a t a X M L   h a s   b e e n   u p d a t e d 
                         / /   U p d a t e   F l a s h V a r s 
                         t h i s . f l a s h V a r s . d a t a X M L   =   d a t a ; 
 
                         / /   C h e c k   w h e t h e r   t h e r e   w a s   a n   e r r o r   o r   n o t . 
                         i f   ( v a r s . e r r o r   = = =   u n d e f i n e d )   { 
                                 / /   C a l l   E x t e r n a l I n t e r f a c e   m e t h o d   a n d   u p d a t e   t h e   d a t a 
                                 i f   ( t h i s . i s A c t i v e ( )   & &   t y p e o f   c h a r t . s e t D a t a X M L   = = =   ' f u n c t i o n ' )   { 
                                         c h a r t . s e t D a t a X M L ( d a t a ,   f a l s e ) ; 
                                 } 
                                 e l s e   { 
                                         / /   R e m o v e   t h e   ' a n i m a t i o n '   f l a g   o f   t h e   c h a r t   w h i l e   d a t a   w a s 
                                         / /   u p d a t e d   d u r i n g   u n a v a i l a b i l i t y   o f   S W F 
                                         d e l e t e   t h i s . f l a s h V a r s . d a t a U R L ; 
                                         d e l e t e   t h i s . f l a s h V a r s . a n i m a t i o n ; 
                                 } 
                         } 
                         / /   S h o w   e r r o r   m e s s a g e . 
                         e l s e   { 
                                 / /   C a l l   E x t e r n a l I n t e r f a c e   m e t h o d   t o   s h o w   m e s s a g e 
                                 i f   ( t h i s . i s A c t i v e ( )   & &   t y p e o f   c h a r t . s h o w C h a r t M e s s a g e   = = =   ' f u n c t i o n ' )   { 
                                         c h a r t . s h o w C h a r t M e s s a g e ( ' I n v a l i d X M L T e x t ' ) ; 
                                 } 
                                 e l s e   { 
                                         / /   R e m o v e   t h e   ' a n i m a t i o n '   f l a g   o f   t h e   c h a r t   w h i l e   d a t a   w a s 
                                         / /   u p d a t e d   d u r i n g   u n a v a i l a b i l i t y   o f   S W F 
                                         t h i s . f l a s h V a r s . d a t a X M L   =   ' < I n v a l i d '   +   v a r s . f o r m a t . t o U p p e r C a s e ( )   +   ' > ' ; 
                                         d e l e t e   t h i s . f l a s h V a r s . d a t a U R L ; 
                                         d e l e t e   t h i s . f l a s h V a r s . a n i m a t i o n ; 
                                 } 
                         } 
                 } , 
                 
                 / /   H a n d l e   r e n d e r e r   r e s i z e . 
                 r e s i z e :   f u n c t i o n   ( )   { 
                         / /   U p d a t e d   f l a s h V a r s   w i t h   n e w   d i m e n s i o n 
                         t h i s . f l a s h V a r s . c h a r t W i d t h   =   t h i s . w i d t h ; 
                         t h i s . f l a s h V a r s . c h a r t H e i g h t   =   t h i s . h e i g h t ; 
 
                         i f   ( t h i s . r e f   ! = =   u n d e f i n e d )   { 
                                 / /   S e t   s i z e s   o f   D O M   e l e m e n t s . 
                                 t h i s . r e f . w i d t h   =   t h i s . w i d t h ; 
                                 t h i s . r e f . h e i g h t   =   t h i s . h e i g h t ; 
                                 i f   ( t y p e o f   t h i s . r e f . r e s i z e   = = =   ' f u n c t i o n ' )   { 
                                         / /   F o r c e   r e s i z e   o n   c h a r t s . 
                                         t h i s . r e f . r e s i z e ( t h i s . r e f . o f f s e t W i d t h ,   t h i s . r e f . o f f s e t H e i g h t ) ; 
                                 } 
                         } 
                 } , 
 
                 / /   S e n d   c h a r t   c o n f i g u r a t i o n 
                 c o n f i g :   f u n c t i o n   ( i t e m s )   { 
                         g l o b a l . e x t e n d ( t h i s . f l a s h V a r s ,   i t e m s ) ; 
                 } 
         } ; 
 
         / /   A d d   f l a s h   r e n d e r e r   l e g a c y   f u n c t i o n s . 
         r e n d e r e r . p r o t o t y p e   =   { 
                 / /   L e g a c y   f u n c t i o n 
                 g e t S W F H T M L :   f u n c t i o n   ( )   { 
 
                         / /   C r e a t e   t e m p o r a r y   e l e m e n t s   a n d   t e m p o r a r y   a c c e s s   I d 
                         v a r   o u t E l m   =   d o c u m e n t . c r e a t e E l e m e n t ( ' s p a n ' ) , 
                                 i n E l m   =   d o c u m e n t . c r e a t e E l e m e n t ( ' s p a n ' ) , 
                                 t e m p I d   =   ' R n V z a W 9 u Q 2 h h c n R z '   +   ( n e w   D a t e ( ) ) . g e t T i m e ( ) ; 
 
                         / /   C r e a t e   D O M   h i e r a r c h y 
                         o u t E l m . a p p e n d C h i l d ( i n E l m ) ; 
                         / /   S p e c i f y   t e m p   a c c e s s   I d 
                         i n E l m . s e t A t t r i b u t e ( ' i d ' ,   t e m p I d ) ; 
                         / /   H i d e   t h i s   e l e m e n t   f r o m   u s e r . 
                         o u t E l m . s t y l e . d i s p l a y   =   ' n o n e ' ; 
                         / /   A d d   t h e   e l e m e n t   t o   D O M . 
                         d o c u m e n t . g e t E l e m e n t s B y T a g N a m e ( ' b o d y ' ) [ 0 ] . a p p e n d C h i l d ( o u t E l m ) ; 
 
                         / /   T e m p o r a r i l y   e m b e d   t h e   s w f   i n   t h e   a b o v e - c r e a t e d   e l e m e n t . 
                         g l o b a l . s w f o b j e c t . e m b e d S W F ( t h i s . s r c ,   t e m p I d ,   t h i s . w i d t h , 
                                 t h i s . h e i g h t ,   ' 8 . 0 . 0 ' ,   u n d e f i n e d ,   t h i s . f l a s h V a r s ,   t h i s . p a r a m s , 
                                 t h i s . a t t r s ) ; 
 
                         / /   G e t   t h e   H T M L   f r o m   t h e   t e m p   o b j e c t s . 
                         v a r   h t m l   =   o u t E l m . i n n e r H T M L . r e p l a c e ( t e m p I d ,   t h i s . i d ) ; 
 
                         / /   C l e a n   u p   t h e   d i r t y   w o r k . 
                         g l o b a l . s w f o b j e c t . r e m o v e S W F ( t e m p I d ) ; 
                         o u t E l m . p a r e n t N o d e . r e m o v e C h i l d ( o u t E l m ) ; 
 
                         / /   R e t u r n   t h e   H T M L   w i t h   i t s   I D   s e t   t o   n o r m a l . 
                         r e t u r n   h t m l ; 
                 } , 
 
                 / /   A d d   l e g a c y   s e t T r a n s p a r e n t   f u n c t i o n 
                 s e t T r a n s p a r e n t :   f u n c t i o n   ( t r a n s p a r e n c y )   { 
                         / /   S e t s   c h a r t   t o   t r a n s p a r e n t   m o d e   w h e n   i s T r a n s p a r e n t   ( w M o d e )   i s   t r u e 
                         / /   ( d e f a u l t ) .   W h e n   n o   p a r a m e t e r   i s   p a s s e d ,   w e   a s s u m e   t r a n s p a r e n t   t o 
                         / /   b e   t r u e . 
                         i f   ( t y p e o f   t r a n s p a r e n c y   ! = =   ' b o o l e a n '   & &   t r a n s p a r e n c y   ! = =   n u l l )   { 
                                 t r a n s p a r e n c y   =   t r u e ; 
                         } 
 
                         / /   S e t   t h e   p r o p e r t y . 
                         t h i s . p a r a m s . w M o d e   =   t r a n s p a r e n c y   = = =   n u l l   ?   ' w i n d o w '   : 
                                 ( t r a n s p a r e n c y   = = =   t r u e   ?   ' t r a n s p a r e n t '   :   ' o p a q u e ' ) ; 
                 } , 
 
                 a d d V a r i a b l e :   g l o b a l . c o r e . p r o t o t y p e . c o n f i g u r e 
         } ; 
 
         / /   A d d   t h e   r e n d e r e r   t o   F u s i o n C h a r t s   c o r e   r e p o s i t o r y 
         g l o b a l . r e n d e r e r . r e g i s t e r ( ' f l a s h ' ,   r e n d e r e r ) ; 
 
         / /   C h e c k   f o r   f l a s h   a n d   i p h o n e / i p a d 
         / /   R e g i s t e r   t h e   s w f   r e n d e r e r   i n   c a s e   w e   h a v e   f l a s h P l a y e r . 
         i f   ( ! / \ ( i P h o n e ; | \ ( i P a d ; / i . t e s t ( n a v i g a t o r . u s e r A g e n t ) )   { 
                 / /   S e t   d e f a u l t   r e n d e r e r 
                 g l o b a l . r e n d e r e r . s e t D e f a u l t ( ' f l a s h ' ) ; 
         } 
 
 
 } ( ) ) ; 
 
 
 
 / * j s l i n t   w h i t e :   t r u e ,   b r o w s e r :   t r u e ,   w i n d o w s :   t r u e ,   f o r i n :   t r u e ,     u n d e f :   t r u e ,  
     p l u s p l u s :   t r u e ,   b i t w i s e :   t r u e ,   r e g e x p :   t r u e ,   i m m e d :   t r u e   * /  
  
 / * g l o b a l   A r r a y :   f a l s e ,   F u s i o n C h a r t s ,   R e g E x p :   f a l s e ,   j Q u e r y :   f a l s e ,   w i n d o w :   f a l s e ,  
     $ :   t r u e ,   H i g h c h a r t s :   f a l s e ,   F u s i o n C h a r t s D a t a F o r m a t s :   f a l s e ,   F C _ L o a d e d ,   F C _ D a t a L o a d e d ,   F C _ R e n d e r e d ,   F C _ D r a w C o m p l e t e   * /  
  
 / * *  
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
   *   H T M L 5   R e n d e r e r   M o d u l e  
   *   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
   * /  
 ( f u n c t i o n   ( )   {  
         v a r   g l o b a l ,   F C C   =   { } ,   b a s e U R L   =   ' J S C l a s s / ' ,   c o v e r t T o F C C ,   r e n d e r A r r a y   =   [ ] ,  
         F C C r e a d y   =   f a l s e ,   i ,   s c r i p t T a g s ,   j s C o n f   =   { } ;  
  
  
         / /   R e g i s t e r   t h e   m o d u l e   w i t h   F u s i o n C h a r t s   a n d   a l s   o g e t   a c c e s s   t o   a   g l o b a l  
         / /   v a r i a b l e   w i t h i n   t h e   c o r e ' s   s c o p e .  
         g l o b a l   =   F u s i o n C h a r t s ( [ ' p r i v a t e ' ,   ' C a n v a s _ R e n d e r e r ' ] ) ;  
         / /   C h e c k   w h e t h e r   t h e   m o d u l e   h a s   b e e n   a l r e a d y   r e g i s t e r e d .   I f   t r u e ,   t h e n  
         / /   d o   n o t   b o t h e r   t o   r e - r e g i s t e r .  
         i f   ( g l o b a l   = = =   u n d e f i n e d )   {  
                 r e t u r n ;  
         }  
  
         v a r   F C C C R E D I T S T A T E   =   f a l s e ;  
  
         / / f u n c t i o n   t h a t   w i l l   r e t u r n   u n d e f i n e d  
         / / w h e n   a n y   f l a s h   p r o p a r t y   h a s   n o   e f f e c t   i n   j s   c h a r t  
         / / t h e n   a d d   t h i s   m e t h o d e   r e f e r e n c e   f o r   t h a t   p r o p e r t y  
         f u n c t i o n   n o E f f e c t ( )   {  
                 r e t u r n   u n d e f i n e d ;  
         }  
  
          
         / / i n i t i a l i z e   H i g h c h a r t s  
         / / t h i s   i s   t h e   b a s e   f u n c t i o n   f u n c t i o n   t o   i n i t i a l i z e   j a v a s c r i p t   c h a r t s   r e n d e r e r  
  
  
         F C C . i n i t   =   f u n c t i o n   ( )   {  
                 v a r   p a s s T h r o u g h S t y l e   =   f u n c t i o n   ( n a m e ,   s u f ,   p r e f )   {  
                                                 r e t u r n   f u n c t i o n   ( v a l u e ,   o b j )   {  
                                                         o b j . s t y l e [ n a m e ]   =   ( p r e f   ?   p r e f   :   ' ' )   +   v a l u e   +   ( s u f   ?   s u f   :   ' ' ) ;  
                                                 } ;  
                                         } ,  
                 / / v a r i a b l e   t o   s t o r e   v a r i o u s   d e f a u l t   v a l u e s  
                 F C F C C   =   {  
                         c o l o r :   [ " A F D 8 F 8 " ,   " F 6 B D 0 F " ,   " 8 B B A 0 0 " ,   " F F 8 E 4 6 " ,   " 0 0 8 E 8 E " ,   " D 6 4 6 4 6 " ,   " 8 E 4 6 8 E " ,   " 5 8 8 5 2 6 " ,   " B 3 A A 0 0 " ,   " 0 0 8 E D 6 " ,   " 9 D 0 8 0 D " ,   " A 1 8 6 B E " ,   " C C 6 6 0 0 " ,   " F D C 6 8 9 " ,   " A B A 0 0 0 " ,   " F 2 6 D 7 D " ,   " F F F 2 0 0 " ,   " 0 0 5 4 A 6 " ,   " F 7 9 4 1 C " ,   " C C 3 3 0 0 " ,   " 0 0 6 6 0 0 " ,   " 6 6 3 3 0 0 " ,   " 6 D C F F 6 " ] ,  
                         s e r i e s N a m e   :   {  
                                 ' C o l u m n 2 D '   :   1 ,  
                                 ' C o l u m n 3 D '   :   1 ,  
                                 ' L i n e '   :   1 ,  
                                 ' A r e a 2 D '   :   1 ,  
                                 ' B a r 2 D '   :   1 ,  
                                 ' P i e 2 D '   :   1 ,  
                                 ' P i e 3 D '   :   1 ,  
                                 ' D o u g h n u t 2 D '   :   1 ,  
                                 ' D o u g h n u t 3 D '   :   1 ,  
                                 ' P a r e t o 2 D '   :   1 . 5 ,  
                                 ' P a r e t o 3 D '   :   1 . 5 ,  
                                 ' M S C o l u m n 2 D '   :   2 ,  
                                 ' M S C o l u m n 3 D '   :   2 ,  
                                 ' M S L i n e '   :   2 ,  
                                 ' Z o o m L i n e ' :   2 . 5 ,  
                                 ' M S B a r 2 D '   :   2 ,  
                                 ' M S B a r 3 D '   :   2 ,  
                                 ' M S A r e a '   :   2 ,  
                                 ' I n v e r s e M S L i n e '   :   2 . 2 ,  
                                 ' I n v e r s e M S C o l u m n 2 D '   :   2 . 2 ,  
                                 ' I n v e r s e M S A r e a '   :   2 . 2 ,  
                                 ' S t a c k e d C o l u m n 3 D '   :   3 ,  
                                 ' M a r i m e k k o ' :   3 ,  
                                 ' S t a c k e d C o l u m n 2 D '   :   3 ,  
                                 ' S t a c k e d C o l u m n 2 D L i n e ' :   3 ,  
                                 ' S t a c k e d C o l u m n 3 D L i n e ' :   3 ,  
                                 ' S t a c k e d B a r 2 D '   :   3 ,  
                                 ' S t a c k e d B a r 3 D '   :   3 ,  
                                 ' S t a c k e d A r e a 2 D '   :   3 ,  
                                 ' M S C o m b i 3 D '   :   4 ,  
                                 ' M S C o m b i 2 D '   :   4 ,  
                                 ' M S C o m b i D Y 2 D '   :   5 ,  
                                 ' M S C o l u m n L i n e 3 D '   :   4 ,  
                                 ' M S C o l u m n 3 D L i n e D Y '   :   5 ,  
                                 ' M S S t a c k e d C o l u m n 2 D '   :   6 ,  
                                 ' M S S t a c k e d C o l u m n 2 D L i n e D Y '   :   6 . 5 ,  
                                 ' S t a c k e d C o l u m n 3 D L i n e D Y '   :   5 . 5 ,  
                                 ' S c a t t e r '   :   7 ,  
                                 ' B u b b l e '   :   7 . 5 ,  
                                 ' S c r o l l C o l u m n 2 D '   :   2 ,  
                                 ' S c r o l l L i n e 2 D '   :   2 ,  
                                 ' S c r o l l A r e a 2 D '   :   2 ,  
                                 ' S c r o l l S t a c k e d C o l u m n 2 D '   :   3 ,  
                                 ' S c r o l l C o m b i 2 D '   :   4 ,  
                                 ' S c r o l l C o m b i D Y 2 D '   :   5 ,  
                                 ' S S G r i d '   :   9 ,  
                                 ' S p l i n e ' :   1 ,  
                                 ' S p l i n e A r e a ' :   1 ,  
                                 ' M S S p l i n e ' :   2 ,  
                                 ' M S S p l i n e A r e a ' :   2 ,  
                                 ' M u l t i A x i s L i n e ' :   8  
                         } ,  
                         h i g h C h a r t s   :   {  
                                 ' C o l u m n 2 D '   :   ' c o l u m n ' ,  
                                 ' C o l u m n 3 D '   :   ' c o l u m n ' ,  
                                 ' L i n e '   :   ' l i n e ' ,  
                                 ' A r e a 2 D '   :   ' a r e a ' ,  
                                 ' B a r 2 D '   :   ' b a r ' ,  
                                 ' P i e 2 D '   :   ' p i e ' ,  
                                 ' P i e 3 D '   :   ' p i e ' ,  
                                 ' D o u g h n u t 2 D '   :   ' p i e ' ,  
                                 ' D o u g h n u t 3 D '   :   ' p i e ' ,  
                                 ' P a r e t o 2 D '   :   ' c o l u m n ' ,  
                                 ' P a r e t o 3 D '   :   ' c o l u m n ' ,  
                                 ' M S C o l u m n 2 D '   :   ' c o l u m n ' ,  
                                 ' M S C o l u m n 3 D '   :   ' c o l u m n ' ,  
                                 ' M S L i n e '   :   ' l i n e ' ,  
                                 ' Z o o m L i n e ' :   ' l i n e ' ,  
                                 ' M S B a r 2 D '   :   ' b a r ' ,  
                                 ' M S B a r 3 D '   :   ' b a r ' ,  
                                 ' M S A r e a '   :   ' a r e a ' ,  
                                 ' I n v e r s e M S L i n e '   :   ' l i n e ' ,  
                                 ' I n v e r s e M S C o l u m n 2 D '   :   ' c o l u m n ' ,  
                                 ' I n v e r s e M S A r e a '   :   ' a r e a ' ,  
                                 ' S t a c k e d C o l u m n 3 D '   :   ' c o l u m n ' ,  
                                 ' S t a c k e d C o l u m n 2 D '   :   ' c o l u m n ' ,  
                                 ' M a r i m e k k o ' :   ' c o l u m n ' ,  
                                 ' S t a c k e d C o l u m n 2 D L i n e ' :   ' c o l u m n ' ,  
                                 ' S t a c k e d C o l u m n 3 D L i n e ' :   ' c o l u m n ' ,  
                                 ' S t a c k e d B a r 2 D '   :   ' b a r ' ,  
                                 ' S t a c k e d B a r 3 D '   :   ' b a r ' ,  
                                 ' S t a c k e d A r e a 2 D '   :   ' a r e a ' ,  
                                 ' M S C o m b i 3 D '   :   ' c o l u m n ' ,  
                                 ' M S C o m b i 2 D '   :   ' c o l u m n ' ,  
                                 ' M S C o m b i D Y 2 D '   :   ' c o l u m n ' ,  
                                 ' M S C o l u m n L i n e 3 D '   :   ' c o l u m n ' ,  
                                 ' M S C o l u m n 3 D L i n e D Y '   :   ' c o l u m n ' ,  
                                 ' M S S t a c k e d C o l u m n 2 D '   :   ' ' ,  
                                 ' M S S t a c k e d C o l u m n 2 D L i n e D Y '   :   ' ' ,  
                                 ' S t a c k e d C o l u m n 3 D L i n e D Y '   :   ' c o l u m n ' ,  
                                 ' S c a t t e r '   :   ' s c a t t e r ' ,  
                                 ' B u b b l e '   :   ' s c a t t e r ' ,  
                                 ' S c r o l l C o l u m n 2 D '   :   ' c o l u m n ' ,  
                                 ' S c r o l l L i n e 2 D '   :   ' l i n e ' ,  
                                 ' S c r o l l A r e a 2 D '   :   ' a r e a ' ,  
                                 ' S c r o l l S t a c k e d C o l u m n 2 D '   :   ' c o l u m n ' ,  
                                 ' S c r o l l C o m b i 2 D '   :   ' c o l u m n ' ,  
                                 ' S c r o l l C o m b i D Y 2 D '   :   ' c o l u m n ' ,  
                                 ' S S G r i d '   :   ' ' ,  
                                 ' S p l i n e ' :   ' s p l i n e ' ,  
                                 ' S p l i n e A r e a ' :   ' a r e a s p l i n e ' ,  
                                 ' M S S p l i n e ' :   ' s p l i n e ' ,  
                                 ' M S S p l i n e A r e a ' :   ' a r e a s p l i n e ' ,  
                                 ' M u l t i A x i s L i n e ' :   ' '  
                         } ,  
                         c o m b i   :   {  
                                 ' c o l u m n 2 d '   :   ' c o l u m n ' ,  
                                 ' c o l u m n 3 d '   :   ' c o l u m n ' ,  
                                 ' l i n e '   :   ' l i n e ' ,  
                                 ' a r e a '   :   ' a r e a '  
                         } ,  
                         v a l u e A b s :   {  
                                 ' P i e 2 D '   :   t r u e ,  
                                 ' P i e 3 D '   :   t r u e ,  
                                 ' D o u g h n u t 2 D '   :   t r u e ,  
                                 ' D o u g h n u t 3 D '   :   t r u e ,  
                                 ' M a r i m e k k o '   :   t r u e  
                         } ,  
                         e x p o r t F o r m a t :   {  
                                 p n g :   ' i m a g e / p n g ' ,  
                                 j p g :   ' i m a g e / j p e g ' ,  
                                 p d f :   ' a p p l i c a t i o n / p d f ' ,  
                                 s v g :   ' i m a g e / s v g + x m l '  
                         } ,  
                         J S O N c o n f :   {  
                                 b l a n k C h a r t :   {  
                                         c h a r t :   {  
                                                 e v e n t s :   { } ,  
                                                 m a r g i n :   [ 0 ,   0 ,   0 ,   0 ]  
                                         } ,  
                                         c r e d i t s :   {  
                                                 h r e f :   ' h t t p : / / w w w . f u s i o n c h a r t s . c o m ? B S = F C H S E v a l M a r k ' ,  
                                                 t e x t :   ' F u s i o n C h a r t s   -   H i g h C h a r t s ' ,  
                                                 e n a b l e d :   F C C C R E D I T S T A T E  
                                         } ,  
                                         l e g e n d :   {  
                                                 e n a b l e d :   f a l s e  
                                         } ,  
                                         t i t l e :   {  
                                                 t e x t :   ' N o   d a t a   t o   d i s p l a y ' ,     / / d e f a u l t   c a p t i o n   n o d a t a   t o   d i s p l a y  
                                                 s t y l e :   {  
                                                         f o n t F a m i l y :   ' V e r d a n a ' ,  
                                                         f o n t S i z e :     ' 1 0 p x ' ,  
                                                         c o l o r :   ' # 6 6 6 6 6 6 '  
                                                 }  
                                         } ,  
                                         p l o t O p t i o n s :   {  
                                                 s e r i e s :   { }  
                                         } ,  
                                         e x p o r t i n g :   {  
                                                 e n a b l e d :   f a l s e  
                                         }  
                                 }  
                         } ,  
                         c o m m o n M e t h o d C S V :   ' s a v e A s I m a g e , p r i n t , e x p o r t C h a r t , g e t X M L , g e t C h a r t A t t r i b u t e , g e t D a t a A s C S V , h a s R e n d e r e d , s i g n a t u r e , c a n c e l E x p o r t ' ,  
                         m e t h o d C S V :   {  
                                 ' p i e 3 d ' :   ' , t o g g l e P i e S l i c e ' ,  
                                 ' p i e 2 d ' :   ' , t o g g l e P i e S l i c e ' ,  
                                 ' d o u g h n u t 2 D ' :   ' , t o g g l e P i e S l i c e ' ,  
                                 ' d o u g h n u t 3 D ' :   ' , t o g g l e P i e S l i c e ' ,  
                                 ' m s c o m b i 3 d ' :   ' , v i e w 2 D , v i e w 3 D , r e s e t V i e w , r o t a t e V i e w , g e t V i e w A n g l e s , f i t T o S t a g e ' ,  
                                 ' z o o m l i n e ' :   ' , z o o m T o , s e t Z o o m M o d e , z o o m O u t , r e s e t C h a r t '  
                         } ,  
  
                         m e t h o d :   {  
                                 g e t E x t e r n a l I n t e r f a c e M e t h o d s :   f u n c t i o n   ( c h a r t T y p e )   {  
                                         r e t u r n   F C F C C . c o m m o n M e t h o d C S V   +  
                                         ( F C F C C . m e t h o d C S V [ c h a r t T y p e   | |   t h i s . F u s i o n C h a r t s . c h a r t T y p e ( ) ]   | |   ' ' ) ;  
                                 } ,  
  
                                 / / p r i n t   t h e   c h a r t  
                                 p r i n t :   f u n c t i o n   ( )   {  
                                         v a r   i d   =   t h i s . i d ;  
                                         F C C . i t e m s [ i d ] . F C C O b j . F C C . p r i n t ( ) ;  
                                 } ,  
                                 e x p o r t C h a r t :   f u n c t i o n   ( c o n f )   { / / x e p o r t   t h e   c h a r t  
                                         v a r   i d   =   t h i s . i d ,   H C C o n f   =   { } ,   H C O b j   =   F C C . i t e m s [ i d ] . F C C O b j . F C C ;  
                                         i f   ( H C O b j . o p t i o n s . e x p o r t i n g . e n a b l e d )   { / / c h e c k   w h e t h e r   e x p o r t i n g   i s   e n a b l e d   o r   n o t  
                                                 i f   ( t y p e o f   c o n f   = = =   ' o b j e c t ' )   {  
                                                         f o r   ( v a r   x   i n   c o n f )   {  
                                                                 i f   ( x . t o L o w e r C a s e ( )   = = =   ' e x p o r t f o r m a t '   & &   F C F C C . e x p o r t F o r m a t [ c o n f [ x ] . t o L o w e r C a s e ( ) ] )   {  
                                                                         H C C o n f . t y p e   =   F C F C C . e x p o r t F o r m a t [ c o n f [ x ] . t o L o w e r C a s e ( ) ] ;  
                                                                 }   e l s e   i f   ( x . t o L o w e r C a s e ( )   = = =   ' e x p o r t f i l e n a m e ' )   {  
                                                                         H C C o n f . f i l e n a m e   =   c o n f [ x ] ;  
                                                                 }  
                                                         }  
                                                 }  
                                                 H C O b j . e x p o r t C h a r t ( H C C o n f ) ;  
                                         }  
                                 } ,  
                                 g e t X M L :   f u n c t i o n   ( )   {  
                                         v a r   i d   =   t h i s . i d ;  
                                         r e t u r n   g l o b a l . c o r e . i t e m s [ i d ] . g e t X M L D a t a ( ) ;  
                                 } ,  
                                 / / f u n c t i o n   t o   c h e c h   t h e   s i g n a t u r e   / v e r t i o n  
                                 s i g n a t u r e   :   f u n c t i o n   ( )   {  
                                         r e t u r n   ' F u s i o n C h a r t s / 3 . 2 . 0 / J S ' ;  
                                 } ,  
                                 h a s R e n d e r e d :   f u n c t i o n   ( )   {  
                                         v a r   i d   =   t h i s . i d ;  
                                         i f   ( t y p e o f   F C C . i t e m s [ i d ]   = = =   ' o b j e c t ' )   {  
                                                 r e t u r n   t r u e ;  
                                         }   e l s e   {  
                                                 r e t u r n   f a l s e ;  
                                         }  
                                 } ,  
                                 t o g g l e P i e S l i c e :   f u n c t i o n   ( i n d e x )   {  
                                         i f   ( t h i s . r e f   & &   t h i s . r e f . F C C   & &   t h i s . r e f . F C C . s e r i e s   & &  
                                                 t h i s . r e f . F C C . s e r i e s [ 0 ]   & &   t h i s . r e f . F C C . s e r i e s [ 0 ] . d a t a   & &  
                                                 t h i s . r e f . F C C . s e r i e s [ 0 ] . d a t a [ i n d e x ]   & &  
                                                 t h i s . r e f . F C C . s e r i e s [ 0 ] . d a t a [ i n d e x ] . s l i c e ( ) )   {  
                                                 / / c a l l   t h e   f u n c t i o n  
                                                 t h i s . r e f . F C C . s e r i e s [ 0 ] . d a t a [ i n d e x ] . s l i c e ( ) ;  
                                         }  
                                 }  
                         } ,  
                          
                         s u p p o r t e d S t y l e :   {  
                                 f o n t :   f u n c t i o n   ( H C ,   t o O b j ,   s t y l e )   {  
                                         v a r   s t y l e o b j e c t ,   x ,   m a p   =   {  
                                                 f o n t :   p a s s T h r o u g h S t y l e ( ' f o n t - f a m i l y ' ) ,  
                                                 s i z e :   p a s s T h r o u g h S t y l e ( ' f o n t - s i z e ' ,   ' p x ' ) ,  
                                                 c o l o r :   p a s s T h r o u g h S t y l e ( ' c o l o r ' ,   u n d e f i n e d ,   ' # ' ) ,  
                                                 a l i g n :   f u n c t i o n   ( v a l u e ,   o b j )   {  
                                                         o b j . a l i g n   =   v a l u e ;  
                                                 } ,  
                                                 b g C o l o r :   p a s s T h r o u g h S t y l e ( ' b a c k g r o u n d - c o l o r ' ,   u n d e f i n e d ,   ' # ' ) ,  
                                                 b o r d e r C o l o r :   p a s s T h r o u g h S t y l e ( ' b o r d e r - c o l o r ' ,   u n d e f i n e d ,   ' # ' ) ,  
                                                 i s H T M L :   ' ' ,  
                                                 l e f t M a r g i n :   p a s s T h r o u g h S t y l e ( ' m a r g i n - l e f t ' ,   ' p x ' ) ,  
                                                 l e t t e r S p a c i n g :   p a s s T h r o u g h S t y l e ( ' l e t t e r - s p a c i n g ' ,   ' p x ' ) ,  
                                                 b o l d :   f u n c t i o n   ( v a l u e ,   o b j )   {  
                                                         o b j [ ' f o n t - w e i g h t ' ]   =   v a l u e   = =   ' 1 '   ?   ' b o l d '   :   ' n o r m a l ' ;  
                                                 } ,  
                                                 i t a l i c :   f u n c t i o n   ( v a l u e ,   o b j )   {  
                                                         o b j [ ' f o n t - s t y l e ' ]   =   v a l u e   = =   ' 1 '   ?   ' i t a l i c '   :   ' n o r m a l ' ;  
                                                 } ,  
                                                 u n d e r l i n e :   f u n c t i o n   ( v a l u e ,   o b j )   {  
                                                         o b j [ ' t e x t - d e c o r a t i o n ' ]   =   v a l u e   = =   ' 1 '   ?   ' u n d e r l i n e '   :   ' n o r m a l ' ;  
                                                 }  
                                         } ;  
                                            
                                         s w i t c h   ( t o O b j )   {  
                                         c a s e   ' c a p t i o n ' :  
                                                 s t y l e o b j e c t   =   H C . t i t l e ;  
                                                 b r e a k ;  
  
                                         c a s e   ' d a t a l a b e l s ' :  
                                                 s t y l e o b j e c t   =   H C . x A x i s . l a b e l s ;  
                                                 b r e a k ;  
  
                                         c a s e   ' d a t a v a l u e s ' :  
                                                 s t y l e o b j e c t   =   H C . p l o t O p t i o n s . s e r i e s . d a t a L a b e l s ;  
                                                 b r e a k ;  
  
                                         c a s e   ' s u b c a p t i o n ' :  
                                                 s t y l e o b j e c t   =   H C . s u b t i t l e ;  
                                                 b r e a k ;  
  
                                         c a s e   ' t o o l t i p ' :  
                                                 s t y l e o b j e c t   =   H C . t o o l t i p ;  
                                                 b r e a k ;  
  
                                         c a s e   ' t r e n d v a l u e s ' :  
                                                 s t y l e o b j e c t   =   u n d e f i n e d ;  
                                                 b r e a k ;  
  
                                         c a s e   ' x a x i s n a m e ' :  
                                                 s t y l e o b j e c t   =   H C . x A x i s . t i t l e ;  
                                                 b r e a k ;  
  
                                         c a s e   ' y a x i s n a m e ' :  
                                                 s t y l e o b j e c t   =   H C . y A x i s [ 0 ] . t i t l e ;  
                                                 b r e a k ;  
                                         c a s e   ' y a x i s v a l u e s ' :  
                                                 s t y l e o b j e c t   =   H C . y A x i s [ 0 ] . l a b e l s ;  
                                                 b r e a k ;  
  
                                         d e f a u l t :  
                                                 b r e a k ;  
                                         }  
  
                                         i f   ( t y p e o f   s t y l e o b j e c t   = = =   ' o b j e c t ' )   {  
                                                 f o r   ( x   i n   s t y l e )   {  
                                                         i f   ( t y p e o f   m a p [ x ]   = = =   ' f u n c t i o n ' )   {  
                                                                 m a p [ x ] ( s t y l e [ x ] ,   s t y l e o b j e c t ) ;  
                                                         }  
                                                 }  
                                         }  
                                 }  
                         }  
                 } ;  
  
                 v a r   c h a r t M e s s a g e S t o r e   =   { } ;  
                  
                 / / c l o n e   a n   o b j e c t ' s   p r o p a t i e s   i n   t o   a n o t h e r   a n d   m a r g e d  
                 f u n c t i o n   m a r g e C l o n e ( o b j 1 ,   o b j 2 )   {  
                         v a r   i t e m ;  
                         i f   ( t y p e o f   o b j 1   ! = =   ' o b j e c t '   & &   t y p e o f   o b j 2   ! = =   ' o b j e c t ' )   { / / i f   n o n e   o f   t h e   a r g u m e n t s   a r e   o b j e c t   t h e n   r e t u r n   b a c k  
                                 r e t u r n   n u l l ;  
                         }  
                         i f   ( t y p e o f   o b j 1   ! = =   ' o b j e c t ' )   {  
                                 o b j 1   =   { } ;  
                         }  
                         i f   ( t y p e o f   o b j 2   ! = =   ' o b j e c t ' )   {  
                                 o b j 2   =   o b j 1 ;  
                                 o b j 1   =   { } ;  
                         }  
                         / / c h e c k   w h e t h e r   o b j 2   i s   a n   a r r a y  
                         / / i f   a r r a y   t h e n   i t e r a t e   t h r o u g h   i t ' s   i n d e x  
                         / / * * * *   M O O T O O L S   p r e c u t i o n  
                         i f   ( o b j 2   i n s t a n c e o f   A r r a y )   {  
                                 f o r   ( i t e m   =   0 ;   i t e m   <   o b j 2 . l e n g t h ;   i t e m   + =   1 )   {  
                                         i f   ( t y p e o f   o b j 2 [ i t e m ]   ! = =   ' o b j e c t ' )   {  
                                                 o b j 1 [ i t e m ]   =   o b j 2 [ i t e m ] ;  
                                         }   e l s e   {  
                                                 o b j 1 [ i t e m ]   =   m a r g e C l o n e ( o b j 1 [ i t e m ] ,   o b j 2 [ i t e m ] ) ;  
                                         }  
                                 }  
                         }  
                         e l s e   {  
                                 f o r   ( i t e m   i n   o b j 2 )   {  
                                         i f   ( t y p e o f   o b j 2 [ i t e m ]   ! = =   ' o b j e c t ' )   {  
                                                 o b j 1 [ i t e m ]   =   o b j 2 [ i t e m ] ;  
                                         }   e l s e   {  
                                                 o b j 1 [ i t e m ]   =   m a r g e C l o n e ( o b j 1 [ i t e m ] ,   o b j 2 [ i t e m ] ) ;  
                                         }  
                                 }  
                         }  
                          
                         r e t u r n   o b j 1 ;  
                 }  
  
  
  
                 / / A d d   t h e   p r o t o t y p e   f o r   t h e   F C C   r e n d e r e r  
                 / / t h i s   c o n t a i n   a l l   t h e   m e t h o d s   w h i c h   f l a s h   r e n d e r e r   a d d   t o   t h e   i n s t a n c e  
  
                 F C C . p r o t o t y p e   =   {  
                          
                         / /   A d d   l e g a c y   s e t T r a n s p a r e n t   f u n c t i o n  
  
                         s e t T r a n s p a r e n t :   f u n c t i o n   ( t r a n s p a r e n c y )   {  
  
                                 i f   ( ! t h i s . j s V a r s )   {  
                                         t h i s . j s V a r s   =   { } ;  
                                 }  
  
                                 / /   S e t s   c h a r t   t o   t r a n s p a r e n t   m o d e   w h e n   i s T r a n s p a r e n t   ( w M o d e )   i s   t r u e  
                                 / /   ( d e f a u l t ) .   W h e n   n o   p a r a m e t e r   i s   p a s s e d ,   w e   a s s u m e   t r a n s p a r e n t   t o  
                                 / /   b e   t r u e .  
                                 i f   ( t y p e o f   t r a n s p a r e n c y   ! = =   ' b o o l e a n '   & &   t r a n s p a r e n c y   ! = =   n u l l )   {  
                                         t r a n s p a r e n c y   =   t r u e ;  
                                 }  
                                 / / s e t   t h e   t r a n p a r e n c y   f l a g  
                                 t h i s . j s V a r s . t r a n s p a r e n t   =   t r a n s p a r e n c y ;  
                                 / / u s i n g   j q u e r y   s e t   t h e   b a c k g r o u n d   c o l o r   o f   t h e   c o n t a i n e r   d i v  
                                 i f   ( t y p e o f   j Q u e r y   = = =   ' f u n c t i o n ' )   {  
                                         j Q u e r y ( ' # '   +   t h i s . i d ) . c s s ( ' b a c k g r o u n d - c o l o r ' ,   ( t r a n s p a r e n c y   = = =   t r u e )   ?   ' '   :   ' # F F F F F F ' ) ;  
                                 }  
  
                         } ,  
                         g e t S W F H T M L :   n o E f f e c t ,   / / f l a s h   s p e c i f i c   m e t h o d  
                          
                         / / J S   c h a r t ' s   f u n c t i o n   t o   p a s s   a   c o n f i g .   f o r   j s   c h a r t s   o n l y  
                         _ o v e r r i d e J S C h a r t C o n f i g u r a t i o n :   f u n c t i o n   ( c o n f )   {  
                                 / / s a v e   t h e   c o n f i g u r a t i o n   o f   t h e   c h h a r t  
                                 / / w h i c h   w i l l   b e   r e t r i v e   d u r i n g   t h e   c h a r t   c r e a t i o n  
                                 j s C o n f [ t h i s . i d ]   =   c o n f ;  
                         }  
  
                 } ;  
  
  
  
  
                 / / s e t   t h e   b a s e U R L  
                 / / i f   u s e r   d e f i n e d   t h e n   u s e   i t  
                 i f   ( g l o b a l . c o r e . o p t i o n s   & &   g l o b a l . c o r e . o p t i o n s . s c r i p t B a s e U r i   ! = =   u n d e f i n e d )   {  
                         b a s e U R L   =   g l o b a l . c o r e . o p t i o n s . s c r i p t B a s e U r i ;  
                 }   e l s e   { / / e l s e   u s e   t h e   b a s e U R L   F u s i o n C h a r t s . j s  
                         s c r i p t T a g s   =   d o c u m e n t . g e t E l e m e n t s B y T a g N a m e ( ' s c r i p t ' ) ;  
                         / / i t e r a t e   t h r o u g h   a l l   t h e   s c r i p t   t a g   t o   f i e n d   t h e   p a t h   o f   t h e   F C . J S   f i l e  
                         i f   ( s c r i p t T a g s )   {  
                                 f o r   ( i   =   0 ;   i   <   s c r i p t T a g s . l e n g t h ;   i   + =   1 )   {  
                                         i f   ( s c r i p t T a g s [ i ] . s r c . i n d e x O f ( ' F u s i o n C h a r t s . j s ' )   ! = =   - 1 )   {  
                                                 b a s e U R L   =   s c r i p t T a g s [ i ] . s r c . s p l i t ( " F u s i o n C h a r t s . j s " ) [ 0 ] ;  
                                         }  
                                 }  
                         }  
                 }  
  
  
                 / / T h a   f u n c t i o n   t o   c h e c k   w h e t h e r   t h e   F C C   i s   r e d a y   o r   n o t  
                 F C C . i s R e a d y   =   f u n c t i o n   ( )   {  
                         r e t u r n   F C C r e a d y ;  
                 } ;  
  
  
                 / / / c o n t a i n e r   f o r   a l l   F C C   o b j e c t   w i t h   t h e   b a s e   o b j e c t [ a f t e r   c o n v e r t i o n ]  
                 / /   &   c h a r t   o b j e c t [ F C   r e f . ]  
                 F C C . i t e m s   =   { } ;  
  
  
  
                 / / f u n c t i o n     t h a t   w i l l   a d d   a   s c r i p t   t a g   i n   h e a d  
                 f u n c t i o n   l o a d S c r i p t ( s r c )   {  
                         / / c r e a t e   n e w   s c r i p t   e l e m e n t  
                         / / s e t   t h e   s r c  
                         / / a p p e n d   i n   h e a d  
                         v a r   n e w e l e   =   d o c u m e n t . c r e a t e E l e m e n t ( ' s c r i p t ' ) ;  
                         n e w e l e . s e t A t t r i b u t e ( ' t y p e ' ,   ' t e x t / j a v a s c r i p t ' ) ;  
                         n e w e l e . s e t A t t r i b u t e ( ' s r c ' ,   s r c ) ;  
                         v a r   h e a d   =   d o c u m e n t . g e t E l e m e n t s B y T a g N a m e ( ' h e a d ' ) ;  
                         h e a d [ 0 ] . a p p e n d C h i l d ( n e w e l e ) ;  
                 }  
  
                 / / f u n c t i o n   t h a t   w i l l   c h a e k   w h e t h e r   F C C   i s   r e a d y   o r   n o t  
  
                 f u n c t i o n   c h e c k F C C R e a d y ( )   {  
                         v a r   t e m p ;  
                         i f   ( t y p e o f   w i n d o w . H i g h c h a r t s   = = =   ' o b j e c t ' )   {  
                                 F C C r e a d y   =   t r u e ;  
                                 / / c a l l   a l l   t h e   s t a c k e d   r e n d e r   a c t i o n s  
                                 i f   ( t y p e o f   F C C . r e n d e r   = =   ' f u n c t i o n ' )   {  
                                         w h i l e   ( r e n d e r A r r a y . l e n g t h   >   0 )   {  
                                                 t e m p   =   r e n d e r A r r a y . s p l i c e ( 0 ,   1 ) [ 0 ] ;  
                                                 F C C . r e n d e r . c a l l ( t e m p [ 0 ] ,   t e m p [ 1 ] ,   t e m p [ 2 ] ) ;  
                                         }  
                                 }  
  
                         / / c a l l   F C C   o n r e a d y   f u n c t i o n  
                         }   e l s e   {  
                                 s e t T i m e o u t ( c h e c k F C C R e a d y ,   3 0 0 ) ;  
                         }  
                 }  
  
                 / / l o a d   H I G F C C H A R T S  
                 f u n c t i o n   l o a d F C C ( )   {  
                         i f   ( t y p e o f   j Q u e r y   = = =   ' f u n c t i o n ' )   {  
                                 j Q u e r y . n o C o n f l i c t ( ) ;  
                                 / / c h e c k   w h e t h e r   t h e r e   n o   o n e   i s   u s i n g   $   t h e n   p l e a s e   r e v e r t   $   t o   i t  
                                 i f   ( $   = = =   u n d e f i n e d )   {  
                                         $   =   j Q u e r y ;  
                                 }  
                                  
                                 i f   ( t y p e o f   w i n d o w . H i g h c h a r t s   ! = =   ' o b j e c t ' )   {  
                                         l o a d S c r i p t ( b a s e U R L   +   ' h i g h c h a r t s . j s ' ) ;  
                                         s e t T i m e o u t ( c h e c k F C C R e a d y ,   3 0 0 ) ;  
                                 }   e l s e   {  
                                         c h e c k F C C R e a d y ( ) ;  
                                 }  
                         }   e l s e   {  
                                 s e t T i m e o u t ( l o a d F C C ,   3 0 0 ) ;  
                         }  
                 }  
  
  
  
                 / / l o a d   j q u e r y  
                 i f   ( t y p e o f   j Q u e r y   ! = =   ' f u n c t i o n ' )   {  
                         l o a d S c r i p t ( b a s e U R L   +   ' j q u e r y . m i n . j s ' ) ;  
                         s e t T i m e o u t ( l o a d F C C ,   3 0 0 ) ;  
                 }   e l s e   {  
                         l o a d F C C ( ) ;  
                 }  
  
  
  
  
                 / / / / / / / / / /   L i s t   o f   t o o l s ( f u n c t i o n s )   n e e d e d / / / / / / / / / /  
  
                 / / c a l c u l a t   a x i s   m a x / m i n  
  
                 v a r   g e t A x i s L i m i t s     =   f u n c t i o n   ( m a x V a l u e ,   m i n V a l u e ,   y A x i s M a x V a l u e ,   y A x i s M i n V a l u e ,   s t o p M a x A t Z e r o ,   s e t M i n A s Z e r o )   {  
  
                                 v a r   m a x P o w e r O f T e n ,   m i n P o w e r O f T e n ,   p o w e r O f T e n ,   y _ i n t e r v a l ,   r a n g e P o w e r O f T e n ,   r a n g e I n t e r v a l ,   y _ t o p B o u n d ,   y _ l o w e r B o u n d ,   y M a x G i v e n ,   y M i n G i v e n ,   y M a x ,   y M i n ,   r a n g e ,   i n t e r v a l ;  
  
                                 / / F i r s t   c h e c k   i f   b o t h   m a x V a l u e   a n d   m i n V a l u e   a r e   p r o p e r   n u m b e r s .  
                                 / / E l s e ,   s e t   d e f a u l t s   a s   9 0 , 0  
                                 m a x V a l u e   =   ( t y p e o f   m a x V a l u e   ! = =   ' n u m b e r ' )   ?   0 . 1   :   m a x V a l u e ;  
                                 m i n V a l u e   =   ( t y p e o f   m i n V a l u e     ! = =   ' n u m b e r ' )   ?   0   :   m i n V a l u e ;  
                                 / / m a x V a l u e   =   ( i s N a N   ( m a x V a l u e )   = =   t r u e   | |   m a x V a l u e   = =   u n d e f i n e d )   ?   0 . 1   :   m a x V a l u e ;  
                                 / / m i n V a l u e   =   ( i s N a N   ( m i n V a l u e )   = =   t r u e   | |   m i n V a l u e   = =   u n d e f i n e d )   ?   0   :   m i n V a l u e ;  
  
  
                                 / / O r ,   i f   o n l y   0   d a t a   i s   s u p p l i e d  
                                 i f   ( ( m a x V a l u e   = = =   m i n V a l u e )   & &   ( m a x V a l u e   = = =   0 ) )   {  
                                         m a x V a l u e   =   0 . 1 ;  
                                 }  
  
                                 / / D e f a u l t s   f o r   s t o p M a x A t Z e r o   a n d   s e t M i n A s Z e r o  
                                 / / s t o p M a x A t Z e r o   =   g e t F i r s t V a l u e   ( s t o p M a x A t Z e r o ,   f a l s e ) ;  
                                 / / s e t M i n A s Z e r o   =   g e t F i r s t V a l u e   ( s e t M i n A s Z e r o ,   t r u e ) ;  
                                 i f   ( t y p e o f   s t o p M a x A t Z e r o   = = =   ' u n d e f i n e d '   | |   t y p e o f   s t o p M a x A t Z e r o   = = =   ' n u l l '   | |   s t o p M a x A t Z e r o   = = =   ' ' )   {  
                                         s t o p M a x A t Z e r o   =   f a l s e ;  
                                 }  
                                 i f   ( t y p e o f   s e t M i n A s Z e r o   = = =   ' u n d e f i n e d '   | |   t y p e o f   s e t M i n A s Z e r o   = = =   ' n u l l '   | |   s e t M i n A s Z e r o   = = =   ' ' )   {  
                                         s e t M i n A s Z e r o   =   t r u e ;  
                                 }  
  
                                 / / G e t   t h e   m a x i m u m   p o w e r   o f   1 0   t h a t   i s   a p p l i c a b l e   t o   m a x v a l u e  
                                 / / T h e   N u m b e r   =   1 0   t o   t h e   p o w e r   m a x P o w e r O f T e n   +   x   ( w h e r e   x   i s   a n o t h e r   n u m b e r )  
                                 / / F o r   e . g . ,   i n   9 9   t h e   m a x P o w e r O f T e n   w i l l   b e   1   =   1 0 ^ 1   +   8 9  
                                 / / A n d   f o r   1 0 2 ,   i t   w i l l   b e   2   =   1 0 ^ 2   +   2  
                                 m a x P o w e r O f T e n   =   M a t h . f l o o r ( M a t h . l o g ( M a t h . a b s ( m a x V a l u e ) )   /   M a t h . L N 1 0 ) ;  
                                 / / G e t   t h e   m i n i m u m   p o w e r   o f   1 0   t h a t   i s   a p p l i c a b l e   t o   m a x v a l u e  
                                 m i n P o w e r O f T e n   =   M a t h . f l o o r ( M a t h . l o g ( M a t h . a b s ( m i n V a l u e ) )   /   M a t h . L N 1 0 ) ;  
  
                                 / / F i n d   w h i c h   p o w e r O f T e n   ( t h e   m a x   p o w e r   o r   t h e   m i n   p o w e r )   i s   b i g g e r  
                                 / / I t   i s   t h i s   w h i c h   w i l l   b e   m u l t i p l i e d   t o   g e t   t h e   y - i n t e r v a l  
                                 p o w e r O f T e n   =   M a t h . m a x ( m i n P o w e r O f T e n ,   m a x P o w e r O f T e n ) ;  
                                 y _ i n t e r v a l   =   M a t h . p o w ( 1 0 ,   p o w e r O f T e n ) ;  
  
                                 / / F o r   a c c o m o d a t i n g   s m a l l e r   r a n g e   v a l u e s   ( s o   t h a t   s c a l e   d o e s n ' t   r e p r e s e n t   t o o   l a r g e   a n   i n t e r v a l  
                                 i f   ( M a t h . a b s ( m a x V a l u e )   /   y _ i n t e r v a l   <   2   & &   M a t h . a b s ( m i n V a l u e )   /   y _ i n t e r v a l   <   2 )   {  
                                         p o w e r O f T e n   - =   1 ;  
                                         y _ i n t e r v a l   =   M a t h . p o w ( 1 0 ,   p o w e r O f T e n ) ;  
                                 }  
  
                                 / / I f   t h e   y _ i n t e r v a l   o f   m i n   a n d   m a x   i s   w a y   m o r e   t h a n   t h a t   o f   r a n g e .  
                                 / / W e   n e e d   t o   r e s e t   t h e   y - i n t e r v a l   a s   p e r   r a n g e  
                                 r a n g e P o w e r O f T e n   =   M a t h . f l o o r ( M a t h . l o g ( m a x V a l u e   -   m i n V a l u e )   /   M a t h . L N 1 0 ) ;  
                                 r a n g e I n t e r v a l   =   M a t h . p o w ( 1 0 ,   r a n g e P o w e r O f T e n ) ;  
                                 / / N o w ,   i f   r a n g e I n t e r v a l   i s   1 0   t i m e s   l e s s   t h a n   y _ i n t e r v a l ,   w e   n e e d   t o   r e - s e t  
                                 / / t h e   l i m i t s ,   a s   t h e   r a n g e   i s   t o o   l e s s   t o   a d j u s t   t h e   a x i s   f o r   m a x , m i n .  
                                 / / W e   d o   t h i s   o n l y   i f   r a n g e   i s   g r e a t e r   t h a n   0   ( i n   c a s e   o f   1   d a t a   o n   c h a r t ) .  
                                 i f   ( ( ( m a x V a l u e   -   m i n V a l u e )   >   0 )   & &   ( ( y _ i n t e r v a l   /   r a n g e I n t e r v a l )   > =   1 0 ) )   {  
                                         y _ i n t e r v a l   =   r a n g e I n t e r v a l ;  
                                         p o w e r O f T e n   =   r a n g e P o w e r O f T e n ;  
                                 }  
                                 / / C a l c u l a t e   t h e   y - a x i s   u p p e r   l i m i t  
                                 y _ t o p B o u n d   =   ( M a t h . f l o o r ( m a x V a l u e   /   y _ i n t e r v a l )   +   1 )   *   y _ i n t e r v a l ;  
                                 / / C a l c u l a t e   t h e   y - a x i s   l o w e r   l i m i t  
                                 / / y _ l o w e r B o u n d  
                                 / / I f   t h e   m i n   v a l u e   i s   l e s s   t h a n   0  
                                 i f   ( m i n V a l u e   <   0 )   {  
                                         / / T h e n   c a l c u l a t e   b y   m u l t i p l y i n g   n e g a t i v e   n u m b e r s   w i t h   y - a x i s   i n t e r v a l  
                                         y _ l o w e r B o u n d   =   -   1   *   ( ( M a t h . f l o o r ( M a t h . a b s ( m i n V a l u e   /   y _ i n t e r v a l ) )   +   1 )   *   y _ i n t e r v a l ) ;  
                                 }   e l s e   {  
                                         / / E l s e ,   s i m p l y   s e t   i t   t o   0 .  
                                         i f   ( s e t M i n A s Z e r o )   {  
                                                 y _ l o w e r B o u n d   =   0 ;  
                                         }   e l s e   {  
                                                 y _ l o w e r B o u n d   =   M a t h . f l o o r ( M a t h . a b s ( m i n V a l u e   /   y _ i n t e r v a l )   -   1 )   *   y _ i n t e r v a l ;  
                                                 / / N o w ,   i f   m i n V a l u e > = 0 ,   w e   k e e p   x _ l o w e r B o u n d   t o   0   -   a s   f o r   v a l u e s   l i k e   m i n V a l u e   2  
                                                 / / l o w e r   b o u n d   g o e s   n e g a t i v e ,   w h i c h   i s   n o t   r e q u i r e d .  
                                                 y _ l o w e r B o u n d   =   ( y _ l o w e r B o u n d   <   0 )   ?   0   :   y _ l o w e r B o u n d ;  
  
                                         }  
                                 }  
                                 / / M a x V a l u e   c a n n o t   b e   l e s s   t h a n   0   i f   s t o p M a x A t Z e r o   i s   s e t   t o   t r u e  
                                 i f   ( s t o p M a x A t Z e r o   & &   m a x V a l u e   < =   0 )   {  
                                         y _ t o p B o u n d   =   0 ;  
                                 }  
  
                                 / / N o w ,   w e   n e e d   t o   m a k e   a   c h e c k   a s   t o   w h e t h e r   t h e   u s e r   h a s   p r o v i d e d   a n   u p p e r   l i m i t  
                                 / / a n d   l o w e r   l i m i t .  
                                 i f   ( y A x i s M a x V a l u e   = = =   n u l l   | |   y A x i s M a x V a l u e   = = =   u n d e f i n e d   | |   y A x i s M a x V a l u e   = = =   " " )   {  
                                         y M a x G i v e n   =   f a l s e ;  
                                 }   e l s e   {  
                                         y M a x G i v e n   =   t r u e ;  
                                 }  
                                 i f   ( y A x i s M i n V a l u e   = = =   n u l l   | |   y A x i s M i n V a l u e   = = =   u n d e f i n e d   | |   y A x i s M i n V a l u e   = = =   " "   | |   t y p e o f   N u m b e r ( y A x i s M i n V a l u e )   = = =   ' N a N ' )   {  
                                         y M i n G i v e n   =   f a l s e ;  
                                 }   e l s e   {  
                                         y M i n G i v e n   =   t r u e ;  
                                 }  
                                 / / I f   h e   h a s   p r o v i d e d   i t   a n d   i t   i s   v a l i d ,   w e   l e a v e   i t   a s   t h e   u p p e r   l i m i t  
                                 / / E l s e ,   w e   e n f o r c e d   t h e   v a l u e   c a l c u l a t e   b y   u s   a s   t h e   u p p e r   l i m i t .  
                                 i f   ( y M a x G i v e n   = = =   f a l s e   | |   ( y M a x G i v e n   = = =   t r u e   & &   N u m b e r ( y A x i s M a x V a l u e )   <   m a x V a l u e ) )   {  
                                         y M a x   =   y _ t o p B o u n d ;  
                                 }   e l s e   {  
                                         y M a x   =   N u m b e r ( y A x i s M a x V a l u e ) ;  
                                 }  
                                 / / N o w ,   w e   d o   t h e   s a m e   f o r   y - a x i s   l o w e r   l i m i t  
                                 i f   ( y M i n G i v e n   = = =   f a l s e   | |   ( y M i n G i v e n   = = =   t r u e   & &   N u m b e r ( y A x i s M i n V a l u e )   >   m i n V a l u e ) )   {  
                                         y M i n   =   y _ l o w e r B o u n d ;  
                                 }   e l s e   {  
                                         y M i n   =   N u m b e r ( y A x i s M i n V a l u e ) ;  
                                 }  
                                 / / S t o r e   a x i s   r a n g e  
                                 r a n g e   =   M a t h . a b s ( y M a x   -   y M i n ) ;  
                                 / / S t o r e   i n t e r v a l  
                                 i n t e r v a l   =   y _ i n t e r v a l ;  
  
                                 r e t u r n   { M a x :   y M a x ,   M i n :   y M i n ,   R a n g e :   r a n g e ,   i n t e r v a l :   i n t e r v a l } ;  
                         } ;  
  
  
  
  
                 / / f u n c t i o n   t o   c r e a t e   t h e c o n t a i n e r   e l e m e n t   f o r   c h a r t  
                 f u n c t i o n   c r e a t e C o n t a i n e r ( c o n t a n e r I d ,   c h a r t I d ,   w i d t h ,   h e i g h t ,   c l e a n C o p y )   {  
                         / / g e t   t h e   c o n t a i n e r  
                         v a r   c o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( c h a r t I d ) ,   _ _ c o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( c o n t a n e r I d ) ,  
                         / * *  
                           *   @ v a r   { R e g E x p }   l e n g t h P e r c e n t a g e R e g E x p   d e t e r m i n e s   w h e t h e r   a   s t r i n g   h a s  
                           *   t r a i l i n g   p e r c e n t a g e   c h a r a c t e r   o r   n o t .   I g n o r i n g   w h i t e - s p a c e s .  
                           * /  
                         l e n g t h P e r c e n t a g e R e g E x p   =   / \ % \ s * ? $ / i g ;  
                         / / / /  
                         / / c h e c k   w h e t h e r   t h e r e   n e e d s   a n   c l e a n   d i v  
                         i f   ( c l e a n C o p y   = = =   t r u e )   {  
                                 / / / d e l e t e   t h e   s p a n   c r e a t e d   b y   F C . j s  
                                 i f   ( c o n t a i n e r )   {  
                                         _ _ c o n t a i n e r . r e m o v e C h i l d ( c o n t a i n e r ) ;  
                                 }  
                                 / / c r e a t e   a   d i v   a s   p e r   c h a r t   i d  
                                 / /   s e t   t h e   h e i g h t   a n d   w i d t h   a n d   r e l a t i v e   p o s i t i o n   f o r   t h e   b a c k   b u t t o n  
                                 / / s e t   t h e   b a c k g r o u n d   w h i t e   f o r   t r a n s p a r e n c y   0  
                                 c o n t a i n e r   =   d o c u m e n t . c r e a t e E l e m e n t ( ' d i v ' ) ;  
                                 c o n t a i n e r . s e t A t t r i b u t e ( ' i d ' ,   c h a r t I d ) ;  
                                 _ _ c o n t a i n e r . a p p e n d C h i l d ( c o n t a i n e r ) ;  
                         }  
                         / / a d d   a l l   a t t r i b u t e s  
                         f o r   ( v a r   x   i n   t h i s . a t t r i b u t e s )   {  
                                 c o n t a i n e r [ x ]   =   t h i s . a t t r i b u t e s [ x ] ;  
                         }  
                         / / a d d   t h e   c l a s s N a m e   f i x   f o r   I E  
                         i f   ( t h i s . a t t r i b u t e s [ ' c l a s s ' ] )   {  
                                 c o n t a i n e r . c l a s s N a m e   =   t h i s . a t t r i b u t e s [ ' c l a s s ' ] ;  
                         }  
                         c o n t a i n e r . s e t A t t r i b u t e ( ' s t y l e ' ,   ' d i s p l a y :   i n l i n e - b l o c k ;   z o o m :   1 ;   * d i s p l a y :   i n l i n e ; ' ) ;  
                         / / / / c h e c k   w h e t h e r   w i d t h   a n d   h i g h t   a r e   s t r i n g  
                         / / o t h e r w i s e   d o n ' t   m a t h   t h e   r e g   j u s t   a d d   p x  
                         c o n t a i n e r . s t y l e . w i d t h   =   w i d t h   +   ( w i d t h . m a t c h ( l e n g t h P e r c e n t a g e R e g E x p )   ?   ' '   :   ' p x ' ) ;  
                         c o n t a i n e r . s t y l e . h e i g h t   =   h e i g h t   +   ( h e i g h t . m a t c h ( l e n g t h P e r c e n t a g e R e g E x p )   ?   ' '   :   ' p x ' ) ;  
                 }  
  
                 / / f u n c t i o n   t h a t   w i l l   r e m o v e   a   c h a r t  
                 f u n c t i o n   r e m o v e C h a r t ( i d ,   d e l e t e D o m )   {  
                         / / d e s t r o y   t h e   H C   o b j   f r o m   H C   m e t h o d e  
                         i f   ( F C C . i t e m s [ i d ] )   {  
                                 i f   ( F C C . i t e m s [ i d ] . F C C O b j   & &   F C C . i t e m s [ i d ] . F C C O b j . F C C )   {  
                                         F C C . i t e m s [ i d ] . F C C O b j . F C C . d e s t r o y ( ) ;  
                                 }  
                                 / / c l e a r e   t h e   m i m e r   f o r   r e s i z e   c h a r t   e v e n t  
                                 c l e a r T i m e o u t ( F C C . i t e m s [ i d ] . t i m e C h a c h ) ;  
                                
                                 / / r e m o v e   t h e   d i v   e l e m e n t   i f   r e q u r e d  
                                 i f   ( d e l e t e D o m   = = =   t r u e )   {  
                                         / /   @ v a r   r e f O b j   { H T M L N o d e }   C r e a t e   r e f e r e n c e   t o   t h e   c h a r t   o b j e c t .  
                                         v a r   r e f O b j   =   F C C . i t e m s [ i d ] . F C C O b j ;  
  
                                         / /   C h e c k   w h e t h e r   H T M L   N o d e   r e f e r e n c e   e x i s t   o r   n o t .   I f   i t   e x i s t s ,  
                                         / /   c l i m b   u p   t o   i t s   p a r e n t   n o d e   i n   D O M   a n d   d e l e t e   t h e   e l e m e n t .  
                                         i f   ( r e f O b j   & &   r e f O b j . p a r e n t N o d e )   {  
                                                 r e f O b j . p a r e n t N o d e . r e m o v e C h i l d ( r e f O b j ) ;  
                                         }  
                                 }  
                                 / / d e l e t e   t h e   H C   o b j   f r o m   l o c a l   s t o r e  
                                 d e l e t e   F C C . i t e m s [ i d ] ;  
                         }  
                 }  
  
                 / / / f u n c t i o n   t o   c r e a t e   b a n k   s e r e a s e  
                 f u n c t i o n   c r e a t e S e r i e s ( F C t y p e ,   c o l o r ,   t y p e ,   n a m e ,   y A x i s ,   s h o w v a l u e ,   l i n e c o l o r ,   l i n e t h i c k n e s s ,   m a r k e r )   {  
                         r e t u r n   {  
                                 d a t a :   [ ] ,  
                                 F C t y p e :   F C t y p e ,  
                                 c o l o r :   c o l o r ,  
                                 t y p e :   t y p e ,  
                                 n a m e :   n a m e   ?   n a m e :   '   ' ,  
                                 y A x i s :   y A x i s   ?   1 :   u n d e f i n e d ,  
                                 s h o w v a l u e :   s h o w v a l u e ,  
                                 l i n e C o l o r :   l i n e c o l o r ,  
                                 l i n e W i d t h   :   l i n e t h i c k n e s s ,  
                                 m a r k e r :   m a r k e r  
                         } ;  
                 }  
  
                 / / p a r s e   a   s t r i n g   a s   p e r   c o n f i g u r a t i o n  
                 f u n c t i o n   p a r s e S t r ( s t r )   {  
                         i f   ( t y p e o f   s t r   = = =   ' s t r i n g ' )   {  
                                 r e t u r n   s t r . r e p l a c e ( / \ { b r \ } / i g ,   ' < b r / > ' ) ;  
                         }  
                         e l s e   {  
                                 r e t u r n   ' ' ;  
                         }  
                 }  
                 / / / / / f u n c t i o n   t h a t   w i l l   c r e a t e   a   h c   o b j e c t   t o   s h o w   a   m e s s a g e  
                 f u n c t i o n   c r e a t e M s g ( i d ,   m s g T x t ,   e v e n t )   {  
                         / / c o p p y   t h e   b l a n k   c h a r t   o b j e c t  
                         v a r   H C J s o n   =   F C F C C . J S O N c o n f . b l a n k C h a r t ;  
                         / / s e t   t h e   t i t l e   y   p o s .   f o r   t h e   c h a r t   s o   t h a t   t h e   m s g   g e t   i n t o   t h e   c e n d e r  
                         H C J s o n . t i t l e . y   =   p a r s e I n t ( d o c u m e n t . g e t E l e m e n t B y I d ( i d ) . o f f s e t H e i g h t ,   1 0 )   /   2 ;  
                         / / s e t   t h e   r e n d e r T o   i d  
                         H C J s o n . c h a r t . r e n d e r T o   =   i d ;  
                         / / / / s e t   t h e   c h a r t   m e s s a g e  
                         H C J s o n . t i t l e . t e x t   =   c h a r t M e s s a g e S t o r e [ i d ] [ m s g T x t ]   ?   c h a r t M e s s a g e S t o r e [ i d ] [ m s g T x t ]   :   m s g T x t ;  
                         / / r a i s e   t h e   n o d a t a   e v e n t  
                         i f   ( t y p e o f   e v e n t   = = =   ' s t r i n g ' )   {  
                                 g l o b a l . r a i s e E v e n t ( e v e n t ,   { } ,   g l o b a l . c o r e . i t e m s [ i d ] ) ;  
                         }  
                         r e t u r n   H C J s o n ;  
                 }  
  
  
                 / / f u n c t i o n   t h a t   w i l l   s h o w   a   m e s s a g e   i n   a c h a r t  
                 f u n c t i o n   s h o w C h a r t M e s s a g e ( m s g )   {  
                         v a r   i d   =   t h i s . i d ,   H C J s o n ,   F C   =   g l o b a l . c o r e . i t e m s [ i d ] ;  
                         / / c h e c k   w h e t e h e r   t h e   c o n t a i n e r   e x i s t  
                         / / = = >   f a l s e   i f   a   l i n k e d   c h a r t   i s   o p e n e d  
                         i f   ( F C . r e f )   {  
                                 / / s a v e   t h e   c h a r t   m e s s a g e  
                                 c h a r t M e s s a g e S t o r e [ i d ] . m s g T x t   =   m s g ;  
                                 / / d e s t r o y   t h e   o l d   H C   c h a r t  
                                 F C . r e f . F C C . d e s t r o y ( ) ;  
                                 / / c r e a t e   n e w   H C   j s o n   t o   s h o w   t h e   c h a r t  
                                 H C J s o n   =   c r e a t e M s g ( i d ,   ' m s g T x t ' ,   u n d e f i n e d ) ;  
                                  
                                 / / c r e a t e   t h e   r e f   o f   n e w   h i g h   c h a r t s  
                                 F C . r e f . F C C   =   n e w   H i g h c h a r t s . C h a r t ( H C J s o n ) ;  
                                  
                                 / / s a v e   t h e   c h a r t ' s   v a r i o u s   o b j e c t s   i n   l o c a l   s t o r e  
                                 F C C . i t e m s [ i d ] . b a s e O b j   =     H C J s o n ;  
                         }  
                          
                         i f   ( F C . l i n k . r o o t   = = =   F C )   { / / c h e c k   w h e t h e r   i t   i s   n o t   a n   l i n k e d   c h a r t  
                                 r e t u r n ;  
                         }  
                         / / i f   l i n k e d   c h a r t   s h o w   t h e   b a c k   b u t t o n  
                         v a r   c o n f i g   =   g l o b a l . e x t e n d ( {  
                                 s h o w :   t r u e  
                         } ,   t h i s . F u s i o n C h a r t s . l i n k . p a r e n t . o p t i o n s . o v e r l a y B u t t o n ) ;  
                         g l o b a l . e x t e n d ( c o n f i g ,   t h i s . F u s i o n C h a r t s . l i n k . p a r e n t . l i n k . c o n f i g u r a t i o n ( ) . o v e r l a y B u t t o n   | |   { } ) ;  
  
                         t h i s . d r a w O v e r l a y B u t t o n ( c o n f i g ) ;  
                 }  
  
                 / / f u n c t i o n   t h a t   w i l l   d r a w   a   o v e r l a y   b u t t o n  
                 f u n c t i o n   d r a w O v e r l a y B u t t o n ( c o n f )   {  
                         i f   ( c o n f . s h o w )   { / / i f   h a v e   t o   s h o w   t h e   o v e r l a y   b u t t o n  
                                 / / c r e a t e w   a   s p a n   f o r   b a c k   b u t t o n  
                                 / / a d d   t h e   t e x t  
                                 / / s e t   b o r d e r   c o l o r   o n c l i c k   f u n c t i o n   e t c .  
                                 v a r   b a c k   =   d o c u m e n t . c r e a t e E l e m e n t ( ' s p a n ' ) ;  
                                 b a c k . i n n e r H T M L   =   c o n f . m e s s a g e   ?   c o n f . m e s s a g e   :   " B a c k " ;  
                                 b a c k . s t y l e . b o r d e r   =   ' 1 p x   s o l i d   # '   +   ( c o n f . b o r d e r C o l o r   ?   c o n f . b o r d e r C o l o r   :   " 7 f 8 9 7 5 " ) ;  
                                 b a c k . s t y l e . b a c k g r o u n d C o l o r   =   ' # '   +   ( c o n f . b g C o l o r   ?   c o n f . b g C o l o r   :   " e d e f e c " ) ;  
                                 b a c k . s t y l e . f o n t F a m i l y   =   c o n f . f o n t   ?   c o n f . f o n t   :   " V e r d a n a " ;  
                                 b a c k . s t y l e . c o l o r   =   ' # '   +   c o n f . f o n t C o l o r   ?   c o n f . f o n t C o l o r : " 4 9 5 6 3 a " ;  
                                 b a c k . s t y l e . f o n t S i z e   =   ( c o n f . f o n t S i z e   ?   c o n f . f o n t S i z e   :   ' 1 0 ' )   +   ' p x ' ;  
                                 b a c k . s t y l e . p a d d i n g   =   ( c o n f . p a d d i n g   ?   c o n f . p a d d i n g   :   ' 3 ' )   +   ' p x ' ;  
                                 b a c k . s t y l e . f o n t W e i g h t   =   p a r s e I n t ( c o n f . b o l d ,   1 0 )   = = =   0   ?   ' n o r m a l '   :   ' b o l d ' ;  
                                 b a c k . s t y l e . p o s i t i o n   =   ' a b s o l u t e ' ;  
                                 b a c k . s t y l e . t o p   =   ' 1 p x ' ;  
                                 b a c k . s t y l e . r i g h t   =   ' 1 p x ' ;  
                                 b a c k . s t y l e . _ c u r s o r   =   ' h a n d ' ;  
                                 b a c k . s t y l e . c u r s o r   =   ' p o i n t e r ' ;  
                                 b a c k . o n c l i c k   =   ( f u n c t i o n   ( s e n d e r )   {  
                                         r e t u r n   f u n c t i o n   ( )   {  
                                                 g l o b a l . r a i s e E v e n t ( ' O v e r l a y B u t t o n C l i c k ' ,   { } ,   s e n d e r . F u s i o n C h a r t s ) ;  
                                         } ;  
                                 } ( t h i s ) ) ;  
                                 d o c u m e n t . g e t E l e m e n t B y I d ( t h i s . i d ) . c h i l d N o d e s [ 0 ] . a p p e n d C h i l d ( b a c k ) ;  
                         }  
                 }  
  
  
                 / / t h i s   f u n c t o n   w i l l   m a p   c h a r t   s e r i e s   t y p e   w i t h   i t s   n a m e     a n d   r e t u r n   i t  
                 f u n c t i o n   g e t S e r i e s N a m e ( c h a r t N a m e )   {  
                         r e t u r n   F C F C C . s e r i e s N a m e [ c h a r t N a m e ] ;  
                 }  
  
                 / / r e d u c e   g r a d e n t   c o l o r   t a k e   o n l y   f i r s t   c o l o r  
                 / / c o n v e r t s   c o l o r   t o   c o m p a t a b l e   c o l o r   f o r m a t  
                 / / * * * *   r g b a   m u s t   b e   r g b s ( r , g , b , a )   f o r m a t  
                 f u n c t i o n   c o n v e r t C o l o r ( c o l o r ,   a l p h a ,   r g b a )   {  
                         v a r   R   =   0 ,   G   =   0 ,   B   =   0 ,   c o l o r S t r ,   t e m p A r r ;  
                          
                          
                         i f   ( r g b a   & &   r g b a . m a t c h ( / ^ r g b a / i g ) )   {  
                                 t e m p A r r   =   r g b a . s p l i t ( ' , ' ) ;  
                                 R   =   t e m p A r r [ 0 ] . s l i c e ( t e m p A r r [ 3 ] . i n d e x O f ( ' ( ' )   +   1 ) ;  
                                 G   =   t e m p A r r [ 1 ] ;  
                                 B   =   t e m p A r r [ 2 ] ;  
                                 i f   ( ! a l p h a )   {  
                                         a l p h a   =   p a r s e I n t ( t e m p A r r [ 3 ] . s l i c e ( 0 ,   t e m p A r r [ 3 ] . i n d e x O f ( ' ) ' ) ) ,   1 0 )   *   1 0 0 ;  
                                 }  
                         }  
                         i f   ( c o l o r )   {  
                                 c o l o r S t r   =   c o l o r . r e p l a c e ( / [ # \ s ] / i g ,   ' ' ) . s p l i t ( ' , ' ) [ 0 ] ;  
                                 s w i t c h   ( c o l o r S t r . l e n g t h )   {  
                                 c a s e   3 :  
                                         c o l o r S t r   =   c o l o r S t r [ 0 ]   +   c o l o r S t r [ 0 ]   +   c o l o r S t r [ 1 ]   +   c o l o r S t r [ 1 ]   +   c o l o r S t r [ 2 ]   +   c o l o r S t r [ 2 ] ;  
                                         b r e a k ;  
                                 c a s e   6 :  
                                         b r e a k ;  
                                 d e f a u l t :  
                                         c o l o r S t r   =   ( c o l o r S t r   +   ' F F F F F F ' ) . s l i c e ( 0 ,   6 ) ;  
                                         b r e a k ;  
                                 }  
                                 R   =   p a r s e I n t ( c o l o r S t r . s l i c e ( 0 ,   2 ) ,   1 6 ) ;  
                                 G   =   p a r s e I n t ( c o l o r S t r . s l i c e ( 2 ,   4 ) ,   1 6 ) ;  
                                 B   =   p a r s e I n t ( c o l o r S t r . s l i c e ( 4 ,   6 ) ,   1 6 ) ;  
                         }  
                          
                         i f   ( ! a l p h a )   {  
                                 a l p h a   =   1 0 0 ;  
                         }  
                         i f   ( t y p e o f   a l p h a   = = =   ' s t r i n g ' )   {  
                                 a l p h a   =   a l p h a . s p l i t ( ' , ' ) [ 0 ] ;  
                         }  
                         a l p h a   =   p a r s e I n t ( a l p h a ,   1 0 )   /   1 0 0 ;  
                         r e t u r n   ' r g b a ( '   +   R   +   ' , '   +   G   +   ' , '   +   B   +   ' , '   +   a l p h a   +   ' ) ' ;  
                 }  
  
  
                 / / / g e t   T h e   G r a d i e n t   P o i n t  
                 v a r   g e t C o r d i n a t e   =   f u n c t i o n   ( x ,   y ,   w i d t h ,   h e i g h t ,   a n g l e )   {  
                         x   =   x   ?   x   :   0 ;  
                         y   =   y   ?   y   :   0 ;  
                         w i d t h   =   ( t y p e o f   w i d t h   ! = =   ' u n d e f i n e d ' )   ?   w i d t h   :   4 0 0 ;  
                         h e i g h t   =   ( t y p e o f   h e i g h t   ! = =   ' u n d e f i n e d ' )   ?   h e i g h t   :   4 0 0 ;  
                         a n g l e   =   ( t y p e o f   a n g l e   ! = =   ' u n d e f i n e d ' )   ?   a n g l e   :   0 ;  
  
                         v a r   x 1 ,   x 2 ,   y 1 ,   y 2 ,   t a n ,   t e m p ;  
                          
                         t a n   =   M a t h . t a n ( ( a n g l e   *   M a t h . P I )   /   1 8 0 ) ;  
                         y 1   =   M a t h . r o u n d ( h e i g h t   /   2   -   ( ( w i d t h   /   2 )   *   t a n ) ) ;  
                         x 1   =   M a t h . r o u n d ( w i d t h   /   2   -   ( ( h e i g h t   /   2 )   /   t a n ) ) ;  
                         x 1   =   ( x 1   <   0 )   ?   0   :   x 1 ;  
                         x 1   =   ( x 1   >   w i d t h )   ?   w i d t h   :   x 1 ;  
                         y 1   =   ( y 1   <   0 )   ?   0   :   y 1 ;  
                         y 1   =   ( y 1   >   h e i g h t )   ?   h e i g h t   :   y 1 ;  
                         x 2   =   w i d t h   -   x 1 ;  
                         y 2   =   h e i g h t   -   y 1 ;  
                         i f   ( a n g l e   >   9 0   & &   a n g l e   < =   2 7 0 )   {  
                                 t e m p   =   y 1 ;  
                                 y 1   =   y 2 ;  
                                 y 2   =   t e m p ;  
                         }  
                         i f   ( a n g l e   >   1 8 0   & &   a n g l e   < =   3 6 0 )   {  
                                 t e m p   =   x 1 ;  
                                 x 1   =   x 2 ;  
                                 x 2   =   t e m p ;  
                         }  
                         r e t u r n   [ x 1   +   x ,   y 1   +   y ,   x 2   +   x ,   y 2   +   y ] ;  
                 } ;  
  
  
                 / / / C r e a t e   T h e   C o l o r   S t o p  
                 v a r   f i l l G c o l o r P o i n t   =   f u n c t i o n   ( b g C o l o r ,   b g A l p h a ,   b g R a t i o )   {  
                         v a r   x ,   f i r s t ,   c o u n t   =   0 ,   b l e n d A t ,   r g b ,   a l p h a ,   c o l o r S t o p   =   [ ] ;  
                         b g A l p h a   =   b g A l p h a   ?   b g A l p h a . s p l i t ( " , " )   :   u n d e f i n e d ;  
                         b g R a t i o   =   b g R a t i o   ?   b g R a t i o . s p l i t ( " , " )   :   u n d e f i n e d ;  
                         b g C o l o r   =   b g C o l o r . s p l i t ( " , " ) ;  
  
                         f i r s t   =   ( t y p e o f   b g R a t i o   = = =   ' o b j e c t ' )   ?   b g R a t i o [ 0 ]   :   u n d e f i n e d ;  
  
                         f o r   ( x   =   0 ;   x   <   b g C o l o r . l e n g t h ;   x   + =   1 )   {  
                                 r g b   =   b g C o l o r [ x ] ;  
                                 b l e n d A t   =   b g R a t i o   ?   b g R a t i o [ x ]   :   u n d e f i n e d ;  
                                 a l p h a   =   b g A l p h a   ?   b g A l p h a [ x ]   : 1 0 0 ;  
                                 a l p h a   =   a l p h a   ?   a l p h a   :   1 0 0 ;  
  
                                 i f   ( ! b l e n d A t )   { / / b l e n d A t   i s   u n d e f i n e d  
                                         f i r s t   =   1 ;  
                                         b l e n d A t   =   ( x   ! = =   0 )   ?   ( ( 1 0 0   -   c o u n t )   /   ( b g C o l o r . l e n g t h   -   x ) )   :   0 ;  
                                 }  
                                 i f   ( f i r s t )   {  
                                         c o u n t   + =   p a r s e I n t ( b l e n d A t ,   1 0 ) ;  
                                 }  
                                 e l s e   {  
                                         c o u n t   =   p a r s e I n t ( b l e n d A t ,   1 0 ) ;  
                                 }  
                                 i f   ( c o u n t   > =   1 0 0 )   {  
                                         c o l o r S t o p . p u s h ( [ 1 ,   c o n v e r t C o l o r ( r g b ,   a l p h a ) ] ) ;  
                                         b r e a k ;  
                                 }  
                                 e l s e   {  
                                         c o l o r S t o p . p u s h ( [ c o u n t   /   1 0 0 ,   c o n v e r t C o l o r ( r g b ,   a l p h a ) ] ) ;  
                                 }  
                         }  
                         r e t u r n   c o l o r S t o p ;  
                 } ;  
  
  
                 / / / / / / / / M a i n   F u n c t i o n   T o   C r e a t e   C o l o r  
                 v a r   C r e a t e C o l o r   =   f u n c t i o n   ( x ,   y ,   w i d t h ,   h e i g h t ,   a n g l e ,   b g C o l o r ,   b g A l p h a ,   b g R a t i o )   {  
                         v a r   c o l o r O b j   =   { } ;  
  
                         / / / F i e n d   T h e   G r a d i e n t   P o i n t  
                         c o l o r O b j . l i n e a r G r a d i e n t   =   g e t C o r d i n a t e ( x ,   y ,   w i d t h ,   h e i g h t ,   a n g l e ) ;  
                         / / s e t   t h e   c o l o e   s t o p s  
                         c o l o r O b j . s t o p s   =   f i l l G c o l o r P o i n t ( b g C o l o r ,   b g A l p h a ,   b g R a t i o ) ;  
                         i f   ( ' \ v '   = = =   ' v ' )   {  
                                 i f   ( 2   *   c o l o r O b j . l i n e a r G r a d i e n t [ 0 ]   >   w i d t h )   {  
                                         c o l o r O b j . s t o p s . r e v e r s e ( ) ;  
                                         f o r   ( v a r   i   =   0 ;   i   <   c o l o r O b j . s t o p s . l e n g t h ;   i   + =   1 )   {  
                                                 c o l o r O b j . s t o p s [ i ] [ 0 ]   =   1   -   c o l o r O b j . s t o p s [ i ] [ 0 ] ;  
                                         }  
                                 }  
                                 / / s e t   1   s t o p   f o r   I E   i f   n o t   e x i s t  
                                 i f   ( c o l o r O b j . s t o p s [ c o l o r O b j . s t o p s . l e n g t h   -   1 ] [ 0 ]   ! = =   1 )   {  
                                         c o l o r O b j . s t o p s . p u s h ( [ 1 ,   c o l o r O b j . s t o p s [ c o l o r O b j . s t o p s . l e n g t h   -   1 ] [ 1 ] ] ) ;  
                                 }  
                                 / / s e t   0   s t o p   f o r   I E   i f   n o t   e x i s t  
                                 i f   ( c o l o r O b j . s t o p s [ 0 ] [ 0 ]   ! = =   0 )   {  
                                         c o l o r O b j . s t o p s . s p l i c e ( 0 ,   0 ,   [ 0 ,   c o l o r O b j . s t o p s [ 0 ] [ 1 ] ] ) ;  
                                 }  
                         }  
                         r e t u r n   c o l o r O b j ;  
                 } ;  
  
                 / / t h i s   f u n c t i o n   w i l l   m a p   F C   n a m e   t o   F C C   n a m e   a n d   r e t u r n   t h e   c o r o s p o n d i n g   F C C   n a m e  
                 v a r   c o n v e r t N a m e s   =   f u n c t i o n   ( c h a r t N a m e )   {  
                         r e t u r n   F C F C C . h i g h C h a r t s [ c h a r t N a m e ] ;  
                 } ;  
  
  
                 / / t h i s   f u n c t i o n   w i l l   d a t s a   t o   p a r c e n t a g e   o f   t o t a l   f o r   p a r e t o   l i n e  
                 v a r   p a r e t o C o n v e r t   =   f u n c t i o n   ( d a t a )   {  
                         v a r   x ,   p s u m   =   0 ,   p a r e t o   =   {  
                                 y A x i s :   1 ,  
                                 d a t a :   [ ] ,  
                                 t y p e :   ' l i n e ' ,  
                                 c o l o r :   ' r g b a ( 0 0 , 0 0 , 0 0 , 1 ) ' ,  
                                 F C t y p e :   1 . 5  
                         } ,   s u m   =   0 ;  
                         i f   ( d a t a   i n s t a n c e o f   A r r a y )   {  
                                 f o r   ( x   =   0 ;   x   <   d a t a . l e n g t h ;   x   + =   1 )   {  
                                         s u m   + =   d a t a [ x ] . y ;  
                                 }  
                                 f o r   ( x   =   0 ;   x   <   d a t a . l e n g t h ;   x   + =   1 )   {  
                                         p s u m   + =   d a t a [ x ] . y ;  
                                         p a r e t o . d a t a . p u s h ( {  
                                                 y   :   M a t h . r o u n d ( ( p s u m   /   s u m )   *   1 0 0 0 0 )   /   1 0 0  
                                         } ) ;  
                                 }  
                         }  
                         r e t u r n   p a r e t o ;  
                 } ;  
  
                 / / r e t u r n   t h e   n a m e   o f   t h e   c h a r t   s w f   f i l e   f r o m   i t ' s   s r c '  
                 / / e . g .   c h a r t s / C o l u m n 2 D . s w f   w i l l   r e t u r n   C o l u m n 2 D  
  
                 v a r   c o n v e r t S W F t o A l i a s   =   f u n c t i o n   ( s w f )   {  
                         v a r   a l i a s   =   s w f . s u b s t r i n g ( s w f . i n d e x O f ( ' . s w f ' ) ,   0 ) ;  
                         r e t u r n   a l i a s . s u b s t r i n g ( a l i a s . l a s t I n d e x O f ( ' / ' )   +   1 ) ;  
                 } ;  
  
  
                 v a r   f o r m a t N u m b e r   =   f u n c t i o n   ( n u m ,   o b j ,   t y p e )   {  
                         / /   I f   t y p e   i s   u n d e f i n e d   i n i t i a l i z e   t y p e   w i t h   1  
                         t y p e   =   t y p e   = = =   u n d e f i n e d   ?   1   :   t y p e ;  
                         / *   i f   ( t y p e o f   n u m   = =   ' s t r i n g ' )   {  
                                 n u m   =   p a r s e F l o a t ( n u m ) ;  
                         } * /  
  
                         / /   D e f i n e s   F u s i o n C h a r t s   d e f a u l t   v a l u e s   a n d   a t t r i b u t e s  
                         v a r   c h a r t   =   {  
                                 f o r m a t n u m b e r :   1 ,  
                                 f o r m a t n u m b e r s c a l e :   1 ,  
                                 d e f a u l t n u m b e r s c a l e :   ' ' ,  
                                 n u m b e r s c a l e u n i t :   ' K , M ' ,  
                                 n u m b e r s c a l e v a l u e :   ' 1 0 0 0 , 1 0 0 0 ' ,  
                                 n u m b e r p r e f i x :   " " ,  
                                 n u m b e r s u f f i x :   " " ,  
                                 d e c i m a l s e p a r a t o r :   " . " ,  
                                 t h o u s a n d s e p a r a t o r :   " , " ,  
                                 i n d e c i m a l s e p a r a t o r :   " " ,  
                                 i n t h o u s a n d s e p a r a t o r :   " " ,  
                                 d e c i m a l s :   " " ,  
                                 f o r c e d e c i m a l s :   " 0 " ,  
                                 y a x i s v a l u e d e c i m a l s :   " " ,  
                                 s f o r m a t n u m b e r :   " 1 " ,  
                                 s f o r m a t n u m b e r s c a l e :   " 0 " ,  
                                 s d e f a u l t n u m b e r s c a l e :   " " ,  
                                 s n u m b e r s c a l e u n i t :   " K , M " ,  
                                 s n u m b e r s c a l e v a l u e :   " 1 0 0 0 , 1 0 0 0 " ,  
                                 s n u m b e r p r e f i x :   " " ,  
                                 s n u m b e r s u f f i x :   " " ,  
                                 s d e c i m a l s :   " " ,  
                                 s f o r c e d e c i m a l s :   " 0 " ,  
                                 s y a x i s v a l u e d e c i m a l s :   " 0 "  
                         } ;  
  
                         v a r   n u m b e r S c a l e V a l u e ,   n u m b e r S c a l e U n i t ,   r e s u l t ,   i ,   r e s ,   p o w e r ,    
                                 f o r m a t e d N u m   =   ' ' ,   c   =   0 ,   i n i t i a l V a l ,   d e c i m a l V a l ,   s p l i t V a l ,  
                                 d e c i m a l L e n g t h ,   l a s t ;  
  
                         / /   R e p l a c e   d e f a u l t   a t t r i b u t e s   w i t h   n e w   a t t r i b u t e s  
                         f o r   ( i   i n   o b j )   {  
                                 c h a r t [ i . t o L o w e r C a s e ( ) ]   =   o b j [ i ] ;  
                         }  
                      
  
                         / /   R e p l a c e   t h e   i n d e c i m a l s e p a r a t o r   v a l u e   w i t h   d e c i m a l   t o   p e r f o r m   n u m e r i c   o p e r a t i o n s  
                         n u m   =   c h a r t . i n d e c i m a l s e p a r a t o r   ! = =   ' '   ?    
                                 n u m . t o S t r i n g ( ) . r e p l a c e ( c h a r t . i n d e c i m a l s e p a r a t o r ,   ' . ' )   :   n u m ;  
  
                         / /   R e p l a c e   t h e   i n t h o u s a n d s e p a r a t o r   v a l u e   w i t h   d e c i m a l   t o   p e r f o r m   n u m e r i c   o p e r a t i o n s  
                         n u m   =   c h a r t . i n t h o u s a n d s e p a r a t o r   ! = =   ' '   ?    
                                 n u m . t o S t r i n g ( ) . r e p l a c e ( c h a r t . i n t h o u s a n d s e p a r a t o r ,   ' ' )   :   n u m ;  
  
                         i f   ( t y p e   ! = =   1 )   {  
                                 c h a r t . f o r m a t n u m b e r   =   c h a r t . s f o r m a t n u m b e r ;  
                                 c h a r t . f o r m a t n u m b e r s c a l e   =   c h a r t . s f o r m a t n u m b e r s c a l e ;  
                                 c h a r t . d e f a u l t n u m b e r s c a l e   =   c h a r t . s d e f a u l t n u m b e r s c a l e ;  
                                 c h a r t . n u m b e r s c a l e u n i t   =   c h a r t . s n u m b e r s c a l e u n i t ;  
                                 c h a r t . n u m b e r s c a l e v a l u e   =   c h a r t . s n u m b e r s c a l e v a l u e ;  
                                 c h a r t . n u m b e r p r e f i x   =   c h a r t . s n u m b e r p r e f i x ;  
                                 c h a r t . n u m b e r s u f f i x   =   c h a r t . s n u m b e r s u f f i x ;  
                                 c h a r t . d e c i m a l s   =   c h a r t . s d e c i m a l s ;  
                                 c h a r t . f o r c e d e c i m a l s   =   c h a r t . s f o r c e d e c i m a l s ;  
                                 c h a r t . y a x i s v a l u e d e c i m a l s   =   c h a r t . s y a x i s v a l u e d e c i m a l s ;  
                         }  
  
                         / /   C r e a t e s   a r r a y   o f   n u m b e r S c a l e V a l u e   a n d   n u m b e r S c a l e U n i t   t o   f o r m a t   t h e   n u m b e r  
                         n u m b e r S c a l e V a l u e   =   c h a r t . n u m b e r s c a l e v a l u e . s p l i t ( ' , ' ) ;  
                         n u m b e r S c a l e U n i t   =   c h a r t . n u m b e r s c a l e u n i t . s p l i t ( ' , ' ) ;  
  
                         r e s u l t   =   r e s   =   n u m . t o S t r i n g ( ) ;  
  
                         / /   f o r m a t   t h e   n u m b e r   w i t h ,  
                         i f   ( c h a r t . f o r m a t n u m b e r   = =   1 )   {  
                                 i f   ( r e s . i n d e x O f ( ' . ' )   ! = =   - 1 )   {  
                                         s p l i t V a l   =   r e s . s p l i t ( ' . ' ) ;  
                                         i n i t i a l V a l   =   s p l i t V a l [ 0 ] ;  
                                         d e c i m a l V a l   =   ' . '   +   s p l i t V a l [ 1 ] ;  
                                 }  
                                 e l s e   {  
                                         i n i t i a l V a l   =   r e s ;  
                                         d e c i m a l V a l   =   ' ' ;  
                                 }  
                                 f o r   ( i   =   i n i t i a l V a l . l e n g t h ;   i   >   0 ;   i   - =   1 )   {  
                                         i f   ( c   %   3   = = =   0   & &   c   ! = =   0 )   {  
                                                 f o r m a t e d N u m   =   c h a r t . t h o u s a n d s e p a r a t o r   +   f o r m a t e d N u m ;  
                                                 c   =   0 ;  
                                  
                                         }  
                                         / / f o r m a t e d N u m   =   r e s [ i   -   1 ]   +   f o r m a t e d N u m ;  
                                         f o r m a t e d N u m   =   r e s . c h a r A t ( i   -   1 )   +   f o r m a t e d N u m ;  
                                         c   + =   1 ;  
                                 }  
  
                                  
  
                                 r e s u l t   =   ( s p l i t V a l   = = =   u n d e f i n e d )   | |   ( d e c i m a l V a l   = = =   0 )   ?   f o r m a t e d N u m   :   f o r m a t e d N u m   +   d e c i m a l V a l ;  
                         }  
  
                         / /   P l a c e s   K ,   M ,   B   n u m b e r   f o r m a t  
                         i f   ( c h a r t . f o r m a t n u m b e r s c a l e   = =   1 )   {  
                                 r e s   =   n u m ;  
                                 f o r   ( i   =   0 ;   i   <   n u m b e r S c a l e V a l u e . l e n g t h   & &   r e s   /   n u m b e r S c a l e V a l u e [ i ]   > =   1 ;   i   + =   1 )   {  
                                         r e s   =   r e s   /   n u m b e r S c a l e V a l u e [ i ] ;  
                                 }  
                                 i   - =   1 ;  
  
                                 i f   ( c h a r t . d e c i m a l s   = = =   ' ' )   {  
                                         c h a r t . d e c i m a l s   =   ' 2 ' ;  
                                 }  
                                 p o w e r   =   M a t h . p o w ( 1 0 ,   c h a r t . d e c i m a l s ) ;  
                                 r e s u l t   =   ( i   = = =   - 1 )   ?   M a t h . r o u n d ( r e s   *   p o w e r )   /   p o w e r   :  
                                         M a t h . r o u n d ( r e s   *   p o w e r )   /   p o w e r ;  
                         }  
  
                         / /   f o r c e   d e c i m a l   i s   t r u e  
                         i f   ( c h a r t . f o r c e d e c i m a l s   = =   1 )   {  
                                 / /   c h e c k e s   w a t h e r   t h e   r e s u l t   n u m b e r   i s   i n   d e c i m a l   o r   n o t  
                                 i f   ( r e s u l t . t o S t r i n g ( ) . i n d e x O f ( c h a r t . d e c i m a l s e p a r a t o r )   ! = =   - 1 )   {  
                                         d e c i m a l V a l   =   r e s u l t . t o S t r i n g ( ) . s p l i t ( c h a r t . d e c i m a l s e p a r a t o r ) [ 1 ] ;  
                                         d e c i m a l L e n g t h   =   d e c i m a l V a l . l e n g t h ;  
                                 }  
                                 e l s e   {  
                                         d e c i m a l L e n g t h   =   0 ;  
                                 }  
                                 i f   ( d e c i m a l L e n g t h   = = =   0 )   {  
                                         r e s u l t   + =   c h a r t . d e c i m a l s e p a r a t o r ;  
                                 }  
                                 i f   ( d e c i m a l L e n g t h   >   c h a r t . d e c i m a l s )   {  
                                         i f   ( c h a r t . d e c i m a l s   = =   1   & &   d e c i m a l V a l [ 0 ]   > =   5 )   {  
                                                 l a s t   =   r e s u l t [ r e s u l t . s u b s t r i n g ( 0 ,   r e s u l t . i n d e x O f ( ' . ' ) ) . l e n g t h   -   1 ] ;  
                                                 l a s t   + =   1 ;  
                                                 r e s u l t   =   r e s u l t . s u b s t r i n g ( 0 ,   ( r e s u l t . i n d e x O f ( ' . ' )   -   1 ) )   +   l a s t ;  
                                                 r e s u l t   =   r e s u l t   +   ' . '   +   ' 0 ' ;  
                                         }  
                                         e l s e   i f   ( d e c i m a l V a l [ c h a r t . d e c i m a l s   -   1 ]   > =   5 )   {  
                                                 l a s t   =   d e c i m a l V a l [ c h a r t . d e c i m a l s ]   > =   5   ?    
                                                         ( p a r s e I n t ( d e c i m a l V a l [ c h a r t . d e c i m a l s   -   1 ] ,   1 0 )   +   1 )   :  
                                                         d e c i m a l V a l [ c h a r t . d e c i m a l s   -   1 ] ;  
                                                 d e c i m a l V a l   =   d e c i m a l V a l . s u b s t r i n g ( 0 ,   c h a r t . d e c i m a l s   -   1 )   +  
                                                         l a s t ;  
                                                 r e s u l t   =   r e s u l t . s u b s t r i n g ( 0 ,   r e s u l t . i n d e x O f ( ' . ' ) )   +   ' . '   +  
                                                         d e c i m a l V a l ;  
                                         }  
                                 }  
                                 e l s e   {  
                                         w h i l e   ( d e c i m a l L e n g t h   <   c h a r t . d e c i m a l s )   {  
                                                 r e s u l t   + =   ' 0 ' ;  
                                                 d e c i m a l L e n g t h   + =   1 ;  
                                         }  
                                 }  
                         }  
  
                         i f   ( c h a r t . f o r m a t n u m b e r s c a l e   = =   1 )   {  
                                 r e s u l t   + =   ( i   = = =   - 1 )   ?  
                                         c h a r t . d e f a u l t n u m b e r s c a l e   :   n u m b e r S c a l e U n i t [ i ] ;  
                         }  
  
                         r e s u l t   =   c h a r t . n u m b e r p r e f i x   +   r e s u l t   +   c h a r t . n u m b e r s u f f i x ;  
  
                         i f   ( c h a r t . d e c i m a l s e p a r a t o r   ! = =   " . "   & &   c h a r t . d e c i m a l s e p a r a t o r   ! = =   " " )   {  
                                 r e s u l t   =   r e s u l t . t o S t r i n g ( ) . r e p l a c e ( ' . ' ,   c h a r t . d e c i m a l s e p a r a t o r ) ;  
                         }  
                         r e t u r n   r e s u l t ;  
                 } ;  
  
                 / / m a p   F u s i o n C h a r t s   a n c h o r   s i d e s   t o   H C   a n c h o r   s y m b o l  
                 / / a n c h o r s i d e   >   4   w i l l   s h o w   t h e   d o w n   t r i a n g l e  
                 v a r   c o n v e r t A n c o r S i d e   =   f u n c t i o n   ( n u m )   {  
                         v a r   x   =   ' c i r c l e ' ;  
                         s w i t c h   ( n u m )   {  
                         c a s e   3 :  
                                 x   =   ' t r i a n g l e ' ;  
                                 b r e a k ;  
                         c a s e   4 :  
                                 x   =   ' d i a m o n d ' ;  
                                 b r e a k ;  
                         d e f a u l t :  
                                 x   =   ' s q u a r e ' ;  
                                 b r e a k ;  
                         }  
                         i f   ( i s N a N ( n u m ) )   {  
                                 x   =   ' c i r c l e ' ;  
                         }  
  
                         r e t u r n   x ;  
                 } ;  
  
  
                 v a r   n e w w i n d o w ; / / / v a r i a b l e   f o r   p o p u p  
                 / / / t h i s   f u n c t i o n   w i l l   o p e n   a   l i n k  
  
                 v a r   p o i n t C l i c k   =   f u n c t i o n   ( f l a g ,   u n e s c a p e )   {  
  
                         v a r   l i n k   =   ' ' ,   a r r ,   c h a r t I d ,   s e n d e r ;  
                         i f   ( ( f l a g   = = =   2   & &   t h i s . l i n k )   | |  
                                 ( f l a g   = = =   1   & &   t h i s . o p t i o n s . c h a r t . l i n k ) )   {  
  
                                 i f   ( f l a g   = = =   2   & &   t h i s . l i n k )   {  
                                         l i n k   =   u n e s c a p e   = =   ' 0 '   ?  
                                                 t h i s . l i n k   :   w i n d o w . d e c o d e U R I C o m p o n e n t ( t h i s . l i n k ) ;  
                                         l i n k . r e p l a c e ( / ^ [ \ s ] * / ,   ' ' ) ;  
                                         a r r   =   t h i s . l i n k . s p l i t ( ' - ' ) ;  
                                         c h a r t I d   =   t h i s . o p t i o n s . i d ;  
                                         s e n d e r   =   g l o b a l . c o r e . i t e m s [ c h a r t I d ] ;  
                                 }  
  
                                 e l s e   i f   ( f l a g   = = =   1   & &   t h i s . o p t i o n s . c h a r t . l i n k )   {  
                                         l i n k   =   u n e s c a p e   = =   ' 0 '   ?  
                                                 t h i s . o p t i o n s . c h a r t . l i n k   :   w i n d o w . d e c o d e U R I C o m p o n e n t ( t h i s . o p t i o n s . c h a r t . l i n k ) ;  
                                         l i n k . r e p l a c e ( / ^ [   ] * / ,   ' ' ) ;  
                                         a r r   =   t h i s . o p t i o n s . c h a r t . l i n k . s p l i t ( ' - ' ) ;  
                                         c h a r t I d   =   t h i s . o p t i o n s . c h a r t . r e n d e r T o ;  
                                         s e n d e r   =   g l o b a l . c o r e . i t e m s [ c h a r t I d ] ;  
                                 }  
                                 s w i t c h   ( a r r [ 0 ] . t o L o w e r C a s e ( ) )   {  
                                 c a s e   ' n ' :  
                                         w i n d o w . o p e n ( a r r [ 1 ] ) ;  
                                         b r e a k ;  
                                 c a s e   ' f ' :  
                                         i f   ( f r a m e s [ a r r [ 1 ] ] )   {  
                                                 f r a m e s [ a r r [ 1 ] ] . l o c a t i o n   =   a r r [ 2 ] ;  
                                         }  
                                         e l s e   {  
                                                 w i n d o w . o p e n ( a r r [ 2 ] ,   a r r [ 1 ] ) ;  
                                         }  
                                         b r e a k ;  
                                 c a s e   ' j ' :  
                                         t r y   {  
                                                 w i n d o w [ a r r [ 1 ] ] ( a r r [ 2 ] ) ;  
                                         }  
                                         c a t c h   ( e r )   {  
  
                                         }  
                                         b r e a k ;  
                                 c a s e   ' p ' :  
                                         n e w w i n d o w   =   w i n d o w . o p e n ( a r r [ 2 ] ,   a r r [ 1 ] . m a t c h ( / [ ^ , ] + / i ) ,  
                                                 a r r [ 1 ] . r e p l a c e ( / [ ^ , ] + , / i ,   ' ' ) ) ;  
                                         i f   ( w i n d o w . f o c u s )   {  
                                                 n e w w i n d o w . f o c u s ( ) ;  
                                         }  
                                         b r e a k ;  
                                 c a s e   ' n e w c h a r t ' :  
                                         v a r   l i n k T y p e   =   a r r [ 1 ] . t o L o w e r C a s e ( ) . s e a r c h ( ' u r l ' )   ! =   - 1   ?  
                                                 ' U R L '   :   F u s i o n C h a r t s D a t a F o r m a t s . J S O N ,   d a t a ,   x ,   c h a r t J s o n ,   l i n k c h a r t I d ;  
  
                                         i f   ( l i n k T y p e   = = =   ' U R L ' )   {  
                                                 d a t a   =   l i n k . r e p l a c e ( / [ ^ \ - ] + - [ ^ \ - ] + - / i ,   ' ' ) ;  
                                         }  
  
                                         e l s e   {  
                                                 c h a r t J s o n   =   g l o b a l . c o r e . i t e m s [ c h a r t I d ] . g e t C h a r t D a t a ( F u s i o n C h a r t s D a t a F o r m a t s . J S O N ) ;  
                                                 l i n k c h a r t I d   =   l i n k . r e p l a c e ( / [ ^ \ - ] + - [ ^ \ - ] + - / i ,   ' ' ) ;  
                                                 i f   ( c h a r t J s o n . l i n k e d d a t a )   {  
                                                         f o r   ( x   =   0 ;   x   <   c h a r t J s o n . l i n k e d d a t a . l e n g t h ;   x   + =   1 )   {  
                                                                 i f   ( c h a r t J s o n . l i n k e d d a t a [ x ] . i d   = =   l i n k c h a r t I d )   {  
                                                                         d a t a   =   c h a r t J s o n . l i n k e d d a t a [ x ] . l i n k e d c h a r t ;  
                                                                 }  
                                                         }  
                                                 }  
                                         }  
                                         g l o b a l . r a i s e E v e n t ( ' L i n k e d C h a r t I n v o k e d ' ,   {  
                                                 l i n k T y p e   :   l i n k T y p e ,  
                                                 d a t a   :   d a t a  
                                         } ,   s e n d e r ) ;  
                                         b r e a k ;  
                                 d e f a u l t :  
                                         a r r   =   l i n k . s p l i t ( ' : ' ) ;  
                                         i f   ( a r r [ 0 ] . t o L o w e r C a s e ( )   = =   ' j a v a s c r i p t ' )   {  
                                                 t r y   {  
                                                         e v a l ( a r r [ 1 ] ) ;  
                                                 }   c a t c h   ( e r r )   {   }  
                                         }  
                                         e l s e   {  
                                                 w i n d o w . l o c a t i o n . h r e f   =   l i n k ;  
                                         }  
                                         b r e a k ;  
                                 }  
                         }  
                 } ;  
  
  
                 / / / f i e n d   t h e   m a x   z   v a l u e   a m o n g   a l l   t h e   d a t a  
                 v a r   m a x Z V a l   =   f u n c t i o n   ( o b j )   {  
                         v a r   m a x   =   0 ,   x ,   y ,   t e m p ;  
                         i f   ( o b j   i n s t a n c e o f   A r r a y )   {  
                                 f o r   ( x   =   0 ;   x   <   o b j . l e n g t h ;   x   + =   1 )   {  
                                         i f   ( o b j [ x ] . d a t a   i n s t a n c e o f   A r r a y )   {  
                                                 f o r   ( y   =   0 ;   y   <   o b j [ x ] . d a t a . l e n g t h ;   y   + =   1 )   {  
                                                         t e m p   =     p a r s e I n t ( o b j [ x ] . d a t a [ y ] . z ,   1 0 ) ;  
                                                         m a x   =   ( m a x   >   t e m p )   ?   m a x   :   t e m p ;  
                                                 }  
                                         }  
                                 }  
                         }  
                         r e t u r n   m a x ;  
                 } ;  
  
                 / / / f u n c t i o n   t o   d e t e r m i n e   m a x   r e d i o u s   f o r   b u b l e   c h a r t   d e p e n d i n g   o n   t h e   c h a r t   w i d t h   a n d   h e i g h t  
                 v a r   m a x R e d i o u s   =   f u n c t i o n   ( w i d t h ,   h e i g h t )   {  
                         v a r   l o w e r ,   m a x   =   5 ;  
                         l o w e r   =   ( w i d t h   >   h e i g h t )   ?   h e i g h t   :   w i d t h ;  
                         i f   ( l o w e r   >   1 0 0 )   {  
                                 m a x   =   l o w e r   /   8 ;  
                         }  
                         r e t u r n   m a x ;  
                 } ;  
  
                 / / / f u n c t i o n   t h a t   w i l l   c r e a t e   a   H C J S O N  
                 v a r   c r e a t e H C J s o n   =   f u n c t i o n   ( _ _ c o n t a i n e r I d ,   c l e a n C o p y )   {  
                         v a r   w i d t h   =   t h i s . w i d t h ,   h e i g h t   =   t h i s . h e i g h t ,  
                                 c h a r t   =   c o n v e r t S W F t o A l i a s ( t h i s . s r c ) ,   i d   =   t h i s . i d ,  
                                 j s o n O b j ,   c o n t a i n e r ,   d a t a C o m p ,   H C J s o n ;  
  
                         / / d e s t r o y   t h e   o l d   c h a r t  
                         r e m o v e C h a r t ( i d ,   c l e a n C o p y ) ;  
  
                         / / c r e a t e   c o n t a i n e r  
                         c r e a t e C o n t a i n e r . c a l l ( t h i s ,   _ _ c o n t a i n e r I d ,   i d ,   w i d t h ,   h e i g h t ,   c l e a n C o p y ) ;  
  
                         / / g e t   t h e   c h a r t   d a t a  
                         d a t a C o m p   =   t h i s . g e t C h a r t D a t a ( F u s i o n C h a r t s D a t a F o r m a t s . J S O N ,   t r u e ) ;  
                         j s o n O b j   =   d a t a C o m p . d a t a ;  
  
                         / / c h a r t   n o t   s u p p o r t e d  
                         i f   ( ! F C F C C . h i g h C h a r t s [ c h a r t ] )   {  
                                 H C J s o n   =   c r e a t e M s g ( i d ,   ' C h a r t N o t S u p p o r t e d ' ,   ' f e a t u r e n o t s u p p o r t e d ' ) ;  
                         }  
                         / / / / i f   c h a r t   h a s   a n y   m s g   t o   s h o w  
                         e l s e   i f   ( c h a r t M e s s a g e S t o r e [ i d ] . m s g T x t )   {  
                                 H C J s o n   =   c r e a t e M s g ( i d ,   ' m s g T x t ' ,   u n d e f i n e d ) ;  
                         }  
                         / / / / i f   c h a r t   h a s   d a t a   l o a d i n g   e r r o r  
                         e l s e   i f   ( t h i s . j s V a r s   & &   t h i s . j s V a r s . L o a d E r r o r )   {  
                                 H C J s o n   =   c r e a t e M s g ( i d ,   ' L o a d D a t a E r r o r T e x t ' ,   u n d e f i n e d ) ;  
                         }  
                         / / / / i f   c h a r t   i s   r e t r i v i n g   d a t a  
                         e l s e   i f   ( t h i s . j s V a r s   & &   t h i s . j s V a r s . s t a l l L o a d )   {  
                                 H C J s o n   =   c r e a t e M s g ( i d ,   ' X M L L o a d i n g T e x t ' ,   u n d e f i n e d ) ;  
                         }  
                         / / / / i f   c h a r t   w i l l   s h o w   x m l   p a r s e   e r r o r  
                         e l s e   i f   ( d a t a C o m p . e r r o r   i n s t a n c e o f   E r r o r )   {  
                                 H C J s o n   =   c r e a t e M s g ( i d ,   ' I n v a l i d X M L T e x t ' ,   ' n o d a t a t o d i s p l a y ' ) ;  
                         }  
                         / / c o n v e r t   t h e   c h a r t ' s   J S O N   i n t o   H C   c o m p a t a b l e   d a t a  
                         e l s e   {  
                                 / / g e t   t h e   c o n t a i n e r  
                                 c o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( i d ) ;  
                                 / / c o n v a r t   i t   i n t o   F C C   d a t a  
                                 H C J s o n   =   c o v e r t T o F C C ( i d ,   c h a r t ,   j s o n O b j ,   i d ,   c o n t a i n e r . o f f s e t W i d t h ,  
                                         c o n t a i n e r . o f f s e t H e i g h t ) ;  
                                  
                                 / / i f   n o   d a t a   t o   d i s p l a y  
                                 i f   ( H C J s o n . s e r i e s . l e n g t h   = = =   0 )   {  
                                         H C J s o n   =   c r e a t e M s g ( i d ,   ' N o D a t a T e x t ' ,   ' n o d a t a t o d i s p l a y ' ) ;  
                                 }  
  
                         }  
                         / / r e t u r n   t h e   H C   o b j e c t  
                         r e t u r n   H C J s o n ;  
  
                 } ;  
  
                 / / / a d d   t h e   e v e n t   l i s t n e r   t o   a d d   t h e   c h a r t   s p e c i f i c   f u n c t i o n s  
                 v a r   a d d E I M e t h o d s   =   f u n c t i o n   ( r e f ,   o b j )   {  
  
                         / /   P r o c e s s   t h e s e   e v e n t s   o n l y   f o r   o b j e c t s   t h a t   h a v e   f l a s h   r e n d e r e r !  
                         i f   ( o b j . o p t i o n s . r e n d e r e r   ! = =   ' j a v a s c r i p t ' )   {  
                                 r e t u r n ;  
                         }  
  
                         / /   T h e   e x t e r n a l I n t e r f a c e M e t h o d s   n a m e s   a r e   p a r s e d   f r o m   C S V   t o  
                         / /   A r r a y .  
                         v a r   e i I t e m s   =   F C F C C . m e t h o d . g e t E x t e r n a l I n t e r f a c e M e t h o d s ( o b j . c h a r t T y p e ( ) ) . s p l i t ( ' , ' ) ,   i ;  
  
                         / /   W e   i t e r a t e   t h r o u g h   a l l   t h e   e x t e r n a l I n t e r f a c e   m e t h o d   n a m e s   a n d  
                         / /   c r e a t e   a n   e x t e n s i b l e   A P I   o b j e c t   t h a t   i s   a d d e d   t o   m a i n  
                         / /   F u s i o n C h a r t s   o b j e c t   a s   r e f e r e n c e .  
                         f o r   ( i   =   0 ;   i   <   e i I t e m s . l e n g t h ;   i   + =   1 )   {  
  
                                 i f   ( t y p e o f   r e f [ e i I t e m s [ i ] ]   = = =   ' f u n c t i o n ' )   {  
                                         c o n t i n u e ;  
                                 }  
  
                                 i f   ( F C F C C . m e t h o d [ e i I t e m s [ i ] ]   = = =   u n d e f i n e d )   {  
                                         r e f [ e i I t e m s [ i ] ]   =   n o E f f e c t ;  
                                 }  
                                 e l s e   {  
                                         r e f [ e i I t e m s [ i ] ]   =   F C F C C . m e t h o d [ e i I t e m s [ i ] ] ;  
                                 }  
                         }  
                 } ;  
  
                     / / / / / / / / f u n c t i o n   t h a t   w i l l   c r e a t e   t h e   c h a r t  
                 / / / t h i s   w i l l   r e p r e s e n t   t h e   F u s i o n c h a r t   o b j e c t  
                 f u n c t i o n   c r e a t e C h a r t ( c a l l B a c k ,   H C J s o n )   {  
                         v a r   c h a r t   =   c o n v e r t S W F t o A l i a s ( t h i s . s r c ) ,   i d   =   t h i s . i d ;  
  
                         / / s e t   t h e   t r a n c p a r e n c y  
                         i f   ( ! ( t h i s . j s V a r s   & &   t h i s . j s V a r s . t r a n s p a r e n t ) )   {  
                                 j Q u e r y ( ' # '   +   t h i s . i d ) . c s s ( ' b a c k g r o u n d - c o l o r ' ,   ' # F F F F F F ' ) ;  
                         }  
  
                         / / c r e a t e   t h e   r e f  
                         v a r   r e f   =   d o c u m e n t . g e t E l e m e n t B y I d ( i d ) ;  
  
                         r e f . d r a w O v e r l a y B u t t o n   =     d r a w O v e r l a y B u t t o n ;  
                         r e f . s h o w C h a r t M e s s a g e   =   s h o w C h a r t M e s s a g e ;  
                         r e f . g e t E x t e r n a l I n t e r f a c e M e t h o d s   =   F C F C C . m e t h o d . g e t E x t e r n a l I n t e r f a c e M e t h o d s ;  
                         a d d E I M e t h o d s ( r e f ,   t h i s ) ;  
  
                         / / c a l l   t h e   c a l l   b a c k   f u n c t i o n  
                         i f   ( t y p e o f   c a l l B a c k   = = =   ' f u n c t i o n ' )   {  
                                 t r y   {  
                                         c a l l B a c k ( {  
                                                 s u c c e s s :   t r u e ,  
                                                 r e f :   r e f ,  
                                                 i d :   i d  
                                         } ) ;  
                                 } c a t c h   ( e r r )   {  
                                 }  
                         }  
  
                         r e f . F C C   =   n e w   H i g h c h a r t s . C h a r t ( H C J s o n ) ;  
  
                         / / a r r a n g e   v l i n e s   &   t r e n d l i n e s   t r e n d Z o n e s   e t c .  
                         v a r   v e r t i c a l P l o t E l e m e n t s   =   j Q u e r y ( ' . h i g h c h a r t s - g r i d ' ) [ 0 ] ;  
                         v a r   h o r i z o n t a l P l o t E l e m e n t s   =   j Q u e r y ( ' . h i g h c h a r t s - g r i d ' ) [ 1 ] ;  
                         i f   ( v e r t i c a l P l o t E l e m e n t s   & &   h o r i z o n t a l P l o t E l e m e n t s )   {  
                                 v e r t i c a l P l o t E l e m e n t s . p a r e n t N o d e . i n s e r t B e f o r e ( h o r i z o n t a l P l o t E l e m e n t s ,   v e r t i c a l P l o t E l e m e n t s ) ;  
                         }  
                         / / s a v e   t h e   c h a r t ' s   v a r i o u s   o b j e c t s   i n   l o c a l   s t o r e  
                         F C C . i t e m s [ i d ]   =   {  
                                 ' b a s e O b j ' :   H C J s o n ,  
                                 ' F C C O b j ' :   r e f ,  
                                 ' c h a r t T y p e ' :   c h a r t  
                         } ;  
  
  
                 }  
                  
  
                 / / f u n c t i o n   t h a t   w i l l   b e   c a l l e d   o n   w i n d o w   r e s i z e   i f   t h e r e   h a s   a   s i z e   d i f f e r e n c e   o c c u r e  
                 v a r   o n W i n d o w R e s i z e   =   f u n c t i o n   ( F C C C h a r t ,   i d )   {  
                         v a r   F C O b j ;  
                         / / C l e a r   t h e   t i m e r   f o r   t h e   p r e v i o u s   p r e v o i u s   f r e q u e n t   r e s i z e   f u n c t i o n  
                         c l e a r T i m e o u t ( F C C C h a r t . t i m e C h a c h ) ;  
                         / / F u s i o n C h a r t s   O B J E C T  
                         F C O b j   =   g l o b a l . c o r e . i t e m s [ i d ] ;  
                         / / r e n d e r   t h e   c h a r t   a f t e r   5 0 0   m s  
                         F C C C h a r t . t i m e C h a c h   =   s e t T i m e o u t ( ( f u n c t i o n   ( F C O b j )   {  
                                 r e t u r n   f u n c t i o n   ( )   {  
                                         v a r   i d   =   F C O b j . i d ,   _ _ c o n t a i n e r I d   =   F C O b j . o p t i o n s . c o n t a i n e r E l e m e n t I d ,   H C J s o n ;  
                                         / /   c h e c k   w h e t h e r   c h a r t   a l r e a d y   r e n d e r e d   a n d   u p d a t e   t h e   d a t a  
                                         i f   ( t y p e o f   _ _ c o n t a i n e r I d   ! = =   ' u n d e f i n e d '   & &  
                                                 t y p e o f   F C C . i t e m s [ i d ]   ! = =   ' u n d e f i n e d ' )   {  
                                                 / / c r e a t e   t h e   H C   j s o n  
                                                 H C J s o n   =   c r e a t e H C J s o n . c a l l ( F C O b j ,   _ _ c o n t a i n e r I d ) ;  
                                                 / / a d d   t h e   l o a d   e v e n t  
                                                 H C J s o n . c h a r t . e v e n t s . l o a d   =   f u n c t i o n   ( )   {  
                                                         g l o b a l . r a i s e E v e n t ( ' l o a d e d ' ,   { } ,   F C O b j ) ;  
                                                         g l o b a l . r a i s e E v e n t ( ' r e s i z e d ' ,   { } ,   F C O b j ) ;  
                                                 } ;  
                                                 / / s t o p   t h e   a n i m a t i o n  
                                                 H C J s o n . p l o t O p t i o n s . s e r i e s . a n i m a t i o n   =   f a l s e ;  
  
                                                 / / r e n d e r   t h e   n e w   c h a r t  
                                                 c r e a t e C h a r t . c a l l ( F C O b j ,   u n d e f i n e d ,   H C J s o n ) ;  
  
                                         }  
                                 } ;  
                         } ( F C O b j ) ) ,   5 0 0 ) ;  
                 } ;  
  
  
                 / / f u n c t i o n   t h a t   w i l l   c a l l   i f   t h e   w i n d o w   r e s i z e   o c u r e d  
                 v a r   F C C r e s i z e   =   f u n c t i o n   ( )   {  
  
                         v a r   F C C C h a r t ,   F C C C o n t a i n e r ,   i d ;  
                         / / i t e r a t e   t h r o u g h   a l l   F u s i o n C h a r t s   H t m l 5   I t e m s   F r o m   S t o r e  
                         f o r   ( v a r   x   i n   F C C . i t e m s )   {       / / / i t ' s   a l w a y e s   a n   o b j e c t  
                                 i d   =   x ;  
                                 / / t a k e   t h e   i n   a   l o c a l   a   v r i a b l e  
                                 F C C C h a r t   =   F C C . i t e m s [ x ] ;  
                                 / / g e t   t h e   c o n t a i n e r   E l e m e n t   o f   t h e   c h a r t  
                                 F C C C o n t a i n e r   =   d o c u m e n t . g e t E l e m e n t B y I d ( x ) ;  
  
                                 / / C h e c k   w h e t h e r   t h e   s i z e   o f   t h e   c o n t a i n e r   h a s   C h a n g e d  
                                 / / c o n t a i n e r   w i l l   b e   n u l l   i f   t h e   c h a r t   h a s   i n v o c k e d   a   l i n k e d   c h a r t  
                                 i f   ( F C C C o n t a i n e r   & &  
                                         ( F C C C o n t a i n e r . o f f s e t W i d t h   ! =   F C C C h a r t . F C C O b j . F C C . c h a r t W i d t h   | |  
                                                 F C C C o n t a i n e r . o f f s e t H e i g h t   ! =   F C C C h a r t . F C C O b j . F C C . c h a r t H e i g h t ) )   {  
                                         o n W i n d o w R e s i z e ( F C C C h a r t ,   i d ) ;  
                                 }  
                         }  
                 } ;  
  
  
  
                 / / / a d d   t h e   r e s i z e   e v e n t  
  
                 i f   ( w i n d o w . a d d E v e n t L i s t e n e r )   { / / f o r   n o n I E  
                         w i n d o w . a d d E v e n t L i s t e n e r ( " r e s i z e " ,   F C C r e s i z e ,   f a l s e ) ;  
                 }  
                 e l s e   i f   ( w i n d o w . a t t a c h E v e n t )   { / / f o r   I E  
                         w i n d o w . a t t a c h E v e n t ( " o n r e s i z e " ,   F C C r e s i z e ) ;  
                 }  
                 e l s e   { / / o l d e r   b r o w s e r  
                         w i n d o w . o n r e s i z e   =   F C C r e s i z e ;  
                 }  
  
  
                 / / / / / / / / / / / / / / / /     W o r k i n g   F u n c t i o n s   / / / / / / / / / / / / / / / / / / / / /  
  
                 / / t h i s   f u n c t i o n   w i l l   c r e a t e   a   d e f a u l t   F C C   o b j e c t  
                 / /  
                 v a r   n e w F C C s t u b   =   f u n c t i o n   ( c O b j )   {  
                         r e t u r n   {  
                                 F C c o n f :   {  
                                         n e g a t i v e :   f a l s e , / / f o r   i n v e r s e   c h a r t   w h e t h e r   t h e r e   h a s   a n y   n e g a t i v e   v a l u e   o r   n o t  
                                         s t a c k V a l u e :   [ ]  
                                 } ,  
                                 c h a r t :   {  
                                         a l i g n T i c k s :   f a l s e ,  
                                         r e n d e r T o :   ' ' ,  
                                         i g n o r e H i d d e n S e r i e s :   f a l s e ,  
                                         e v e n t s :   {  
                                                 c l i c k :   f u n c t i o n   ( )   {  
                                                         p o i n t C l i c k . c a l l ( t h i s ,   1 ,   c O b j . c h a r t . u n e s c a p e l i n k s ) ;  
                                                 }  
                                         } ,  
                                         m a r g i n :   [ 1 5 ,   1 5 ,   5 0 ,   6 0 ] ,  
                                         b o r d e r R a d i u s :   0 ,  
                                         p l o t B a c k g r o u n d C o l o r   :   ' # F F F F F F '  
                                 } ,  
                                 c o l o r s :   [ ] ,  
                                 c r e d i t s :   {  
                                         h r e f :   ' h t t p : / / w w w . f u s i o n c h a r t s . c o m ? B S = F C H S E v a l M a r k ' ,  
                                         t e x t :   ' F u s i o n C h a r t s   -   H i g h C h a r t s ' ,  
                                         e n a b l e d :   F C C C R E D I T S T A T E  
                                 } ,  
                                 g l o b a l :   { } ,  
                                 l a b e l s :   {  
                                         i t e m s :   [ ]  
                                 } ,  
                                 l a n g :   { } ,  
                                 l e g e n d :   {  
                                         e n a b l e d   :   t r u e ,  
                                         s y m b o l W i d t h :   5 ,  
                                         b o r d e r R a d i u s :   0 ,  
                                         i t e m S t y l e :   { }  
                                 } ,  
                                 l o a d i n g :   { } ,  
                                 p l o t O p t i o n s :   {  
                                         s e r i e s :   {  
                                                 b o r d e r C o l o r   :   ' # 3 3 3 3 3 3 ' ,  
                                                 e v e n t s :   { } ,  
                                                 d a t a L a b e l s   :   {  
                                                         e n a b l e d   :   t r u e ,  
                                                         c o l o r :   ' # 5 5 5 5 5 5 ' ,  
                                                         s t y l e :   { } ,  
                                                         f o r m a t t e r   :   f u n c t i o n   ( )   {  
                                                                 v a r   x ,   y ,   s h o w v a l u e   =   t h i s . p o i n t . o p t i o n s . s h o w v a l u e   | |  
                                                                         t h i s . s e r i e s . o p t i o n s . s h o w v a l u e   | |  
                                                                         t h i s . s e r i e s . c h a r t . o p t i o n s . c h a r t . s h o w v a l u e ;  
                                                                 i f   ( t h i s . s e r i e s . t y p e   = =   ' p i e ' )   {  
                                                                         x   =   ( c O b j . c h a r t . s h o w l a b e l s   = = =   ' 0 '   | |   ! t h i s . p o i n t . F C n a m e   ?   ' '   :   t h i s . p o i n t . F C n a m e ) ;  
                                                                         y   =   s h o w v a l u e   = = =   ' 1 '   ?   ( M a t h . r o u n d ( t h i s . p e r c e n t a g e   *   1 0 0 )   /   1 0 0 )   +   ( c O b j . c h a r t . s h o w p e r c e n t a g e v a l u e s   = = =   ' 1 '   ?   ' % '   :   ' ' ) :   ' ' ;  
                                                                          
                                                                         r e t u r n   p a r s e S t r ( x   +   ( x   ! = =   ' '   & &   y   ! = =   ' '   ?   c O b j . c h a r t . t o o l t i p s e p c h a r   :   ' ' )   +   y ) ;  
                                                                 }  
                                                                 e l s e   i f   ( s h o w v a l u e   = = =   ' 1 ' )   {  
                                                                         i f   ( t h i s . p o i n t . o p t i o n s . d i s p l a y v a l u e )   {  
                                                                                 x   =   t h i s . p o i n t . o p t i o n s . d i s p l a y v a l u e ;  
                                                                         }   e l s e   {  
                                                                                 x   =   f o r m a t N u m b e r ( t h i s . y ,   c O b j . c h a r t ,   1 ) ;  
                                                                                 i f   ( t h i s . s e r i e s . o p t i o n s . F C t y p e   = =   1 . 5   & &   t h i s . s e r i e s . t y p e   = =   ' l i n e ' )   {  
                                                                                         x   =   t h i s . y   +   ' % ' ;  
                                                                                 }  
                                                                                 i f   ( t h i s . s e r i e s . o p t i o n s . F C t y p e   = =   7 . 5 )   {  
                                                                                         x   =   ' ' ;  
                                                                                 }  
                                                                         }  
                                                                         r e t u r n   p a r s e S t r ( x ) ;  
                                                                 }   e l s e   {  
                                                                         r e t u r n   ' ' ;  
                                                                 }  
                                                         }  
                                                 } ,  
                                                 p o i n t :   {  
                                                         e v e n t s :   {  
                                                                 c l i c k :     f u n c t i o n   ( )   {  
                                                                         p o i n t C l i c k . c a l l ( t h i s ,   2 ,   c O b j . c h a r t . u n e s c a p e l i n k s ) ;  
                                                                 }  
                                                         }  
                                                 }  
                                         } ,  
                                         a r e a :   {  
                                                 s t a t e s :   {  
                                                         h o v e r :   {  
                                                                 e n a b l e d :   f a l s e  
                                                         }  
                                                 } ,  
                                                 m a r k e r :   {  
                                                         l i n e W i d t h :   1 ,  
                                                         r a d i u s :   3 ,  
                                                         s t a t e s :   {  
                                                                 h o v e r :   {  
                                                                         e n a b l e d :   f a l s e  
                                                                 } ,  
                                                                 s e l e c t :   {  
                                                                         e n a b l e d :   f a l s e  
                                                                 }  
                                                         }  
                                                 }  
                                         } ,  
                                         a r e a s p l i n e :   {  
                                                 s t a t e s :   {  
                                                         h o v e r :   {  
                                                                 e n a b l e d :   f a l s e  
                                                         }  
                                                 } ,  
                                                 m a r k e r :   {  
                                                         l i n e W i d t h :   1 ,  
                                                         r a d i u s :   3 ,  
                                                         s t a t e s :   {  
                                                                 h o v e r :   {  
                                                                         e n a b l e d :   f a l s e  
                                                                 } ,  
                                                                 s e l e c t :   {  
                                                                         e n a b l e d :   f a l s e  
                                                                 }  
                                                         }  
                                                 }  
                                         } ,  
                                         l i n e :   {  
                                                 s t a t e s :   {  
                                                         h o v e r :   {  
                                                                 e n a b l e d :   f a l s e  
                                                         }  
                                                 } ,  
                                                 m a r k e r :   {  
                                                         l i n e W i d t h :   1 ,  
                                                         r a d i u s :   3 ,  
                                                         s t a t e s :   {  
                                                                 h o v e r :   {  
                                                                         e n a b l e d :   f a l s e  
                                                                 } ,  
                                                                 s e l e c t :   {  
                                                                         e n a b l e d :   f a l s e  
                                                                 }  
                                                         }  
                                                 }  
                                         } ,  
                                         s p l i n e :   {  
                                                 s t a t e s :   {  
                                                         h o v e r :   {  
                                                                 e n a b l e d :   f a l s e  
                                                         }  
                                                 } ,  
                                                 m a r k e r :   {  
                                                         l i n e W i d t h :   1 ,  
                                                         r a d i u s :   3 ,  
                                                         s t a t e s :   {  
                                                                 h o v e r :   {  
                                                                         e n a b l e d :   f a l s e  
                                                                 } ,  
                                                                 s e l e c t :   {  
                                                                         e n a b l e d :   f a l s e  
                                                                 }  
                                                         }  
                                                 }  
                                         } ,  
                                         p i e :   {  
                                                 s i z e :   ' 8 0 % ' ,  
                                                 a l l o w P o i n t S e l e c t :   t r u e ,  
                                                 c u r s o r :   ' p o i n t e r '  
                                         } ,  
                                         c o l u m n :   { }  
                                 } ,  
                                 p o i n t :   { } ,  
                                 s e r i e s :   [ { } ] ,  
                                 s u b t i t l e :   {  
                                         t e x t :   ' ' ,  
                                         s t y l e   :   { }  
                                 } ,  
                                 s y m b o l s :   [ ] ,  
                                 t i t l e :   {  
                                         t e x t   :   ' ' ,  
                                         s t y l e   :   { }  
                                 } ,  
                                 t o o l b a r :   { } ,  
                                 t o o l t i p :   {  
                                         b o r d e r R a d i u s :   0 ,  
                                         s t y l e :   { } ,  
                                         f o r m a t t e r   :   f u n c t i o n   ( )   {  
                                                 v a r   x   =   ' ' ,   c h a r S e p   =   c O b j . c h a r t . t o o l t i p s e p c h a r ;  
                                                 i f   ( t h i s . p o i n t . o p t i o n s . t o o l t e x t )   {  
                                                         x   =   t h i s . p o i n t . o p t i o n s . t o o l t e x t ;  
                                                 }   e l s e   {  
                                                         i f   ( t h i s . s e r i e s . o p t i o n s . F C t y p e   > =   2   & &   t h i s . s e r i e s . n a m e   ! = =   '   ' )   {  
                                                                 x   + =   t h i s . s e r i e s . n a m e   +   c h a r S e p ;  
                                                         }  
                                                         x   + =   t h i s . x   ?   t h i s . x   +   c h a r S e p :   ' ' ;  
                                                         i f   ( t h i s . s e r i e s . o p t i o n s . F C t y p e   = =   1 . 5   & &   t h i s . s e r i e s . t y p e   = =   ' l i n e ' )   {  
                                                                 x   =   t h i s . x   +   c h a r S e p   +   t h i s . y   +   ' % ' ;  
                                                         }  
                                                         e l s e   i f   ( t h i s . s e r i e s . t y p e   = =   ' p i e ' )   {  
                                                                 x   =   ( t h i s . p o i n t . F C n a m e   ?   t h i s . p o i n t . F C n a m e   +   c h a r S e p :   ' ' )   +   ( M a t h . r o u n d ( t h i s . p e r c e n t a g e   *   1 0 0 )   /   1 0 0 )   +   ( c O b j . c h a r t . s h o w p e r c e n t i n t o o l t i p   = = =   ' 0 '   ?   ' '   :   ' % ' ) ;  
                                                         }  
                                                         e l s e   i f   ( t h i s . s e r i e s . o p t i o n s . F C t y p e   = = =   2 . 5 )   {  
                                                                 x   =   f o r m a t N u m b e r ( t h i s . y ,   c O b j . c h a r t ,   1 ) ;  
                                                         }  
                                                         e l s e   {  
                                                                 x   + =   f o r m a t N u m b e r ( t h i s . y ,   c O b j . c h a r t ,   1 ) ;  
                                                         }  
                                                         i f   ( t h i s . p o i n t . z )   {  
                                                                 x   + =   c h a r S e p   +   t h i s . p o i n t . z ;  
                                                         }  
                                                 }  
                                                 r e t u r n   p a r s e S t r ( x ) ;  
                                         }  
                                 } ,  
                                 x A x i s :   {  
                                         l a b e l s :   {  
                                                 r o t a t i o n :   - 2 5 ,  
                                                 s t y l e :   { } ,  
                                                 f o r m a t t e r   :   f u n c t i o n   ( )   {  
                                                         r e t u r n   p a r s e S t r ( t y p e o f   t h i s . v a l u e   = = =   ' s t r i n g '   ?   t h i s . v a l u e   :   ' ' ) ;  
                                                 } ,  
                                                 a l i g n :   ' r i g h t '  
                                         } ,  
                                         c a t e g o r i e s :   [ ] ,  
                                         p l o t L i n e s :   [ ] ,  
                                         p l o t B a n d s :   [ ] ,  
                                         t i t l e   :   {  
                                                 s t y l e :   { } ,  
                                                 t e x t :   ' '  
                                         }  
                                 } ,  
                                 y A x i s :   [ {  
                                         s t a r t O n T i c k :   f a l s e ,  
                                         e n d O n T i c k   :   f a l s e ,  
                                         t i t l e   :   {  
                                                 s t y l e :   { } ,  
                                                 t e x t   :   ' '  
                                         } ,  
                                         l a b e l s :   {  
                                                 s t y l e :   { } ,  
                                                 f o r m a t t e r   :   f u n c t i o n   ( )   {  
                                                         r e t u r n   p a r s e S t r ( f o r m a t N u m b e r ( t h i s . v a l u e ,   c O b j . c h a r t ,   1 ) ) ;  
                                                 }  
                                         } ,  
                                         p l o t B a n d s :   [ ] ,  
                                         p l o t L i n e s :   [ ]  
                                 } ,   {  
                                         g r i d L i n e W i d t h :   0 ,  
                                         s t a r t O n T i c k :   f a l s e ,  
                                         e n d O n T i c k   :   f a l s e ,  
                                         t i t l e   :   {  
                                                 s t y l e :   { } ,  
                                                 t e x t   :   ' '  
                                         } ,  
                                         l a b e l s :   {  
                                                 s t y l e :   { } ,  
                                                 e n a b l e d   :   f a l s e ,  
                                                 f o r m a t t e r   :   f u n c t i o n   ( )   {  
                                                         r e t u r n   p a r s e S t r ( f o r m a t N u m b e r ( t h i s . v a l u e ,   c O b j . c h a r t ,   2 ) ) ;  
                                                 }  
                                         } ,  
                                         o p p o s i t e :   t r u e  
                                 } ] ,  
                                 e x p o r t i n g :   {  
                                         b u t t o n s :   {  
                                                 e x p o r t B u t t o n :   { } ,  
                                                 p r i n t B u t t o n :   {  
                                                         e n a b l e d :   f a l s e  
                                                 }  
                                         }  
                                 }  
                         } ;  
  
                 } ;  
                  
                 / / / a d d   x A x i s   P l o t   L i n e s  
                 f u n c t i o n   a d d V l i n e ( h c ,   c o l o r ,   a l p h a ,   w i d t h ,   v a l u e )   {  
                         h c . x A x i s . p l o t L i n e s . p u s h ( {  
                                 c o l o r :   c o n v e r t C o l o r ( c o l o r   | |   ' # 4 4 4 4 4 4 ' ,   a l p h a   | |   1 0 0 ) ,  
                                 w i d t h :   w i d t h   ?   w i d t h   :   1 ,  
                                 v a l u e :   v a l u e  
                         } ) ;  
                 }  
  
  
                 / / / f u n c t i o n   t o   a d d   p o i n t s   i n   a   s e r i e s  
                 f u n c t i o n   a d d P o i n t ( s e r i e s O b j ,   p o i n t O b j ,   s e r i e s ,   c h a r t N a m e ,   i d ,   H C O b j ,   g e t S c o l o r ,   b u b b l e R a t i o ,   F C O b j )   {  
                         v a r   x ,   y ,   i s A b s   =   F C F C C . v a l u e A b s [ c h a r t N a m e ] ,   v a l u e ,  
                         s e r i e s T y p e   =   s e r i e s O b j . t y p e   | |   H C O b j . c h a r t . d e f a u l t S e r i e s T y p e ,  
                         d a t a s e p e r a t o r ,   t e m p Y ,   d a t a Y m a x ,   d a t a Y m i n ,   l o o p M a x ;  
  
                         / / f i e n d   t h e   v a r i a b l e   n a m e   m a x   a n d   m i n   c a l c u l a t i o n  
                         i f   ( ! s e r i e s O b j . y A x i s )   {  
                                 d a t a Y m a x   =   ' d a t a Y 0 m a x ' ;  
                                 d a t a Y m i n   =   ' d a t a Y 0 m i n ' ;  
                         }  
                         e l s e   {  
                                 d a t a Y m a x   =   ' d a t a Y '   +   s e r i e s O b j . y A x i s   +   ' m a x ' ;  
                                 d a t a Y m i n   =   ' d a t a Y '   +   s e r i e s O b j . y A x i s   +   ' m i n ' ;  
                         }  
  
                         / / s e t   t h e   l o o p i n g   l i m i t   d e p e n d i n g   u p o n   c h a r t   t y p e  
                         i f   ( s e r i e s   <   7   & &   s e r i e s   > =   2   & &   s e r i e s   ! =   2 . 5 )   {  
                                 l o o p M a x   =   H C O b j . x A x i s . c a t e g o r i e s . l e n g t h ;  
                         }  
                         e l s e   {  
                                 l o o p M a x   =   p o i n t O b j . l e n g t h ;  
                         }  
  
                         / / i t t e r a t e   t h r o u g h   p o i n t O b j  
                         i f   ( p o i n t O b j   i n s t a n c e o f   A r r a y )   {  
                                 f o r   ( y   =   0 ;   y   <   l o o p M a x ;   y   + =   1 )   {  
                                         i f   ( t y p e o f   p o i n t O b j [ y ]   = = =   ' o b j e c t ' )   {  
                                                 i f   ( ! p o i n t O b j [ y ] . v l i n e )   {  
                                                         i f   ( s e r i e s O b j . c u r s o r   ! =   ' p o i n t e r '   & &   p o i n t O b j [ y ] . l i n k )   {  
                                                                 s e r i e s O b j . c u r s o r   =   ' p o i n t e r ' ;  
                                                         }  
                                                         / /   a d d   t h e   d a t a   p o i n t  
                                                         t e m p Y   =   ( i s A b s   ?   M a t h . a b s ( p a r s e F l o a t ( p o i n t O b j [ y ] . v a l u e   | |   p o i n t O b j [ y ] . y ) ) : p a r s e F l o a t ( p o i n t O b j [ y ] . v a l u e   | |   p o i n t O b j [ y ] . y ) ) ;  
                                                         / / c h e c k   w h e t h e r   i t   i s   a n   n e g a t i v e   v a l u e  
                                                         i f   ( t e m p Y   <   0 )   {  
                                                                 H C O b j . F C c o n f . n e g a t i v e   =   t r u e ;  
                                                         }  
                                                         / / c h e c k   w h e t h e r   i t   i s   t h e   m a x   v a l u e  
                                                         i f   ( t y p e o f   H C O b j . F C c o n f [ d a t a Y m a x ]   = = =   ' u n d e f i n e d '   | |   t e m p Y   >   H C O b j . F C c o n f [ d a t a Y m a x ] )   {  
                                                                 H C O b j . F C c o n f [ d a t a Y m a x ]   =   t e m p Y ;  
                                                         }  
                                                         / / c h e c k   w h e t h e r   i t   t h e   m i n   v a l u e  
                                                         i f   ( t y p e o f   H C O b j . F C c o n f [ d a t a Y m i n ]   = = =   ' u n d e f i n e d '   | |   t e m p Y   <   H C O b j . F C c o n f [ d a t a Y m i n ] )   {  
                                                                 H C O b j . F C c o n f [ d a t a Y m i n ]   =   t e m p Y ;  
                                                         }  
  
                                                         / / s e t   t h e   s t a c k i n g   v a l u e  
                                                         i f   ( t y p e o f   H C O b j . F C c o n f . s t a c k V a l u e [ y ]   = = =   ' u n d e f i n e d ' )   {  
                                                                 H C O b j . F C c o n f . s t a c k V a l u e [ y ]   =   t e m p Y ;  
                                                         }  
                                                         e l s e   {  
                                                                 H C O b j . F C c o n f . s t a c k V a l u e [ y ]   + =   t e m p Y ;  
                                                         }  
                                                         s e r i e s O b j . d a t a . p u s h ( {  
                                                                 y :   t e m p Y   | |   0 ,  
                                                                 x :   ( i s A b s   ?   M a t h . a b s ( p a r s e F l o a t ( p o i n t O b j [ y ] . x ) ) : p a r s e F l o a t ( p o i n t O b j [ y ] . x ) )   | |   u n d e f i n e d ,  
                                                                 z :   ( i s A b s   ?   M a t h . a b s ( p a r s e F l o a t ( p o i n t O b j [ y ] . z ) ) : p a r s e F l o a t ( p o i n t O b j [ y ] . z ) )   | |   u n d e f i n e d ,  
                                                                 c o l o r :   ( s e r i e s   <   2   | |   p o i n t O b j [ y ] . c o l o r   | |   p o i n t O b j [ y ] . a l p h a )   ?   c o n v e r t C o l o r ( p o i n t O b j [ y ] . c o l o r   | |   ( s e r i e s   <   2   & &   g e t S c o l o r ( y ) ) ,   p o i n t O b j [ y ] . a l p h a ,   s e r i e s O b j . c o l o r ) :   u n d e f i n e d ,  
                                                                 F C n a m e :   s e r i e s   <   2   ?   p o i n t O b j [ y ] . l a b e l   :   u n d e f i n e d , / /   f o r   s i n g l e   s e r e a s e   a d d   t h e   l a b e l   a s   n a m e  
                                                                 l i n k :   p o i n t O b j [ y ] . l i n k ,  
                                                                 s l i c e d :   p o i n t O b j [ y ] . i s s l i c e d   = =   ' 1 ' ,  
                                                                 i d :   i d ,  
                                                                 d i s p l a y v a l u e :   p o i n t O b j [ y ] . d i s p l a y v a l u e ,  
                                                                 s h o w v a l u e :   p o i n t O b j [ y ] . s h o w v a l u e ,  
                                                                 t o o l t e x t :   p o i n t O b j [ y ] . t o o l t e x t ,  
                                                                 m a r k e r :   ( s e r i e s T y p e   = = =   ' a r e a s p l i n e '   | |   s e r i e s T y p e   = = =   ' s p l i n e '   | |   s e r i e s T y p e   = = =   ' a r e a '   | |   s e r i e s T y p e   = = =   ' l i n e ' )   ?   {  
                                                                         e n a b l e d   :   p o i n t O b j [ y ] . d r a w a n c h o r s   ?   ( p o i n t O b j [ y ] . d r a w a n c h o r s   = =   ' 1 '   ?   t r u e   :   f a l s e )   :   u n d e f i n e d ,  
                                                                         r a d i u s :   p o i n t O b j [ y ] . a n c h o r r a d i u s   ?   p o i n t O b j [ y ] . a n c h o r r a d i u s   :   u n d e f i n e d ,  
                                                                         s y m b o l :   c o n v e r t A n c o r S i d e ( p a r s e I n t ( p o i n t O b j [ y ] . a n c h o r s i d e s ,   1 0 ) ) ,  
                                                                         f i l l C o l o r :   p o i n t O b j [ y ] . a n c h o r b g c o l o r   ?   c o n v e r t C o l o r ( p o i n t O b j [ y ] . a n c h o r b g c o l o r   | |   ' F F F F F F ' ,   p o i n t O b j [ y ] . a n c h o r b g a l p h a   | |   1 0 0 )   :   u n d e f i n e d ,  
                                                                         l i n e C o l o r :   p o i n t O b j [ y ] . a n c h o r b o r d e r c o l o r   ?   c o n v e r t C o l o r ( p o i n t O b j [ y ] . a n c h o r b o r d e r c o l o r   | |   ' 7 6 7 5 7 5 ' ,   p o i n t O b j [ y ] . a n c h o r a l p h a   | |   1 0 0 )   :   u n d e f i n e d ,  
                                                                         l i n e W i d t h :   p o i n t O b j [ y ] . a n c h o r b o r d e r t h i c k n e s s   ?   p o i n t O b j [ y ] . a n c h o r b o r d e r t h i c k n e s s   :   u n d e f i n e d  
                                                                 }   :   ( s e r i e s   = = =   7 . 5   ?   {  
                                                                         r a d i u s :   p o i n t O b j [ y ] . z   ?   M a t h . r o u n d ( ( p o i n t O b j [ y ] . z   /   b u b b l e R a t i o )   *   1 0 )   /   1 0 :   u n d e f i n e d  
                                                                 }   :   n u l l )  
                                                         } ) ;  
  
  
                                                         / / a d d   c a t e g o r y   f o r   s i n g l e   s e r i e s   c h a r t  
                                                         i f   ( s e r i e s   <   2 )   {  
                                                                 H C O b j . x A x i s . c a t e g o r i e s . p u s h ( p o i n t O b j [ y ] . s h o w l a b e l   = = =   ' 0 '   ?   ' '   :   ( p o i n t O b j [ y ] . l a b e l   | |   ' ' ) ) ;  
                                                         }  
                                                 }  
                                                 e l s e   i f   ( s e r i e s   <   2 )   {  
                                                         / / / i f   i t   i s   a   v l i n e   t h e n   a d d   p l o t l o n e   o r   b a n d   f o r   i t  
                                                         a d d V l i n e ( H C O b j ,   p o i n t O b j [ y ] . c o l o r ,   p o i n t O b j [ y ] . a l p h a ,   p o i n t O b j [ y ] . t h i c k n e s s ,   y   -   0 . 5 ) ;  
                                                 }  
                                         }   e l s e   i f   ( t y p e o f   p o i n t O b j [ y ]   = = =   ' s t r i n g '   & &   F C O b j . c h a r t . c o m p a c t d a t a m o d e   = =   ' 1 ' )   {  
                                                 d a t a s e p e r a t o r   =   F C O b j . c h a r t . d a t a s e p a r a t o r   | |   ' | ' ;  
                                                 v a l u e   =   p o i n t O b j [ y ] . s p l i t ( d a t a s e p e r a t o r ) ;  
                                                 f o r   ( x   =   0 ;   x   <   v a l u e . l e n g t h ;   x   + =   1 )   {  
                                                         t e m p Y   =   i s A b s   ?   M a t h . a b s ( p a r s e F l o a t ( v a l u e [ x ] ) ) : p a r s e F l o a t ( v a l u e [ x ] ) ;  
                                                         / / c h e c k   w h e t h e r   i t   i s   a n   n e g a t i v e   v a l u e  
                                                         i f   ( t e m p Y   <   0 )   {  
                                                                 H C O b j . F C c o n f . n e g a t i v e   =   t r u e ;  
                                                         }  
                                                         / / c h e c k   w h e t h e r   i t   i s   t h e   m a x   v a l u e  
                                                         i f   ( t y p e o f   H C O b j . F C c o n f [ d a t a Y m a x ]   = = =   ' u n d e f i n e d '   | |   t e m p Y   >   H C O b j . F C c o n f [ d a t a Y m a x ] )   {  
                                                                 H C O b j . F C c o n f [ d a t a Y m a x ]   =   t e m p Y ;  
                                                         }  
                                                         / / c h e c k   w h e t h e r   i t   t h e   m i n   v a l u e  
                                                         i f   ( t y p e o f   H C O b j . F C c o n f [ d a t a Y m i n ]   = = =   ' u n d e f i n e d '   | |   t e m p Y   <   H C O b j . F C c o n f [ d a t a Y m i n ] )   {  
                                                                 H C O b j . F C c o n f [ d a t a Y m i n ]   =   t e m p Y ;  
                                                         }  
                                                         s e r i e s O b j . d a t a . p u s h ( {  
                                                                 y   :   t e m p Y   | |   0  
                                                         } ) ;  
                                                 }  
                                         }  
                                         e l s e   {  
                                                 s e r i e s O b j . d a t a . p u s h ( { y :   0 } ) ;  
                                         }  
                                 }  
                         }  
                 }  
  
  
 / / / / / / / f u n c t i o n   t o   a d d   c a t e g o r y  
  
                 f u n c t i o n   a d d C a t e g o r y ( o b j ,   s e r i e s ,   h c )   {  
                         v a r   x ,   d a t a s e p e r a t o r ,   c o u n t C a t   =   0 ,   z o o m C a t   =   [ ] ;  
                         i f   ( o b j . c a t e g o r i e s   & &   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y )   {  
                                 f o r   ( x   =   0 ;   x   <   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y . l e n g t h ;   x   + =   1 )   {  
                                         i f   ( t y p e o f   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ]   = = =   ' o b j e c t ' )   {  
                                                 i f   ( ! o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . v l i n e )   {  
                                                         i f   ( s e r i e s   = =   2 . 5 )   {  
                                                                 z o o m C a t . p u s h ( o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . l a b e l   ?   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . l a b e l :   ' ' ) ;  
                                                         }   e l s e   {  
                                                                 h c . x A x i s . c a t e g o r i e s . p u s h ( o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . l a b e l   ?   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . l a b e l :   ' ' ) ;  
                                                         }  
  
                                                         c o u n t C a t   + =   1 ;  
                                                 }  
                                                 e l s e   {  
                                                         a d d V l i n e ( h c ,   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . c o l o r ,   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . a l p h a ,   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . t h i c k n e s s ,   c o u n t C a t   -   0 . 5 ) ;  
                                                 }  
                                         }   e l s e   i f   ( t y p e o f   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ]   = = =   ' s t r i n g '   & &   o b j . c h a r t . c o m p a c t d a t a m o d e   = =   ' 1 ' )   {  
                                                 d a t a s e p e r a t o r   =   o b j . c h a r t . d a t a s e p a r a t o r   ?   o b j . c h a r t . d a t a s e p a r a t o r   :   ' | ' ;  
                                                 i f   ( s e r i e s   = =   2 . 5 )   {  
                                                         z o o m C a t   =   z o o m C a t . c o n c a t ( o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . s p l i t ( d a t a s e p e r a t o r ) ) ;  
                                                 }   e l s e   {  
                                                         h c . x A x i s . c a t e g o r i e s   =   h c . x A x i s . c a t e g o r i e s . c o n c a t ( o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . s p l i t ( d a t a s e p e r a t o r ) ) ;  
                                                 }  
                                         }  
                                 }  
                         }  
                       / / / f i x   o f   b u g   # 5 1 0  
                         i f   ( s e r i e s   = = =   2 . 5 )   {  
                                 h c . x A x i s . m a x Z o o m   =   2 ;  
                                 h c . c h a r t . z o o m T y p e   =   ' x ' ;  
                                 h c . c h a r t . s h o w v a l u e   =   o b j . c h a r t . s h o w v a l u e s   = = =   ' 1 '   ?   ' 1 '   :   ' 0 ' ;  
                                 h c . x A x i s . c a t e g o r i e s   =   u n d e f i n e d ;  
                                 h c . x A x i s . m i n   =   0 ;  
                                 h c . x A x i s . m a x   =   z o o m C a t . l e n g t h   -   1 ;  
                                 h c . x A x i s . e n d O n T i c k   =   f a l s e ;  
                                 h c . x A x i s . l a b e l s . f o r m a t t e r   =   f u n c t i o n   ( )   {  
                                         r e t u r n     p a r s e S t r ( z o o m C a t [ t h i s . v a l u e ] ) ;  
                                 } ;  
                         }  
  
                 }  
  
  
                 / / c r e a t e   M S S t a c k e d   C h a r t  
  
                 f u n c t i o n   M S S t a c k e d ( o b j ,   s e r i e s ,   c h a r t N a m e ,   H C O b j ,   w i d t h ,   h i g h t ,   i d ,   g e t S c o l o r )   {  
                         v a r   x ,   y ,   z ,   n e w S e r i e s ,   c o u n t _ s e t   =   0 ,   m a x _ c a t   =   0 ,   a   =   [ ] ,  
                         p l o t W i d t h   =   w i d t h   -   ( H C O b j . c h a r t . m a r g i n [ 1 ]   +   H C O b j . c h a r t . m a r g i n [ 3 ] ) ,  
                         p l o t H i g h t   =   h i g h t   -   ( H C O b j . c h a r t . m a r g i n [ 0 ]   +   H C O b j . c h a r t . m a r g i n [ 2 ] ) ,  
                         n o S t a c k ,   p o i n t W i d t h ,   c a t W i d t h ,   t e m p h e i g h t ,   m a x H i g h t   =   0 ,   p o i n t V a l u e   =   0 ;  
  
                         / /   g e t   t h e   n o   o f   c a t e g o r y  
                         i f   ( o b j . c a t e g o r i e s   & &   o b j . c a t e g o r i e s [ 0 ]   & &   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y )   {  
                                 m a x _ c a t   =   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y . l e n g t h ;  
                         }  
  
                         / / i f   t h e r e   h a s   p a r e n t   d a t a s e t   t r h e n   i e r a t e   b t h r o u g h   i t  
  
                         i f   ( o b j . d a t a s e t   & &   o b j . d a t a s e t   i n s t a n c e o f   A r r a y )   {  
                                 n o S t a c k   =   o b j . d a t a s e t . l e n g t h ;  
                                 c a t W i d t h   =   p l o t W i d t h   /   m a x _ c a t ;  
                                 p o i n t W i d t h   =   c a t W i d t h   /   ( n o S t a c k   +   2 ) ;  
                                 f o r   ( x   =   0 ;   x   <   o b j . d a t a s e t . l e n g t h ;   x   + =   1 )   {  
                                         t e m p h e i g h t   =   [ ] ;  
                                         / / i f   i t   h a s   c h i l d   d a t a s e t   t h e n   i t t e r a t e   t h r o u g h   i t  
                                         i f   ( o b j . d a t a s e t [ x ] . d a t a s e t   & &   o b j . d a t a s e t [ x ] . d a t a s e t   i n s t a n c e o f   A r r a y )   {  
                                                 f o r   ( y   =   0 ;   y   <   o b j . d a t a s e t [ x ] . d a t a s e t . l e n g t h   ;   y   + =   1 )   {  
                                                         n e w S e r i e s   =   {  
                                                                 F C t y p e :   s e r i e s ,  
                                                                 t y p e :   o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . r e n d e r a s   ?   F C F C C . c o m b i [ o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . r e n d e r a s . t o L o w e r C a s e ( ) ] :   u n d e f i n e d ,  
                                                                 n a m e :   o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . s e r i e s n a m e   ?   o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . s e r i e s n a m e :   '   ' ,  
                                                                 d a t a :   [ ] ,  
                                                                 c o l o r :   c o n v e r t C o l o r ( o b j . d a t a s e t [ x ] . c o l o r   | |   g e t S c o l o r ( c o u n t _ s e t ) ,   o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . a l p h a   | |   1 0 0 ) ,  
                                                                 y A x i s :   o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . p a r e n t y a x i s   = =   ' S '   ?   1   :   u n d e f i n e d ,  
                                                                 s h o w v a l u e :   o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . s h o w v a l u e s ,  
                                                                 m C o l u m :   x ,  
                                                                 m S t a c k :   y  
                                                         } ;  
  
                                                         i f   ( o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . d a t a   i n s t a n c e o f   A r r a y )   {  
                                                                 f o r   ( z   =   0 ;   z   <   m a x _ c a t ;   z   + =   1 )   {  
                                                                         t e m p h e i g h t [ z ]   =   t e m p h e i g h t [ z ]   ?   t e m p h e i g h t [ z ]   :   0 ;  
                                                                         p o i n t V a l u e   =   ( o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . d a t a [ z ]   & &   o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . d a t a [ z ] . v a l u e )   ?   p a r s e F l o a t ( o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . d a t a [ z ] . v a l u e ) :   ' ' ;  
                                                                         t e m p h e i g h t [ z ]   + =   p o i n t V a l u e   ?   p o i n t V a l u e   :   0 ;  
                                                                         n e w S e r i e s . d a t a . p u s h ( {  
                                                                                 M W i d t h :   p o i n t W i d t h ,  
                                                                                 M X :   ( z   *   c a t W i d t h )   +   ( ( x   +   1 )   *   p o i n t W i d t h ) ,  
                                                                                 M Y :   t e m p h e i g h t [ z ] ,  
                                                                                 y :   p o i n t V a l u e ,  
                                                                                 l i n k :     o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . d a t a [ z ] . l i n k ,  
                                                                                 i d :   i d ,  
                                                                                 c o l o r :   o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . d a t a [ z ] . c o l o r   ?   c o n v e r t C o l o r ( o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . d a t a [ z ] . c o l o r   | |   g e t S c o l o r ( c o u n t _ s e t ) ,   o b j . d a t a s e t [ x ] . d a t a s e t [ y ] . d a t a [ z ] . a l p h a   | |   1 0 0 )   :   u n d e f i n e d  
                                                                         } ) ;  
                                                                 }  
                                                         }  
  
                                                         a . p u s h ( n e w S e r i e s ) ;  
                                                         / / a t   t h e   e n d   i n c r e a m e n t   t h e   s e r e a s e   c o u n t e r  
                                                         c o u n t _ s e t   + =   1 ;  
                                                 }  
                                         }  
                                         f o r   ( z   =   0 ;   z   <   m a x _ c a t ;   z   + =   1 )   {  
                                                 i f   ( m a x H i g h t   <   t e m p h e i g h t [ z ] )   {  
                                                         m a x H i g h t   =   t e m p h e i g h t [ z ] ;  
                                                 }  
                                         }  
                                 }  
                         }  
  
  
                         H C O b j . y A x i s [ 0 ] . m a x   =   m a x H i g h t   +   5 ;  
  
  
                         r e t u r n   a ;  
                 }  
                  
  
                   / / / F u n c t i o n   T o   a d d   d a t a   &   c a t e g o r i e s  
                 f u n c t i o n   a d d D a t a ( o b j ,   s e r i e s ,   c h a r t N a m e ,   h c ,   w i d t h ,   h e i g h t ,   i d )   {  
                         v a r   a   =   [ ] ,   x ,   y ,   z ,   c o u n t _ s e t ,   g e t S c o l o r ,   p a r e t o ,   y C a l T e m p ;  
                         / / t h i s   f u n c t i o n   w i d e c i d e   t h e   d e f a u l t   c o l o r   f o r   a   s e r i e s   o r   d a t a ;  
                         g e t S c o l o r   =   f u n c t i o n   ( i n d e x )   {  
                                 v a r   p a l e t t ;  
                                 / / i f   p a l e t t   c o l o r   i s   s u p p l y e d   t h e n   u s e   i t  
                                 / / c h e c k   w h e t h e r   i t   i s   a n   c o m a   s e p e r a t e d   s t r i n g   t h e n   s p l i t   i t   i n t o   a r r a y  
                                 / / e l s e   u s e   d e f a u l t   c o l o r   p a l e t t  
                                 p a l e t t   =   ( o b j . c h a r t . p a l e t t e c o l o r s )   ?   ( ( t y p e o f   o b j . c h a r t . p a l e t t e c o l o r s   = = =   ' s t r i n g ' )   ?   o b j . c h a r t . p a l e t t e c o l o r s . s p l i t ( ' , ' )   :   o b j . c h a r t . p a l e t t e c o l o r s )   :   F C F C C . c o l o r ;  
                                 / / / r e t u r n   c o l o r   f o r   t h e   i n d e x   p o s i t i o n  
                                 r e t u r n   p a l e t t [ i n d e x   %   p a l e t t . l e n g t h ] ;  
  
                         } ;  
  
                         / / s w i t c h   d e p e n d i n g   o n   t h e   c h a r t ' s   t y p e / s e r i e s  
                         s w i t c h   ( s e r i e s )   {  
                         c a s e   1 :     / / s i n g l e   s e r i e s  
                         c a s e   1 . 5 :     / / p a r e t o  
                                 / / / o p t i o n s   t h a t   h a v e   t o   c h a n g e   f o r   p a r e t o   c h a r t  
                                 i f   ( s e r i e s   = =   1 . 5 )   {  
                                         / / s e t   t h e   s e c o n d a r y   y   a x i s   v a l u e   m a x   a s   1 0 0  
                                         h c . y A x i s [ 1 ] . m a x   =   1 0 0 ;  
                                         / / s e t   t h e   l a b e l   f o r m a t e r   f o r   l i n e   s e r i e s  
                                         h c . y A x i s [ 1 ] . l a b e l s . f o r m a t t e r   =   f u n c t i o n   ( )   {  
                                                 r e t u r n   p a r s e S t r ( t h i s . v a l u e   +   ' % ' ) ;  
                                         } ;  
                                         i f   ( o b j . d a t a   i n s t a n c e o f   A r r a y )   {  
                                                 o b j . d a t a . s o r t ( f u n c t i o n   ( a ,   b )   {  
                                                         r e t u r n   p a r s e F l o a t ( b . v a l u e )   -   p a r s e F l o a t ( a . v a l u e ) ;  
                                                 } ) ;  
                                         }  
                                 }  
  
  
                                         / / / / /   s p e c i a l   s e t i n g s   f o r   s i n g l e   s e r i e s   / / / / /  
                                         / / d i s a b l e   t h e   l e g e n d   f o r   c h h a r t  
                                 h c . l e g e n d . e n a b l e d   =   f a l s e ;  
  
  
                                         / / / / / / c a t e g o r y     & &     d a t a \ \ \ \ \ \ \  
  
                                         / / i t e r a t e   t h r o u g h   a l l   t h e   d a t a  
                                 i f   ( o b j . d a t a )   {  
                                         z   =   c r e a t e S e r i e s ( s e r i e s ) ;  
                                         a d d P o i n t ( z ,   o b j . d a t a ,   s e r i e s ,   c h a r t N a m e ,   i d ,   h c ,   g e t S c o l o r ) ;  
                                            
                                           / / / p i e   s p e c i f f i c   f u n c t i o n s  
                                         i f   ( c o n v e r t N a m e s ( c h a r t N a m e )   = =   ' p i e ' )   {  
                                                 / / r e v a r s e   t h e   s e r i e s   f o r   p i e / d o u g g n u t   t o   m a k e   i t   c l o c k w i s e  
                                                 z . d a t a . r e v e r s e ( ) ;  
                                                 / / r e m o v e   t h e   s e r e a s e   c o l o r   t o   a v o i d   o n c l i c k   d i s c o l o r e d   s l i c e  
                                                 z . c o l o r   =   u n d e f i n e d ;  
                                                 / / r e m o v e   t h e   p l o t b o d e r  
                                                 h c . c h a r t . p l o t B o r d e r W i d t h   =   0 ;  
                                                 / / s e t   t h e   m a x   m a r g i n  
                                                 x   =   h c . c h a r t . b o r d e r W i d t h   +   1 ;  
                                                 h c . c h a r t . m a r g i n   =   [ h c . c h a r t . m a r g i n [ 0 ] ,   x ,   x ,   x ] ;  
                                         }  
                                         a . p u s h ( z ) ;  
                                         / / f o r   p a r e t o   a d d   t h e   l i n e   s e r e a s e  
                                         i f   ( ( c h a r t N a m e   = =   ' P a r e t o 2 D '   | |   c h a r t N a m e   = =   ' P a r e t o 3 D ' )   & &   o b j . c h a r t . s h o w c u m u l a t i v e l i n e   ! = =   ' 0 ' )   {  
                                                 p a r e t o   =   p a r e t o C o n v e r t ( z . d a t a ) ;  
                                                 a . p u s h ( p a r e t o ) ;  
                                         }  
                                 }  
                                 b r e a k ;  
                         c a s e   2 :  
                         c a s e   2 . 2 :  
                         c a s e   2 . 5 :                                  
                         c a s e   3 :                                  
                         c a s e   4 :  
                         c a s e   5 :  
                         c a s e   5 . 5 :  
                         c a s e   6 :  
                         c a s e   6 . 5 :  
                                 s w i t c h   ( s e r i e s )   {  
                                 c a s e   2 . 2 :  
                                         h c . y A x i s [ 0 ] . r e v e r s e d   =   t r u e ;  
                                         / / s e t   t h e   P C   r e v e r s e   c h a r t   f l a g  
                                         h c . y A x i s [ 0 ] . P C r e v e r s e d   =   t r u e ;  
                                         b r e a k ;  
                                 c a s e   3 :  
                                         i f   ( o b j . c h a r t . s t a c k 1 0 0 p e r c e n t   = =   ' 1 ' )   {  
                                                 h c . p l o t O p t i o n s . s e r i e s . s t a c k i n g   =   ' p e r c e n t ' ;  
                                                 h c . y A x i s [ 0 ] . l a b e l s . f o r m a t t e r   =   f u n c t i o n   ( )   {  
                                                         r e t u r n   p a r s e S t r ( t h i s . v a l u e   +   ' % ' ) ;  
                                                 } ;  
                                         }   e l s e   {  
                                                 h c . p l o t O p t i o n s . s e r i e s . s t a c k i n g   =   ' n o r m a l ' ;  
                                         }  
                                         b r e a k ;  
                                 c a s e   5 . 5 :  
                                         h c . p l o t O p t i o n s . c o l u m n . s t a c k i n g   =   o b j . c h a r t . s t a c k 1 0 0 p e r c e n t   = =   ' 1 '   ?   ' p e r c e n t '   :   ' n o r m a l ' ;  
                                 }  
                                     / / / / / / / / c a t e g o r y / / / / / / / /  
  
                                 a d d C a t e g o r y ( o b j ,   s e r i e s ,   h c ) ;  
                                       / / / / / / / / d a t a / / / / / / / /  
                                 i f   ( s e r i e s   ! = =   6 )   {  
                                         i f   ( o b j . d a t a s e t )   {  
                                                 c o u n t _ s e t   =   0 ;  
                                                 f o r   ( x   =   0 ; x   <   o b j . d a t a s e t . l e n g t h ; x   + =   1 )   {  
                                                         z   =   c r e a t e S e r i e s ( s e r i e s ,   c o n v e r t C o l o r ( o b j . d a t a s e t [ x ] . c o l o r   | |     g e t S c o l o r ( c o u n t _ s e t ) ,   o b j . d a t a s e t [ x ] . a l p h a   | |     1 0 0 ) ,  
                                                         o b j . d a t a s e t [ x ] . r e n d e r a s   ?   F C F C C . c o m b i [ o b j . d a t a s e t [ x ] . r e n d e r a s . t o L o w e r C a s e ( ) ] :   ( ( o b j . d a t a s e t [ x ] . p a r e n t y a x i s   = =   ' S '   & &   ( s e r i e s   = =   5   | |   s e r i e s   = =   5 . 5 ) )   ?   ' l i n e ' :   u n d e f i n e d ) ,  
                                                         o b j . d a t a s e t [ x ] . s e r i e s n a m e ,   o b j . d a t a s e t [ x ] . p a r e n t y a x i s   = =   ' S ' ,   o b j . d a t a s e t [ x ] . s h o w v a l u e s ,  
                                                         o b j . d a t a s e t [ x ] . p l o t b o r d e r c o l o r   ?   c o n v e r t C o l o r ( o b j . d a t a s e t [ x ] . p l o t b o r d e r c o l o r ,   o b j . d a t a s e t [ x ] . p l o t b o r d e r a l p h a   | |   9 5 )   :   u n d e f i n e d ,  
                                                         p a r s e I n t ( o b j . d a t a s e t [ x ] . p l o t b o r d e r t h i c k n e s s   | |   o b j . d a t a s e t [ x ] . l i n e t h i c k n e s s ,   1 0 )   | |   u n d e f i n e d ) ;  
  
                                                         v a r   s e r i e s T y p e   =   z . t y p e   | |   h c . c h a r t . d e f a u l t S e r i e s T y p e ;  
                                                         z . m a r k e r   =   ( s e r i e s T y p e   = = =   ' a r e a '   | |   s e r i e s T y p e   = = =   ' l i n e '   | |   s e r i e s T y p e   = = =   ' s p l i n e '   | |   s e r i e s T y p e   = = =   ' a r e a s p l i n e ' )   ?   {  
                                                                         e n a b l e d   :   o b j . d a t a s e t [ x ] . d r a w a n c h o r s   ?   ( o b j . d a t a s e t [ x ] . d r a w a n c h o r s   = =   ' 1 '   ?   t r u e   :   f a l s e )   :   u n d e f i n e d ,  
                                                                         r a d i u s :   o b j . d a t a s e t [ x ] . a n c h o r r a d i u s   ?   o b j . d a t a s e t [ x ] . a n c h o r r a d i u s   :   u n d e f i n e d ,  
                                                                         s y m b o l :   c o n v e r t A n c o r S i d e ( p a r s e I n t ( o b j . d a t a s e t [ x ] . a n c h o r s i d e s ,   1 0 ) ) ,  
                                                                         f i l l C o l o r :   o b j . d a t a s e t [ x ] . a n c h o r b g c o l o r   ?   c o n v e r t C o l o r ( o b j . d a t a s e t [ x ] . a n c h o r b g c o l o r   | |   ' F F F F F F ' ,   o b j . d a t a s e t [ x ] . a n c h o r b g a l p h a   | |   1 0 0 )   :   u n d e f i n e d ,  
                                                                         l i n e C o l o r :   o b j . d a t a s e t [ x ] . a n c h o r b o r d e r c o l o r   ?   c o n v e r t C o l o r ( o b j . d a t a s e t [ x ] . a n c h o r b o r d e r c o l o r   | |   ' 7 6 7 5 7 5 ' ,   o b j . d a t a s e t [ x ] . a n c h o r a l p h a   | |   1 0 0 )   :   u n d e f i n e d ,  
                                                                         l i n e W i d t h :   o b j . d a t a s e t [ x ] . a n c h o r b o r d e r t h i c k n e s s   ?   o b j . d a t a s e t [ x ] . a n c h o r b o r d e r t h i c k n e s s   :   u n d e f i n e d  
                                                                 }   :   n u l l ;  
  
  
  
                                                         c o u n t _ s e t   + =   1 ;  
                                                         i f   ( o b j . d a t a s e t [ x ] . d a t a )   {  
                                                                 a d d P o i n t ( z ,   o b j . d a t a s e t [ x ] . d a t a ,   s e r i e s ,   c h a r t N a m e ,   i d ,   h c ,   u n d e f i n e d ,   u n d e f i n e d ,   o b j ) ;  
                                                         }  
                                                         a . p u s h ( z ) ;  
                                                 }  
                                                 i f   ( s e r i e s   = =   3   | |   s e r i e s   = =   5 . 5   | |   c o n v e r t N a m e s ( c h a r t N a m e )   = =   ' b a r ' )   {  
                                                         v a r   t e m p A r r   =   [ ] ;  
                                                         f o r   ( x   =   0 ;   x   <   a . l e n g t h ;   x   + =   1 )   {  
                                                                 i f   ( a [ x ] . t y p e )   {  
                                                                         t e m p A r r . p u s h ( a [ x ] ) ;  
                                                                 }   e l s e   {  
                                                                         t e m p A r r . s p l i c e ( 0 ,   0 ,   a [ x ] ) ;  
                                                                 }  
                                                         }  
                                                         a   =   t e m p A r r ;  
                                                         h c . l e g e n d . r e v e r s e d   =   t r u e ;  
                                                 }  
                                         }  
                                 }   e l s e   {  
                                         a   =   M S S t a c k e d ( o b j ,   s e r i e s ,   c h a r t N a m e ,   h c ,   w i d t h ,   h e i g h t ,   i d ,   g e t S c o l o r ) ;  
                                 }  
                                    
  
                                 b r e a k ;  
                         c a s e   7 :  
                         c a s e   7 . 5 :  
                                         / / / / / / / / s p e c i a l   c o n f .   f o r   x - y   p l o t   c h a r t s  
                                 h c . c h a r t . s h o w v a l u e   =   o b j . c h a r t . s h o w v a l u e s   = =   ' 1 '   ?   ' 1 '   :   ' 0 ' ;  
  
                                         / / / / / / / / c a t e g o r y / / / / / / / /  
  
                                 i f   ( o b j . c a t e g o r i e s   & &   o b j . c a t e g o r i e s [ 0 ]   & &   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y )   {  
                                         f o r   ( x   =   0 ; x   <     o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y . l e n g t h ;   x   + =   1 )   {  
                                                 i f   ( o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . s h o w v e r t i c a l l i n e   & &   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . s h o w v e r t i c a l l i n e   = =   ' 1 ' )   {  
                                                         a d d V l i n e ( h c ,   o b j . c a t e g o r i e s [ 0 ] . v e r t i c a l l i n e c o l o r ,   o b j . c a t e g o r i e s [ 0 ] . v e r t i c a l l i n e a l p h a ,   o b j . c a t e g o r i e s [ 0 ] . v e r t i c a l l i n e t h i c k n e s s ,   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . x ) ;  
                                                 }  
                                                 h c . x A x i s . c a t e g o r i e s [ o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . x ]   =   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . l a b e l   ?   o b j . c a t e g o r i e s [ 0 ] . c a t e g o r y [ x ] . l a b e l :   ' ' ;  
                                         }  
                                 }  
  
                                         / / / / / / / / d a t a / / / / / / / /  
  
                                 v a r   b u b b l e R R a t i o   =   m a x Z V a l ( o b j . d a t a s e t )   /   m a x R e d i o u s ( w i d t h ,   h e i g h t ) ;  
                                 i f   ( o b j . d a t a s e t )   {  
                                         c o u n t _ s e t   =   0 ;  
                                         f o r   ( x   =   0 ;   x   <   o b j . d a t a s e t . l e n g t h ;   x   + =   1 )   {  
                                                 z   =   c r e a t e S e r i e s ( s e r i e s ,   c o n v e r t C o l o r ( o b j . d a t a s e t [ x ] . c o l o r   | |   g e t S c o l o r ( c o u n t _ s e t ) ,   o b j . d a t a s e t [ x ] . a l p h a   | |   1 0 0 ) ,   o b j . d a t a s e t [ x ] . r e n d e r a s   ?   F C F C C . c o m b i [ o b j . d a t a s e t [ x ] . r e n d e r a s ] :   ( ( o b j . d a t a s e t [ x ] . p a r e n t y a x i s   = =   ' S '   & &   ( s e r i e s   = =   5   | |   s e r i e s   = =   5 . 5 ) )   ?   ' l i n e ' :   u n d e f i n e d ) ,   o b j . d a t a s e t [ x ] . s e r i e s n a m e ,   o b j . d a t a s e t [ x ] . p a r e n t y a x i s   = =   ' S ' ,   o b j . d a t a s e t [ x ] . s h o w v a l u e s ,   u n d e f i n e d ,   u n d e f i n e d ) ;  
                                                 z . m a r k e r   =   {  
                                                         s y m b o l :   ( s e r i e s   = =   7 . 5 )   ?   ' c i r c l e '   :   c o n v e r t A n c o r S i d e ( p a r s e I n t ( o b j . d a t a s e t [ x ] . a n c h o r s i d e s ,   1 0 ) ) ,  
                                                         s t a t e s :   {  
                                                                 h o v e r :   {  
                                                                         e n a b l e d :   f a l s e  
                                                                 }  
                                                         }  
                                                 } ;  
                                                 c o u n t _ s e t   + =   1 ;  
                                                 i f   ( o b j . d a t a s e t [ x ] . d a t a )   {  
                                                         a d d P o i n t ( z ,   o b j . d a t a s e t [ x ] . d a t a ,   s e r i e s ,   c h a r t N a m e ,   i d ,   h c ,   g e t S c o l o r ,   b u b b l e R R a t i o ) ;  
                                                 }  
                                                 a . p u s h ( z ) ;  
                                         }  
                                 }  
                                 h c . x A x i s . m a x   =   o b j . c h a r t . x a x i s m a x v a l u e   ?   p a r s e I n t ( o b j . c h a r t . x a x i s m a x v a l u e ,   1 0 ) :   u n d e f i n e d ;  
                                 h c . x A x i s . m i n   =   o b j . c h a r t . x a x i s m i n v a l u e   ?   p a r s e I n t ( o b j . c h a r t . x a x i s m i n v a l u e ,   1 0 ) :   u n d e f i n e d ;  
                                 h c . x A x i s . s h o w L a s t L a b e l     =   t r u e ;  
                                 b r e a k ;  
                         d e f a u l t :  
                                 b r e a k ;  
                         }  
                         i f   ( ! ( ( s e r i e s   = = =   3   | |   s e r i e s   = = =   5 . 5 )   & &   o b j . c h a r t . s t a c k 1 0 0 p e r c e n t   = = =   ' 1 ' )   & &   c h a r t N a m e   ! = =   ' M a r i m e k k o ' )   { / / i f   i t   i s   n o t   a n   1 0 0 p e r c e n t   s t a c k   c h a r t  
                                 i f   ( s e r i e s   = = =   3   | |   s e r i e s   = = =   5 . 5 )   {  
                                         h c . F C c o n f . d a t a Y 0 m a x   =   h c . F C c o n f . s t a c k V a l u e [ 0 ] ;  
                                         h c . F C c o n f . d a t a Y 0 m i n   =   h c . F C c o n f . s t a c k V a l u e [ 0 ] ;  
                                         f o r   ( y   =   1 ;   y   <   h c . F C c o n f . s t a c k V a l u e . l e n g t h ;   y   + =   1 )   {  
                                                 i f   ( h c . F C c o n f . s t a c k V a l u e [ y ]   >   h c . F C c o n f . d a t a Y 0 m a x )   {  
                                                         h c . F C c o n f . d a t a Y 0 m a x   =   h c . F C c o n f . s t a c k V a l u e [ y ] ;  
                                                 }  
                                                 i f   ( h c . F C c o n f . s t a c k V a l u e [ y ]   <   h c . F C c o n f . d a t a Y 0 m i n )   {  
                                                         h c . F C c o n f . d a t a Y 0 m i n   =   h c . F C c o n f . s t a c k V a l u e [ y ] ;  
                                                 }  
                                         }  
                                 }  
  
                                 i f   ( s e r i e s   = = =   1 . 5   | |   s e r i e s   = = =   5 . 5   | |   s e r i e s   = = =   5   | |   s e r i e s   = = =   6 . 5 )   {  
                                         y C a l T e m p   =   g e t A x i s L i m i t s ( h c . F C c o n f . d a t a Y 0 m a x ,   h c . F C c o n f . d a t a Y 0 m i n ,   o b j . c h a r t . p y a x i s m a x v a l u e ,   o b j . c h a r t . p y a x i s m i n v a l u e ,   ' ' ,   o b j . c h a r t . s e t a d a p t i v e y m i n   ! = =   ' 1 ' ) ;  
                                         h c . y A x i s [ 0 ] . m a x   =   y C a l T e m p . M a x ;  
                                         h c . y A x i s [ 0 ] . m i n   =   y C a l T e m p . M i n ;  
                                         i f   ( s e r i e s   ! = =   1 . 5 )   {  
                                                 y C a l T e m p   =   g e t A x i s L i m i t s ( h c . F C c o n f . d a t a Y 1 m a x ,   h c . F C c o n f . d a t a Y 1 m i n ,   o b j . c h a r t . s y a x i s m a x v a l u e ,   o b j . c h a r t . s y a x i s m i n v a l u e ,   ' ' ,   o b j . c h a r t . s e t a d a p t i v e s y m i n   ! = =   ' 1 ' ) ;  
                                                 h c . y A x i s [ 1 ] . m a x   =   y C a l T e m p . M a x ;  
                                                 h c . y A x i s [ 1 ] . m i n   =   y C a l T e m p . M i n ;  
                                         }  
                                 }  
                                 e l s e   {  
                                         y C a l T e m p   =   g e t A x i s L i m i t s ( h c . F C c o n f . d a t a Y 0 m a x ,   h c . F C c o n f . d a t a Y 0 m i n ,   o b j . c h a r t . y a x i s m a x v a l u e ,   o b j . c h a r t . y a x i s m i n v a l u e ,   ' ' ,   o b j . c h a r t . s e t a d a p t i v e y m i n   ! = =   ' 1 ' ) ;  
                                         h c . y A x i s [ 0 ] . m a x   =   y C a l T e m p . M a x ;  
                                         h c . y A x i s [ 0 ] . m i n   =   y C a l T e m p . M i n ;  
                                 }  
                         }  
                         h c . s e r i e s   =   a ;  
                 }  
  
         / / / m o d i f y   a s   p e r   l e g e n d  
                 f u n c t i o n   M o d y f y L e g e n d ( h c ,   o b j )   {  
                         v a r   n o S e r i e s   =   h c . s e r i e s . l e n g t h ,   l e g e n d P o s ,   l e g e n d W i d t h ,   l e g e n d H e i g h t ;  
  
                         i f   ( o b j . c h a r t . s h o w l e g e n d   = =   ' 0 ' )   {  
                                 h c . l e g e n d . e n a b l e d   =   f a l s e ;  
                         }   e l s e   {  
                                 h c . l e g e n d . l a b e l F o r m a t t e r     =   f u n c t i o n   ( )   {  
                                         r e t u r n   p a r s e S t r ( t h i s . n a m e ) ;  
                                 } ;  
                                 i f   ( o b j . c h a r t . i n t e r a c t i v e l e g e n d   = =   ' 0 ' )   {  
                                         h c . p l o t O p t i o n s . s e r i e s . e v e n t s . l e g e n d I t e m C l i c k   =   f u n c t i o n   ( e v e n t )   {  
                                                 r e t u r n   f a l s e ;  
                                         } ;  
                                         h c . l e g e n d . i t e m S t y l e . c u r s o r   =   ' d e f a u l t ' ;  
                                 }  
                                 h c . l e g e n d . s h a d o w   =   o b j . c h a r t . l e g e n d s h a d o w   = =   ' 0 '   ?   f a l s e   :   t r u e ;  
                                 h c . l e g e n d . b a c k g r o u n d C o l o r   =   c o n v e r t C o l o r ( o b j . c h a r t . l e g e n d b g c o l o r   | |   ' # f f f f f f ' ,   o b j . c h a r t . l e g e n d b g a l p h a   | |   1 0 0 ) ;  
                                 h c . l e g e n d . b o r d e r C o l o r   =   c o n v e r t C o l o r ( o b j . c h a r t . l e g e n d b o r d e r c o l o r   | |   ' # 5 4 5 4 5 4 ' ,   o b j . c h a r t . l e g e n d b o r d e r a l p h a   | |   1 0 0 ) ;  
                                 h c . l e g e n d . b o r d e r W i d t h   =   o b j . c h a r t . l e g e n d b o r d e r t h i c k n e s s   | |   1 ;  
                                 i f   ( o b j . r e v e r s e l e g e n d   = =   ' 1 ' )   {  
                                         h c . l e g e n d . r e v e r s e d   =   ! h c . l e g e n d . r e v e r s e d ;  
                                 }  
  
                                 i f   ( o b j . c h a r t . l e g e n d p o s i t i o n   = =   ' R I G H T ' )   {  
                                         h c . l e g e n d . v e r t i c a l A l i g n   =   ' m i d d l e ' ;  
                                         h c . l e g e n d . a l i g n   =   ' r i g h t ' ;  
                                         h c . l e g e n d . w i d t h   =   7 0 ;  
                                         h c . l e g e n d . x   =   - 1 5 ;  
                                         h c . c h a r t . m a r g i n [ 1 ]   + =   8 5 ;  
                                 }   e l s e   {  
                                         h c . l e g e n d . x   =   0 ;  
                                         h c . c h a r t . m a r g i n [ 2 ]   + =   4 6 ;  
                                 }  
                         }  
  
                 }  
  
                 / / / / f u n c t i o n   t o   e n t e r   a   t e x t   i n   c h a r t  
                 f u n c t i o n   c r e a t e T e x t ( t e x t ,   t o p ,   l e f t )   {  
                         r e t u r n   {  
                                 h t m l :   t e x t ,  
                                 s t y l e :   {  
                                         l e f t :   l e f t   +   ' p x ' ,  
                                         t o p :   t o p   +   ' p x '  
                                 }  
                         } ;  
  
                 }  
  
  
   / / f u n c t i o n   t o   c o n v e r t   a   m a r i m e k k o   c h a r t  
                 f u n c t i o n   c o n v e r t M a r i m e k o ( H C O b j ,   F C O b j ,   c h a r t W i d t h ,   c h a r t H i g h t ,   F C C a t e g o r i e s )   {  
                         v a r   p l o t W i d t h   =   c h a r t W i d t h   -   ( H C O b j . c h a r t . m a r g i n [ 1 ]   +   H C O b j . c h a r t . m a r g i n [ 3 ] ) ,  
                         p l o t H i g h t   =   c h a r t H i g h t   -   ( H C O b j . c h a r t . m a r g i n [ 0 ]   +   H C O b j . c h a r t . m a r g i n [ 2 ] ) ,  
                         y ,   z ,   a r r   =   [ ] ,   t o t a l   =   0 ,   t e m p ,   s e t P e r s e n t   =   f a l s e ,  
                         c a t C o u n t F l a g   =   t r u e ,   t e m p 2 ,   t o t a l p e r c e n t   =   0 ;  
  
                         i f   ( H C O b j . x A x i s . l a b e l s . e n a b l e d   = = =   f a l s e   & &   F C O b j . c h a r t . s h o w x a x i s p e r c e n t v a l u e s   ! =   ' 0 ' )   {  
                                 H C O b j . x A x i s . t i t l e . m a r g i n   + =   1 5 ;  
                                 H C O b j . c h a r t . m a r g i n [ 2 ]   + =   1 5 ;  
  
                         }  
                         / / s e t   t h e   p l o t H i g h t   q u i t   b i g g e r   t o   a d d a j u s t   x a x i s p e r c e n t v a l u e s  
                         i f   ( H C O b j . x A x i s . l a b e l s . e n a b l e d   ! = =   f a l s e   & &   F C O b j . c h a r t . s h o w x a x i s p e r c e n t v a l u e s   ! =   ' 0 ' )   {  
                                 p l o t H i g h t   + =   1 5 ;  
                         }  
                         i f   ( F C C a t e g o r i e s   & &   F C C a t e g o r i e s [ 0 ]   & &   F C C a t e g o r i e s [ 0 ] . c a t e g o r y   i n s t a n c e o f   A r r a y )   {  
                               
