ÿþ/ /   J S c r i p t   F i l e  
  
  
 f u n c t i o n   b u i l d N o r m U p d a t e D i s p l a y ( p o d I d )  
 {  
 	 v a r   o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p o d I d ) ;  
 	 v a r   n o r m D s p   =   $ ( o b j . g e t A t t r i b u t e ( " n o r m d s p i d " ) ) ;  
 	 v a r   m a x D s p   =   $ ( o b j . g e t A t t r i b u t e ( " m a x d s p i d " ) ) ;  
 	  
 	 v a r   s t r   =   " < d i v   s t y l e = ' p a d d i n g :   2 0 p x ; ' > D e t a i l s   o f   t h i s   u p d a t e   a r e   n o t   a v a i l a b l e . < / d i v > " ;  
 	 i f   ( m a x D s p )  
 	 {  
 	 	 v a r   s r c h F r a m e   =   m a x D s p . g e t E l e m e n t s ( " i f r a m e " ) [ 0 ] ; 	 	  
 	 	 i f   ( s r c h F r a m e )  
 	 	 {  
 	 	 	 v a r   s c   =   s r c h F r a m e . c o n t e n t W i n d o w ;  
 	 	 	 i f   ( ( s c )   & &   ( s c . i n p u t F r a m e ) )  
 	 	 	 {  
 	 	 	 	 v a r   u p d   =   s c . i n p u t F r a m e . _ u p d a t e S e t ;  
 	 	 	 	 i f   ( u p d )   s t r   =   u p d . n o r m a l i z e d d i s p l a y ;  
 	 	 	 }  
 	 	 }  
 	 } 	  
 	 n o r m D s p . i n n e r H T M L   =   s t r ;  
 }  
  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
 * 	 	 	 U s e r   i s   a s k i n g   t o   c l o s e   a n   u p d a t e  
 * 	 	 	 p a g e .     C a l l   a   r o u t i n e   o n   t h e  
 * 	 	 	 i n p u t F r a m e   t o   s e e   i f   t h e r e   a r e  
 * 	 	 	 a n y   p e n d i n g   u p d a t e s .  
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
 f u n c t i o n   r e m o v e U p d a t e P o d ( p o d I d )  
 {  
 	 v a r   o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p o d I d ) ;  
 	 v a r   n o r m D s p   =   $ ( o b j . g e t A t t r i b u t e ( " n o r m d s p i d " ) ) ;  
 	 v a r   m a x D s p   =   $ ( o b j . g e t A t t r i b u t e ( " m a x d s p i d " ) ) ;  
 	  
 	 v a r   m a i n F r a m e   =   m a x D s p . g e t E l e m e n t s ( " i f r a m e " ) [ 0 ] ; 	 	  
 	 i f   ( m a i n F r a m e )  
 	 {  
 	 	 v a r   s c   =   m a i n F r a m e . c o n t e n t W i n d o w ;  
 	 	 i f   ( s c )   r e t u r n   s c . i n p u t F r a m e . p e n d i n g U p d a t e s ( ) ;  
 	 }  
 	 r e t u r n   t r u e ;  
 }  
  
 f u n c t i o n   b u i l d N o r m S e a r c h D i s p l a y ( p o d I d )  
 {  
 	 v a r   o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p o d I d ) ;  
 	 v a r   n o r m D s p   =   $ ( o b j . g e t A t t r i b u t e ( " n o r m d s p i d " ) ) ;  
 	 v a r   m a x D s p   =   $ ( o b j . g e t A t t r i b u t e ( " m a x d s p i d " ) ) ;  
 	  
 	 v a r   s t r   =   " " ;  
 	  
 	 i f   ( m a x D s p )  
 	 {  
 	 	 v a r   s r c h F r a m e   =   m a x D s p . g e t E l e m e n t s ( " i f r a m e " ) [ 0 ] ; 	 	  
 	 	 i f   ( s r c h F r a m e )  
 	 	 {  
 	 	 	 v a r   s c   =   s r c h F r a m e . c o n t e n t W i n d o w ;  
 	 	 	 i f   ( s c   & &   s c . _ s e a r c h N o d e )  
 	 	 	 {  
 	 	 	 	 v a r   n a m e   =   " "  
 	 	 	 	 v a r   t N o d e ;  
 	 	 	 	 t N o d e   =   s c . _ s e a r c h N o d e . s e l e c t S i n g l e N o d e ( " . / / M E N U T E X T " ) ;  
 	 	 	 	 i f   ( t N o d e )   n a m e   =   t N o d e . t e x t ;  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 t N o d e   =   s c . _ s e a r c h N o d e . s e l e c t S i n g l e N o d e ( " . / / T O O L T I P " ) ;  
 	 	 	 	 	 i f   ( t N o d e )   n a m e   =   t N o d e . t e x t ;  
 	 	 	 	 	 e l s e  
 	 	 	 	 	 {  
 	 	 	 	 	 	 t N o d e   =   s c . _ s e a r c h N o d e . g e t A t t r i b u t e ( " i d " ) ;  
 	 	 	 	 	 	 i f   ( t N o d e )   n a m e   =   t N o d e . t e x t ; 	 	 	 	 	 	  
 	 	 	 	 	 }  
 	 	 	 	 }  
  
 	 	 	 	 v a r   c r i t   =   s c . b u i l d Q u e r y ( 0 , t r u e ) ;  
 	 	 	 	 i f   ( c r i t . l e n g t h   >   7 5 )   c r i t   =   c r i t . r e p l a c e ( / , ( ? = \ w ) / g , " ,   " ) ;  
 	 	 	 	 	 	 	 	  
 	 	 	 	 s t r   =   " < t a b l e   c l a s s = ' s e a r c h i n f o t a b l e '   c e l l p a d d i n g = ' 3 ' > " ;  
 	 	 	 	 s t r   + =   " < t r > < t h > S e a r c h   N a m e : < / t h > < t h > "   +   n a m e   +   " < / t h > < / t r > " ;  
 	 	 	 	 s t r   + =   " < t r > < t h > R e s o u r c e : < / t h > < t d > "   +   s c . _ r e s o u r c e   +   " < / t d > < / t r > " ;  
 	 	 	 	 i f   ( s c . _ c l a s s )   s t r   + =   " < t r > < t h > C l a s s : < / t h > < t d > "   +   s c . _ c l a s s   +   " < / t d > < / t r > " ;  
 	 	 	 	 s t r   + =   " < t r > < t h > C r i t e r i a : < / t h > < t d > "   +   c r i t   +   " < / t d > < / t r > " ;  
 	 	 	 	 i f   ( s c . _ l a t e s t C o u n t   > = 0 )   s t r   + =   " < t r > < t h > C o u n t : < / t h > < t d > "   +   s c . _ l a t e s t C o u n t   +   " < / t d > < / t r > " ;  
 	 	 	 	 s t r   + =   " < / t a b l e > " ;  
 	 	 	 	  
 	 	 	 	 n o r m D s p . i n n e r H T M L   =   s t r ;  
 	 	 	 }  
 	 	 }  
 	 } 	  
  
     i f   ( s t r   = =   " " )  
 	 	 s t r   =   " < d i v   s t y l e = ' p a d d i n g :   2 0 p x ; ' > D e t a i l s   o f   t h i s   s e a r c h   a r e   n o t   a v a i l a b l e   u n t i l   a f t e r   t h e   s e a r c h   h a s   b e e n   u s e d . < / d i v > " ;  
  
 }  
  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
 * 	 	 	 U s e r   i s   a s k i n g   t o   c l o s e   a   s e a r c h  
 * 	 	 	 p a g e .     C a l l   a   r o u t i n e   t o   s a v e    
 * 	 	 	 a   s e s s i o n - s p e c i f i c   c o p y   o f   t h i s   s e a r c h  
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
 f u n c t i o n   s a v e S e a r c h S e t t i n g s ( p o d I d )  
 {  
 	 v a r   o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p o d I d ) ;  
 	 v a r   n o r m D s p   =   $ ( o b j . g e t A t t r i b u t e ( " n o r m d s p i d " ) ) ;  
 	 v a r   m a x D s p   =   $ ( o b j . g e t A t t r i b u t e ( " m a x d s p i d " ) ) ;  
 	  
 	 v a r   m a i n F r a m e   =   m a x D s p . g e t E l e m e n t s ( " i f r a m e " ) [ 0 ] ; 	 	  
 	 i f   ( m a i n F r a m e )  
 	 {  
 	 	 v a r   s c   =   m a i n F r a m e . c o n t e n t W i n d o w ;  
 	 	 i f   ( s c )   r e t u r n   s c . c o n f i r m S e a r c h L o g o u t ( ) ;  
 	 }  
 	 r e t u r n   t r u e ;  
 }  
  
  
 f u n c t i o n   o p e n A d d G a d g e t ( )  
 {  
     _ M o d a l D i v . s h o w P o p u p ( ' a d d G a d g e t D i a l o g . h t m ' ,   6 0 0 ,   4 5 0 ,   ' P o d   G a d g e t s ' ) ;  
 }  
  
  
 f u n c t i o n   o p e n P o d T a b P r e f ( t a b I d )  
 {  
 	 v a r   t a b i d   =   p o d T o o l s . g e t A c t i v e T a b I d ( ) ;  
 	 v a r   s U R L   =   ' t a b P r e f e r e n c e s D i a l o g . h t m ? t a b i d = '   +   t a b i d ;  
     _ M o d a l D i v . s h o w P o p u p ( s U R L ,   7 0 0 ,   5 0 0 ,   ' P r e f e r e n c e s ' ) ;  
 }  
  
  
  
 v a r   p o d T o o l s   =   {  
  
         " l o g i n D a t a X M L "                 :   n u l l ,  
 	 	 " d a s h O p t s " 	 	 	 	 	 	 :   n u l l ,    
         " i s D r a g g i n g "                     :   f a l s e ,  
         " d r o p S p o t s "                       :   n u l l ,  
         " d r a g P o d L i s t "                   :   n u l l ,  
         " d r a g C o n t a i n e r I d "           :   n u l l ,  
         " d r a g O b j e c t "                     :   n u l l ,  
         " d r a g C l o n e "                       :   n u l l ,  
         " d r a g P l a c e h o l d e r "           :   n u l l ,  
 	 	 " c u s t o m T a b S u f f i x " 	 	 	 :   " N a v A 7 Z Q W " ,  
         " w i n d o w s T a b I d "                 :   " W i n N a v A 7 Z Q W " ,  
         " m e s s a g e T a b I d "                 :   " M s g N a v A 7 Z Q W " ,  
         " r e q u i r e d T a b s " 	 	 	 	 :   {   h o m e t a b : ' H o m e '   } ,  
         " t r a n D s p A r e a "                   :   n u l l ,  
         " c u r L a y o u t T y p e " 	 	 	 	 :   n u l l ,  
  
         " c h e c k P o d E v e n t "   :   f u n c t i o n ( o b j ,   e v e n t N a m e )   {    
                 v a r   r e f i d   =   o b j . g e t P r o p e r t y ( " r e f i d " ) ;  
                 v a r   g O b j   =   p o d T o o l s . g e t G a d g e t D e f ( r e f i d ) ;  
                 v a r   e v e n t c o d e   =   g O b j . g e t A t t r i b u t e ( e v e n t N a m e ) ;        
                 i f   ( e v e n t c o d e )    
                 {  
                     e v e n t c o d e   =   p o d T o o l s . r e p l a c e T a g s ( o b j ,   e v e n t c o d e ) ;  
                     r e t u r n   e v a l ( e v e n t c o d e ) ;  
                 }  
                 r e t u r n   t r u e ;  
         } ,  
  
         " m i n i m i z e P o d "   :   f u n c t i o n ( p a r a m ,   p o s t C h g )   {    
  
                 v a r   o b j   =   n u l l ;  
                 v a r   t m p O b j   =   n u l l ;  
                  
                 o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p a r a m ) ;  
  
                 v a r   p o d I d   =   o b j . i d ;  
  
  
 	 	 	 	 v a r   w a s M a x i m i z e d   =   o b j . h a s C l a s s ( " m a x i m i z e d p o d " ) ;  
                 p o d T o o l s . m a x i m i z e P o d _ r e t u r n ( ) ;  
  
  
                 / /   H i d e   t h e   m i n i m i z e   b u t t o n  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d m i n b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
  
                 / /   d i s p l a y   t h e   n o r m a l i z e   b u t t o n  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d n o r m b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
                 / /   D i s p l a y   t h e   m a x i m i z e   b u t t o n  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d m a x b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
                 / /   h i d e   t h e   r e f r e s h   b u t t o n    
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d r e f r e s h b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
  
                 / /   h i d e   t h e   t o u r   b u t t o n    
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d t o u r b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
  
                 / /   h i d e   t h e   p r e f e r e n c e s   b u t t o n    
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d p r e f b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
  
                 o b j . a d d C l a s s ( " m i n i m i z e d p o d " ) ;  
                 o b j . r e m o v e C l a s s ( " m a x i m i z e d p o d " ) ;  
                 o b j . r e m o v e C l a s s ( " n o r m a l i z e d p o d " ) ;  
  
 	 	 	 	 / /   H i d e   t h e   p r e f e r e n c e s   p a n e l   i f   i t   i s   o p e n  
 	 	 	 	 p o d T o o l s . h i d e P o d P r e f s ( o b j )  
  
  
                 / /   H i d e   t h e   p o d   p a r t s   ( d i v i d e r ,   t a b s ,   a n d   c o n t e n t )  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ t i t l e ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )    
                 {  
                     t m p O b j . r e m o v e C l a s s ( " r p b t a b b e d m e n u " ) ;  
                     t m p O b j . r e m o v e C l a s s ( " p o d t i t l e e x t r a " ) ;  
                 }  
  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ c o n t e n t s ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ t a b m e n u ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
                  
  
                 / /   D i s p l a y   p o d   r o w s   f o r   t h e   s e l e c t e d   t a b   i f   w e   a r e   r e t u r n i n g   f r o m   t h e   p o d   b e i n g   m a x i m i z e d .  
                 i f   ( w a s M a x i m i z e d )   p o d T o o l s . d i s p l a y R o w s F o r T a b ( o b j . g e t P r o p e r t y ( " t a b i d " ) ) ;  
  
                 p o d T o o l s . n o t i f i c a t i o n . m i n i m i z e P o d ( p o d I d ,   p o s t C h g )  
                 p o d T o o l s . c h e c k P o d E v e n t ( o b j ,   " o n m i n i m i z e " ) ;  
                  
         } ,  
          
         " m a x i m i z e P o d "   :   f u n c t i o n ( p a r a m ,   p o s t C h g )   {    
  
                 p o d T o o l s . m a x i m i z e P o d _ r e t u r n ( ) ;  
  
                 v a r   o b j   =   n u l l ;  
                 v a r   t m p O b j   =   n u l l ;  
                  
                 o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p a r a m ) ;  
  
  
                 v a r   p o d I d   =   o b j . i d ;  
  
                 / / $ $ ( ' . a c t i v e n a v s e c t i o n ' ) . e a c h ( f u n c t i o n ( i t e m ) {   i t e m . r e m o v e C l a s s ( " a c t i v e n a v s e c t i o n " ) ;   } ) ;  
                 / / $ ( p o d I d + " _ l i n k " ) . g e t P a r e n t ( ) . a d d C l a s s ( " a c t i v e n a v s e c t i o n " ) ;  
  
                 / /   r e m o v e   c l a s s   m a r k i n g   a n y   s e l e c t e d   i t e m s   a s   a c t i v e .  
                 p o d T o o l s . c l e a r A c t i v e N a v S e c t i o n s ( ) ;  
                  
                 / /   m a r k   t h e   s e l e c t   t a b   a s   a c t i v e  
                 p o d T o o l s . s e t A c t i v e N a v S e c t i o n ( $ ( p o d I d + " _ l i n k " ) . g e t P a r e n t ( ) ) ;  
  
  
  
                 / /   D i s p l a y   t h e   n o r m a l i z e   b u t t o n  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d n o r m b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
                 / /   D i s p l a y   t h e   m i n i m i z e   b u t t o n  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d m i n b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
                 / /   H i d e   t h e   m a x i m i z e   b u t t o n  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d m a x b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
  
                 / /   d i s p l a y   t h e   r e f r e s h   b u t t o n    
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d r e f r e s h b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
                 / /   d i s p l a y   t h e   t o u r   b u t t o n    
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d t o u r b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
                 / /   d i s p l a y   t h e   p r e f e r e n c e s   b u t t o n    
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d p r e f b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
  
                 o b j . a d d C l a s s ( " m a x i m i z e d p o d " ) ;  
                 o b j . r e m o v e C l a s s ( " m i n i m i z e d p o d " ) ;  
                 o b j . r e m o v e C l a s s ( " n o r m a l i z e d p o d " ) ;  
  
                 / /   D i s p l a y   t h e   p o d   p a r t s   ( d i v i d e r   a n d   t a b s )  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ t i t l e ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )    
                 {  
                     t m p O b j . a d d C l a s s ( " r p b t a b b e d m e n u " ) ;  
                     t m p O b j . r e m o v e C l a s s ( " p o d t i t l e e x t r a " ) ;  
                 }  
  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ t a b m e n u ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )    
                 {  
                 	 i f   ( t m p O b j . g e t P r o p e r t y ( ' h i d e m a x ' ) = = ' t r u e ' )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
                 	 e l s e   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " b l o c k " ) ;  
                 }  
  
  
                 / /   D i s p l a y   t h e   p r i m a r y   c o n t e n t s   b l o c k    
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ c o n t e n t s ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " b l o c k " ) ;  
  
  
                 / /   d i s p l a y   t h e   b l o c k   t h a t   d i s p l a y s   t h e   n o r m a l i z e d   v e r s i o n   o f   t h e   d i s p l a y  
                 / /   i f   i t   d o e s n ' t   e x i s t ,   w e   n e e d   t o   b u i l d   i t .  
                 v a r   m a x d s p i d   =   o b j . g e t A t t r i b u t e ( " m a x d s p i d " ) ;  
                 v a r   n o r m d s p i d   =   o b j . g e t A t t r i b u t e ( " n o r m d s p i d " ) ;  
                
                 / /   i f   t h e   m a x   d i v   i s   d i f f e r e n t   f r o m   t h e   n o r m a l i z e d   d i v ,   h i d e   t h e   n o r m a l i z e d   d i v  
                 i f   ( m a x d s p i d   ! =   n o r m d s p i d )    
 	 	 	 	 {  
 	                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   n o r m d s p i d   +   " ' ] " ) [ 0 ] ;  
 	                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
 	 	 	 	 }  
                  
                 / /   d i s p l a y   ( a n d   b u i l d   i f   n e c e s s a r y )   t h e   m a x i m i z e d   d i s p l a y  
                 v a r   d s p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   m a x d s p i d   +   " ' ] " ) [ 0 ] ;  
                 i f   ( d s p O b j )   d s p O b j . s e t S t y l e ( " d i s p l a y " ,   " b l o c k " ) ;  
                 e l s e  
                 {  
                     d s p O b j   =   t h i s . d s p L o a d D i s p l a y D i v ( o b j ,   " m a x " ) ;  
                 }    
                  
                 / /   I f   w e   s e t   t h e   h e i g h t   w i t h   t h e   p r e f e r e n c e   o r   g a d g e t   a t t r i b u t e ,   c l e a r   t h e   v a l u e   o n   m a x i m i z e  
                 i f   ( d s p O b j   & &   d s p O b j . g e t A t t r i b u t e ( " n o r m h e i g h t " ) )   d s p O b j . s e t S t y l e ( " h e i g h t " ,   ' ' ) ;  
                  
                 / / A d d   a   p l a c e h o l d e r   w h e r e   p o d   c u r r e n t l y   r e s i d e s   b e c a u s e   w e   a r e   g o i n g   t o   m o v e   i t   i n   t h e   D O M   w h i l e   i t   i s   m z x i m i z e d .  
                 v a r   p h o l d e r   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' i d ' :   ' m a x p o d p l a c e h o l d e r '   } ) . i n j e c t ( o b j ,   ' b e f o r e ' )  
                  
                 / / H i d e   a l l   o f   t h e   p o d   a r e a   c h i l d r e n .  
                 v a r   p o d A r e a   =   $ ( ' p o d a r e a ' ) ;  
                 p o d A r e a . g e t C h i l d r e n ( ) . e a c h ( f u n c t i o n ( c o l ) {   c o l . s e t S t y l e ( " d i s p l a y " , " n o n e " ) ;   } ) ;  
                  
                 / / c r e a t e   a   n e w   f u l l   w i d t h   e l e m e n t   t o   h o l d   t h e   m a x i m i z e d   p o d .     A d d   t h e   p o d   t o   t h e   n e w   d i v  
                 v a r   e l   =   n e w   E l e m e n t ( " d i v " ,   { ' i d ' :   ' m a x i m i z e d p o d ' ,   ' c l a s s ' :   ' m a x i m i z e d p o d ' } ) . i n j e c t ( p o d A r e a , ' t o p ' ) ;      
                 o b j . i n j e c t ( e l )              
                              
                 p o d T o o l s . d s p R e m o v e B o r d e r s ( o b j ) ;  
  
                 p o d T o o l s . n o t i f i c a t i o n . m a x i m i z e P o d ( p o d I d ,   p o s t C h g )  
                  
                 / /   S e t   t h e   d i s p l a y   h e i g h t   a n d   a d d   a n   e v e n t   h a n d l e r   t o   s e t   s i z e   o n   w i n d o w   r e s i z e .  
                 p o d T o o l s . r e s i z e M a x i m i z e d P o d ( ) ;  
                 w i n d o w . a d d E v e n t ( ' r e s i z e ' ,   p o d T o o l s . r e s i z e M a x i m i z e d P o d ) ;  
  
 	 	 	 	 / /   I f   t h i s   i s   t h e   f i r s t   t i m e   t h e y   m a x i m i z e d   t h e   p o d   t o d a y   c h e c k   t o   s e e  
 	 	 	 	 / /   i f   w e   s h o u l d   d i s p l a y   t h e   s t a r t u p   y o u r  
 	 	 	 	 i f   ( o b j . g e t P r o p e r t y ( " s t a r t t o u r c h e c k e d " ) ! = ' t r u e ' )  
 	 	 	 	 {  
 	 	 	 	 	 p o d T o o l s . c h e c k S t a r t u p T o u r ( o b j ) ;  
 	 	 	 	 	 o b j . s e t P r o p e r t y ( " s t a r t t o u r c h e c k e d " ,   " t r u e " ) ; 	  
 	 	 	 	 }  
 	 	 	 	  
  
 	 	 	 	 i f   ( d s p O b j )   p o d T o o l s . c h e c k P o d E v e n t ( o b j ,   " o n m a x i m i z e " ) ;  
         } ,  
          
         " m a x i m i z e P o d _ r e t u r n " :   f u n c t i o n ( ) {  
  
                 v a r   m a x p o d   =   $ ( ' m a x i m i z e d p o d ' ) ;  
                 v a r   m a x p h o l d e r   =   $ ( ' m a x p o d p l a c e h o l d e r ' ) ;  
  
                 i f   ( ! m a x p o d   & &   ! m a x p h o l d e r )   r e t u r n   ;  
                                  
                 i f   ( m a x p o d   & &   ! m a x p h o l d e r )   a l e r t ( " W e   h a v e   a   m a x i m i z e d   p o d   b y   n o   p l a c e h o l d e r   t o   r e t u r n   i t   i n t o " ) ;  
                 i f   ( m a x p o d   & &   ! m a x p h o l d e r )   a l e r t ( " W e   h a v e   a   m a x i m i z e d   p o d   p l a c e h o l d e r   b u t   n o t h i n g   t o   p u t   i n t o   i t . " ) ;  
                  
  
                 v a r   o b j   =   m a x p h o l d e r . r e p l a c e W i t h ( m a x p o d . g e t F i r s t ( ) ) ;     / / r e p l a c e   t h e   p l a c e h o l d e r   w i t h   t h e   p o d   i n s i d e   o f   t h e   m a x i m i z e d   p o d   h o l d e r  
                 o b j . r e m o v e C l a s s ( " m a x i m i z e d p o d " ) ;  
                 m a x p o d . r e m o v e ( ) ;                                                 / / r e m o c e d   t h e   m a x i m i z e d   p o d   h o l d e r .                  
  
  
 	 	 	 	 / /   r e m o v e   t h e   r e s i z e   e v e n t  
 	 	 	 	 w i n d o w . r e m o v e E v e n t ( ' r e s i z e ' , p o d T o o l s . r e s i z e M a x i m i z e d P o d ) ;  
  
 	 	 	 	 v a r   p o d I d   =   o b j . i d ;  
  
                 v a r   m a x d s p i d   =   o b j . g e t A t t r i b u t e ( " m a x d s p i d " ) ;  
                 v a r   n o r m d s p i d   =   o b j . g e t A t t r i b u t e ( " n o r m d s p i d " ) ;  
  
                 / /   i f   t h e   m a x   d i v   i s   d i f f e r e n t   f r o m   t h e   n o r m a l i z e d   d i v ,   h i d e   t h e   n o r m a l i z e d   d i v  
                 i f   ( m a x d s p i d   ! =   n o r m d s p i d )    
 	 	 	 	 {  
 	                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   m a x d s p i d   +   " ' ] " ) [ 0 ] ;  
 	                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
  
 	                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   n o r m d s p i d   +   " ' ] " ) [ 0 ] ;  
 	                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
 	 	 	 	 }  
  
  
                 / /   u n h i d e   a l l   o f   t h e   p o d   a r e a   c o l u m n s  
                 v a r   p o d A r e a   =   $ ( ' p o d a r e a ' ) ;  
                 p o d A r e a . g e t C h i l d r e n ( ) . e a c h ( f u n c t i o n ( c o l ) {   c o l . s e t S t y l e ( " d i s p l a y " , " " ) ;   } ) ;  
                                  
                 / / v a r   i t e m l i s t   =   $ $ ( ' . a c t i v e n a v s e c t i o n ' )  
                 / / v a r   t a g i d   =   i t e m l i s t [ 0 ] . g e t P a r e n t ( ) . g e t P r o p e r t y ( " i d " ) ;  
                 / / i t e m l i s t . e a c h ( f u n c t i o n ( i t e m ) {   i t e m . r e m o v e C l a s s ( " a c t i v e n a v s e c t i o n " ) ;   } ) ;  
                 / / $ ( t a g i d ) . a d d C l a s s ( " a c t i v e n a v s e c t i o n " ) ;  
  
                 / /   r e m o v e   c l a s s   m a r k i n g   a n y   s e l e c t e d   i t e m s   a s   a c t i v e .  
                 p o d T o o l s . c l e a r A c t i v e N a v S e c t i o n s ( ) ;  
                  
                 / /   m a r k   t h e   s e l e c t   t a b   a s   a c t i v e                  
                 / / p o d T o o l s . s e t A c t i v e N a v S e c t i o n ( $ ( p o d I d + " _ l i n k " ) . g e t P a r e n t ( ) ) ;  
                 p o d T o o l s . s e t A c t i v e N a v S e c t i o n ( p o d T o o l s . g e t A c t i v e N a v S e c t i o n ( p o d I d ) ) ;  
        
                  
                 p o d T o o l s . d s p R e t u r n B o r d e r s ( o b j ) ;  
                  
                 p o d T o o l s . n o r m a l i z e P o d ( o b j ) ;  
                  
                 p o d T o o l s . c h e c k P o d E v e n t ( o b j ,   " o n m a x i m i z e r e t u r n " ) ;  
  
         } ,  
          
         " n o r m a l i z e P o d "   :   f u n c t i o n ( p a r a m ,   p o s t C h g )   {    
  
                 v a r   o b j   =   n u l l ;  
                 v a r   t m p O b j   =   n u l l ;  
                  
                 o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p a r a m ) ;  
  
                 v a r   p o d I d   =   o b j . i d ;  
  
  
 	 	 	 	 v a r   w a s M a x i m i z e d   =   o b j . h a s C l a s s ( " m a x i m i z e d p o d " ) ;  
                 p o d T o o l s . m a x i m i z e P o d _ r e t u r n ( ) ;  
  
  
                 / /   H i d e   t h e   n o r m a l i z e   b u t t o n  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d n o r m b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
  
                 / /   D i s p l a y   t h e   m i n i m i z e   b u t t o n  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d m i n b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
                 / /   D i s p l a y   t h e   m a x i m i z e   b u t t o n  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d m a x b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
                 / /   h i d e   t h e   r e f r e s h   b u t t o n    
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d r e f r e s h b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
                 / /   s h o w   t h e   t o u r   b u t t o n    
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d t o u r b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
                 / /   h i d e   t h e   p r e f e r e n c e s   b u t t o n    
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " a [ c l a s s = ' p o d p r e f b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
  
                 o b j . a d d C l a s s ( " n o r m a l i z e d p o d " ) ;  
                 o b j . r e m o v e C l a s s ( " m a x i m i z e d p o d " ) ;  
                 o b j . r e m o v e C l a s s ( " m i n i m i z e d p o d " ) ;  
  
                 / /   D i s p l a y   t h e   p o d   p a r t s   ( d i v i d e r   a n d   t a b s )  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ t i t l e ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )    
                 {  
                     t m p O b j . a d d C l a s s ( " r p b t a b b e d m e n u " ) ;  
                     i f   ( t m p O b j . g e t E l e m e n t s ( " d i v [ c l a s s = ' t a b b e d m e n u ' ] " ) . l e n g t h   = =   0   | |  
                             t m p O b j . g e t P r o p e r t y ( ' h i d e n o r m ' ) = = ' t r u e ' )  
                     	 t m p O b j . a d d C l a s s ( " p o d t i t l e e x t r a " ) ;  
                 }  
  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ t a b m e n u ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )    
                 {  
                 	 i f   ( t m p O b j . g e t P r o p e r t y ( ' h i d e n o r m ' ) = = ' t r u e ' )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
                 	 e l s e   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " b l o c k " ) ;  
                 }  
  
  
                 / /   D i s p l a y   t h e   p r i m a r y   c o n t e n t s   b l o c k    
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ c o n t e n t s ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " b l o c k " ) ;  
  
                 v a r   m a x d s p i d   =   o b j . g e t A t t r i b u t e ( " m a x d s p i d " ) ;  
                 v a r   n o r m d s p i d   =   o b j . g e t A t t r i b u t e ( " n o r m d s p i d " ) ;  
  
                 / /   i f   t h e   m a x   d i v   i s   d i f f e r e n t   f r o m   t h e   n o r m a l i z e d   d i v ,   h i d e   t h e   n o r m a l i z e d   d i v  
                 i f   ( m a x d s p i d   ! =   n o r m d s p i d )    
 	 	 	 	 {  
 	                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   m a x d s p i d   +   " ' ] " ) [ 0 ] ;  
 	                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
 	 	 	 	 }  
  
  
                 / /   d i s p l a y   t h e   b l o c k   t h a t   d i s p l a y s   t h e   n o r m a l i z e d   v e r s i o n   o f   t h e   d i s p l a y  
                 / /   i f   i t   d o e s n ' t   e x i s t ,   w e   n e e d   t o   b u i l d   i t .  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   n o r m d s p i d   +   " ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " b l o c k " ) ;  
                 e l s e  
                 {  
                     t m p O b j   =   t h i s . d s p L o a d D i s p l a y D i v ( o b j ,   " n o r m " ) ;  
                 }    
            
                 / /   S e t   t h e   p o d   h e i g h t . . . i f   w e   h a v e   p o d   d i s p l a y   a r e a  
                 i f   ( t m p O b j   & &   t m p O b j . g e t A t t r i b u t e ( " n o r m h e i g h t " ) )   t m p O b j . s e t S t y l e ( " h e i g h t " ,   t m p O b j . g e t A t t r i b u t e ( " n o r m h e i g h t " ) ) ;  
  
  
                 / /   D i s p l a y   p o d   r o w s   f o r   t h e   s e l e c t e d   t a b   i f   w e   a r e   r e t u r n i n g   f r o m   t h e   p o d   b e i n g   m a x i m i z e d .  
                 i f   ( w a s M a x i m i z e d )   p o d T o o l s . d i s p l a y R o w s F o r T a b ( o b j . g e t P r o p e r t y ( " t a b i d " ) ) ;  
  
  
                 p o d T o o l s . n o t i f i c a t i o n . n o r m a l i z e P o d ( p o d I d ,   p o s t C h g )  
                 i f   ( t m p O b j )   p o d T o o l s . c h e c k P o d E v e n t ( o b j ,   " o n n o r m a l i z e " ) ;  
         } ,  
  
 	 	 " r e f r e s h P o d " :   f u n c t i o n ( p a r a m )   {  
  
                 v a r   o b j   =   n u l l ;  
                 o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p a r a m ) ;  
  
 	             p o d T o o l s . c h e c k P o d E v e n t ( o b j ,   " r e f r e s h " ) ;  
  
 	 	 } ,  
  
         " s h o w P o d P r e f s "   :   f u n c t i o n ( p a r a m )   {    
  
                 v a r   o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p a r a m ) ;  
  
  
                 v a r   p o d I d   =   o b j . i d ;  
                
  
                 / / l o a d   t h e   p r e f   a r e a   i f   i t   h a s n ' t   a l r e a d y   b e e n   l o a d e d  
                 v a r   p r e f A r e a   =   $ ( p o d I d   +   ' _ p r e f ' ) ;  
                 i f   ( ! p r e f A r e a )    
                 {  
                     p r e f A r e a   =   p o d T o o l s . d s p L o a d P r e f A r e a D i v ( o b j ) ;                      
                 }  
                
 	 	 	 	 v a r   t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ t i t l e ' ] " ) [ 0 ] ;  
 	 	 	 	 i f   ( t m p O b j )    
 	 	 	 	 {  
 	 	 	 	 	 v a r   t a b D i v   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ t a b m e n u ' ] " ) [ 0 ] ;  
 	 	 	 	 	 i f   ( t a b D i v )   t a b D i v . s e t S t y l e ( " d i s p l a y " , " n o n e " ) ;           / / W e   h i d   t h e   t a b s   w h e n   w e   d i s p l a y e d   t h e   p r e f e r e n c e s .     b r i n g   t h e m   b a c k .  
 	 	 	 	     i f   ( ! t a b D i v )   t m p O b j . a d d C l a s s ( " p o d t i t l e e x t r a " ) ;   / / w e   n e e d   t o   a d d   t h e   p o d t i t l e e x t r a   c l a s s   f o r   t h e   p r e f e r e n c e s   t o   d i s p l a y   c l e a n  
 	 	 	 	  
 	 	 	 	 	 / /   I f   w e   h a v e   t a b s   b u t   h a v e n ' t   l o a d e d   c o n t e n t   y e t ,   t h e   p r e f   a r e a   l o o k s   f u n n y   u n l e s s   w e   a d d  
 	 	 	 	 	 / /   t h i s   c l a s s .     I t   g e t s   r e m o v e d   ( w h e r e   n e e d e d )   a u t o m a t i c a l l y   l a t e r   i n   t h e   p r o c e s s    
 	 	 	 	 	 i f   ( t a b D i v   & &   ! $ ( o b j . g e t A t t r i b u t e ( " n o r m d s p i d " ) ) )   t m p O b j . a d d C l a s s ( " p o d t i t l e e x t r a " ) ; 	 	 	  
 	 	 	 	 }    
                
                  
                 / / D i s p l a y   t h e   p r e f   a r e a  
                 p r e f A r e a . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
         } ,  
  
         " h i d e P o d P r e f s "   :   f u n c t i o n ( p a r a m )   {    
                  
                 v a r   o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p a r a m ) ;  
  
  
                 v a r   p o d I d   =   o b j . i d ;  
  
 	 	 	 	  
                 v a r   p r e f A r e a   =   $ ( p o d I d   +   ' _ p r e f ' ) ;  
                 i f   ( ! p r e f A r e a )   r e t u r n ;  
 	 	 	 	 i f   ( p r e f A r e a . g e t S t y l e ( " d i s p l a y " ) = = " n o n e " )   r e t u r n ;  
 	 	 	 	  
 	 	 	 	 / /   H i d e   t h e   p r e f   a r e a  
                 p r e f A r e a . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
  
  
 	 	 	 	 v a r   t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ t i t l e ' ] " ) [ 0 ] ;  
 	 	 	 	 i f   ( t m p O b j )    
 	 	 	 	 {  
 	 	 	 	 	 v a r   t a b D i v   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ t a b m e n u ' ] " ) [ 0 ] ;  
 	 	 	 	 	 i f   ( t a b D i v )   t a b D i v . s e t S t y l e ( " d i s p l a y " , " " ) ;            
 	 	 	 	 }              
  
  
 	 	 	 	 / /   I f   w e   a r e   w a i t i n g   f o r   r e q u i r e d   p o d   p r e f e r e n c e s   t h e n   m i n i m i z e   t h e   p o d  
                 v a r   n o r m d s p i d   =   o b j . g e t A t t r i b u t e ( " n o r m d s p i d " ) ;  
                 t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   n o r m d s p i d   +   " ' ] " ) [ 0 ] ;  
                 i f   ( ! t m p O b j )    
                 {  
                 	 / /   T h e   p r e f   a r e a   n e e d s   t o   b e   h i d d e n   b e f o r e   w e   m i n i m i z e   b e c a u s e   m i n i m i z e   i s   g o i n g   t o   c a l l   t h i s   f u n c t i o n  
                 	 p o d T o o l s . m i n i m i z e P o d ( o b j ) ; 	 	 	 	  
                 	 r e t u r n ;  
                 }  
         } ,  
  
 	 	 " c h e c k S t a r t u p T o u r " :   f u n c t i o n ( p a r a m )  
 	 	 { 	 	 	  
 	 	 	 / /   I f   t h e   u s e r ' s   p r e f e r e n c e s   s a y   t o   i g n o r e   t o u r s   o n   s t a r t u p ,   l o o k   n o   f u r t h e r  
 	 	 	 i f   ( h e l p W i n d o w . c h e c k A l l o w T o u r ( ) = = f a l s e )   r e t u r n ;  
  
             v a r   o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p a r a m ) ;  
             v a r   g a d g e t N o d e   =   t h i s . g e t G a d g e t D e f ( o b j . g e t A t t r i b u t e ( " r e f i d " ) )  
 	 	 	 i f   ( g a d g e t N o d e )  
 	 	 	 {  
 	 	 	 	 v a r   t o u r N a m e   =   g a d g e t N o d e . g e t A t t r i b u t e ( " t o u r " ) ;  
 	 	 	 	 i f   ( t o u r N a m e )  
 	 	 	 	 {  
 	 	 	 	 	 i f   ( h e l p W i n d o w . c h e c k A l l o w S t a r t u p T o u r ( t o u r N a m e ) )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 s e t T i m e o u t ( " p o d T o o l s . t o u r P o d ( ' "   +   o b j . i d   +   " ' ,   t r u e ) " ,   3 0 0 0 ) ;  
             	 	 }  
             	 }  
 	 	 	 }  
 	 	 } ,  
 	 	 	  
 	 	 " t o u r P o d " :   f u n c t i o n ( p a r a m ,   s h o w S t a r t u p )   {  
  
                 v a r   o b j   =   n u l l ;  
                 o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p a r a m ) ;  
 	 	 	 	 v a r   m a x D s p   =   $ ( o b j . g e t A t t r i b u t e ( " m a x d s p i d " ) ) ;  
 	 	 	 	 v a r   t o p F r a m e   =   m a x D s p . g e t E l e m e n t s ( " i f r a m e " ) [ 0 ] ; 	 	  
 	 	 	 	 h w   =   t o p F r a m e . c o n t e n t W i n d o w . h e l p W i n d o w ;  
 	             v a r   r e f i d   =   o b j . g e t P r o p e r t y ( " r e f i d " ) ;  
 	              
 	             v a r   g a d g e t N o d e   =   _ p o d G a d g e t s . s e l e c t S i n g l e N o d e ( " / P O D L I S T / P O D [ @ i d = ' " + r e f i d + " ' ] " ) ;  
 	 	 	 	 i f   ( g a d g e t N o d e )  
 	 	 	 	 {  
 	 	 	 	 	 / /   F o r   n o w . . . i f   t h e   p o d   i s   n o t   a l r e a d y   m a x i m i z e d ,   m a x i m i z e   i t  
 	 	 	 	 	 i f ( ! $ ( ' m a x i m i z e d p o d ' ) ) 	 {   p o d T o o l s . m a x i m i z e P o d ( o b j ) ;   }  
  
 	 	 	 	 	  
 	             	 v a r   t o u r N a m e   =   g a d g e t N o d e . g e t A t t r i b u t e ( " t o u r " ) ;  
 	 	 	 	 	 i f   ( h w )   h w . t o u r ( t o u r N a m e ,   s h o w S t a r t u p ) ;  
 	 	 	 	 }  
 	 	 } ,  
  
         " t o g g l e P o d P r e f s "   :   f u n c t i o n ( p a r a m )   {    
                  
                 v a r   o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p a r a m ) ;  
                 v a r   p o d I d   =   o b j . i d ;  
  
                 v a r   p r e f A r e a   =   $ ( p o d I d   +   ' _ p r e f ' ) ;  
                 i f   ( ! p r e f A r e a )   {  
                 	 p o d T o o l s . s h o w P o d P r e f s ( o b j ) ;  
 / /                     p r e f A r e a   =   p o d T o o l s . d s p L o a d P r e f A r e a D i v ( o b j ) ;                      
                 }  
                 e l s e   i f   ( p r e f A r e a . g e t S t y l e ( " d i s p l a y " ) = = " n o n e " )  
                     p o d T o o l s . s h o w P o d P r e f s ( o b j ) ;    
                 e l s e  
                     p o d T o o l s . h i d e P o d P r e f s ( o b j ) ;                  
         } ,  
  
         " s a v e P o d P r e f s " :   f u n c t i o n ( p a r a m )   {  
  
                 v a r   o b j   =   p o d T o o l s . g e t P o d O b j e c t ( p a r a m ) ;  
                 v a r   p o d I d   =   o b j . i d ;  
  
                 v a r   p r e f D i v   =   $ ( p o d I d   +   ' _ p r e f ' ) ;  
                 i f   ( ! p r e f D i v )   a l e r t ( " I t   d o e s n ' t   l o o k   l i k e   t h e r e   a r e   a n y   p r e f e r e n c e s   t o   s a v e " ) ;  
                  
                 / / G e t   t h e   i m p u t   o b j e c t s   t h a t   w e   n e e d   t o   s t o r e  
                 v a r   i n p u t L i s t   =   p r e f D i v . g e t E l e m e n t s ( " i n p u t " ) ;  
  
                 v a r   d b P o d N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B / P O D [ @ i d = ' "   +   p o d I d   +   " ' ] " ) ;  
                 i f   ( ! d b P o d N o d e )   a l e r t ( " C o u l d   n o t   f i n d   t h e   p o d :   "   +   p o d I d ) ;  
  
                 v a r   d b P r e f N o d e   =   d b P o d N o d e . s e l e c t S i n g l e N o d e ( " P R E F " ) ;  
                 i f   ( ! d b P r e f N o d e )   d b P r e f N o d e   =   d b P o d N o d e . a p p e n d C h i l d ( d b P o d N o d e . o w n e r D o c u m e n t . c r e a t e E l e m e n t ( " P R E F " ) ) ;  
                  
                 i n p u t L i s t . e a c h ( f u n c t i o n ( i t e m )   {  
                     v a r   n a m e   =   i t e m . i d . r e p l a c e ( p o d I d ,   " " ) ;  
                     v a r   v a l u e   =   i t e m . g e t P r o p e r t y ( " v a l u e " ) ;  
                      
                     v a r   v a l u e N o d e   =   d b P r e f N o d e . s e l e c t S i n g l e N o d e ( " V A L U E [ @ n a m e = ' "   +   n a m e   +   " ' ] " ) ;  
                     i f   ( ! v a l u e N o d e )  
                     {  
                         v a l u e N o d e   =   d b P r e f N o d e . a p p e n d C h i l d ( d b P r e f N o d e . o w n e r D o c u m e n t . c r e a t e E l e m e n t ( " V A L U E " ) ) ;  
                         v a l u e N o d e . s e t A t t r i b u t e ( " n a m e " ,   n a m e ) ;                          
                     }  
                     v a l u e N o d e . t e x t   =   v a l u e ;  
                 } ) ;  
  
  
                 / /   C l o s e   t h e   p r e f s   w i n d o w .  
                 p o d T o o l s . h i d e P o d P r e f s ( o b j )  
                  
  
                 / /   D e l e t e   t h e   c u r r e n t   d i s p l a y s   a n d   r e l o a d   t h e m .  
                 v a r   m a x d s p i d   =   o b j . g e t A t t r i b u t e ( " m a x d s p i d " ) ;  
                 v a r   n o r m d s p i d   =   o b j . g e t A t t r i b u t e ( " n o r m d s p i d " ) ;  
                 i f   ( $ ( m a x d s p i d ) )     $ ( m a x d s p i d ) . r e m o v e ( ) ;  
                 i f   ( $ ( n o r m d s p i d ) )     $ ( n o r m d s p i d ) . r e m o v e ( ) ;  
                  
                 / /   R e b u i l d   t h e   d i s p l a y  
                 s w i t c h ( o b j . g e t P r o p e r t y ( " s t a t e " ) )  
                 {  
                     c a s e   " m i n " :  
                         p o d T o o l s . m i n i m i z e P o d ( o b j ,   f a l s e ) ;  
                         b r e a k ;  
                     c a s e   " m a x " :  
                         p o d T o o l s . m a x i m i z e P o d ( o b j ,   f a l s e ) ;  
                         b r e a k ;  
                     c a s e   " n o r m " :  
                     d e f a u l t :  
                         p o d T o o l s . n o r m a l i z e P o d ( o b j ,   f a l s e ) ;  
                         b r e a k ;  
                 }  
  
                 p o d T o o l s . c h e c k P o d E v e n t ( o b j ,   " o n s a v e p r e f " ) ;  
                  
                 p o d T o o l s . n o t i f i c a t i o n . s a v e P r e f s ( p o d I d ,   t r u e ) ;                  
         } ,    
          
         " s e l e c t P o d " :   f u n c t i o n ( p o d I d ,   t a b I d )   {  
  
                 / /   r e t u r n   m a x i m i z e d   p o d   t o   n o r m a l .  
                 p o d T o o l s . m a x i m i z e P o d _ r e t u r n ( ) ;  
          
                 / / C h e c k   t o   s e e   i f   t h e   p o d   t a b   h a s   b e e n   b u i l t .     I f   i t   h a s n ' t ,   b u i l d   t h a t   p o d ' s   t a b   i f    
                 i f   ( ! $ ( p o d I d ) )  
                 {  
                     p o d T a b N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B [ @ i d = ' "   +   t a b I d   +   " ' ] " ) ;  
                     i f   ( ! p o d T a b N o d e )   {   a l e r t ( " c o u l d n ' t   f i n d   t h e   t a b   ' "   +   t a b I d   +   " '   i n   d a s h b o a r d   o p t i o n s " ) ;   r e t u r n ;   }  
                     p o d T o o l s . d s p P o d A r e a _ B u i l d P o d s ( p o d T a b N o d e ) ;                      
                 }  
                  
                 / /   o p e n   t h e   m a x i m i z e d   p o d  
                 p o d T o o l s . m a x i m i z e P o d ( p o d I d ) ;  
         } ,  
          
          
         " d i s p l a y R o w s F o r T a b "   :   f u n c t i o n ( t a b I d )   {  
  
                 / /   H i d e   a l l   o f   t h e   e x i s t i n g   p o d   c o l u m n s  
                 $ $ ( ' . p o d c o l ' ) . e a c h ( f u n c t i o n ( c o l )   {   c o l . s e t S t y l e ( " d i s p l a y " , " n o n e " ) ;   } ) ;  
  
                 / /   D i s p l a y   p o d   r o w s   f o r   t h e   s e l e c t e d   t a b  
                 $ ( ' p o d a r e a ' ) . g e t C h i l d r e n ( ) . e a c h ( f u n c t i o n ( i t e m )   {   i f ( i t e m . g e t P r o p e r t y ( ' t a b i d ' ) = = t a b I d )   i t e m . s e t S t y l e ( " d i s p l a y " , " " ) ;   } ) ;  
         	  
         } ,    
                  
         " g e t A c t i v e T a b I d "   :   f u n c t i o n ( )   {  
  
 	 	 	 	 / /   L o o k   f o r   a   v i s i b l e   c o l u u m n .   I f   f o u n d ,   r e t u r n   t h a t   c o l u m n s   t a b i d  
                 $ $ ( ' . p o d c o l ' ) . e a c h ( f u n c t i o n ( c o l )   {   i f   ( c o l . g e t S t y l e ( ' d i s p l a y ' ) = = ' ' )   r e t u r n   c o l . g e t P r o p e r t y ( ' t a b i d ' ) ;   } ) ;  
                  
                 / /   L o o k   f o r   a   m a x i m i z e d   p o d .     I f   f o u n d ,   r e t u r n   t h e   t a b   i d   o n   t h e   m a x i m i z e d   p o d  
                 v a r   m a x p o d H o l d e r   =   $ ( ' m a x i m i z e d p o d ' )  
                 v a r   m a x p o d   =   n u l l ;  
                 i f   ( m a x p o d H o l d e r )   m a x p o d   =   m a x p o d H o l d e r . g e t E l e m e n t ( " d i v [ t a b i d ] " ) ;  
                 i f   ( m a x p o d )   r e t u r n   m a x p o d . g e t P r o p e r t y ( ' t a b i d ' ) ;  
  
         	     r e t u r n   n u l l ;  
         } ,  
                  
         " s h o w T a b " :   f u n c t i o n ( t a b I d )   {  
                 v a r   t O b j   =   $ ( t a b I d ) ;  
                  
                 / /   r e t u r n   m a x i m i z e d   p o d   t o   n o r m a l .  
                 p o d T o o l s . m a x i m i z e P o d _ r e t u r n ( ) ;  
                  
                 / /   C h e c k   t o   s e e   i f   t h e   t a b   p o d s   a r e   b u i l d .   ( l o o k   f o r   c o l 1   b e c a u s e   t h e r e   m u s t   b e   a t   l e a s t   1   c o l u m n )   I f   t h e y   a r e   n o t   b u i l t ,   b u i l d   t h e m .  
                 i f ( ! $ ( t a b I d + ' c o l 1 ' ) )    
                 {  
                     p o d T a b N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B [ @ i d = ' "   +   t a b I d   +   " ' ] " ) ;  
                     i f   ( ! p o d T a b N o d e )   {   a l e r t ( " c o u l d n ' t   f i n d   t h e   t a b   ' "   +   t a b I d   +   " '   i n   d a s h b o a r d   o p t i o n s " ) ;   r e t u r n ;   }  
                     p o d T o o l s . d s p P o d A r e a _ B u i l d P o d s ( p o d T a b N o d e ) ;  
                 }  
  
                 / /   D i s p l a y   p o d   r o w s   f o r   t h e   s e l e c t e d   t a b  
                 p o d T o o l s . d i s p l a y R o w s F o r T a b ( t a b I d ) ;  
                  
                  
                 / /   r e m o v e   c l a s s   m a r k i n g   a n y   s e l e c t e d   i t e m s   a s   a c t i v e .  
                 p o d T o o l s . c l e a r A c t i v e N a v S e c t i o n s ( ) ;  
                  
                 / /   m a r k   t h e   s e l e c t   t a b   a s   a c t i v e  
                 p o d T o o l s . s e t A c t i v e N a v S e c t i o n ( t O b j ) ;  
  
 	 	 	 	 / /   i d e n t i f y   t h e   l a y o u t   t y p e 	 	 	 	  
 	 	 	 	 p o d T o o l s . c u r L a y o u t T y p e   =   t O b j . g e t A t t r i b u t e ( " l a y o u t " ) ;  
         } ,  
  
         " c l e a r A c t i v e N a v S e c t i o n s " :   f u n c t i o n ( )   {  
    
                 v a r   i t e m l i s t   =   $ $ ( ' . a c t i v e n a v s e c t i o n ' )  
                 i t e m l i s t . e a c h ( f u n c t i o n ( i t e m ) {    
                     i t e m . r e m o v e C l a s s ( " a c t i v e n a v s e c t i o n " ) ;    
                     v a r   b d   =   i t e m . g e t P a r e n t ( ) . g e t P a r e n t ( ) ;  
                     i f   ( b d . g e t A t t r i b u t e ( " c o r n e r " ) = = " t r u e " )  
                     {  
                         i t e m . i n j e c t ( b d ,   " b e f o r e " ) ;  
                         b d . r e m o v e ( ) ;  
                     }  
                 } ) ;          
         } ,  
          
         " s e t A c t i v e N a v S e c t i o n " :   f u n c t i o n ( o b j )   {  
  
                 o b j . a d d C l a s s ( " a c t i v e n a v s e c t i o n " ) ;  
                  
                 v a r   t l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' c l a s s ' :   ' n a v - t l ' ,   ' c o r n e r ' : ' t r u e ' } ) . i n j e c t ( o b j ,   ' b e f o r e ' ) ;  
                 v a r   b l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' c l a s s ' :   ' n a v - b l ' ,   ' c o r n e r ' : ' t r u e ' } ) . i n j e c t ( t l ) ;  
                 o b j . i n j e c t ( b l ) ;  
  
         } ,  
  
         " g e t A c t i v e N a v S e c t i o n " :   f u n c t i o n ( p o d I d )   {  
  
 	 	 	 i f   ( p o d I d )  
 	 	 	 {  
 	 	 	 	 / /   G r a b   t h e   d i v   t h a t   c o n a i n s   t h e   n a v t r e e   l i n k  
 	 	 	 	 v a r   t O b j   =   $ ( p o d I d   +   ' _ l i n k ' ) . g e t P a r e n t ( ) ;        
 	  
 	 	 	 	 / /   I t   i s   ' p o s s i b l e '   t h a t   l i n k   i t e m   i s   s u r r o u n d   b y   r o u n d e d   c o r n e r   d i v s .      
 	 	 	 	 / /   I f   s o ,   m o v e   u p   p a s t   t h e   r o u n d e d   c o r n e r   d i v s .     o t h e r w i s e   t h e   p a r e n t   i s   t h e   i s   t h e   s e c t i o n   t a b   c o n t a i n e r  
 	           	 d o   {   t O b j   =   t O b j . g e t P a r e n t ( ) ;   }   w h i l e   ( t O b j . g e t A t t r i b u t e ( " c o r n e r " ) = = " t r u e " ) 	                     	  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 t O b j   =   $ $ ( " . a c t i v e n a v s e c t i o n " ) [ 0 ] ; 	  
 	 	 	 }  
 	 	 	  
 	 	 	 r e t u r n   t O b j ;  
         } ,  
  
         " i n s e r t T a b " :   f u n c t i o n ( t a b I d ,   t a b L a b e l ,   s e q ,   i s T e m p ,   p o s t C h g )   {  
  
                 v a r   l a y o u t   =   " 2 A " ;  
                
                 v a r   t O b j ;  
                 t O b j   =   p o d T o o l s . d s p N a v T r e e _ A d d T a b ( t a b I d ,   t a b L a b e l ,   f a l s e ,   l a y o u t ,   n u l l ) ;  
                      
                 / / U p d a t e   t h e   d a s h b o a r d   x m l  
                 p o d T o o l s . n o t i f i c a t i o n . i n s e r t T a b ( t a b I d ,   t a b L a b e l ,   s e q ,   i s T e m p ,   p o s t C h g ) ;  
  
                 p o d T o o l s . b u i l d T a b L a y o u t ( t a b I d ,   l a y o u t ,   f a l s e ) ;  
                          
                 / /   n o w   t h a t   w e   h a v e   d r o p   a r e a s ,   c a l l   d r a g S e t u p ;  
                 p o d T o o l s . d r a g S e t u p ( ) ;      
                      
                 r e t u r n   t O b j ;                  
         } ,  
  
 	 	 " s e t P o d C o l W i d t h s " :   f u n c t i o n ( t a b I d ,   l a y T y p e ,   f o r c e d A d j u s t )   {  
 	 	 	 	 / /   W h e n   t h e   p o d   i s   m a x i m i z e d   w e   n e e d   t o   s e t   t h e   w i d t h   o f   ' p o d a r e a '   b e c a u s e   t h e  
 	 	 	 	 / /   i f r a m e   ( i f   t h e r   i s   o n e )   i n s i d e   o f   m a x i m i z e d   p o d   r e s i z e s   i t s e l f   t o   t h e   s i z e  
 	 	 	 	 / /   o f   ' p o d a r e a ' .     I f   t h e   p o d   i s   n o t   m a x i m i z e d ,   ' p o d a r e a '   w i d t h   n e e d s   t o   b e   ' a u t o ' .  
 	 	 	 	 v a r   m a x p o d   =   $ ( ' m a x i m i z e d p o d ' ) ;  
 	 	 	 	 i f ( m a x p o d )  
 	 	 	 	 {  
 	 	 	 	 	 v a r   b a W   =   $ ( d o c u m e n t . b o d y ) . g e t C o o r d i n a t e s ( ) . w i d t h ;  
 	 	 	 	 	 v a r   n a v W   =   $ ( ' n a v c e l l ' ) . g e t C o o r d i n a t e s ( ) . w i d t h ;  
 	 	 	 	 	 v a r   p a L   =   $ ( ' p o d a r e a ' ) . g e t C o o r d i n a t e s ( ) . l e f t ;  
 	 	 	 	 	 v a r   t a r g e t W   =     b a W   -   p a L ;       / / v a r   t a r g e t W   =     b a W   -   n a v W ;    
 	 	 	 	 	 i f   ( ! i s N a N ( f o r c e d A d j u s t ) )   t a r g e t W   + =   f o r c e d A d j u s t ;  
 	 	 	 	 	 $ ( ' p o d a r e a ' ) . s e t S t y l e ( ' w i d t h ' ,   t a r g e t W ) ;  
 	 	 	 	 }  
 	 	 	 	 e l s e  
 	 	 	 	 {  
 	 	 	 	 	 $ ( ' p o d a r e a ' ) . s e t S t y l e ( ' w i d t h ' ,   ' ' ) ;  
 	  
 	 	 	 	 	 i f   ( ! t a b I d   | |   ! l a y T y p e )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 a c t T a b   =   $ $ ( " . a c t i v e n a v s e c t i o n " ) [ 0 ] ;  
 	 	 	 	 	 	 i f   ( ! a c t T a b )   r e t u r n ;  
 	 	 	 	 	 	 t a b I d   =   a c t T a b . g e t A t t r i b u t e ( " i d " ) ;  
 	 	 	 	 	 	 l a y T y p e   =   a c t T a b . g e t A t t r i b u t e ( " l a y o u t " ) ;  
 	 	 	 	 	 }  
 	 	 	 	  
 	 	 	 	 	 v a r   b A r e a   =   $ ( ' b o d y A r e a ' ) ;  
 	 	 	 	 	 v a r   p a g e W   =   b A r e a . o f f s e t W i d t h ;  
 	 	 	 	 	 v a r   n a v W   =   $ ( ' n a v c e l l ' ) . o f f s e t W i d t h ;  
 	 	 	 	 	 v a r   t a r g e t W   =   p a g e W   -   n a v W   -   ( 1 5   +   ( 1 2   *   p a r s e I n t ( l a y T y p e ) ) ) ;  
 	 	 	 	 	 i f   ( ! i s N a N ( f o r c e d A d j u s t ) )   t a r g e t W   + =   f o r c e d A d j u s t ;  
 	  
 	                 s w i t c h ( l a y T y p e )  
 	                 {  
 	                     c a s e   ' 1 A ' :  
 	 	 	 	 	 	 	 $ ( t a b I d + ' c o l 1 ' ) . s e t S t y l e ( " w i d t h " ,   t a r g e t W ) ;  
 	 	 	 	 	 	 	 b r e a k ;  
 	                     c a s e   ' 2 A ' :  
 	 	 	 	 	 	 	 v a r   e a c h C o l W   =   t a r g e t W   /   2 ;  
 	 	 	 	 	 	 	 $ ( t a b I d + ' c o l 1 ' ) . s e t S t y l e ( " w i d t h " ,   e a c h C o l W ) ;  
 	 	 	 	 	 	 	 $ ( t a b I d + ' c o l 2 ' ) . s e t S t y l e ( " w i d t h " ,   e a c h C o l W ) ;  
 	 	 	 	 	 	 	 b r e a k ;  
 	                     c a s e   ' 2 B ' :  
 	 	 	 	 	 	 	 $ ( t a b I d + ' c o l 1 ' ) . s e t S t y l e ( " w i d t h " ,   t a r g e t W   *   0 . 3 5 ) ;  
 	 	 	 	 	 	 	 $ ( t a b I d + ' c o l 2 ' ) . s e t S t y l e ( " w i d t h " ,   t a r g e t W   *   0 . 6 5 ) ;  
 	 	 	 	 	 	 	 b r e a k ;  
 	                     c a s e   ' 3 A ' :  
 	 	 	 	 	 	 	 $ ( t a b I d + ' c o l 1 ' ) . s e t S t y l e ( " w i d t h " ,   t a r g e t W   *   0 . 3 3 3 ) ;  
 	 	 	 	 	 	 	 $ ( t a b I d + ' c o l 2 ' ) . s e t S t y l e ( " w i d t h " ,   t a r g e t W   *   0 . 3 3 3 ) ;  
 	 	 	 	 	 	 	 $ ( t a b I d + ' c o l 3 ' ) . s e t S t y l e ( " w i d t h " ,   t a r g e t W   *   0 . 3 3 3 ) ;  
 	 	 	 	 	 	 	 b r e a k ;  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 	  
 	 	 }   ,  
 	 	  
  
         " b u i l d T a b L a y o u t " :   f u n c t i o n ( t a b I d ,   l a y T y p e ,   p o s t C h g )   {  
          
                 v a r   p a   =   $ ( ' p o d a r e a ' )  
                          
                 $ ( t a b I d ) . s e t P r o p e r t y ( " l a y o u t " ,   l a y T y p e ) ;  
  
                 v a r   e l ;  
                 v a r   c o l l i s t   =   n e w   A r r a y ( ) ;  
  
                 s w i t c h ( l a y T y p e )  
                 {  
                     c a s e   ' 1 A ' :  
                         e l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' i d ' :   t a b I d + ' c o l 1 ' ,   ' c l a s s ' :   ' p o d c o l   l e f t p o d c o l ' ,   ' t a b i d ' :   t a b I d   } ) . i n j e c t ( p a ) ;  
                         c o l l i s t . p u s h ( e l ) ;  
                         b r e a k ;  
                     c a s e   ' 2 A ' :  
                         e l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' i d ' :   t a b I d + ' c o l 1 ' ,   ' c l a s s ' :   ' p o d c o l   l e f t p o d c o l ' ,   ' t a b i d ' :   t a b I d   } ) . i n j e c t ( p a ) ;  
                         c o l l i s t . p u s h ( e l ) ;  
                         e l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' i d ' :   t a b I d + ' c o l 2 ' ,   ' c l a s s ' :   ' p o d c o l   n e x t p o d c o l ' ,   ' t a b i d ' :   t a b I d   } ) . i n j e c t ( p a ) ;  
                         c o l l i s t . p u s h ( e l ) ;  
                         b r e a k ;  
                     c a s e   ' 2 B ' :  
                         e l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' i d ' :   t a b I d + ' c o l 1 ' ,   ' c l a s s ' :   ' p o d c o l   l e f t p o d c o l ' ,   ' t a b i d ' :   t a b I d   } ) . i n j e c t ( p a ) ;  
                         c o l l i s t . p u s h ( e l ) ;  
                         e l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' i d ' :   t a b I d + ' c o l 2 ' ,   ' c l a s s ' :   ' p o d c o l   n e x t p o d c o l ' ,   ' t a b i d ' :   t a b I d   } ) . i n j e c t ( p a ) ;  
                         c o l l i s t . p u s h ( e l ) ;  
                         b r e a k ;  
                     c a s e   ' 3 A ' :  
                         e l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' i d ' :   t a b I d + ' c o l 1 ' ,   ' c l a s s ' :   ' p o d c o l   l e f t p o d c o l ' ,   ' t a b i d ' :   t a b I d   } ) . i n j e c t ( p a ) ;  
                         c o l l i s t . p u s h ( e l ) ;  
                         e l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' i d ' :   t a b I d + ' c o l 2 ' ,   ' c l a s s ' :   ' p o d c o l   n e x t p o d c o l ' ,   ' t a b i d ' :   t a b I d   } ) . i n j e c t ( p a ) ;  
                         c o l l i s t . p u s h ( e l ) ;  
                         e l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' i d ' :   t a b I d + ' c o l 3 ' ,   ' c l a s s ' :   ' p o d c o l   n e x t p o d c o l ' ,   ' t a b i d ' :   t a b I d   } ) . i n j e c t ( p a ) ;  
                         c o l l i s t . p u s h ( e l ) ;  
                         b r e a k ;  
                 }  
  
 	 	 	 	 p o d T o o l s . s e t P o d C o l W i d t h s ( t a b I d ,   l a y T y p e ) ;  
  
                 / /   n o w   t h a t   w e   h a v e   d r o p   a r e a s ,   c a l l   d r a g S e t u p ;  
                 p o d T o o l s . d r a g S e t u p ( ) ;  
                  
                 r e t u r n   c o l l i s t ;  
         } ,    
          
         " r e b u i l d T a b L a y o u t " :   f u n c t i o n ( t a b I d ,   l a y T y p e ,   p o s t C h g )   {  
  
             v a r   p a   =   $ ( ' p o d a r e a ' )  
  
             v a r   c u r L a y T y p e   =   $ ( t a b I d ) . g e t P r o p e r t y ( " l a y o u t " ) ;  
             v a r   c u r C o l s   =   p a r s e I n t ( c u r L a y T y p e ) ;  
             v a r   n e w C o l s   =   p a r s e I n t ( l a y T y p e ) ;  
  
  
             / /   C h e c k   t o   s e e   i f   t h e   t a b   p o d s   a r e   b u i l d .   ( l o o k   f o r   c o l 1   b e c a u s e   t h e r e   m u s t   b e   a t   l e a s t   1   c o l u m n )   I f   t h e y   a r e   n o t   b u i l t ,   b u i l d   t h e m .  
             v a r   p o d T a b N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B [ @ i d = ' "   +   t a b I d   +   " ' ] " ) ;  
             i f ( ! $ ( t a b I d + ' c o l 1 ' ) )    
             {  
                 i f   ( ! p o d T a b N o d e )   {   a l e r t ( " c o u l d n ' t   f i n d   t h e   t a b   ' "   +   t a b I d   +   " '   i n   d a s h b o a r d   o p t i o n s " ) ;   r e t u r n ;   }  
                 p o d T o o l s . d s p P o d A r e a _ B u i l d P o d s ( p o d T a b N o d e ) ;  
             }  
              
              
             i f   ( n e w C o l s   >   c u r C o l s )  
             {  
                 w h i l e   ( n e w C o l s   >   c u r C o l s )  
                 {  
                     c u r C o l s   + = 1 ;  
                     e l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' i d ' :   t a b I d + ' c o l ' + c u r C o l s ,   ' c l a s s ' :   ' p o d c o l   n e x t p o d c o l ' ,   ' t a b i d ' :   t a b I d   } ) . i n j e c t ( p a ) ;  
                 }  
             }  
             e l s e   i f   ( n e w C o l s   <   c u r C o l s )  
             {  
                 w h i l e   ( n e w C o l s   <   c u r C o l s )  
                 {  
                     v a r   c o l T o D r o p   =   $ ( t a b I d + ' c o l 1 ' ) ;  
                     v a r   c o l T o R e m o v e   =   $ ( t a b I d + ' c o l ' + c u r C o l s ) ;  
                     w h i l e   ( c o l T o R e m o v e . c h i l d N o d e s . l e n g t h   >   0 )  
                         c o l T o D r o p . a p p e n d C h i l d ( c o l T o R e m o v e . f i r s t C h i l d ) ;  
                          
                     c u r C o l s   - =   1 ;  
                 }  
             }  
              
  
 	 	 	 p o d T o o l s . s e t P o d C o l W i d t h s ( t a b I d ,   l a y T y p e ) ;  
  
              
             $ ( t a b I d ) . s e t P r o p e r t y ( " l a y o u t " ,   l a y T y p e ) ;  
             p o d T o o l s . n o t i f i c a t i o n . c h a n g e T a b L a y o u t ( t a b I d ,   l a y T y p e ,   p o s t C h g ) ;  
  
  
     	 	 p o d T o o l s . b a l a n c e C o l u m n s ( t a b I d ,   p o s t C h g ) ;  
  
             p o d T o o l s . d r a g S e t u p ( ) ;  
              
             / /   C a l l   t h e   d r o p   e v e n t   f o r   a n y   o f   t h e   p o d s   w i t h   o n d r o p  
             f o r   ( v a r   c = 1 ;   c < = n e w C o l s ;   c + + )  
             {  
             	 v a r   p o d L i s t   =   $ ( t a b I d + ' c o l ' + c ) . g e t E l e m e n t s ( ' . p o d ' ) ;  
             	 f o r   ( v a r   p = 0 ;   p < p o d L i s t . l e n g t h ;   p + + )  
             	 {  
             	 	 p o d T o o l s . c h e c k P o d E v e n t ( p o d L i s t [ p ] ,   " o n d r o p " ) ;  
             	 }  
             }  
              
         } ,  
  
         " b a l a n c e C o l u m n s " :   f u n c t i o n ( t a b I d ,   p o s t C h g )   {  
          
  
             v a r   p o d T a b N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B [ @ i d = ' "   +   t a b I d   +   " ' ] " ) ;  
             v a r   p o d N o d e L i s t   =   p o d T a b N o d e . s e l e c t N o d e s ( " P O D " ) ;  
             v a r   p o d C o u n t   =   p o d N o d e L i s t . l e n g t h ;  
             v a r   c o l C o u n t   =   p a r s e I n t ( p o d T a b N o d e . g e t A t t r i b u t e ( " l a y o u t " ) ) ;  
              
             i f   ( i s N a N ( c o l C o u n t )   | |   c o l C o u n t = = 1 )   r e t u r n     / /   n o t h i n g   t o   d o    
                  
             / /   b u i l d   a n   a r r a y   t o   h o l d   c o l u m n   h e i g h t   t o t a l s  
             v a r   c o l H   =   n e w   A r r a y ( 0 , 0 , 0 ) ;  
                
             / /   b u i l d   a n   a r r a y   o f   p o d s  
             v a r   p o d D a t a   =   n e w   A r r a y ( ) ;  
             f o r   ( v a r   i = 0 ;   i   <   p o d N o d e L i s t . l e n g t h ;   i + + )  
             {  
                 v a r   p o d I d   =   p o d N o d e L i s t [ i ] . g e t A t t r i b u t e ( " i d " ) ;  
                 v a r   s e q   =   p o d N o d e L i s t [ i ] . g e t A t t r i b u t e ( " s e q " ) ;  
                 v a r   p o d D i v   =   $ ( p o d I d ) ;  
                 p o d D a t a . p u s h ( [ [ p o d I d ] ,   [ s e q ] ,   [ p o d D i v . o f f s e t H e i g h t ] ,   [ n u l l ] ] ) ;    
             }  
              
             / /   F i n d   b i g g e s t   h e i g h t s  
             v a r   p o d s B y H e i g h t   =   n e w   A r r a y ( ) ;  
             w h i l e   ( p o d D a t a . l e n g t h   >   0 )  
             {  
                 v a r   n e x t B i g H   =   - 1 ;  
                 v a r   n e x t B i g I d x   =   - 1 ;  
                 f o r   ( n = 0 ;   n < p o d D a t a . l e n g t h ;   n + + )  
                 {  
                     i f   ( p o d D a t a [ n ] [ 2 ] [ 0 ]   >   n e x t B i g H )  
                     {  
                           n e x t B i g I d x   =   n ;  
                           n e x t B i g H   =   p o d D a t a [ n ] [ 2 ] [ 0 ] ;  
                     }  
                 }  
                 v a r   d t a   =   p o d D a t a . s p l i c e ( n e x t B i g I d x , 1 ) ;  
                 p o d s B y H e i g h t . p u s h ( d t a [ 0 ] ) ;  
             }  
            
  
             / /   A s s i g n   p o d s   t o   c o l u m n s  
             f o r   ( v a r   i = 0 ;   i < p o d s B y H e i g h t . l e n g t h ;   i + + )  
             {  
                 / / f i n d   t h e   s m a l l e s t   c o l u m n  
                 v a r   s m a l l C o l   =   1 ;  
                 v a r   s m a l l C o l V a l u e   =   c o l H [ 0 ] ;  
                 i f   ( c o l H [ 1 ]   <   c o l H [ 0 ] )   {   s m a l l C o l   =   2 ;   s m a l l C o l V a l u e   =   c o l H [ 1 ] ;   }  
                 i f   ( c o l C o u n t   = =   3   & &   c o l H [ 2 ]   <   s m a l l C o l V a l u e )   {   s m a l l C o l   =   3 ;   s m a l l C o l V a l u e   =   c o l H [ 2 ] ;   }  
                  
                 / / A s s i g n   t h e   s m a l l e s   c o l u m n   n u m b e r   t o   e a c h   c o l u m n  
                 p o d s B y H e i g h t [ i ] [ 3 ] [ 0 ]   =   s m a l l C o l ;  
                 c o l H [ s m a l l C o l   -   1 ]   + =   p o d s B y H e i g h t [ i ] [ 2 ] [ 0 ] ;  
             }  
  
             / / r e s o r t   b y   s e q u e n c e   -   p u t   i t   b a c k   i n t o   p o d D a t a  
             w h i l e   ( p o d s B y H e i g h t . l e n g t h   >   0 )  
             {  
                 v a r   n e x t S e q   =   9 9 9 9 ;  
                 v a r   n e x t S e q I d x   =   - 1 ;  
                 f o r   ( n = 0 ;   n < p o d s B y H e i g h t . l e n g t h ;   n + + )  
                 {  
                     i f   ( p o d s B y H e i g h t [ n ] [ 1 ] [ 0 ]   <   n e x t S e q )  
                     {  
                           n e x t S e q I d x   =   n ;  
                           n e x t S e q   =   p o d s B y H e i g h t [ n ] [ 1 ] [ 0 ] ;  
                     }  
                 }  
                 v a r   d t a   =   p o d s B y H e i g h t . s p l i c e ( n e x t S e q I d x , 1 ) ;  
                 p o d D a t a . p u s h ( d t a [ 0 ] ) ;  
             }    
            
             / / l o o p   t h r o u g h   a l l   o f   t h e   p o d s .      
             / / I f   i t   i s   a   n e w   c o l u m n ,   m o v e   i t .    
             f o r   ( v a r   i = 0 ;   i <   p o d D a t a . l e n g t h ;   i + + )  
             {  
                 v a r   p o d I d   =   p o d D a t a [ i ] [ 0 ] [ 0 ] ;    
                 v a r   n e w C o l   =   p o d D a t a [ i ] [ 3 ] [ 0 ] ;    
                 v a r   p o d N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B / P O D [ @ i d = ' "   +   p o d I d   +   " ' ] " ) ;  
                 i f   ( p o d N o d e . g e t A t t r i b u t e ( " c o l " ) ! = n e w C o l )  
                 {  
                     v a r   d r o p C o l   =   $ ( t a b I d + " c o l " + ( n e w C o l ) ) ;  
                     v a r   p o d   =   $ ( p o d I d ) ;  
                     d r o p C o l . a p p e n d C h i l d ( p o d ) ;  
                 }  
             }  
  
             / /   S e t   c o l u m n s   a n d   s e q u e n c e  
             f o r   ( v a r   c = 0 ;   c < c o l C o u n t ;   c + + )  
             {  
                 v a r   c o l d i v   =   $ ( t a b I d + " c o l " + ( c + 1 ) ) ;  
                 v a r   d i v L i s t   =   c o l d i v . g e t C h i l d r e n ( " d i v " ) ;  
 	 	 	 	 v a r   s q   =   1 ;  
                 f o r   ( v a r   i = 0 ;   i <   d i v L i s t . l e n g t h ;   i + + )  
                 {  
                     v a r   p o d I d   =   d i v L i s t [ i ] . i d ;  
                     i f   ( p o d I d   ! =   " p o d p l a c e h o l d e r " )  
                     {  
                         p o d T o o l s . n o t i f i c a t i o n . s e t P o d L o c a t i o n ( p o d I d ,   c + 1 ,   s q ,   f a l s e ) ;  
                         s q   + =   1 ;  
                     }  
                 }  
             }  
              
             p o d T o o l s . n o t i f i c a t i o n . r e s e q u e n c e T a b N o d e s ( t a b I d ,   p o s t C h g ) ;  
                              
         } ,    
                          
         " r e m o v e T a b " :   f u n c t i o n ( t a b I d ,   p o s t C h g )   {  
  
                 / /   r e t u r n   m a x i m i z e d   p o d   t o   n o r m a l    
                 p o d T o o l s . m a x i m i z e P o d _ r e t u r n ( ) ;  
                  
             	 v a r   t O b j   =   $ ( t a b I d ) ;  
 	 	 	 	 i f   ( t O b j )  
 	 	 	 	 {  
 	 	 	 	  
 	                 / /   r e m o v e   a l l   o f   t h e   h t m l   p o d   d i s p l a y   c o n t a i n e r s  
 	                 v a r   d c D i v ;  
 	                 v a r   c o l   =   1 ;  
 	                 d o    
 	                 {  
 	                     d c D i v   =   $ ( t a b I d + ' c o l ' + c o l ) ;  
 	                     i f   ( d c D i v )  
 	                     {  
 	                         d c D i v . r e m o v e ( ) ;  
 	                         c o l   + =   1 ;  
 	                     }  
 	                 }   w h i l e   ( d c D i v )  
 	                  
 	                 / /   r e m o v e   h t m l   f r o m   t h e   l i s t  
 	             	 v a r   i s A c t T a b   =   ( t O b j . h a s C l a s s ( " a c t i v e n a v s e c t i o n " ) = = t r u e )  
 	                 t O b j . r e m o v e ( ) ;  
 	  
 	  
 	                 / /   r e m o v e   t h e   x m l   f r o m   d a s h b o a r d   o p t i o n s   a n d   u p d a t e   h o s t  
 	                 p o d T o o l s . n o t i f i c a t i o n . r e m o v e T a b ( t a b I d ,   p o s t C h g ) ;  
 	 	 	 	 }  
                  
                 / /   m a k e   s u r e   w e   h a v e   a   g o o d   d i s p l a y .     I f   w e   j u s t   r e m o v e d   t h e   a c t i v e   t a b ,   s h o w   t h e   h o m e   t a b  
                 i f   ( i s A c t T a b   = =   t r u e )   p o d T o o l s . s h o w T a b ( $ $ ( ' . p o d l i s t ' ) [ 0 ] . i d ) ;  
  
                 r e t u r n   ;  
         } ,  
      
         " r e n a m e T a b " :   f u n c t i o n ( t a b I d ,   t a b L a b e l ,   p o s t C h g )   {  
              
             / /   C h a n g e   t h e   l a b e l   i n   t h e   H T M L   l i s t  
             v a r   t O b j   =   $ ( t a b I d ) ;  
             v a r   l O b j   =   t O b j . g e t E l e m e n t s ( " a [ c l a s s = ' p t l a b e l ' ] " ) [ 0 ] ;  
             l O b j . s e t T e x t ( t a b L a b e l ) ;  
              
             / / U p d a t e   d a s h b o a r d   o p t i o n s   x m l   a n d   u p d a t e   h o s t  
             p o d T o o l s . n o t i f i c a t i o n . r e n a m e T a b ( t a b I d ,   t a b L a b e l ,   p o s t C h g ) ;  
              
         } ,  
          
         " r e m o v e P o d " :   f u n c t i o n ( p o d I d ,   b S h o w T a b ,   p o s t C h g )   {  
  
                 / /   r e t u r n   m a x i m i z e d   p o d   t o   n o r m a l    
                 p o d T o o l s . m a x i m i z e P o d _ r e t u r n ( ) ;  
                  
                 v a r   p O b j   =   $ ( p o d I d ) ;  
                 v a r   t a b I d   =   p O b j . p a r e n t N o d e . g e t A t t r i b u t e ( " t a b i d " ) ;  
                            
                 i f   ( ! p o d T o o l s . c h e c k P o d E v e n t ( p O b j ,   " o n r e m o v e " ) )   r e t u r n ;  
          
  
                 / / r e m o v e   h t m l   n o d e   f r o m   d i s p l a y  
     	 	 	 p O b j . g e t E l e m e n t s ( ' i f r a m e ' ) . e a c h (   f u n c t i o n ( i t e m )   {    
     	 	 	 / /   t h i s   i s   c a u s e i n g   a n   e r r o r   w h e n   t h e   n e w   p a g e   l o a d s .     I   t h i n k   t h a t   I   n e e d   t o   u p d a t e   t h e   m o o t o o l s   b e c a u s e   s e a r c h / r e p o r t s   a r e   u s i n g   a n   o l d   v e r s i o n  
 	     	 	 	 i t e m . s r c = ' a b o u t : b l a n k ' ;       / /   r e s e t   t h e   s o u r c e   s o   t h e   f r a m e   c o n t e n t ' s   u n l o a d   e v e n t s   g e t   c a l l e d .  
     	 	 	 } ) ;        
                 p O b j . r e m o v e ( ) ;  
  
  
                 p o d T o o l s . c l e a r A c t i v e N a v S e c t i o n s ( ) ;  
  
                 / /   r e m o v e   h t m l   f r o m   l i s t  
             	 v a r   t O b j   =   $ ( t a b I d ) ;  
                 v a r   c n t = 0 ;  
                 f o r   ( i = t O b j . c h i l d N o d e s . l e n g t h - 1 ;   i > = 0 ;   i - - )  
                 {  
                 	 i f   ( t O b j . c h i l d N o d e s [ i ] . g e t A t t r i b u t e ( " c l a s s N a m e " ) = = " p o d l i s t i t e m " )  
                 	 {  
                 	     v a r   a N o d e   =   t O b j . c h i l d N o d e s [ i ] . g e t F i r s t ( ) ;  
                 	     i f   ( a N o d e . g e t A t t r i b u t e ( " i d " ) = = p o d I d + " _ l i n k " )  
                 	     {  
                 	     	 t O b j . c h i l d N o d e s [ i ] . p a r e n t N o d e . r e m o v e C h i l d ( t O b j . c h i l d N o d e s [ i ] ) ;  
                 	     }  
                 	     e l s e  
                 	     {  
 	 	 	 	 	 	 	 c n t + = 1 ;  
                 	     }                 	      
                 	 }  
                 }    
                
                  
                 / / o p e n   t h e   t a b  
                 i f   ( b S h o w T a b   = =   t r u e )  
                 {  
                 	 i f   ( c n t   >   0 )   p o d T o o l s . s h o w T a b ( t a b I d ) ;  
                 	 e l s e   p o d T o o l s . s h o w T a b ( $ $ ( ' . p o d l i s t ' ) [ 0 ] . i d ) ;  
                 }  
                  
                  
                 / / r e m o v e   x m l   n o d e   f r o m   d a s h b o a r d   o p t i o n s   a n d   u p d a t e   h o s e  
                 p o d T o o l s . n o t i f i c a t i o n . r e m o v e P o d ( p o d I d ,   p o s t C h g ) ;  
                  
                 d e l e t e ( p O b j ) ; 	 	 	 	 / / T h e   D I V   i s   b e i n g   r e m o v e d ,   b u t   n o t   d e l e t e d  
  
 	 	 } ,  
          
          
         " h i d e C r o s s h a i r "   :   f u n c t i o n ( i d )   {  
 	 	 	 	 i f   ( $ ( ' m a x i m i z e d p o d ' ) )   r e t u r n ;  
                 v a r   o b j   =   $ ( i d ) ;  
  
                 t m p O b j   =   o b j . g e t E l e m e n t ( " a [ c l a s s = ' p o d m o v e b t n ' ] " ) ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
         } ,          
          
         " s h o w C r o s s h a i r "   :   f u n c t i o n ( i d )   {  
 	 	 	 	 i f   ( $ ( ' m a x i m i z e d p o d ' ) )   r e t u r n ;  
                 v a r   o b j   =   $ ( i d ) ;  
                 t m p O b j   =   o b j . g e t E l e m e n t ( " a [ c l a s s = ' p o d m o v e b t n ' ] " ) ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
         } ,          
          
         " s h r i n k T a b "   :   f u n c t i o n ( t a b I d )   {  
                 v a r   t O b j   =   $ ( t a b I d ) ;  
                 i f   ( ! t O b j )   {   a l e r t ( t a b I d   +   "   i s   a n   i n v a l i d   t a b   i d . " ) ;   r e t u r n   }  
                  
                 t O b j . g e t C h i l d r e n ( ) . e a c h ( f u n c t i o n ( i t e m )   {   i f ( i t e m . i d ! = t a b I d + " _ h e a d e r " )   i t e m . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;   } ) ;  
  
  
                 / /   H i d e   t h e   s h r i n k   b u t t o n  
                 t m p O b j   =   t O b j . g e t E l e m e n t s ( " a [ c l a s s = ' p t s h r i n k b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
  
                 / /   D i s p l a y   t h e   e x p a n d   b u t t o n  
                 t m p O b j   =   t O b j . g e t E l e m e n t s ( " a [ c l a s s = ' p t e x p a n d b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
         } ,    
          
         " e x p a n d T a b "   :   f u n c t i o n ( t a b I d )   {  
                 v a r   t O b j   =   $ ( t a b I d ) ;  
                 i f   ( ! t O b j )   {   a l e r t ( t a b I d   +   "   i s   a n   i n v a l i d   t a b   i d . " ) ;   r e t u r n   }  
                  
                 t O b j . g e t C h i l d r e n ( ) . e a c h ( f u n c t i o n ( i t e m )   {   i t e m . s e t S t y l e ( " d i s p l a y " ,   " " ) ;   } ) ;  
  
                 / /   D i s p l a y   t h e   s h r i n k   b u t t o n  
                 t m p O b j   =   t O b j . g e t E l e m e n t s ( " a [ c l a s s = ' p t s h r i n k b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
                 / /   h i d e   t h e   e x p a n d   b u t t o n  
                 t m p O b j   =   t O b j . g e t E l e m e n t s ( " a [ c l a s s = ' p t e x p a n d b t n ' ] " ) [ 0 ] ;  
                 i f   ( t m p O b j )   t m p O b j . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
         } ,    
  
 	 	 " t o g g l e S h o w T a b G r o u p " :   f u n c t i o n ( )   {  
 	 	 	  
 	 	 	 v a r   n c t r   =   $ ( ' n a v c o n t a i n e r ' ) ;  
 	 	 	 v a r   n c e l l   =   $ ( ' n a v c e l l ' ) ;  
  
 	 	 	 v a r   a d j u s t V a l ;  
  
 	 	 	 i f   ( n c t r . g e t S t y l e ( " d i s p l a y " )   = = " n o n e "   | |   p a r s e I n t ( n c t r . g e t S t y l e ( " w i d t h " ) ) = = 0   )  
 	 	 	 {  
 	 	 	 	 / /   e x p a n d   t a b  
 	 	 	 	 a d j u s t V a l   =   - 2 0 0 ;  
 	 	 	 	  
 	 	 	 	 n c t r . s e t S t y l e ( ' d i s p l a y ' ,   ' ' ) ;    
  
 	 	 	 	 v a r   f r o m W i d t h   =   0 ;  
 	 	 	 	 v a r   t o W i d t h   =   p a r s e I n t ( n c e l l . g e t A t t r i b u t e ( " w v a l " ) ) ;  
 	 	 	 	  
 	 	 	 	 v a r   m y E f f e c t s 1   =   n e w   F x . S t y l e s ( ' n a v c o n t a i n e r ' ,   { d u r a t i o n :   3 0 0 ,   t r a n s i t i o n :   F x . T r a n s i t i o n s . l i n e a r } ) ;  
 	 	 	 	 m y E f f e c t s 1 . c u s t o m ( {   ' w i d t h ' :   [ f r o m W i d t h ,   t o W i d t h ] } ) ;  
 	 	 	 	 v a r   m y E f f e c t s 2   =   n e w   F x . S t y l e s ( ' n a v c o n t a i n e r ' ,   { d u r a t i o n :   7 0 0 ,   t r a n s i t i o n :   F x . T r a n s i t i o n s . l i n e a r } ) ; 	 	  
 	 	 	 	 m y E f f e c t s 2 . a d d E v e n t ( " o n C o m p l e t e " ,   f u n c t i o n ( )   {   n c t r . s t y l e . c s s T e x t   =   n c t r . g e t P r o p e r t y ( ' o r i g s t y l e ' )   } ) ;  
 	 	 	 	 m y E f f e c t s 2 . c u s t o m ( {   ' o p a c i t y ' :   [ 0 ,   1 ]   } ) ;  
 	 	 	 	 v a r   m y E f f e c t s 3   =   n e w   F x . S t y l e s ( ' n a v c e l l ' ,   { d u r a t i o n :   3 0 0 ,   t r a n s i t i o n :   F x . T r a n s i t i o n s . l i n e a r } ) ;  
 	 	 	 	 m y E f f e c t s 3 . c u s t o m ( {   ' w i d t h ' :   [ 3 ,   t o W i d t h ]   } ) ;  
  
 / / 	 	 	 	 n c e l l . s e t S t y l e ( ' w i d t h ' ,   n c e l l . g e t A t t r i b u t e ( " w v a l " ) ) ; 	  
 	 	 	 	 $ ( ' l e f t T o g g l e L i n k ' ) . r e m o v e C l a s s ( " p t e x p a n d t a b s b t n " ) . a d d C l a s s ( " p t s h r i n k t a b s b t n " )  
 	 	 	 	                                       . s e t P r o p e r t y ( " t i t l e " ,   " S h r i n k   t a b   g r o u p " ) ;  
 	 	 	  
 	 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 / /   s h r i n k   t a b  
 	 	 	 	 n c t r . s e t P r o p e r t y ( ' o r i g s t y l e ' ,   $ ( ' n a v c o n t a i n e r ' ) . s t y l e . c s s T e x t ) ;  
 	 	 	 	 v a r   f r o m W i d t h   =   p a r s e I n t ( n c e l l . g e t S t y l e ( " w i d t h " ) ) ;  
 	 	 	 	 v a r   t o W i d t h   =   0 ;  
  
 	 	 	 	 n c e l l . s e t A t t r i b u t e ( " w v a l " ,   n c e l l . g e t S t y l e ( " w i d t h " ) ) ;  
 	 	 	 	 n c e l l . s e t S t y l e ( ' w i d t h ' ,   ' 3 p x ' ) ; 	  
  
         	 	 v a r   m y E f f e c t s 1   =   n e w   F x . S t y l e s ( ' n a v c o n t a i n e r ' ,   { d u r a t i o n :   3 0 0 ,   t r a n s i t i o n :   F x . T r a n s i t i o n s . l i n e a r } ) ;  
 	 	 	 	 m y E f f e c t s 1 . c u s t o m ( {   ' w i d t h ' :   [ f r o m W i d t h ,   t o W i d t h ]   } ) ;  
 	 	 	 	 v a r   m y E f f e c t s 2   =   n e w   F x . S t y l e s ( ' n a v c o n t a i n e r ' ,   { d u r a t i o n :   1 5 0 ,   t r a n s i t i o n :   F x . T r a n s i t i o n s . l i n e a r } ) ;  
 	 	 	 	 m y E f f e c t s 2 . c u s t o m ( {   ' o p a c i t y ' :   [ 1 ,   0 ]   } ) ;  
  
  
 	 	 	 	 / / 	 n c t r . s e t S t y l e ( ' d i s p l a y ' ,   ' n o n e ' ) ;    
 	 	 	 	  
 	 	 	 	 $ ( ' l e f t T o g g l e L i n k ' ) . r e m o v e C l a s s ( " p t s h r i n k t a b s b t n " ) . a d d C l a s s ( " p t e x p a n d t a b s b t n " )  
 	 	 	 	                                       . s e t P r o p e r t y ( " t i t l e " ,   " E x p a n d   t a b   g r o u p " ) ;  
 	 	 	 } 	  
  
 	 	 	 i f ( $ ( ' m a x i m i z e d p o d ' ) )  
 	 	 	 {    
 	 	 	 	 / / r e s i z e   t h e   p o d   i f   i t   i s   m a x i m i z e d  
 	 	 	 	 s e t T i m e o u t ( ' p o d T o o l s . s e t P o d C o l W i d t h s ( ) ; p o d T o o l s . r e s i z e M a x P o d W i d t h ( ) ; ' ,   3 5 0 ) ;      
 	 	 	 }  
 	 	 	 e l s e    
 	 	 	 {    
 	 	 	 	 / /   o t h e r w i s e   r e s i z e   t h e   p o d   a r e a   c o l u m n s  
 	 	 	 	 i f   ( a d j u s t V a l )   p o d T o o l s . s e t P o d C o l W i d t h s ( n u l l ,   n u l l ,   a d j u s t V a l ) ;    
 	 	 	 	 s e t T i m e o u t ( ' p o d T o o l s . s e t P o d C o l W i d t h s ( ) ; ' ,   3 5 0 ) ; 	    
 	 	 	 }  
 	 	 } ,    
 	 	  
 	 	 " t o g g l e S h o w H e a d e r "   :   f u n c t i o n ( i n s t a n t )   {  
  
 	 	 	 v a r   d e l a y   =   3 0 0 ;  
 	 	 	 i f   ( i n s t a n t )   d e l a y = 0 ;  
  
 	 	 	 v a r   e x p a n d D i v   =   $ ( ' h e a d e r _ e x p a n d ' ) ;  
 	 	 	 i f   ( ! e x p a n d D i v )   a l e r t ( " c o u l d   n o t   f i n d   e x p a n d   d i v " ) ;  
 	 	 	  
 	 	 	 v a r   s h r i n k D i v   =   $ ( ' h e a d e r _ s h r i n k ' ) ;  
 	 	 	 i f   ( ! s h r i n k D i v )   a l e r t ( " c o u l d   n o t   f i n d   s h r i n k   d i v " ) ;  
  
 	 	 	 v a r   s l i d e D i v   =   $ ( ' h e a d e r _ s l i d e a r e a ' ) ;  
 	 	 	 i f   ( ! s h r i n k D i v )   a l e r t ( " c o u l d   n o t   f i n d   s h r i n k   d i v " ) ;  
  
 	 	 	 v a r   d s p I d   =   " " ;  
 	 	 	  
 	 	 	 v a r   h a   =   $ ( ' h e a d e r A r e a ' )  
 	 	 	 i f   ( h a . h a s C l a s s ( " h i d e " ) )  
 	 	 	 {  
 	 	 	 	 d s p I d   =   ' h e a d e r _ e x p a n d ' ;  
 	 	 	 	  
 	 	 	 	 / /   E x p a n d   t h e   h e a d e r  
 	 	 	 	 h a . r e m o v e C l a s s ( ' h i d e ' ) ;  
  
 	 	 	 	 v a r   c u r H e i g h t   =   s l i d e D i v . g e t C o o r d i n a t e s ( ) . h e i g h t ;  
 	 	 	 	 v a r   d e s t H e i g h t   =   1 0 0 ;  
  
 	 	 	 	 s h r i n k D i v . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;    
 	 	 	 	 v a r   m y E f f e c t s 1   =   n e w   F x . S t y l e s ( s l i d e D i v ,   { d u r a t i o n :   d e l a y ,   t r a n s i t i o n :   F x . T r a n s i t i o n s . l i n e a r } ) ;  
 	 	 	 	 m y E f f e c t s 1 . a d d E v e n t ( ' o n C o m p l e t e ' ,   f u n c t i o n ( )   {   e x p a n d D i v . s e t S t y l e ( " d i s p l a y " ,   " " ) ;   }   ) ; 	 	 	 	  
 	 	 	 	 m y E f f e c t s 1 . c u s t o m ( {   ' h e i g h t ' :   [ c u r H e i g h t ,   d e s t H e i g h t ] } ) ;  
  
  
 	 	 	 	 $ ( ' h e a d T o g g l e L i n k ' ) . r e m o v e C l a s s ( " p t e x p a n d h e a d b t n " ) . a d d C l a s s ( " p t s h r i n k h e a d b t n " )  
 	 	 	 	                                       . s e t P r o p e r t y ( " t i t l e " ,   " S h r i n k   h e a d e r " ) ;  
 	 	 	 }  
 	 	 	 e l s e  
 	 	 	 {  
 	 	 	 	 d s p I d   =   ' h e a d e r _ s h r i n k ' ;  
  
 	 	 	 	 / /   S h r i n k   t h e   h e a d e r  
 	 	 	 	 h a . a d d C l a s s ( ' h i d e ' ) ;  
  
  
 	 	 	 	 v a r   c u r H e i g h t   =   s l i d e D i v . g e t C o o r d i n a t e s ( ) . h e i g h t ;  
 	 	 	 	 v a r   d e s t H e i g h t   =   2 4 ;  
 	 	 	 	  
 	 	 	 	 s h r i n k D i v . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
 	 	 	 	 e x p a n d D i v . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;    
 	 	 	 	 v a r   m y E f f e c t s 1   =   n e w   F x . S t y l e s ( s l i d e D i v ,   { d u r a t i o n :   d e l a y ,   t r a n s i t i o n :   F x . T r a n s i t i o n s . l i n e a r } ) ;  
 	 	 	 	 m y E f f e c t s 1 . c u s t o m ( {   ' h e i g h t ' :   [ c u r H e i g h t ,   d e s t H e i g h t ] } ) ;  
  
  
 	 	 	 	 $ ( ' h e a d T o g g l e L i n k ' ) . r e m o v e C l a s s ( " p t s h r i n k h e a d b t n " ) . a d d C l a s s ( " p t e x p a n d h e a d b t n " )  
 	 	 	 	                                       . s e t P r o p e r t y ( " t i t l e " ,   " E x p a n d   h e a d e r " ) ;  
 	 	 	 }  
 	 	 	  
 	  
 	 	 	 / /   f i n d   a n y   s h a r e d   e l e m e n t s   ( i d e n t i f i e d   w i t h   t h e   c l a s s   s h a r e d h e a d a r e a )   a n d  
 	 	 	 / /   m o v e   t o   t h e   h e a d e r   s e c t i o n   t h a t   i s   b e i n g   d i s p l a y e d  
 	 	 	 $ $ ( ' . s h a r e d h e a d a r e a ' ) . e a c h ( f u n c t i o n ( i t e m ) {    
 	 	 	 	 	 v a r   d e s t E l   =   $ ( d s p I d   +   ' _ '   +   i t e m . g e t P r o p e r t y ( " i d " ) ) ;  
 	 	 	 	 	 i f   ( d e s t E l )   i t e m . i n j e c t ( d e s t E l ) ;      
 	 	 	 	   }   ) ;  
 	 	 	 	  
 	 	 	  
 	 	 	 / /   I f   a   p o d   i s   m a x i m i z e d ,   r e s i z e   t h e   f r a m e    
 	 	 	 i f ( $ ( ' m a x i m i z e d p o d ' ) )  
 	 	 	 {    
 	 	 	 	 / / r e s i z e   t h e   p o d   i f   i t   i s   m a x i m i z e d  
 	 	 	 	 s e t T i m e o u t ( ' p o d T o o l s . r e s i z e M a x P o d H e i g h t ( 1 ) ; ' ,   d e l a y + 5 0 ) ;      
 	 	 	 }  
 	 	 } ,  
          
         " i n i t P o d "   :   f u n c t i o n ( i d ,   m y P o d S r c )   {  
         	         	  
             v a r   o b j   =   $ ( i d ) ;  
             t h i s . i n i t P o d O b j e c t ( o b j ,   m y P o d S r c )  
         } ,          
          
         " i n i t P o d O b j e c t "   :   f u n c t i o n ( o b j ,   m y P o d S r c )   {  
             i f   ( o b j )   {  
                 t h i s . d s p B u i l d P o d ( o b j ,   m y P o d S r c ) ;  
             }  
  
         } ,  
         " i n i t P o d s "   :   f u n c t i o n ( c r i t )   {  
             $ $ ( c r i t ) . e a c h ( f u n c t i o n ( i t e m ) {  
                 p o d T o o l s . i n i t P o d O b j e c t ( i t e m )  
             } ) ;  
         } ,  
  
 	 	 " f i n d P o d B y I d "   :   f u n c t i o n ( p o d I d )   {  
 	 	 	  
 	 	 	 v a r   p o d   =   $ ( p o d I d ) ;  
 	 	 	 i f   ( ! p o d )   r e t u r n   n u l l ;  
 	 	 	  
 	 	 	 r e t u r n   p o d ;  
 	 	 } ,  
  
 	 	 " f i n d P o d B y T y p e "   :   f u n c t i o n ( r e f I d )   {  
  
 	 	 } ,  
 	 	  
  
         / *   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *   * /  
          
         " g e t G a d g e t D e f "   :   f u n c t i o n ( r e f i d ,   h i d e M s g )   {    
             i f   ( ! r e f i d )   a l e r t ( " n e e d   a   r e f i d   t o   g e t   a   g a d g e t " ) ;  
             v a r   g a d g e t N o d e   =   _ p o d G a d g e t s . s e l e c t S i n g l e N o d e ( " / P O D L I S T / P O D [ @ i d = ' " + r e f i d + " ' ] " ) ;  
             i f   ( ! g a d g e t N o d e )    
             {  
             	 i f ( ! h i d e M s g )  
             	 {  
             	 	 a l e r t   ( " C o u l d   n o t   f i n d   t h e   g a d g e t   ( "   +   r e f i d   +   " ) " ) ;  
             	 	 d e b u g g e r ;  
             	 }  
             }  
  
             r e t u r n   g a d g e t N o d e ;  
         } ,  
  
 	 	 " g e t P o d O b j e c t "   :   f u n c t i o n ( p a r a m )   {  
  
 	 	 	 v a r   o b j ;  
             i f   ( t y p e o f ( p a r a m ) = = ' o b j e c t ' )   o b j = p a r a m ;  
             e l s e   i f   ( t y p e o f ( p a r a m ) = = ' s t r i n g ' )   o b j = $ ( p a r a m ) ;  
             i f   ( ! o b j )   a l e r t ( " U n a b l e   t o   f i n d   a n   o b j e c t   i n   n o r m a l i z e P o d ( ) " ) ;  
  
 	 	 	 r e t u r n   o b j ; 	 	 	  
 	 	 } ,  
 	 	  
  
         / *   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *   * /  
         / *   * * *   M e t h o d s   a n d   P r o p e r t i e s   u s e d   t o   b u i l d   t h e   d i s p l a y   * * *   * /  
         / *   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *   * /  
  
         " d s p R e m o v e B o r d e r s "   :   f u n c t i o n   ( p a r a m )   {  
  
               v a r   o b j ;  
               i f   ( t y p e o f ( p a r a m ) = = ' o b j e c t ' )   o b j = p a r a m ;  
               e l s e   i f   ( t y p e o f ( p a r a m ) = = ' s t r i n g ' )   o b j = $ ( p a r a m ) ;  
               i f   ( ! o b j )   a l e r t ( " U n a b l e   t o   f i n d   a n   o b j e c t   i n   n o r m a l i z e P o d ( ) " ) ;  
                
                
               f o r   ( v a r   i = 0 ;   i < 8 ;   i + + )  
               {  
                   o b j   =   o b j . g e t F i r s t ( ) ;  
                   o b j . c l a s s N a m e   =   o b j . c l a s s N a m e   +   " _ h i d e " ;                                          
               }  
         } ,        
  
         " d s p R e t u r n B o r d e r s "   :   f u n c t i o n   ( p a r a m )   {  
  
               v a r   o b j ;  
               i f   ( t y p e o f ( p a r a m ) = = ' o b j e c t ' )   o b j = p a r a m ;  
               e l s e   i f   ( t y p e o f ( p a r a m ) = = ' s t r i n g ' )   o b j = $ ( p a r a m ) ;  
               i f   ( ! o b j )   a l e r t ( " U n a b l e   t o   f i n d   a n   o b j e c t   i n   n o r m a l i z e P o d ( ) " ) ;  
                
                
               f o r   ( v a r   i = 0 ;   i < 8 ;   i + + )  
               {  
                   o b j   =   o b j . g e t F i r s t ( ) ;  
                   o b j . c l a s s N a m e   =   o b j . c l a s s N a m e . r e p l a c e ( " _ h i d e " ,   " " ) ;                                          
               }  
         } ,        
        
         " d s p B u i l d B o r d e r s "   :   f u n c t i o n   ( )   {  
  
             v a r   n e w d i v   =   d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ;  
             n e w d i v . c l a s s N a m e = " r p b - t " ;  
             v a r   c u r d i v   =   n e w d i v . a p p e n d C h i l d ( 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 u r d i v . c l a s s N a m e = " r p b - b " ;  
             c u r d i v   =   c u r d i v . a p p e n d C h i l d ( 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 u r d i v . c l a s s N a m e = " r p b - l " ;  
             c u r d i v   =   c u r d i v . a p p e n d C h i l d ( 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 u r d i v . c l a s s N a m e = " r p b - r " ;  
             c u r d i v   =   c u r d i v . a p p e n d C h i l d ( 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 u r d i v . c l a s s N a m e = " r p b - b l " ;  
             c u r d i v   =   c u r d i v . a p p e n d C h i l d ( 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 u r d i v . c l a s s N a m e = " r p b - b r " ;  
             c u r d i v   =   c u r d i v . a p p e n d C h i l d ( 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 u r d i v . c l a s s N a m e = " r p b - t l " ;  
             c u r d i v   =   c u r d i v . a p p e n d C h i l d ( 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 u r d i v . c l a s s N a m e = " r p b - t r " ;  
              
             / / w r k D a t a . p o d O u t s i d e B o x   =   n e w d i v ;  
             / / w r k D a t a . p o d I n s i d e B o x   =   c u r d i v ;  
             r e t u r n   { p o d O u t s i d e B o x   :   n e w d i v ,   p o d I n s i d e B o x   :   c u r d i v } ;  
         } ,  
          
          
         " d s p B u i l d T i t l e "   :   f u n c t i o n   ( p o d C o n t a i n e r ,   p o d I d ,   g a d g e t N o d e )   {  
          
             v a r   t i t l e p a r e n t   =   n e w   E l e m e n t ( " d i v " ,   {   ' c l a s s ' :   ' p o d t i t l e d i v ' ,   ' i d ' :   p o d I d   +   ' _ t i t l e ' ,   ' o w n e r i d ' :   p o d I d   } ) ;  
             v a r   t i t l e d i v   =   n e w   E l e m e n t ( " d i v " ,   {   ' i d ' :   p o d I d   +   ' _ t i t l e b o x ' ,   ' c l a s s ' :   ' p o d t i t l e d i v b o x ' ,   ' o w n e r i d ' :   p o d I d   } ) ;  
             v a r   t i t l e t e x t   =   n e w   E l e m e n t ( " s p a n " ,   {   ' c l a s s ' :   ' p o d t i t l e t e x t ' ,   ' i d ' :   p o d I d   +   ' _ t i t l e t e x t '   } ) ;  
             v a r   t i t l e b u t t o n s   =   n e w   E l e m e n t ( " s p a n " ,   {   ' c l a s s ' :   ' p o d t i t l e b u t t o n s '   } ) ;  
  
             v a r   m o v e i m g   =   n e w   E l e m e n t ( " a " ,   {   ' c l a s s ' :   ' p o d m o v e b t n '   } ) . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
             v a r   m i n b u t t o n   =   n e w   E l e m e n t ( " a " ,   {   ' c l a s s ' :   ' p o d m i n b t n ' ,   ' h r e f ' :   ' # ' ,   ' t i t l e ' :   ' M i n i m i z e   P o d ' ,  
                                                                                   ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {     p o d T o o l s . m i n i m i z e P o d ( p o d I d ,   t r u e ) ;   r e t u r n   f a l s e ;   }   }   } ) ;  
  
 	 	 	 v a r   t o u r b u t t o n   =   n u l l ;  
             v a r   t o u r F u n c   =   g a d g e t N o d e . g e t A t t r i b u t e ( " t o u r " ) ;  
             i f   ( t o u r F u n c   & &   t o u r F u n c ! = ' ' )  
             {  
             	 t o u r b u t t o n   =   n e w   E l e m e n t ( " a " ,   {   ' c l a s s ' :   ' p o d t o u r b t n ' ,   ' h r e f ' :   ' # ' ,     ' t i t l e ' :   ' H e l p   F o r   T h i s   P o d ' ,    
                                                                         ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {   p o d T o o l s . t o u r P o d ( p o d I d ) ;   r e t u r n   f a l s e ;   }   }   } ) ;  
     	 	 }  
 	 	 	  
             v a r   n o r m b u t t o n   =   n e w   E l e m e n t ( " a " ,   {   ' c l a s s ' :   ' p o d n o r m b t n ' ,   ' h r e f ' :   ' # ' ,   ' t i t l e ' :   ' N o r m a l i z e   P o d ' ,  
                                                                         ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {   p o d T o o l s . n o r m a l i z e P o d ( p o d I d ,   t r u e ) ;   r e t u r n   f a l s e ;   }   }   } ) ;  
             n o r m b u t t o n . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
             v a r   m a x b u t t o n   =   n e w   E l e m e n t ( " a " ,   {   ' c l a s s ' :   ' p o d m a x b t n ' ,   ' h r e f ' :   ' # ' ,   ' t i t l e ' :   ' M a x i m i z e   P o d ' ,  
                                                                                   ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {     p o d T o o l s . m a x i m i z e P o d ( p o d I d ,   t r u e ) ;   r e t u r n   f a l s e ;   }   }   } ) ;  
                                                                                    
             v a r   p r e f b u t t o n   =   n e w   E l e m e n t ( " a " ,   {   ' c l a s s ' :   ' p o d p r e f b t n ' ,   ' h r e f ' :   ' # ' ,     ' t i t l e ' :   ' P o d   S e t t i n g s ' ,    
                                                                         ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {   p o d T o o l s . t o g g l e P o d P r e f s ( p o d I d ) ;   r e t u r n   f a l s e ;   }   }   } ) ;  
                                                                                    
             v a r   r e f r e s h b u t t o n   =   n u l l ;  
             v a r   r e f r e s h F u n c   =   g a d g e t N o d e . g e t A t t r i b u t e ( " r e f r e s h " ) ;  
             i f   ( r e f r e s h F u n c   & &   r e f r e s h F u n c ! = ' ' )  
             {  
             	 r e f r e s h b u t t o n   =   n e w   E l e m e n t ( " a " ,   {   ' c l a s s ' :   ' p o d r e f r e s h b t n ' ,   ' h r e f ' :   ' # ' ,     ' t i t l e ' :   ' R e f r e s h   P o d ' ,    
                                                                         ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {   p o d T o o l s . r e f r e s h P o d ( p o d I d ) ;   r e t u r n   f a l s e ;   }   }   } ) ;  
     	 	 }  
     	 	  
             v a r   c l o s e b u t t o n   =   n e w   E l e m e n t ( " a " ,   {   ' c l a s s ' :   ' p o d q c l o s e ' ,   ' h r e f ' :   ' # ' ,     ' t i t l e ' :   ' R e m o v e   P o d ' ,    
                                                                         ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {   p o d T o o l s . r e m o v e P o d ( p o d I d ,   t r u e ,   t r u e ) ;   r e t u r n   f a l s e ;   }   }   } ) . s e t T e x t ( " c l o s e " ) ;  
  
             v a r   e n d f l o a t   =   n e w   E l e m e n t ( " s p a n " ) ;  
             e n d f l o a t . s e t S t y l e ( ' c l e a r ' , ' b o t h ' )  
  
 	 	 	 v a r   s t r   =   " "  
             i f   ( p o d C o n t a i n e r . g e t A t t r i b u t e ( " t i t l e " ) )   s t r   =   p o d C o n t a i n e r . g e t A t t r i b u t e ( " t i t l e " )  
             e l s e   i f ( g a d g e t N o d e . g e t A t t r i b u t e ( " t i t l e " ) )     s t r   =   g a d g e t N o d e . g e t A t t r i b u t e ( " t i t l e " ) ;  
             e l s e   s t r   =   g a d g e t N o d e . g e t A t t r i b u t e ( " l a b e l " ) ;  
             s t r   =   p o d T o o l s . r e p l a c e T a g s ( { i d : p o d I d } ,   s t r ) ;  
 	 	 	 t i t l e t e x t . i n n e r T e x t   =   s t r ;  
              
              
             m a x b u t t o n . i n j e c t ( t i t l e b u t t o n s ,   ' b o t t o m ' ) ;  
             n o r m b u t t o n . i n j e c t ( t i t l e b u t t o n s ,   ' b o t t o m ' ) ;  
             m i n b u t t o n . i n j e c t ( t i t l e b u t t o n s ,   ' b o t t o m ' ) ;  
             p r e f b u t t o n . i n j e c t ( t i t l e b u t t o n s ,   ' b o t t o m ' ) ;  
             i f   ( r e f r e s h b u t t o n )   r e f r e s h b u t t o n . i n j e c t ( t i t l e b u t t o n s ,   ' b o t t o m ' ) ;  
             i f   ( t o u r b u t t o n )   t o u r b u t t o n . i n j e c t ( t i t l e b u t t o n s ,   ' b o t t o m ' ) ;  
   	 	 	 i f   ( g a d g e t N o d e . g e t A t t r i b u t e ( " q u i c k c l o s e " ) = = " t r u e " )   c l o s e b u t t o n . i n j e c t ( t i t l e b u t t o n s ,   ' b o t t o m ' ) ;    
             m o v e i m g . i n j e c t ( t i t l e b u t t o n s ,   ' b o t t o m ' ) ;  
  
             t i t l e t e x t . i n j e c t ( t i t l e d i v ,   ' t o p ' ) ;  
             t i t l e b u t t o n s . i n j e c t ( t i t l e d i v ,   ' b o t t o m ' ) ;  
             e n d f l o a t . i n j e c t ( t i t l e d i v ,   ' b o t t o m ' ) ;  
             t i t l e d i v . i n j e c t ( t i t l e p a r e n t ) ;  
  
             / /   A d d   E v e n t s    
             t i t l e d i v . a d d E v e n t s ( {  
 	 	 	         ' m o u s e o v e r ' :   f u n c t i o n ( )   {   p o d T o o l s . s h o w C r o s s h a i r ( p o d I d ) ;   } ,  
 	 	 	         ' m o u s e o u t ' :   f u n c t i o n ( )   {   p o d T o o l s . h i d e C r o s s h a i r ( p o d I d ) ;   }  
 	 	 	 } ) ;  
 	 	 	  
 	 	 	 t h i s . d r a g A d d E v e n t s T o P o d ( t i t l e d i v ) ;  
 	 	 	  
             / / w r k D a t a . p o d T i t l e B o x   =   t i t l e p a r e n t ;  
 	 	 	 r e t u r n   t i t l e p a r e n t ;  
         } ,  
                  
         " d s p B u i l d P o d "   :   f u n c t i o n   ( o b j ,   m y P o d S r c )   {  
  
             v a r   p o d I d   =   o b j . i d ;  
             v a r   p o d T y p e   =   o b j . g e t A t t r i b u t e ( " r e f i d " ) ;  
  
             / /   f i n d   t h e   g a d g e t      
             v a r   g a d g e t N o d e   =   t h i s . g e t G a d g e t D e f ( o b j . g e t A t t r i b u t e ( " r e f i d " ) )  
              
              
             / /   s p e c i f y   t h e   n a m e s   o f   t h e   d i v s   t h a t   c o n t a i n   o u r   d a t a .     w e   w i l l   l o a d   t h e m   l a t e r   w h e n   w e   n e e d   t h e m .  
             / /   f o r   n o w   w e   e x p e c t   e i t h e r   a   d i s p l a y   n o d e   f o r   m a x   a n d   n o r m ,   o r   a   s i n g l e   d i s p l a y   n o d e   t o   b e   s h a r e d  
             v a r   n o r m E x i s t s   =   ( g a d g e t N o d e . s e l e c t S i n g l e N o d e ( " D I S P L A Y [ @ w h e n = ' n o r m ' ] " )   ! =   n u l l )  
             v a r   m a x E x i s t s   =   ( g a d g e t N o d e . s e l e c t S i n g l e N o d e ( " D I S P L A Y [ @ w h e n = ' m a x ' ] " )   ! =   n u l l )  
             i f   ( n o r m E x i s t s = = t r u e   & &   m a x E x i s t s = = t r u e )  
             {  
                 o b j . s e t P r o p e r t y ( " n o r m d s p i d " ,   p o d I d   +   " _ n o r m d s p " ) ;  
                 o b j . s e t P r o p e r t y ( " m a x d s p i d " ,   p o d I d   +   " _ m a x d s p " ) ;  
             }  
             e l s e  
             {  
                 o b j . s e t P r o p e r t y ( " n o r m d s p i d " ,   p o d I d   +   " _ d s p " ) ;  
                 o b j . s e t P r o p e r t y ( " m a x d s p i d " ,   p o d I d   +   " _ d s p " ) ;  
             }  
              
             v a r   b o r d e r P a r t s   =   t h i s . d s p B u i l d B o r d e r s ( ) ;  
             v a r   p o d T i t l e B o x   =   t h i s . d s p B u i l d T i t l e ( o b j ,   p o d I d ,   g a d g e t N o d e ) ;  
              
              
             / /   I f   t h e   p o d   c o n t a i n s   t a b s ,   a d d   t h e m   h e r e .     O t h e r w i s e   a d d   a   d i v i d i n g   l i n e .  
             v a r   t a b s N o d e   =   g a d g e t N o d e . s e l e c t S i n g l e N o d e ( " T A B S " ) ;  
             i f   ( t a b s N o d e )  
             {  
                 / /   A d d   t a b s   t o   t h e   t i t l e   b o x   h e r e   ( u s e   t a b T o o l s )  
                 v a r   t b B o x   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' c l a s s ' :   ' t a b b e d m e n u ' ,   ' i d ' :   p o d I d   +   ' _ t a b m e n u '   } ) . i n j e c t ( p o d T i t l e B o x ) ;  
                 v a r   s t r   =   " " ;  
                 f o r   ( v a r   i = 0 ;   i < t a b s N o d e . c h i l d N o d e s . l e n g t h ;   i + + )  
                     s t r   + =   t a b s N o d e . c h i l d N o d e s [ i ] . x m l ;  
  
 	 	 	 	 t b B o x . i n n e r H T M L   =   s t r ;  
 	 	 	 	  
 	 	 	 	 i f ( t a b s N o d e . g e t A t t r i b u t e ( ' h i d e m a x ' ) )   t b B o x . s e t P r o p e r t y ( ' h i d e m a x ' ,   t a b s N o d e . g e t A t t r i b u t e ( ' h i d e m a x ' ) ) ;  
 	 	 	 	 i f ( t a b s N o d e . g e t A t t r i b u t e ( ' h i d e n o r m ' ) )   t b B o x . s e t P r o p e r t y ( ' h i d e n o r m ' ,   t a b s N o d e . g e t A t t r i b u t e ( ' h i d e n o r m ' ) ) ;  
             }  
             e l s e   p o d T i t l e B o x . a d d C l a s s ( ' p o d t i t l e e x t r a ' ) ;      
  
             p o d T i t l e B o x . a d d C l a s s ( ' r p b t a b b e d m e n u ' ) ;        
  
  
             b o r d e r P a r t s . p o d I n s i d e B o x . a p p e n d C h i l d ( p o d T i t l e B o x ) ;  
  
  
             v a r   c n t r d i v   =   n e w   E l e m e n t ( " d i v " ,   {   ' c l a s s ' :   ' p o d c o n t e n t s ' ,   ' i d ' :   p o d I d   +   ' _ c o n t e n t s '   } ) ;  
             c n t r d i v . i n j e c t ( b o r d e r P a r t s . p o d I n s i d e B o x ) ;  
              
              
             o b j . a p p e n d C h i l d ( b o r d e r P a r t s . p o d O u t s i d e B o x ) ;  
  
  
             / /   S e t   i n i t i a l   d i s p l a y   t o   e i t h e r   m i n i m i z e d   o r   n o r m a l i z e d .  
             v a r   i n i t D i s p l a y   =   " n o r m " ;  
             i f   ( m y P o d S r c )   i n i t D i s p l a y   =   m y P o d S r c . g e t A t t r i b u t e ( " d i s p l a y " )  
             s w i t c h ( i n i t D i s p l a y )  
             {  
                 c a s e   " m i n " :  
                         t h i s . m i n i m i z e P o d ( o b j ,   f a l s e ) ;  
                         b r e a k ;  
                 c a s e   " n o r m " :  
                 d e f a u l t :  
                         t h i s . n o r m a l i z e P o d ( o b j ,   f a l s e ) ;  
                         b r e a k ;  
             }                                
  
 / / i f   ( m a i n W i n d o w . _ a g t . a g e n t i d = = " a r m o 3 a g e n t " )   d e b u g g e r ;  
  
             / / t h i s . d r a g A d d E v e n t s T o P o d ( o b j ) ;  
         } ,  
          
         " d s p L o a d P r e f A r e a D i v "   :   f u n c t i o n   ( o b j )   {  
                 v a r   p o d I d   =   o b j . i d ;  
                 / / g e t   t h e   g a d g e t n o d e  
                 v a r   g a d g e t N o d e   =   t h i s . g e t G a d g e t D e f ( o b j . g e t A t t r i b u t e ( " r e f i d " ) ) ;  
                 v a r   g a d g e t P r e f N o d e   =   g a d g e t N o d e . s e l e c t S i n g l e N o d e ( " P R E F " ) ;  
                  
                 / / p r e f s   g e t   l o a d e d   i n t o   t h e   h t m l   t h a t   l o o k s   l i k e   t h i s :  
                 / /     < d i v   i d = " p o d 1 _ p r e f "   s t y l e = " c l e a r : b o t h ;   f l o a t : n o n e " >  
                 / /         < b r   / >  
                 / /         < d i v   c l a s s = " p o d p r e f a r e a " >  
                 / /                 < d i v   c l a s s = " p o d p r e f i n f o a r e a " > s t u f f   g o e s   h e r e < / d i v >  
                 / /                 < d i v   c l a s s = " p o d p r e f d a t a a r e a " >  
                 / /                         < s p a n   c l a s s = " p o d p r e f l a b e l " > Z i p c o d e : < / s p a n >  
                 / /                         < i n p u t   i d = " T e x t 1 "   t y p e = " t e x t "   > < / i n p u t >  
                 / /                 < / d i v >                  
                 / /                 < t a b l e   c l a s s = " p o d p r e f b u t t o n a r e a "   w i d t h = " 1 0 0 % " >  
                 / /                         < t r >  
                 / /                         < t d > < b u t t o n > R e m o v e < / b u t t o n > < / t d >  
                 / /                         < t d   a l i g n = " r i g h t " > < b u t t o n > O K < / b u t t o n > & # 1 6 0 ; < b u t t o n > C a n c e l < / b u t t o n > < / t d >  
                 / /                         < / t r >  
                 / /                 < / t a b l e >  
                 / /         < / d i v >  
                 / /     < / d i v >  
                 / / T h e   i n n e r t m l   o f   t h e   p o d   p r e f a r e a   c o m e s   f r o m   t h e   g a d g e t  
                 / / T h e   h t m l   g e t   l o a d e d   i n t o   t h e   e n d   o f   t h e    
                  
                 v a r   t D i v   =   $ ( p o d I d   +   ' _ t i t l e ' ) ;  
  
                 v a r   n e w D i v   =   n e w   E l e m e n t ( " d i v " ,   {   ' i d ' :   p o d I d + " _ p r e f " } ) . s e t S t y l e s ( { ' c l e a r ' :   ' b o t h ' ,   ' f l o a t ' :   ' n o n e ' } ) . i n j e c t ( t D i v ) ;  
                 v a r   b r T a g   =   n e w   E l e m e n t ( " b r " ) . i n j e c t ( n e w D i v ) ;  
                 v a r   p r e f D i v   =   n e w   E l e m e n t ( " d i v " ,   {   ' c l a s s ' :   ' p o d p r e f a r e a ' } ) . i n j e c t ( n e w D i v ) ;  
  
                 v a r   a d d O K B t n   =   f a l s e ;  
                 i f   ( g a d g e t P r e f N o d e )  
                 {  
                         v a r   s t r   =   " " ;  
                         f o r   ( v a r   i = 0 ;   i <   g a d g e t P r e f N o d e . c h i l d N o d e s . l e n g t h ;   i + + )   s t r   + =   g a d g e t P r e f N o d e . c h i l d N o d e s [ i ] . x m l ;  
                         p r e f D i v . i n n e r H T M L   =   p o d T o o l s . r e p l a c e T a g s ( o b j ,   s t r ) ;  
                          
                         v a r   i n p u t L i s t   =   p r e f D i v . g e t E l e m e n t s ( " i n p u t " ) ;  
                         i n p u t L i s t . e a c h ( f u n c t i o n ( i t e m )   {    
                                         v a r   i n p u t N a m e   =   i t e m . g e t A t t r i b u t e ( " i d " ) ;  
                                         / /   m a k e   t h e   i d   s p e c i f i c   t o   t h i s   p o d  
                                         i t e m . s e t A t t r i b u t e ( " i d " ,   p o d I d   +   i n p u t N a m e ) ;  
                                         / /   l o a d   t h e   d a t a   f r o m   t h e    
                                         v a r   n d   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B / P O D [ @ i d = ' "   +   p o d I d   +   " ' ] / P R E F / V A L U E [ @ n a m e = ' "   +   i n p u t N a m e   +   " ' ] " ) ;  
                                         i f   ( n d )  
                                         i t e m . s e t A t t r i b u t e ( " v a l u e " ,   n d . t e x t ) ;  
                                          
                                         a d d O K B t n   =   t r u e ;  
                                 } ) ;                          
                 }  
                 e l s e  
                 {  
                         v a r   s e t N o d e   =   _ p o d G a d g e t s . s e l e c t S i n g l e N o d e ( " / / P O D L I S T / C O N F I G / S E T T I N G [ @ i d = ' n o p r e f t e x t ' ] " ) ;  
                         i f   ( s e t N o d e )  
                         {  
                             p r e f D i v . i n n e r H T M L   =   p o d T o o l s . r e p l a c e T a g s ( o b j ,   s e t N o d e . x m l ) ;  
                         }  
 / / < P O D L I S T   x m l n s : v a l e t = " w w w . v a l e t m l s . c o m " >  
 / /     < C O N F I G >  
 / /         < S E T T I N G   i d = " n o p r e f t e x t " >  
 / /             < d i v > T h i s   p o d   d o e s   n o t   h a v e   a n y   s e t t i n g s   t h a t   c a n   b e   m o d i f i e d . < / d i v >  
 / /         < / S E T T I N G >  
 / /     < / C O N F I G >                  
                 }                  
  
 	 	 	 	 t r y  
 	 	 	 	 {  
 	                 v a r   b t n D i v   =   n e w   E l e m e n t ( " d i v " ,   {   ' c l a s s ' :   ' p o d p r e f b u t t o n a r e a ' } ) . i n j e c t ( p r e f D i v ) ;  
 	                 v a r   l e f t O b j     =   n e w   E l e m e n t ( " d i v " ) . s e t S t y l e ( " f l o a t " ,   " l e f t " ) . i n j e c t ( b t n D i v ) ;  
 	                 v a r   r i g h t O b j   =   n e w   E l e m e n t ( " d i v " ) . s e t S t y l e ( " f l o a t " ,   " r i g h t " ) . i n j e c t ( b t n D i v ) ;  
 	  
 	 	 	 	 	 i f   ( ( g a d g e t N o d e . g e t A t t r i b u t e ( " r e q u i r e d " )   ! =   " t r u e " )   & &  
 	 	 	 	 	 	 	 ( g a d g e t N o d e . g e t A t t r i b u t e ( " r e q u i r e d " )   ! =   " T R U E " )   & &  
 	 	 	 	 	 	 	 ( g a d g e t N o d e . g e t A t t r i b u t e ( " r e q u i r e d " )   ! =   " Y E S " )   & &  
 	 	 	 	 	         ( g a d g e t N o d e . g e t A t t r i b u t e ( " r e q u i r e d " )   ! =   " y e s " ) )  
 	                 	 v a r   b t n   =   n e w   E l e m e n t ( " b u t t o n " ,   {   ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {   p o d T o o l s . r e m o v e P o d ( p o d I d ,   t r u e ,   t r u e ) ;   }   }   } ) . s e t T e x t ( " R e m o v e " ) . i n j e c t ( r i g h t O b j ) ;  
 	                  
 	                 i f   ( a d d O K B t n )  
 	                 {  
 	                         v a r   b t n   =   n e w   E l e m e n t ( " b u t t o n " ,   {   ' c l a s s ' :   ' ' ,    
 	                                                                                             ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {     p o d T o o l s . s a v e P o d P r e f s ( p o d I d ) ;   }   }   } ) . s e t T e x t ( " O K " ) . i n j e c t ( l e f t O b j ) ;  
 	                         v a r   b t n   =   n e w   E l e m e n t ( " b u t t o n " ,   {   ' c l a s s ' :   ' ' ,  
 	                                                                                             ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {   p o d T o o l s . h i d e P o d P r e f s ( p o d I d ) ;   }   }   } ) . s e t T e x t ( " C a n c e l " ) . i n j e c t ( l e f t O b j ) ;  
 	                 }  
 	 	 	 	 }  
 	 	 	 	 c a t c h ( e r r )   { d e b u g g e r ;   }  
                 r e t u r n   n e w D i v ;  
         } ,    
                  
         " d s p L o a d D i s p l a y D i v "   :   f u n c t i o n   ( o b j ,   a t y p e )   {  
    
                 v a r   t y p e P r o p ;  
                 a t y p e   =   a t y p e . t o L o w e r C a s e ( ) ;  
                 i f   ( a t y p e = = " n o r m " )   t y p e P r o p = " n o r m d s p i d " ;  
                 e l s e   i f   ( a t y p e = = " m a x " )   t y p e P r o p = " m a x d s p i d " ;  
                 e l s e   a l e r t ( a t y p e   +   "   i s   a n   i n v a l i d   t y p e   p a s s e d   t o   d s p L o a d D i s a p l a y D i v " ) ;  
                  
                 v a r   p o d I d   =   o b j . i d ;  
                  
                 / / g e t   t h e   g a d g e t n o d e  
                 v a r   g a d g e t N o d e   =   t h i s . g e t G a d g e t D e f ( o b j . g e t A t t r i b u t e ( " r e f i d " ) ) ;  
  
 	 	 	  
 	 	 	 	 / /   c h e c k   t o   s e e   i f   w e   h a v e   a l l   o f   t h e   r e q u i r e d   p r e f e r e n c e s .     I f   w e   d o n ' t  
 	 	 	 	 / /   d i s p l a y   t h e n   o p e n   t h e   p r e f   a r e a   i n s t e a d   o f   t h e   d i s p l a y   a r e a .  
 	 	 	 	 v a r   p r e f N o d e   =   g a d g e t N o d e . s e l e c t S i n g l e N o d e ( " P R E F " ) ;  
 	 	 	 	 i f   ( p r e f N o d e )  
 	 	 	 	 {  
 	 	 	 	 	 v a r   r e q P r e f s   =   p r e f N o d e . g e t A t t r i b u t e ( " r e q u i r e d " ) ;  
 	 	 	 	 	 i f   ( r e q P r e f s )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 v a r   h a v e A l l   =   t r u e ;  
 	 	 	 	 	 	 v a r   f L i s t   =   r e q P r e f s . s p l i t ( " ; " ) ;  
 	 	 	 	 	 	 f o r   ( v a r   i = 0 ;   i < f L i s t . l e n g t h ;   i + + )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 v a r   i n p u t N a m e   =   f L i s t [ i ] ;  
 	 	 	 	 	 	 	 v a r   n d   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B / P O D [ @ i d = ' "   +   p o d I d   +   " ' ] / P R E F / V A L U E [ @ n a m e = ' "   +   i n p u t N a m e   +   " ' ] " ) ;  
                             i f   ( ! n d )   h a v e A l l   =   f a l s e ;  
                             e l s e   i f   ( ! n d . t e x t )   h a v e A l l   =   f a l s e ; 	 	 	 	 	 	  
 	 	 	 	 	 	 }  
 	 	 	 	 	  
 	 	 	 	 	     i f   ( h a v e A l l = = f a l s e )  
 	 	 	 	 	     {  
 	 	 	 	 	 	 	 p o d T o o l s . s h o w P o d P r e f s ( o b j ) ;  
  
 	 	 	 	 	 	 	 v a r   t m p O b j   =   o b j . g e t E l e m e n t s ( " d i v [ i d = ' "   +   p o d I d   +   " _ t i t l e ' ] " ) [ 0 ] ;  
                 	 	 	 i f   ( t m p O b j )   t m p O b j . r e m o v e C l a s s ( " r p b t a b b e d m e n u " ) ; 	 	 / / h i d e   t h e   d i v i d e r   l i n e   s i n c e   w e   d o n t   h a v e   a   s e c t i o n   t o   d i s p l a y 	 	 	 	 	  
 	 	 	 	 	 	 	  
 	 	 	 	 	 	 	 r e t u r n ;  
 	 	 	 	 	     } 	 	 	 	 	      
 	 	 	 	 	 }  
 	 	 	 	 }  
  
  
                 / / d e c i d e   w h i c h   n o d e    
                 v a r   d s p N o d e   =   g a d g e t N o d e . s e l e c t S i n g l e N o d e ( " . / / D I S P L A Y [ @ w h e n = ' a l l '   o r   @ w h e n = ' "   +   a t y p e   +   " ' ] " ) ;  
                 i f   ( ! d s p N o d e )   d s p N o d e   =   g a d g e t N o d e . s e l e c t S i n g l e N o d e ( " . / / D I S P L A Y " ) ;  
                                  
                 / / c r e a t e   t h e   d i v   w i t h   t h e   n o r m a l i z e d   i d  
                 v a r   c n t r d i v   =   $ ( p o d I d   +   ' _ c o n t e n t s ' ) ;  
                 v a r   n e w d i v   =   n e w   E l e m e n t ( " d i v " ,   {   ' i d ' :   o b j . g e t P r o p e r t y ( t y p e P r o p ) } ) . i n j e c t ( c n t r d i v ) ;  
  
                  
                 / /   r e m o v e   a n y   x m l   n o d e s   t h a t   t o   n o t   h a v e   h a v e   r e q u i r e d   p e r m i s s i o n s  
                 v a r   p e r m N o d e s   =   d s p N o d e . s e l e c t N o d e s ( " . / / * [ @ p e r m i s s i o n s ] " ) ;  
                 f o r   ( v a r   c = 0 ;   c   <   p e r m N o d e s . l e n g t h ;   c + + )  
                 {  
 	                 v a r   p e r m V a l u e   =   p e r m N o d e s [ c ] . g e t A t t r i b u t e ( " p e r m i s s i o n s " ) ;  
                     v a r   m a t c h   =   p e r m V a l u e . m a t c h ( / ( \ w + ) \ ( ( [ \ w , ] + ) \ ) / ) ;  
                     i f   ( m a t c h )   {  
 	 	 	 	 	 	 v a r   p a s s e d A l g o r i t h m   =   m a t c h [ 1 ] ;  
                     	 v a r   t e s t P e r m i s s i o n   =   m a t c h [ 2 ] ;  
 	 	 	 	 	 	  
 	 	 	 	 	 	 i f   ( _ a g t . p e r m i s s i o n T e s t ( t e s t P e r m i s s i o n ,   p a s s e d A l g o r i t h m )   = =   f a l s e )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 v a r   p N o d e   =   p e r m N o d e s [ c ] . p a r e n t N o d e ;  
 	 	 	 	 	 	 	 p N o d e . r e m o v e C h i l d ( p e r m N o d e s [ c ] ) ;  
                         }  
 	 	 	 	 	 }  
                 }  
  
                 / / f i l l   t h e   n e w   d i v   w i t h   t h e   d a t a   f r o m   t h e   g a d g e t  
                 n e w d i v . i n n e r H T M L   =   p o d T o o l s . r e p l a c e T a g s ( o b j ,   d s p N o d e . x m l ) ;  
                  
                 / /   a d d   t h e   h e i g h t   a t t r i b u t e   ( i f   i t   e x i s t s )   t o   t h e   n o m a l i z e d   d i s p l a y   a r e a .  
                 / /   t h e   n o r m a l i z e   f u n c t i o n   w i l l   s e t   t h e   h e i g h t   w h e n   w e   u s e   t h a t   d i v  
 	 	 	 	 v a r   p r e f N o d e   =   p o d T o o l s . g e t P r e f N o d e ( p o d I d ,   ' h e i g h t ' ) ;  
                 i f   ( a t y p e ! = " m a x "   & &   ( g a d g e t N o d e . g e t A t t r i b u t e ( " h e i g h t " )   | |   p r e f N o d e ) )    
                 {  
 	 	 	 	 	 v a r   h t ;  
 	 	 	 	 	 i f   ( p r e f N o d e )   h t   =   p r e f N o d e . t e x t ;  
 	 	 	 	 	 e l s e   h t   =   g a d g e t N o d e . g e t A t t r i b u t e ( " h e i g h t " ) ;  
                 	  
                 	 n e w d i v . s e t A t t r i b u t e ( " n o r m h e i g h t " ,   h t ) ;  
 	 	 	 	 	 n e w d i v . s e t S t y l e s ( { ' o v e r f l o w ' :   ' a u t o ' ,   ' m a r g i n - b o t t o m ' : ' 8 p x ' ,   ' o v e r f l o w - x ' :   ' h i d d e n '   }   ) ;  
                 }  
                  
                 p o d T o o l s . c h e c k P o d E v e n t ( o b j ,   " o n d i s p l a y l o a d " ) ;  
                  
                 r e t u r n   n e w d i v ;  
         } ,  
  
  
         " d r o p T h e P o d "   :   f u n c t i o n   ( )   {  
  
                 p o d T o o l s . d r o p S p o t s . e a c h ( f u n c t i o n ( d r o p ) {   d r o p . r e m o v e E v e n t s ( ) ;   } ) ;  
       	 	 	 	          
                 p o d T o o l s . d r a g P l a c e h o l d e r . p a r e n t N o d e . i n s e r t B e f o r e ( p o d T o o l s . d r a g O b j e c t ,   p o d T o o l s . d r a g P l a c e h o l d e r ) ;  
                 p o d T o o l s . d r a g P l a c e h o l d e r . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
  
                 p o d T o o l s . d r a g O b j e c t . s e t S t y l e ( ' d i s p l a y ' ,   ' b l o c k ' ) ;  
  
                 v a r   d r o p P o d I d   =   p o d T o o l s . d r a g O b j e c t . i d ;  
                 v a r   d r o p C o l   =   p o d T o o l s . d r a g O b j e c t . p a r e n t N o d e . i d . r e p l a c e ( p o d T o o l s . d r a g O b j e c t . t a b i d + " c o l " , " " ) ;  
                 v a r   d r o p A f t e r P o d I d   =   n u l l  
                 i f   ( p o d T o o l s . d r a g O b j e c t . p r e v i o u s S i b l i n g )   d r o p A f t e r P o d I d   =   p o d T o o l s . d r a g O b j e c t . p r e v i o u s S i b l i n g . i d  
                  
                 i f   ( p o d T o o l s . d r a g C l o n e )   p o d T o o l s . d r a g C l o n e . r e m o v e ( ) ;  
                 p o d T o o l s . d r a g C l o n e   =   n u l l ;          
                  
                 p o d T o o l s . c h e c k P o d E v e n t ( p o d T o o l s . d r a g O b j e c t ,   " o n d r o p " ) ;  
                 p o d T o o l s . n o t i f i c a t i o n . m o v e P o d ( d r o p P o d I d ,   d r o p C o l ,   d r o p A f t e r P o d I d ,   t r u e ) ;  
         } ,  
  
  
                  
         " d r a g S e t u p "   :   f u n c t i o n   ( i t e m )   {  
        
                 / /   d r a g S e t u p   m a y   b e   c a l l e d   m o r e   t h a n   o n c e  
                 / /   d r a g S e t u p   m u s t   b e   c a l l e d   a f t e r   t h e   c o l u m n s   a r e   c r e a t e d  
  
                 d r o p   =   $ ( ' p o d a r e a ' ) ;  
                 p o d T o o l s . d r o p S p o t s   =   $ $ ( ' . p o d c o l ' ) ;  
  
                 p o d T o o l s . d r a g P o d L i s t   =   n u l l ;  
                 p o d T o o l s . d r a g C o n t a i n e r I d   =   n u l l ;  
                 p o d T o o l s . d r a g O b j e c t   =   n u l l ;  
                 p o d T o o l s . i s D r a g g i n g = f a l s e ;  
  
                 i f   ( ! p o d T o o l s . d r a g P l a c e h o l d e r )  
                 {  
                         p o d T o o l s . d r a g P l a c e h o l d e r   =   n e w   E l e m e n t ( ' d i v ' ,   {  
                                 ' i d ' :   ' p o d p l a c e h o l d e r ' ,  
                                 ' c l a s s ' :   ' p o d p l a c e h o l d e r ' ,  
                                 ' s t y l e s ' :   {  
                                         ' d i s p l a y ' :   ' n o n e '  
                                 }              
                         } ) ;  
                 }  
                 e l s e   p o d T o o l s . d r a g P l a c e h o l d e r   =   $ ( p o d T o o l s . d r a g P l a c e h o l d e r ) ;  
         } ,  
  
                  
         " d r a g A d d E v e n t s T o P o d "   :   f u n c t i o n   ( i t e m )   {  
  
 	         i t e m . a d d E v e n t ( ' m o u s e d o w n ' ,   f u n c t i o n ( e )   {  
  
 	 	         e   =   n e w   E v e n t ( e ) . s t o p ( ) ;  
                 i f   ( e . t a r g e t . t a g N a m e   = =   ' A ' )   r e t u r n ;  
  
                 p o d T o o l s . d r a g P o d L i s t   =   n u l l ;     / / s t a r t   w i t h   a   f r e s h   l i s t   o f   p o d   l o c a i t o n s  
                 v a r   p o d I d   =   t h i s . g e t P r o p e r t y ( " o w n e r i d " ) ;  
                 v a r   o w n e r P o d   =   $ ( p o d I d ) ;  
                  
                 / /   d o n ' t   a l l o w   m a x i m i z e d   p o d s   t o   d r a g  
                 i f   ( o w n e r P o d . h a s C l a s s ( " m a x i m i z e d p o d " ) )   r e t u r n ;  
  
                 v a r   c o o r d   =   o w n e r P o d . g e t C o o r d i n a t e s ( ) ;  
                  
                 i f   ( p o d T o o l s . d r a g C l o n e )   {   p o d T o o l s . d r o p T h e P o d ( ) ;   r e t u r n ;   }  
  
 	 	         / / v a r   p o d T o o l s . d r a g C l o n e   =   t h i s ;  
 	 	         p o d T o o l s . d r a g C l o n e   =   o w n e r P o d . c l o n e ( )  
 	 	 	         . s e t S t y l e s ( c o o r d )   / /   t h i s   r e t u r n s   a n   o b j e c t   w i t h   l e f t / t o p / b o t t o m / r i g h t ,   s o   i t s   p e r f e c t  
 	 	 	         / / . s e t S t y l e s ( t h i s . g e t C o o r d i n a t e s ( ) )   / /   t h i s   r e t u r n s   a n   o b j e c t   w i t h   l e f t / t o p / b o t t o m / r i g h t ,   s o   i t s   p e r f e c t  
 	 	 	         . s e t S t y l e s ( { ' o p a c i t y ' :   0 . 7 ,   ' p o s i t i o n ' :   ' a b s o l u t e ' } )  
 	 	 	         . a d d E v e n t ( ' e m p t y d r o p ' ,   f u n c t i o n ( )   { 	  
                         	 	 p o d T o o l s . d r o p T h e P o d ( ) ;  
 	 	 	         } ) ;  
 	 	 	     p o d T o o l s . d r a g C l o n e . i d = " d r a g c l o n e " ;  
 	 	 	     p o d T o o l s . d r a g C l o n e . i n j e c t ( d o c u m e n t . b o d y ) ;  
 	 	         p o d T o o l s . d r a g C l o n e . s e t S t y l e s ( { ' l e f t ' :   c o o r d . l e f t ,   ' t o p ' :   c o o r d . t o p ,   ' w i d t h ' :   c o o r d . w i d t h ,   ' h e i g h t ' :   c o o r d . h e i g h t   } )  
 	 	         p o d T o o l s . d r a g C l o n e . a d d C l a s s ( ' d r a g i t e m ' ) ;  
  
             p o d T o o l s . d r a g C l o n e . a d d E v e n t s ( {  
                       ' m o u s e m o v e ' :   f u n c t i o n ( )   {  
  
  
                         i f   ( p o d T o o l s . i s D r a g g i n g = = t r u e )  
                         {  
                                 / /   B u i l d   t h e   p o d   l i s t  
 	 	 	                     i f   ( ! p o d T o o l s . d r a g P o d L i s t )   {  
 	 	 	                         p o d T o o l s . d r a g P o d L i s t   =   n e w   A r r a y ( ) ;  
 	 	 	                         v a r   p c l i s t   =   $ $ ( ' . p o d c o l ' ) ;  
 	 	 	                         f o r   ( v a r   i = 0 ;   i   <   p c l i s t . l e n g t h ;   i + + )   {  
 	 	 	                             f o r   ( v a r   n = 0 ;   n   <   p c l i s t [ i ] . c h i l d N o d e s . l e n g t h ;   n + + )   {  
 	 	                                     v a r   t h i s p o d   =   p c l i s t [ i ] . c h i l d N o d e s [ n ] ;  
 	 	 	                                 i f   ( t h i s p o d . n o d e N a m e . t o U p p e r C a s e ( )   = =   " D I V "   & &   ( t h i s p o d . c u r r e n t S t y l e . p o s i t i o n   ! =   " a b s o l u t e "   & &   t h i s p o d . c u r r e n t S t y l e . d i s p l a y   ! =   ' n o n e ' ) ) {  
 	 	 	                                     v a r   p o d c o o r d   =   t h i s p o d . g e t C o o r d i n a t e s ( ) ;  
     	 	 	                                 p o d T o o l s . d r a g P o d L i s t . p u s h ( [ [ p c l i s t [ i ] . i d ] , [ t h i s p o d ] , [ p o d c o o r d . t o p   +   p a r s e I n t ( p o d c o o r d . h e i g h t / 2 ) ] , [ t h i s p o d ] ] ) ;  
     	 	 	                             }  
 	 	 	                             }  
 	 	 	                         }  
 	 	 	                     }  
  
 	 	 	                     v a r   c u r C o n t I d   =   t h i s . p a r e n t N o d e . i d ;  
 	 	 	                     v a r   d r a g I t e m   =   $ $ ( ' . d r a g i t e m ' ) [ 0 ] ;  
 	 	 	                     i f   ( d r a g I t e m )  
 	 	 	                     {  
 	 	 	                             v a r   d r a g O b j C o o r d   =   d r a g I t e m . g e t C o o r d i n a t e s ( ) ;  
 	 	 	                             v a r   d r a g C e n t e r   =   d r a g O b j C o o r d . t o p   +   p a r s e I n t ( d r a g O b j C o o r d . h e i g h t / 2 ) ;  
                                         v a r   d r o p B e f o r e   =   n u l l ;  
                                         f o r   ( i = 0 ;   i   <   p o d T o o l s . d r a g P o d L i s t . l e n g t h ;   i + + )   {  
                                             i f   ( p o d T o o l s . d r a g P o d L i s t [ i ] [ 0 ] = = p o d T o o l s . d r a g C o n t a i n e r I d )   {  
                                                 i f   ( d r a g C e n t e r   <   p o d T o o l s . d r a g P o d L i s t [ i ] [ 2 ] )   {  
                                                     d r o p B e f o r e   =   p o d T o o l s . d r a g P o d L i s t [ i ] [ 3 ] ;  
                                                     b r e a k ;  
                                                 }  
                                             }  
                                         }  
                                                  
  
                                         p o d T o o l s . d r a g P l a c e h o l d e r   =   $ ( ' p o d p l a c e h o l d e r ' ) ;  
                                         v a r   c o n t a i n e r N o d e   =   $ ( p o d T o o l s . d r a g C o n t a i n e r I d ) ;  
                                         i f   ( ! d r o p B e f o r e )   {  
                                             c o n t a i n e r N o d e . a p p e n d C h i l d ( p o d T o o l s . d r a g P l a c e h o l d e r ) ;  
                                         }    
                                         e l s e   {  
                                             i f   ( ( d r o p B e f o r e [ 0 ] . p r e v i o u s S i b l i n g   = =   n u l l   | |   d r o p B e f o r e [ 0 ] . p r e v i o u s S i b l i n g . i d ! = " p o d p l a c e h o l d e r " )  
                                                       & &   d r o p B e f o r e [ 0 ] . i d   ! =   " p o d p l a c e h o l d e r " )   {  
                                                     c o n t a i n e r N o d e . i n s e r t B e f o r e ( p o d T o o l s . d r a g P l a c e h o l d e r ,   d r o p B e f o r e [ 0 ] ) ;  
                                                     / / p o d T o o l s . d r a g P o d L i s t . e m p t y ( ) ;  
                                                     p o d T o o l s . d r a g P o d L i s t   =   n u l l ;  
                                             }  
                                         }  
  
                                         / / v a r   p c o l   =   p o d T o o l s . d r a g P l a c e h o l d e r . g e t P a r e n t ( ) ;  
                                         v a r   w   =   c o n t a i n e r N o d e . o f f s e t W i d t h   -   p a r s e I n t ( c o n t a i n e r N o d e . g e t S t y l e ( ' p a d d i n g L e f t ' ) )   -   p a r s e I n t ( c o n t a i n e r N o d e . g e t S t y l e ( ' p a d d i n g R i g h t ' ) )   -   4 ;    
                                         p o d T o o l s . d r a g P l a c e h o l d e r . s e t S t y l e ( " w i d t h " ,   w ) ;  
  
  
 / /   T h e   h o m e p a g e   h a s   a   p l a c e h o l d e r   i n   t h e   n a v c o n t a i n e r   t h a t   l e t s   u s   t h r o w   i n   s o m e   d e b u g g i n g   d a t a  
 / /   T h i s   i s   a n   e x a m p l e   o f   h o w   t o   p o p u l a t e   t h a t   s e c t i o n .  
 / /   v a r   e   =   n e w   E l e m e n t ( ' d i v ' ) . s e t T e x t ( c o n t a i n e r N o d e . i d   +   "   /   "   +   w ) . i n j e c t ( $ ( ' m y I n f o ' ) ) ;  
  
                                 }  
                         }  
  
  
                       } ,  
                       ' m o u s e u p ' :   f u n c t i o n ( )   {  
                           p o d T o o l s . i s D r a g g i n g   =   f a l s e ;  
                       }  
             } ) ;  
  
  
                 p o d T o o l s . d r a g P l a c e h o l d e r . s e t S t y l e s ( { ' d i s p l a y ' :   " " ,   ' h e i g h t ' :   c o o r d . h e i g h t ,   ' w i d t h ' :   c o o r d . w i d t h - 4   } ) ;  
                 p o d T o o l s . d r a g P l a c e h o l d e r . i n j e c t ( o w n e r P o d . i d , ' b e f o r e ' )                
                
  
  
                 p o d T o o l s . d r a g O b j e c t   =   o w n e r P o d ;  
                 p o d T o o l s . d r a g O b j e c t . s e t S t y l e ( ' d i s p l a y ' ,   ' n o n e ' ) ;  
  
            
                 p o d T o o l s . d r o p S p o t s . e a c h ( f u n c t i o n ( d r o p ) {  
 	 	                 d r o p . a d d E v e n t s ( {  
 	 	 	                 ' d r o p ' :   f u n c t i o n ( e l e m e n t ,   d r o p p a b l e )   {  
 	 	 	                  
 	 	 	                         p o d T o o l s . d r o p T h e P o d ( ) ;  
 	 	 	                         r e t u r n ;  
 	 	 	                  
 	 	 	                 } ,  
 	 	 	                 ' o v e r ' :   f u n c t i o n ( )   {  
 	 	 	                     / / t h i s . s t y l e . b a c k g r o u n d C o l o r = " # 9 8 B 5 C 1 "  
  
 	 	 	                     p o d T o o l s . i s D r a g g i n g   =   t r u e ;  
 	 	 	                     p o d T o o l s . d r a g C o n t a i n e r I d   =   t h i s . i d ;  
 	 	 	    
 	 	 	   	 	 	 	 	 / /   r e s e t   t h e   w i d t h   o f   t h e   p o d   p l a c e h o l d e r   ( d o t t e d   b o x )   t o   z e r o .     T h e   t r u e   w i d t h   w i l l  
 	 	 	   	 	 	 	 	 / /   b e   s e t   i n s i d e   o f   t h e   m o u s e m o v e   e v e n t .     W e   n e e d   t o   s e t   t h e   w i d t h   t o   z e r o   b e c a u s e  
 	 	 	   	 	 	 	 	 / /   s o m e t i m e s   ( i e 6 )   t h e   p l a c e h o l d e r   c h a n g e s   t h e   d r o p   c o l u m n   w i d t h .     H o w e v e r ,   i t   i s   t h e    
 	 	 	   	 	 	 	 	 / /   d r o p   c o l u m n   t h a t   s h o u l d   d e t e r m i n   t h e   w i d t h   o f   t h e   d r a g P l a c e H o l d e r .  
 	 	 	 	 	 	 	 	 i f   ( p o d T o o l s . d r a g P l a c e h o l d e r )   p o d T o o l s . d r a g P l a c e h o l d e r . s e t S t y l e ( " w i d t h " ,   0 ) ;  
 	 	 	                      
 	 	 	                 } ,  
 	 	 	                 ' l e a v e ' :   f u n c t i o n ( )   {  
 	 	 	                     / / t h i s . s t y l e . b a c k g r o u n d C o l o r = " # f f f f f f "  
 	 	 	                 }  
 	 	                 } ) ;  
                 } ) ;  
            
 	 	         v a r   d r a g   =   p o d T o o l s . d r a g C l o n e . m a k e D r a g g a b l e ( {  
 	 	 	         d r o p p a b l e s :   ' . p o d c o l '  
 	 	         } ) ;   / /   t h i s   r e t u r n s   t h e   d r a g g e d   e l e m e n t  
            
 	 	         d r a g . s t a r t ( e ) ;   / /   s t a r t   t h e   e v e n t   m a n u a l  
  
 	         } ) ;  
                
         } ,  
                  
 / *   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *   * /  
 / *   *       H e l p e r   F u n c t i o n                                                                                                                                                     *   * /  
 / *   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *   * /  
  
 	 	 " g e t P r e f N o d e "   :   f u n c t i o n   ( p o d I d ,   p r e f N a m e )   {  
 	 	 	 r e t u r n   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " . / / P O D [ @ i d = ' "   +   p o d I d   +   " ' ] / P R E F / V A L U E [ @ n a m e = ' "   +   p r e f N a m e   +   " ' ] " ) ;  
 	 	 } ,    
                  
         " r e p l a c e T a g s "   :   f u n c t i o n   ( o b j ,   s t r )   {  
        
             / /   I f   t h e r e   a r e n ' t   a n y   t a g s ,   e x i t   t h e   f u n c t i o n    
             i f   ( s t r . t e s t ( " { { " ) = =   f a l s e )   r e t u r n   s t r ;    
  
             / /   C h e c k   f o r   p o d   p r e f e r e n c e   t a g s  
             i f   ( s t r . t e s t ( " { { p o d p r e f " ) = = t r u e )  
             {  
                 v a r   p r e f N o d e ;  
                 p r e f N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " . / / P O D [ @ i d = ' "   +   o b j . i d   +   " ' ] / P R E F " ) ;  
                 i f   ( p r e f N o d e )   {  
                     v a r   c n t   =   t r u e ;  
                     w h i l e   ( c n t = = t r u e )   {  
                         v a r   m a t c h   =   s t r . m a t c h ( / { { p o d p r e f \ ( ( \ w + ) \ ) } } / ) ;  
                         i f   ( m a t c h )   {  
                             v a r   v a l N o d e   =   p r e f N o d e . s e l e c t S i n g l e N o d e ( " V A L U E [ @ n a m e = ' "   +   m a t c h [ 1 ]   +   " ' ] " ) ;  
                             i f   ( v a l N o d e )   s t r   =   s t r . r e p l a c e ( m a t c h [ 0 ] ,   v a l N o d e . t e x t ) ;  
                             e l s e   {   a l e r t ( " r e p l a c e   t a g s   w a s   l o o k i n g   f o r   t h e   p r e f e r e n c e s   ' "   +   m a t c h [ 1 ]   +   " '   b u t   d i d n ' t   f i n d   i t . " ) ;   c n t   =   f a l s e ;   }  
                         }  
                         e l s e  
                             c n t = f a l s e ;  
                     }  
                 }  
             }  
  
             / /   C h e c k   f o r   l o g i n   d a t a   t a g s  
             i f   ( s t r . t e s t ( " { { l o g i n d a t a " ) = = t r u e )  
             {  
                 i f   ( p o d T o o l s . l o g i n D a t a X M L   = =   n u l l )   a l e r t ( " Y o u   a r e   t r y i n g   t o   i n c l u d e   l o g i n d a t a   t a g s   b u t   h a v e   s e t   p o d T o o l s . l o g i n D a t a X M L   t o   t h e   l o g i n   X M L   s t r u c t u r e . " )  
                 e l s e   {  
                     v a r   c n t   =   t r u e ;  
                     w h i l e   ( c n t = = t r u e )   {  
                         v a r   m a t c h   =   s t r . m a t c h ( / { { l o g i n d a t a \ ( ( \ w + ) \ ) } } / ) ;  
                         i f   ( m a t c h )   {  
                         	 i f   ( m a t c h [ 1 ] . t o L o w e r C a s e ( )   = =   ' p a s s w o r d ' )  
                         	 {  
                         	 	 s t r   =   s t r . r e p l a c e ( m a t c h [ 0 ] ,   m a i n W i n d o w . a g t . p a s s w o r d ) ;  
                         	 }  
                         	 e l s e  
                         	 {  
 	                             v a r   v a l N o d e   =   p o d T o o l s . l o g i n D a t a X M L . s e l e c t S i n g l e N o d e ( " / / "   +   m a t c h [ 1 ] ) ;  
 	                             i f   ( v a l N o d e )   s t r   =   s t r . r e p l a c e ( m a t c h [ 0 ] ,   v a l N o d e . t e x t ) ;  
 	                             e l s e   s t r   =   s t r . r e p l a c e ( m a t c h [ 0 ] ,   m a t c h [ 1 ]   +   "   n o t   f o u n d " ) ;  
                             }  
                         }  
                         e l s e  
                             c n t = f a l s e ;  
                     }  
                 }  
             }  
  
             / /   C h e c k   f o r   o b j e c t   s o u r c e   t a g s   ( l i k e   a g e n t   p h o t o )  
             i f   ( s t r . t e s t ( " { { o b j s r c " ) = = t r u e )  
             {  
                 i f   ( p o d T o o l s . l o g i n D a t a X M L   = =   n u l l )   a l e r t ( " Y o u   a r e   t r y i n g   t o   i n c l u d e   l o g i n d a t a   t a g s   b u t   h a v e   s e t   p o d T o o l s . l o g i n D a t a X M L   t o   t h e   l o g i n   X M L   s t r u c t u r e . " )  
                 e l s e   {  
                     v a r   c n t   =   t r u e ;  
                     w h i l e   ( c n t = = t r u e )   {  
                         v a r   m a t c h   =   s t r . m a t c h ( / { { o b j s r c \ ( ( \ w + ) \ ) } } / ) ;  
                         i f   ( m a t c h )   {  
                             v a r   v a l N o d e   =   p o d T o o l s . l o g i n D a t a X M L . s e l e c t S i n g l e N o d e ( " / / O B J E C T S / @ "   +   m a t c h [ 1 ] . t o U p p e r C a s e ( ) ) ;  
                             i f   ( v a l N o d e )   s t r   =   s t r . r e p l a c e ( m a t c h [ 0 ] ,   u n e s c a p e ( v a l N o d e . t e x t ) ) ;  
                             e l s e   s t r   =   s t r . r e p l a c e ( m a t c h [ 0 ] ,   m a t c h [ 1 ]   +   "   n o t   f o u n d " ) ;  
                         }  
                         e l s e  
                             c n t = f a l s e ;  
                     }  
                 }  
             }  
  
 	 	 	 / /   C a l l   a    
 	 	 	 i f   ( s t r . t e s t ( " { { f u n c t i o n : " ) = = t r u e )  
 	 	 	 {  
                 v a r   c n t   =   t r u e ;  
                 w h i l e   ( c n t = = t r u e )   {  
  
 	 	 	 	 	 / /   v a r   m a t c h   =   s t r . m a t c h ( / { { f u n c t i o n : ( . * ) \ ( ( . * ) \ ) } } / ) ;  
 	 	 	 	 	 v a r   m a t c h   =     s t r . m a t c h ( / { { f u n c t i o n : ( ( . * ) \ ( ( . * ) \ ) ) } } / ) ;  
 	 	 	 	 	 i f ( m a t c h )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 v a r   f u l l F u n c   =   m a t c h [ 1 ] ;  
 	 	 	 	 	 	 v a r   f u n c N a m e   =   m a t c h [ 2 ] ;  
 	 	 	 	 	 	 v a r   p a r m s N a m e   =   m a t c h [ 3 ] ;  
 	 	 	 	 	 	  
 	 	 	 	 	 	 v a r   v a l N o d e   =   e v a l ( f u l l F u n c ) ;  
 	 	 	 	 	 	 s t r   =   s t r . r e p l a c e ( m a t c h [ 0 ] ,   v a l N o d e ) ;  
 	 	 	 	 	 }  
                     e l s e  
                         c n t = f a l s e ;  
                 }  
 	 	 	 	  
 	 	 	 }  
 	 	 	  
              
             s t r   =   s t r . r e p l a c e ( / { { p o d i d } } / g ,   o b j . i d ) ;  
              
             r e t u r n   s t r ;  
         } ,  
  
         " s e t P o d A r e a M i n H e i g h t " :   f u n c t i o n ( )   {  
          
                 v a r   w i n H   =   w i n d o w . s i z e ( ) . h e i g h t ;  
                 v a r   h e a d H   =   0 ;  
                 v a r   f o o t H   =   0 ;  
                 v a r   p o d H   =   0 ;  
                  
                 v a r   o b j ;  
                 o b j   =   $ ( ' h e a d e r A r e a ' ) ;   i f   ( o b j )   h e a d H   =   o b j . g e t C o o r d i n a t e s ( ) . h e i g h t ;  
                 o b j   =   $ ( ' f o o t e r A r e a ' ) ;   i f   ( o b j )   f o o t H   =   o b j . g e t C o o r d i n a t e s ( ) . h e i g h t ;  
                  
                 v a r   m i n H   =   w i n H   -   h e a d H   -   f o o t H   -   1 0 ;  
                 $ ( ' h e i g h t f i l l e r ' ) . s e t S t y l e ( " h e i g h t " ,   m i n H ) ;  
         } ,  
  
  
         " r e s i z e M a x i m i z e d P o d " :   f u n c t i o n ( )   {  
 	 	 	 	 p o d T o o l s . r e s i z e M a x P o d W i d t h ( ) ;  
 	 	 	 	 p o d T o o l s . r e s i z e M a x P o d H e i g h t ( ) ;  
 	 	 } ,  
  
         " r e s i z e M a x P o d W i d t h " :   f u n c t i o n ( )   {         	  
 	 	 	 	 / / f i n d   m a x i m i z e d   p o d  
 	 	 	 	 v a r   m p   =   $ ( ' m a x i m i z e d p o d ' ) ;  
 	 	 	 	 i f   ( m p   & &   m p . c h i l d r e n . l e n g t h   >   0 )  
 	 	 	 	 { 	 	 	 	 	  
 	 	 	 	 	 / /   f i n d   t h e   m a x   d i s p l a y   d i v  
 	 	 	 	     v a r   m a x d s p i d   =   m p . g e t F i r s t ( ) . g e t A t t r i b u t e ( " m a x d s p i d " ) ;  
 	 	 	 	     i f   ( m a x d s p i d )  
 	 	 	 	     {  
 	 	 	     	 	 v a r   m a x d i v   =   $ ( m a x d s p i d ) ;  
 	 	 	 	 	 	  
 	 	 	 	 	 	 i f   ( m a x d i v )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 / / f i n d   t h e   f r a m e  
 	 	 	 	 	 	 	 v a r   f m   =   m a x d i v . g e t E l e m e n t s ( " i f r a m e " ) [ 0 ] ;  
 	 	 	 	 	 	 	 i f   ( f m )  
 	 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 	 v a r   p a   =   $ ( ' p o d a r e a ' ) . g e t C o o r d i n a t e s ( ) ;  
 	 	 	 	 	 	 	 	 f m . s e t S t y l e ( " w i d t h " ,   p a . w i d t h ) ;    
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 } ,  
  
  
         " r e s i z e M a x P o d H e i g h t " :   f u n c t i o n ( z z )   {  
 	 	 	 	 / / f i n d   m a x i m i z e d   p o d  
 	 	  
 	 	 	 	 v a r   m p   =   $ ( ' m a x i m i z e d p o d ' ) ;  
 	 	 	 	 i f   ( m p   & &   m p . c h i l d r e n . l e n g t h   >   0 )  
 	 	 	 	 {  
 	 	 	 	 	 / /   f i n d   t h e   m a x   d i s p l a y   d i v  
 	 	 	 	     v a r   m a x d s p i d   =   m p . g e t F i r s t ( ) . g e t A t t r i b u t e ( " m a x d s p i d " ) ;  
 	 	 	 	     i f   ( m a x d s p i d )  
 	 	 	 	     {  
 	 	 	     	 	 v a r   m a x d i v   =   $ ( m a x d s p i d ) ;  
 	 	 	 	 	 	  
 	 	 	 	 	 	 i f   ( m a x d i v )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 / / f i n d   t h e   f r a m e  
 	 	 	 	 	 	 	 v a r   f m   =   m a x d i v . g e t E l e m e n t s ( " i f r a m e " ) [ 0 ] ;  
 	 	 	 	 	 	 	 i f   ( f m )  
 	 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 	 v a r   f t   =   $ ( ' f o o t e r A r e a ' ) ;  
 	 	 	 	 	 	 	 	 v a r   h t   =   w i n d o w . s i z e ( ) . h e i g h t   -   f m . g e t C o o r d i n a t e s ( ) . t o p ;  
 	 	 	 	 	 	 	 	 i f   ( f t )   h t   - =   f t . g e t C o o r d i n a t e s ( ) . h e i g h t ;  
 	 	 	 	 	 	 	 	 f m . s e t S t y l e ( " h e i g h t " ,   h t ) ;  
 	 	 	 	 	 	 	 }  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 }  
 	 	 } ,  
 	 	  
 	 	 " c l o s e M a x i m i z e d P o d " :   f u n c t i o n ( p o s t C h g )   {  
  
 	 	 	 	 v a r   m p   =   $ ( ' m a x i m i z e d p o d ' ) ;  
 	 	 	 	 i f   ( m p )  
 	 	 	 	 {  
 	 	 	 	 	 v a r   p o d N o d e   =   m p . g e t E l e m e n t ( ' d i v . p o d ' ) ;  
 	 	 	 	 	 i f   ( p o d N o d e )   p o d T o o l s . r e m o v e P o d ( p o d N o d e . g e t P r o p e r t y ( ' i d ' ) ,   t r u e ,   p o s t C h g ) ;  
 	 	 	 	 }  
 	 	 	  
 	 	 } ,  
  
  
                  
 / *   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *   * /  
 / *   *       B U I L D   F u n c t i o n                                                                                                                                                     *   * /  
 / *   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *   * /  
          
         " g e t U n i q u e P o d I d " :   f u n c t i o n ( p o d I d )   {  
  
                 i f   ( ! p o d I d )   p o d I d   =   " p o d " ;  
                  
                 i f   ( $ ( p o d I d ) )  
                 {    
                     v a r   i   =   0 ;  
                     w h i l e   ( $ ( p o d I d + i ) )   i + + ;  
                     p o d I d   =   p o d I d + i ;  
                 }  
                  
                 r e t u r n   p o d I d ;  
         } ,  
          
         " i n s e r t W i n d o w N a v P o d " :   f u n c t i o n ( g a d g e t I d ,   p o d I d ,   p o d L a b e l ,   a r g u m e n t s )   {  
  
 	 	 	 	 v a r   g a d g e t N o d e   =   p o d T o o l s . g e t G a d g e t D e f ( g a d g e t I d ) ;  
 	 	 	 	 v a r   z o n e   =   g a d g e t N o d e . g e t A t t r i b u t e ( " z o n e " ) ;  
  
                 v a r   t a b I d ;  
                 v a r   t a b L a b e l ;  
                 v a r   d r o p C o l N u m   =   1 ;  
  
 	 	 	 	 s w i t c h ( z o n e . t o L o w e r C a s e ( ) )  
 	 	 	 	 {  
 	 	 	 	 	 c a s e   " s e a r c h " :  
 	 	 	 	 	 	 t a b I d   =   " s e a r c h "   +   p o d T o o l s . c u s t o m T a b S u f f i x ;  
 	 	 	 	 	 	 t a b L a b e l   =   " S e a r c h e s " ;  
 	 	 	 	 	 	 b r e a k ;  
 	 	 	 	 	 c a s e   " u p d a t e " :  
 	 	 	 	 	 	 t a b I d   =   " u p d a t e "   +   p o d T o o l s . c u s t o m T a b S u f f i x ;  
 	 	 	 	 	 	 t a b L a b e l   =   " U p d a t e s " ;  
 	 	 	 	 	 	 b r e a k ;  
 	 	 	 	 	 d e f a u l t :  
 	 	 	 	 	 	 t a b I d   =   " w i n d o w "   +   p o d T o o l s . c u s t o m T a b S u f f i x ;  
 	 	 	 	 	 	 t a b L a b e l   =   " W i n d o w s " ;  
 	 	 	 	 	 	 b r e a k ;  
 	 	 	 	 }              
                  
                 / /   M a k e   s u r e   t h e   t a b   e x i s t s .     I f   i t   d o e s n ' t   c r e a t e   i t  
                 v a r   t O b j   =   $ ( t a b I d ) ;  
                 i f   ( ! t O b j )  
                 {                
                     i f   ( ! t a b L a b e l )   t a b L a b e l   =   t a b I d ;  
                     t O b j   =   p o d T o o l s . i n s e r t T a b ( t a b I d ,   t a b L a b e l ,   n u l l ,   t r u e ,   f a l s e ) ;  
                 }  
  
                 p o d I d   =   p o d T o o l s . g e t U n i q u e P o d I d ( p o d I d ) ;  
  
                 / /   A d d   p o d   t o   n a v t r e e  
                 p o d T o o l s . d s p N a v T r e e _ A d d P o d ( t O b j ,   p o d I d ,   g a d g e t I d ,   p o d L a b e l )  
  
                 / /   A d d   p o d   t o   p o d a r e a  
                 v a r   d r o p C o l   =   $ ( t a b I d + ' c o l ' + d r o p C o l N u m ) ;  
                 i f   ( ! d r o p C o l )   d r o p C o l   =   $ ( t a b I d + ' c o l 1 ' ) ;  
                 i f   ( ! d r o p C o l )   {   a l e r t ( " c a n ' t   f i n d   a   c o l u m n   t o   d r o p   t h e   p o d . " ) ;   r e t u r n ;   }  
                    
                    
                    
 / /                     v a r   d o c   =   p o d T o o l s . d a s h O p t s . d o c u m e n t E l e m e n t . o w n e r D o c u m e n t ;  
 / /                     v a r   p o d T a b N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S " ) . a p p e n d C h i l d ( d o c . c r e a t e E l e m e n t ( " P O D T A B " ) )  
 / /                     p o d T a b N o d e . s e t A t t r i b u t e ( " i d " ,   t a b I d ) ;  
 / /                     p o d T a b N o d e . s e t A t t r i b u t e ( " l a b e l " ,   t a b L a b e l ) ;  
 / /                     v a r   n e w P o d   =   p o d T a b N o d e . a p p e n d C h i l d ( d o c . c r e a t e E l e m e n t ( " P O D " ) ) ;  
 / /                     n e w P o d . s e t A t t r i b u t e ( " i d " ,   p o d I d ) ;  
 / /                     n e w P o d . s e t A t t r i b u t e ( " r e f i d " ,   g a d g e t I d ) ;  
 / /                     / / n e w P o d . s e t A t t r i b u t e ( " l a b e l " ,   p o d L a b e l ) ;  
 / /                     n e w P o d . s e t A t t r i b u t e ( " d i s p l a y " ,   " m a x " ) ;  
 / /                     n e w P o d . s e t A t t r i b u t e ( " c o l " ,   " 1 " ) ;  
  
  
                 / /   U p d a t e   d a s h b o a r d   X M L  
                 v a r   n e w P o d   =   p o d T o o l s . n o t i f i c a t i o n . i n s e r t P o d ( t a b I d ,   p o d I d ,   1 ,   n u l l ,   g a d g e t I d ,   p o d L a b e l ,   f a l s e )    
                 n e w P o d . s e t A t t r i b u t e ( " d i s p l a y " ,   " m a x " ) ;  
  
                  
 	 	 	 	  
 	 	 	 	 i f   ( a r g u m e n t s )  
 	 	 	 	 {  
 	 	 	 	 	 v a r   d o c   =   n e w P o d . o w n e r D o c u m e n t ;  
 	 	 	 	     v a r   p r e f N o d e   =   n e w P o d . a p p e n d C h i l d ( d o c . c r e a t e E l e m e n t ( " P R E F " ) ) ;  
 	 	 	 	     v a r   a r g s   =   a r g u m e n t s . s p l i t ( " ; " ) ;  
 	 	 	 	     f o r   ( v a r   i = 0 ;   i <   a r g s . l e n g t h ;   i + + )  
 	 	 	 	     {  
 	 	 	 	         v a r   p a r t s   =   a r g s [ i ] . s p l i t ( " = " ) ;  
 	 	 	 	         i f   ( p a r t s . l e n g t h   ! =   2 )   a l e r t ( ' I   e x p e c t e d   t o   s e e   t w o   a n   e q u a l   s i g n   i n   ( '   +   a r g s [ i ]   + ' )   w h i c h   i s   p a r t   '   +   i   + '   o f   '   +   a r g u m e n t s ) ;  
 	 	 	 	         v a r   v a l N o d e   =   d o c . c r e a t e E l e m e n t ( " V A L U E " ) ;  
 	 	 	 	         v a l N o d e . s e t A t t r i b u t e ( " n a m e " ,   p a r t s [ 0 ] ) ;  
 	 	 	 	         v a l N o d e . 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 ( u n e s c a p e ( p a r t s [ 1 ] ) ) ) ;  
 	 	 	 	         p r e f N o d e . a p p e n d C h i l d ( v a l N o d e ) ;  
 	 	 	 	     }  
 	 	 	 	 }                  
 	 	 	 	                            
              
              
                 p o d T o o l s . d s p P o d A r e a _ B u i l d P o d   ( p o d I d ,   g a d g e t I d ,   t a b I d ,   n u l l ,   d r o p C o l )  
              
                 p o d T o o l s . s e l e c t P o d ( p o d I d ,   t a b I d ) ;      
                  
                 r e t u r n   p o d I d ;  
  
         } ,  
          
         " i n s e r t M e s s a g e N a v P o d " :   f u n c t i o n ( g a d g e t I d ,   p o d I d ,   p o d L a b e l ,   a r g u m e n t s )   {  
  
                 v a r   t a b I d   =   p o d T o o l s . m e s s a g e T a b I d ;  
                 v a r   t a b L a b e l   =   " M e s s a g e s " ;  
                 v a r   d r o p C o l N u m   =   1 ;  
              
                  
                 / /   M a k e   s u r e   t h e   t a b   e x i s t s .     I f   i t   d o e s n ' t   c r e a t e   i t  
                 v a r   t O b j   =   $ ( t a b I d ) ;  
                 i f   ( ! t O b j )  
                 {                
                     i f   ( ! t a b L a b e l )   t a b L a b e l   =   t a b I d ;  
                     t O b j   =   p o d T o o l s . i n s e r t T a b ( t a b I d ,   t a b L a b e l ,   n u l l ,   t r u e ,   f a l s e ) ;  
                 }  
  
 	 	 	 	 / /   M a k e   s u r e   t h a t   t h e   g a d g e t   d o e s n ' t   a l r e a d y   e x i s t   o n   t h i s   t a b  
 	 	 	 	 v a r   g L i s t   =   $ ( ' p o d a r e a ' ) . g e t E l e m e n t s ( " d i v [ r e f i d = ' "   +   g a d g e t I d   +   " ' ] " ) ;  
 	 	 	 	 f o r   ( v a r   i = 0 ;   i < g L i s t . l e n g t h ;   i + + )  
 	 	 	 	 {  
 	 	 	 	 	 i f   ( g L i s t [ i ] . g e t P r o p e r t y ( " t a b i d " )   = =   t a b I d )   r e t u r n ;  
 	 	 	 	 }  
 	 	 	 	  
  
  
                 p o d I d   =   p o d T o o l s . g e t U n i q u e P o d I d ( p o d I d ) ;  
  
                 / /   A d d   p o d   t o   n a v t r e e  
                 p o d T o o l s . d s p N a v T r e e _ A d d P o d ( t O b j ,   p o d I d ,   g a d g e t I d ,   p o d L a b e l )  
  
                 / /   A d d   p o d   t o   p o d a r e a  
                 v a r   d r o p C o l   =   $ ( t a b I d + ' c o l ' + d r o p C o l N u m ) ;  
                 i f   ( ! d r o p C o l )   d r o p C o l   =   $ ( t a b I d + ' c o l 1 ' ) ;  
                 i f   ( ! d r o p C o l )   {   a l e r t ( " c a n ' t   f i n d   a   c o l u m n   t o   d r o p   t h e   p o d . " ) ;   r e t u r n ;   }  
                    
                  
  
                 / /   U p d a t e   d a s h b o a r d   X M L  
                 v a r   n e w P o d   =   p o d T o o l s . n o t i f i c a t i o n . i n s e r t P o d ( t a b I d ,   p o d I d ,   1 ,   n u l l ,   g a d g e t I d ,   p o d L a b e l ,   f a l s e )    
                 n e w P o d . s e t A t t r i b u t e ( " d i s p l a y " ,   " m a x " ) ;  
  
                  
 	 	 	 	  
 	 	 	 	 i f   ( a r g u m e n t s )  
 	 	 	 	 {  
 	 	 	 	 	 v a r   d o c   =   n e w P o d . o w n e r D o c u m e n t ;  
 	 	 	 	     v a r   p r e f N o d e   =   n e w P o d . a p p e n d C h i l d ( d o c . c r e a t e E l e m e n t ( " P R E F " ) ) ;  
 	 	 	 	     v a r   a r g s   =   a r g u m e n t s . s p l i t ( " ; " ) ;  
 	 	 	 	     f o r   ( v a r   i = 0 ;   i <   a r g s . l e n g t h ;   i + + )  
 	 	 	 	     {  
 	 	 	 	         v a r   p a r t s   =   a r g s [ i ] . s p l i t ( " = " ) ;  
 	 	 	 	         i f   ( p a r t s . l e n g t h   ! =   2 )   a l e r t ( ' I   e x p e c t e d   t o   s e e   t w o   a n   e q u a l   s i g n   i n   ( '   +   a r g s [ i ]   + ' )   w h i c h   i s   p a r t   '   +   i   + '   o f   '   +   a r g u m e n t s ) ;  
 	 	 	 	         v a r   v a l N o d e   =   d o c . c r e a t e E l e m e n t ( " V A L U E " ) ;  
 	 	 	 	         v a l N o d e . s e t A t t r i b u t e ( " n a m e " ,   p a r t s [ 0 ] ) ;  
 	 	 	 	         v a l N o d e . 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 ( u n e s c a p e ( p a r t s [ 1 ] ) ) ) ;  
 	 	 	 	         p r e f N o d e . a p p e n d C h i l d ( v a l N o d e ) ;  
 	 	 	 	     }  
 	 	 	 	 }                  
 	 	 	 	                            
              
              
                 p o d T o o l s . d s p P o d A r e a _ B u i l d P o d   ( p o d I d ,   g a d g e t I d ,   t a b I d ,   n u l l ,   d r o p C o l )  
              
                 / / p o d T o o l s . s e l e c t P o d ( p o d I d ,   t a b I d ) ;      
  
         } ,  
          
         " i n s e r t N e w P o d " :   f u n c t i o n ( t a b I d ,   t a b L a b e l ,   d r o p C o l N u m ,   g a d g e t I d ,   p o d I d ,   p o d L a b e l ,   p o s t C h g )   {  
                 i f   ( ! g a d g e t I d )   a l e r t ( " y o u   m u s t   p a s s   a   g a d g e t I d   t o   i n s e r t N e w P o d ( ) " ) ;  
  
                 i f   ( ! p o d I d )   p o d I d   =   g a d g e t I d ;  
                 p o d I d   =   p o d T o o l s . g e t U n i q u e P o d I d ( p o d I d ) ;  
                  
                 v a r   t O b j ;  
                 i f   ( t a b I d = = n u l l )  
                 {  
                     t O b j   =   $ $ ( ' . a c t i v e n a v s e c t i o n ' ) [ 0 ] ;  
                      
                     i f   ( t O b j . h a s C l a s s ( ' p o d l i s t i t e m ' )   = =   t r u e )  
                     {  
                     	 d o   {   t O b j   =   t O b j . g e t P a r e n t ( ) ;   }   w h i l e   ( t O b j . g e t A t t r i b u t e ( " c o r n e r " ) = = " t r u e " ) 	                     	  
                     }  
                      
                     t a b I d   =   t O b j . i d ;  
                      
                     / /   d o n ' t   a d d   a   n e w   g a d g e t   t o   t h e   w i n d o w ' s   t a b  
                     / /   I f   t h e   w i n d o w s   t a b   i s   a c t v e m   t h e n   a d d   t h e   g a d g e t   t o   t h e   f i r s t   t a b  
                     i f   ( t a b I d . i n d e x O f ( p o d T o o l s . c u s t o m T a b S u f f i x )   > =   0 )     / /   = =   p o d T o o l s . w i n d o w s T a b I d   | |   t a b I d   = =   p o d T o o l s . m e s s a g e T a b I d )  
                     {  
                         t O b j   =   $ $ ( ' . p o d l i s t ' ) [ 0 ] ;  
                         t a b I d   =   t O b j . i d ;  
                         p o d T o o l s . s h o w T a b ( t a b I d ) ;  
                     }  
                 }  
                 e l s e  
                 {  
                     / /   M a k e   s u r e   t h e   t a b   e x i s t s .     I f   i t   d o e s n ' t   c r e a t e   i t  
                     t O b j   =   $ ( t a b I d ) ;  
                     i f   ( ! i O b j )  
                     {  
                         i f   ( ! t a b L a b e l )   t a b L a b e l   =   t a b I d ;  
                         t O b j   =   p o d T o o l s . d s p N a v T r e e _ A d d T a b ( t a b I d ,   t a b L a b e l ,   f a l s e ,   " 2 A " ,   n u l l ) ;  
                     }  
                 }  
                  
            
                 / /   A d d   p o d   t o   n a v t r e e  
                 p o d T o o l s . d s p N a v T r e e _ A d d P o d ( t O b j ,   p o d I d ,   g a d g e t I d ,   p o d L a b e l )  
                  
                 / /   A d d   p o d   t o   p o d a r e a  
                 / /   I f   w e   d o n ' t   h a v e   a   c o l u m n ,   f i n d   t h e   s h o r t e s t   c o l u m n  
                 i f   ( ! d r o p C o l N u m )  
                 {  
                     v a r   a l l P o d C o l s   =   $ ( ' p o d a r e a ' ) . c h i l d N o d e s ;  
                     v a r   m i n H   =   9 9 9 9 9 ;  
                     v a r   c n   =   1 ;  
                     f o r   ( v a r   i   =   0 ;   i < a l l P o d C o l s . l e n g t h ;   i + + )  
                     {  
                         i f   ( a l l P o d C o l s [ i ] . g e t A t t r i b u t e ( " t a b i d " ) = = t a b I d )  
                         {  
 	 	 	 	 	 	 	 v a r   c u r H   =   0  
 	 	 	 	 	 	 	 f o r   ( v a r   n = 0 ;   n < a l l P o d C o l s [ i ] . c h i l d N o d e s . l e n g t h ;   n + + )  
 	 	 	 	 	 	 	     c u r H   + =   a l l P o d C o l s [ i ] . c h i l d N o d e s [ n ] . o f f s e t H e i g h t ;  
      
                             i f   ( c u r H   <   m i n H )    
                             {  
                                 m i n H   =   c u r H ;  
                                 d r o p C o l N u m   =   c n ;  
                             }  
                             c n   + =   1 ;  
                         }  
                     }  
  
                     i f   ( ! d r o p C o l N u m )   d r o p C o l N u m = 1 ;  
                      
                 }    
                 v a r   d r o p C o l   =   $ ( t a b I d + ' c o l ' + d r o p C o l N u m ) ;  
                 i f   ( ! d r o p C o l )   d r o p C o l   =   $ ( t a b I d + ' c o l 1 ' ) ;  
                 i f   ( ! d r o p C o l )   {   a l e r t ( " c a n ' t   f i n d   a   c o l u m n   t o   d r o p   t h e   p o d . " ) ;   r e t u r n ;   }  
                  
  
                 p o d T o o l s . d s p P o d A r e a _ B u i l d P o d   ( p o d I d ,   g a d g e t I d ,   t a b I d ,   n u l l ,   d r o p C o l )                
                  
                 / /   u p d a t e   d a s h b o a r d   X M L   a n d   s e n d   t o   h o s t .  
                 p o d T o o l s . n o t i f i c a t i o n . i n s e r t P o d ( t a b I d ,   p o d I d ,   d r o p C o l N u m ,   n u l l ,   g a d g e t I d ,   n u l l ,   p o s t C h g )  
  
                 p o d T o o l s . c h e c k P o d E v e n t ( $ ( p o d I d ) ,   " o n i n s e r t n e w p o d " ) ;  
         } ,  
          
         " d s p I n i t "   :   f u n c t i o n   ( d o N a v T r e e )   {  
  
             	 i f   ( d o N a v T r e e   = =   n u l l )   d o N a v T r e e   =   t r u e ;  
  
 	 	 	 	 / /   C h e c k   f o r   r e q u i r e d   t a b s .      
 	 	 	 	 v a r   p o d T a b s R o o t   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S " ) ;  
 	 	 	 	 f o r   ( v a r   k e y   i n   p o d T o o l s . r e q u i r e d T a b s )  
 	 	 	 	 {  
 	 	 	 	 	 v a r   p o d T a b s R o o t   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S " ) ;  
 	 	 	 	 	 v a r   p o d T a b N o d e   =   p o d T a b s R o o t . s e l e c t S i n g l e N o d e ( " P O D T A B [ @ i d = ' "   +   S t r i n g ( k e y )   +   " ' ] " ) ;  
 	 	 	 	 	 i f   ( ! p o d T a b N o d e )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 p o d T a b N o d e   =   p o d T a b s R o o t . a p p e n d C h i l d ( p o d T a b s R o o t . o w n e r D o c u m e n t . c r e a t e E l e m e n t ( " P O D T A B " ) ) ;  
 	 	 	 	 	 	 p o d T a b N o d e . s e t A t t r i b u t e ( " i d " ,   S t r i n g ( k e y ) ) ;  
 	 	 	 	 	 	 p o d T a b N o d e . s e t A t t r i b u t e ( " l a b e l " ,   S t r i n g ( p o d T o o l s . r e q u i r e d T a b s [ k e y ] ) ) ;  
 	 	 	 	 	 }  
 	 	 	 	   / / n d . s e t A t t r i b u t e ( k e y ,   S t r i n g ( a t t r i b u t e s [ k e y ] ) ) ;      
 	         	 }  
 	         	  
 	         	 / /   M a k e   s u r e   o n e   o f   t h e   t a b s   i s   a c t i v e  
 	 	 	 	 v a r   p o d T a b N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B [ @ a c t i v e = ' t r u e ' ] " ) ;  
 	 	 	 	 i f ( ! p o d T a b N o d e )   p o d T a b s R o o t . s e l e c t S i n g l e N o d e ( " P O D T A B " ) . s e t A t t r i b u t e ( " a c t i v e " ,   " t r u e " ) ;  
              
              
                 $ ( ' h e a d e r A r e a ' ) . s e t S t y l e ( " d i s p l a y " ,   " " )  
 	 	 	     $ ( ' f o o t e r A r e a ' ) . s e t S t y l e ( " d i s p l a y " ,   " " )  
 	 	 	 	 $ ( ' b o d y A r e a ' ) . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
  
                 p o d T o o l s . d s p S e t H e a d e r ( p o d T o o l s . d a s h O p t s ) ;  
                 p o d T o o l s . d s p S e t F o o t e r ( p o d T o o l s . d a s h O p t s ) ;  
 	 	         i f ( d o N a v T r e e )   p o d T o o l s . d s p N a v T r e e _ B u i l d ( p o d T o o l s . d a s h O p t s ) ;  
         } ,    
      
         " d s p N a v T r e e _ B u i l d "   :   f u n c t i o n   ( m y P o d s )   {  
           	 	 	 	      
                 v a r   n c   =   $ ( ' n a v c o n t a i n e r ' ) ;  
                 n c . e m p t y ( ) ;  
          
                 v a r   t a b L i s t   =   m y P o d s . s e l e c t N o d e s ( " . / / P O D T A B S / P O D T A B " ) ;  
                 f o r   ( t c   =   0 ;   t c   <   t a b L i s t . l e n g t h ;   t c + + )  
                 {               	  
                     v a r   i d   =   t a b L i s t [ t c ] . g e t A t t r i b u t e ( " i d " ) ;  
                     v a r   l a b e l   =   t a b L i s t [ t c ] . g e t A t t r i b u t e ( " l a b e l " ) ;  
                     v a r   i s A c t   =   ( t a b L i s t [ t c ] . g e t A t t r i b u t e ( " a c t i v e " ) = = " t r u e " ) ;  
                     v a r   l a y o u t   =   t a b L i s t [ t c ] . g e t A t t r i b u t e ( " l a y o u t " ) ;  
                     v a r   n e w T a b   =   p o d T o o l s . d s p N a v T r e e _ A d d T a b ( i d ,   l a b e l ,   i s A c t ,   l a y o u t ,   n c ) ;  
  
 	 	 	 	 	 / /   W e   h a v e   t o   a d d   t h i s   f i l l e r   i n s t e a d   o f   u s i n g   a   m a r g i n   s t y l e   b e c a u s e   i e 6   i s   f i l l i n g  
 	 	 	 	 	 / /   f i l l i n g   t h e   m a r g i n   w h e n   t h e   t a b   i s   a c t i v e .  
                 	 v a r   f i l l e r   =   n e w   E l e m e n t ( ' d i v ' ,   { ' c l a s s ' :   ' n a v c o n t a i n e r f i l l e r ' } ) . i n j e c t ( n c ) ;  
  
                     v a r   p o d L i s t   =   t a b L i s t [ t c ] . s e l e c t N o d e s ( " P O D " ) ;  
                     f o r   ( p c   =   0 ;   p c   <   p o d L i s t . l e n g t h ;   p c + + )  
                     {  
                         v a r   r e f I d   =   p o d L i s t [ p c ] . g e t A t t r i b u t e ( " r e f i d " ) ;  
                         v a r   o v r L a b e l   =   p o d L i s t [ p c ] . g e t A t t r i b u t e ( " l a b e l " ) ;  
                         v a r   p o d I d   =   p o d L i s t [ p c ] . g e t A t t r i b u t e ( " i d " ) ;  
                         p o d T o o l s . d s p N a v T r e e _ A d d P o d ( n e w T a b ,   p o d I d ,   r e f I d ,   o v r L a b e l ) ;  
                     }    
  
  
                     / /   D o n ' t   s h o w   t h e   n a v   l i s t   a s   e x p a n d e d   u n l e s s   t h e   e x p a n d   a t t i b u t e   i s   s e t   o r   t h e   t a b   i s   t h e   a c t i v e   t a b  
                     i f   ( t a b L i s t [ t c ] . g e t A t t r i b u t e ( " e x p a n d " ) ! = " t r u e "   & &   i s A c t = = f a l s e )   p o d T o o l s . s h r i n k T a b ( i d ) ;  
  
                     i f   ( i s A c t )   p o d T o o l s . d s p P o d A r e a _ B u i l d P o d s ( t a b L i s t [ t c ] )  
                 }  
  
                 v a r   e l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' i d ' :   ' n a v t r e e b o t t o m ' }   ) . s e t S t y l e ( ' c l e a r ' ,   ' b o t h ' ) . i n j e c t ( n c ) ;  
         } ,  
          
                  
         " d s p N a v T r e e _ A d d T a b "   :   f u n c t i o n   ( i d ,   l a b e l ,   i s A c t ,   l a y o u t ,   p O b j )   {  
    
             i f   ( ! p O b j )   p O b j   =   $ ( ' n a v c o n t a i n e r ' ) ;  
              
             i f ( ! l a y o u t )   l a y o u t   =   " 2 A " ;  
             v a r   e l   =   n e w   E l e m e n t ( " d i v " ,   { ' i d ' :   i d ,   ' c l a s s ' :   ' p o d l i s t ' ,   ' l a y o u t ' :   l a y o u t   } ) . i n j e c t ( p O b j ) ;  
             / / i f   ( i s A c t )   e l . a d d C l a s s ( " a c t i v e n a v s e c t i o n " ) ;  
  
  
             v a r   h d r   =   n e w   E l e m e n t ( " d i v " ,   { ' i d ' :   i d + " _ h e a d e r " ,   ' c l a s s ' :   ' p o d l i s t h e a d e r '   } ) . i n j e c t ( e l ) ;  
              
             v a r   b t n ;  
             b t n   =   n e w   E l e m e n t ( " a " ,   {   ' c l a s s ' :   ' p t s h r i n k b t n ' ,   ' h r e f ' :   ' # ' ,   ' t i t l e ' :   ' S h r i n k   T a b ' ,  
                                                               ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {   p o d T o o l s . s h r i n k T a b ( i d ) ;   r e t u r n   f a l s e ;   }   }   } ) . i n j e c t ( h d r ) ;  
             b t n   =   n e w   E l e m e n t ( " a " ,   {   ' c l a s s ' :   ' p t e x p a n d b t n ' ,   ' h r e f ' :   ' # ' ,   ' t i t l e ' :   ' E x p a n d   T a b ' ,  
                                                               ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {   p o d T o o l s . e x p a n d T a b ( i d ) ;   r e t u r n   f a l s e ;   }   }   } ) . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) . i n j e c t ( h d r ) ;  
  
              
             v a r   l b   =   n e w   E l e m e n t ( " a " ,   {   ' c l a s s ' :   ' p t l a b e l ' ,   ' h r e f ' :   ' # ' ,    
                                                                     ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {   p o d T o o l s . s h o w T a b ( i d ) ;   r e t u r n   f a l s e ;   }   }   } ) . i n j e c t ( h d r ) ;  
             l b . i n n e r H T M L   =   l a b e l ;  
  
  
 / /             b t n   =   n e w   E l e m e n t ( " a " ,   {   ' c l a s s ' :   ' p t s h r i n k t a b s b t n ' ,   ' h r e f ' :   ' # ' ,   ' t i t l e ' :   ' S h r i n k   T a b   G r o u p ' ,  
 / /                                                               ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {   p o d T o o l s . t o g g l e S h o w T a b G r o u p ( ) ;   r e t u r n   f a l s e ;   }   }   } ) . i n j e c t ( h d r ) ;  
 / /             b t n   =   n e w   E l e m e n t ( " s p a n " ) . i n j e c t ( h d r ) ;  
  
             b t n   =   n e w   E l e m e n t ( " a " ,   {   ' c l a s s ' :   ' p t p r e f b t n ' ,   ' h r e f ' :   ' # ' ,   ' t i t l e ' :   ' P o d   P r e f e r e n c e s ' ,  
                                                               ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {   o p e n P o d T a b P r e f ( i d ) ;   r e t u r n   f a l s e ;   }   }   } ) . i n j e c t ( h d r ) ;  
             i f   ( i s A c t   = =   f a l s e )   b t n . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;              
             b t n   =   n e w   E l e m e n t ( " s p a n " ) . s e t S t y l e ( " c l e a r " , " b o t h " ) . i n j e c t ( h d r ) ;  
              
  
              
             / /   m o v e   t h e   d i v   t h a t   c l e a r s   f l o a t s   u n d e r   t h i s   n e w   t a b  
             v a r   n t b   =   $ ( ' n a v t r e e b o t t o m ' ) ;  
             i f   ( n t b )   n t b . i n j e c t ( p O b j )  
  
 	 	 	 i f   ( i s A c t )   p o d T o o l s . s e t A c t i v e N a v S e c t i o n ( e l ) ;              
              
             r e t u r n   e l ;  
         } ,  
          
                  
         " d s p N a v T r e e _ A d d P o d "   :   f u n c t i o n   ( t O b j ,   p o d I d ,   r e f I d ,   l a b e l )   {  
              
             v a r   t a b I d   =   t O b j . i d ;  
  
 	 	 	 v a r   h i d e i t   =   f a l s e ;  
 	 	 	 v a r   p i l i s t   =   t O b j . g e t E l e m e n t s ( " d i v [ c l a s s = ' p o d l i s t i t e m ' ] " ) ;  
 	 	 	 i f   ( p i l i s t . l e n g t h   >   0 )  
 	 	 	 {  
 	 	 	 	 i f   ( p i l i s t [ 0 ] . g e t S t y l e ( " d i s p l a y " )   = =   " n o n e " )    
 	 	 	 	 	 h i d e i t   =   t r u e ;  
 	 	 	 }  
  
             v a r   e l   =   n e w   E l e m e n t ( " d i v " ,   { ' c l a s s ' :   ' p o d l i s t i t e m ' } ) . i n j e c t ( t O b j ) ;  
 	 	 	 i f   ( h i d e i t = = t r u e )   e l . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
                          
             v a r   l b   =   n e w   E l e m e n t ( " a " ,   { ' h r e f ' :   ' # ' ,   ' i d ' :   p o d I d + ' _ l i n k ' ,  
                                                                 ' e v e n t s ' :   {   ' c l i c k ' :   f u n c t i o n ( ) {     p o d T o o l s . s e l e c t P o d ( p o d I d ,   t a b I d ) ;   r e t u r n   f a l s e ;   }   }      
                                                                 } ) . i n j e c t ( e l ) ;  
  
             i f   ( ! l a b e l )   l a b e l   =   p o d T o o l s . g e t G a d g e t D e f ( r e f I d ) . g e t A t t r i b u t e ( " l a b e l " ) ;                                          
             l b . i n n e r H T M L   =   p o d T o o l s . r e p l a c e T a g s ( { i d : p o d I d } ,   l a b e l ) ;  
              
             r e t u r n   e l ;  
         } ,  
          
 / /         " d s p P o d A r e a _ B u i l d "   :   f u n c t i o n   ( m y P o d s )   {  
 / /              
 / /             / / B u i l d   t h e   l i s t   o f   P o d s  
 / /             / / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *  
 / /             v a r   a c t i v e P o d T a b   =   m y P o d s . s e l e c t S i n g l e N o d e ( " / / P O D T A B [ @ a c t i v e = ' t r u e ' ] " ) ;  
 / /             i f   ( ! a c t i v e P o d T a b )   m y P o d s   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B " ) ;  
 / /             i f   ( a c t i v e P o d T a b )  
 / /             {  
 / /                 / / B u i l d   t h e   c o l u m n s   ( f o r   n o w   w e   a r e   j u s t   b u i l d i n g   t w o   e v e n   c o l u m n s )  
 / /                 v a r   p a   =   $ ( ' p o d a r e a ' )  
 / /                 p a . e m p t y ( ) ;   / / r e m o v e   a n y   e x i t i n g   c h i l d r e n .  
 / /                 v a r   e l ;  
 / /                 e l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' i d ' :   ' p o d c o l 1 ' ,   ' c l a s s ' :   ' p o d c o l ' } ) . i n j e c t ( p a ) ;  
 / /                 e l   =   n e w   E l e m e n t ( ' d i v ' ,   {   ' i d ' :   ' p o d c o l 2 ' ,   ' c l a s s ' :   ' p o d c o l ' } ) . i n j e c t ( p a ) ;  
 / /                  
 / /                 / /   n o w   t h a t   w e   h a v e   d r o p   a r e a s ,   c a l l   d r a g S e t u p ;  
 / /                 p o d T o o l s . d r a g S e t u p ( ) ;  
  
 / /                  
 / /                 / / f i l l   t h e   c o l u m n s  
 / /                 v a r   c o l l i s t   =   $ $ ( ' . p o d c o l ' ) ;  
 / /                 v a r   p o d l i s t   =   a c t i v e P o d T a b . s e l e c t N o d e s ( " P O D " ) ;  
 / /                 f o r   ( v a r   i = 0 ;   i   <   p o d l i s t . l e n g t h   ;   i + + )  
 / /                 {  
 / /                     v a r   c o l   =   M a t h . m i n ( p o d l i s t [ i ] . g e t A t t r i b u t e ( " c o l " ) ,   c o l l i s t . l e n g t h ) ;  
 / /                     v a r   s e q   =   p o d l i s t [ i ] . g e t A t t r i b u t e ( " s e q " ) ;  
 / /                     v a r   p o d i d   =   p o d l i s t [ i ] . g e t A t t r i b u t e ( " i d " ) ;  
 / /                     v a r   p o d r e f i d   =   p o d l i s t [ i ] . g e t A t t r i b u t e ( " r e f i d " ) ;  
 / /                                          
 / /                     v a r   d r o p c o l   =   c o l l i s t [ c o l ] ;  
 / /                     v a r   n e w p o d   =   n e w   E l e m e n t ( " d i v " ,   { ' i d ' :   p o d i d ,   ' r e f i d ' :   p o d r e f i d ,   ' c l a s s ' :   ' p o d '   } ) . i n j e c t ( d r o p c o l ) ;  
 / /                  
 / /                     p o d T o o l s . i n i t P o d ( n e w p o d ,   p o d l i s t [ i ] ) ;  
 / /                 }  
 / /             }  
 / /         } ,  
  
         " d s p P o d A r e a _ B u i l d P o d s "   :   f u n c t i o n   ( p o d T a b )   {  
          
                 v a r   t a b I d   =   p o d T a b . g e t A t t r i b u t e ( " i d " ) ;                  
                 v a r   l a y o u t   =   p o d T a b . g e t A t t r i b u t e ( " l a y o u t " ) ;  
                 i f   ( ! l a y o u t )   l a y o u t   =   " 2 A " ;  
  
                 v a r   c o l l i s t   =   p o d T o o l s . b u i l d T a b L a y o u t ( t a b I d ,   l a y o u t ,   f a l s e ) ;  
                  
  
                 / / f i l l   t h e   c o l u m n s  
                 v a r   p o d l i s t   =   p o d T a b . s e l e c t N o d e s ( " P O D " ) ;  
                 f o r   ( v a r   i = 0 ;   i   <   p o d l i s t . l e n g t h   ;   i + + )  
                 {  
                     v a r   c o l   =   M a t h . m a x ( 1 ,   M a t h . m i n ( p o d l i s t [ i ] . g e t A t t r i b u t e ( " c o l " ) ,   c o l l i s t . l e n g t h ) ) ;  
                     v a r   s e q   =   p o d l i s t [ i ] . g e t A t t r i b u t e ( " s e q " ) ;  
                     v a r   p o d i d   =   p o d l i s t [ i ] . g e t A t t r i b u t e ( " i d " ) ;  
                     v a r   p o d r e f i d   =   p o d l i s t [ i ] . g e t A t t r i b u t e ( " r e f i d " ) ;  
                                          
                     v a r   d r o p c o l   =   c o l l i s t [ c o l - 1 ] ;  
                     v a r   n e w p o d   =   n e w   E l e m e n t ( " d i v " ,   { ' i d ' :   p o d i d ,   ' r e f i d ' :   p o d r e f i d ,   ' c l a s s ' :   ' p o d ' ,   ' t a b i d ' :   t a b I d   } ) . i n j e c t ( d r o p c o l ) ;  
                  
                     p o d T o o l s . i n i t P o d ( n e w p o d ,   p o d l i s t [ i ] ) ;  
                 }          
         } ,    
          
         / *   B u i l d s   a   p o d   i n   t h e   p o d   a r e a   * /  
         " d s p P o d A r e a _ B u i l d P o d "   :   f u n c t i o n   ( p o d I d ,   p o d R e f I d ,   t a b I d ,   m y P o d N o d e ,   d r o p C o l )   {  
          
                 v a r   n e w p o d   =   n e w   E l e m e n t ( " d i v " ,   { ' i d ' :   p o d I d ,   ' r e f i d ' :   p o d R e f I d ,   ' c l a s s ' :   ' p o d ' ,   ' t a b i d ' :   t a b I d   } ) . i n j e c t ( d r o p C o l ) ;  
                  
                 p o d T o o l s . i n i t P o d ( n e w p o d ,   m y P o d N o d e ) ;  
         } ,    
  
 	 	 " r e s e t P o d T i t l e " :   f u n c t i o n   ( p o d I d )   {  
 	 	          
 	 	 	 	 v a r   s t r   =   " "  
                 v a r   d b P o d N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B / P O D [ @ i d = ' "   +   p o d I d   +   " ' ] " ) ;  
                 v a r   g a d g e t N o d e   =   t h i s . g e t G a d g e t D e f ( d b P o d N o d e . g e t A t t r i b u t e ( " r e f i d " ) )  
  
  
 	 	 	 	 / /   r e s e t   t h e   p o d   t i t l e   b a r  
 	 	 	 	 v a r   t i t l e T e x t   =   $ ( p o d I d   +   ' _ t i t l e t e x t ' ) ;  
 	             i f   ( d b P o d N o d e . g e t A t t r i b u t e ( " t i t l e " ) )   s t r   =   d b P o d N o d e . g e t A t t r i b u t e ( " t i t l e " )  
 	             e l s e   i f ( g a d g e t N o d e . g e t A t t r i b u t e ( " t i t l e " ) )     s t r   =   g a d g e t N o d e . g e t A t t r i b u t e ( " t i t l e " ) ;  
 	             e l s e   s t r   =   g a d g e t N o d e . g e t A t t r i b u t e ( " l a b e l " ) ;  
 	 	 	 	 t i t l e T e x t . i n n e r T e x t   =   p o d T o o l s . r e p l a c e T a g s ( { i d : p o d I d } ,   s t r ) ;  
  
  
 	 	 	 	 / /   r e s e t   t h e   n a v t r e e   l a b e l  
 	 	 	 	 v a r   l i n k L a b e l   =   $ ( p o d I d   +   ' _ l i n k ' ) ;  
 	 	 	 	 l i n k L a b e l . i n n e r T e x t   =   p o d T o o l s . r e p l a c e T a g s ( { i d : p o d I d } ,   g a d g e t N o d e . g e t A t t r i b u t e ( " l a b e l " ) ) ;  
 	 	 } ,  
  
         " d s p S e t H e a d e r "   :   f u n c t i o n   ( m y P o d D e f s )   {  
             v a r   m y H e a d e r   =   m y P o d D e f s . s e l e c t S i n g l e N o d e ( " . / / P O D T A B S / H E A D E R " )  
             i f   ( m y H e a d e r )  
             {  
                 v a r   r e f I d   =   m y H e a d e r . g e t A t t r i b u t e ( " r e f i d " ) ;  
                 v a r   h d e f   =   p o d T o o l s . g e t G a d g e t D e f ( r e f I d ) ;  
                 i f   ( h d e f )    
                 {  
 	 	 	 	 	 v a r   h a   =   $ ( ' h e a d e r A r e a ' ) ;  
 	 	 	 	 	 h a . r e m o v e C l a s s ( ' h i d e ' ) ;  
                 	 h a . i n n e r H T M L   =   p o d T o o l s . r e p l a c e T a g s ( m y H e a d e r ,   h d e f . x m l ) ;  
                 }  
             }              
         } ,  
  
         " d s p S e t F o o t e r "   :   f u n c t i o n   ( m y P o d D e f s )   {  
         r e t u r n ;  
             v a r   m y H e a d e r   =   m y P o d D e f s . s e l e c t S i n g l e N o d e ( " . / / P O D T A B S / F O O T E R " )  
             i f   ( m y H e a d e r )  
             {  
                   r e f I d   =   m y H e a d e r . g e t A t t r i b u t e ( " r e f i d " ) ;  
                   v a r   h d e f   =   p o d T o o l s . g e t G a d g e t D e f ( r e f I d ) ;  
                   i f   ( h d e f )   $ ( ' f o o t e r A r e a ' ) . i n n e r H T M L   =   p o d T o o l s . r e p l a c e T a g s ( m y H e a d e r ,   h d e f . x m l ) ;  
             }              
         } ,  
          
          
         / *   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *   * /  
  
         " n o t i f i c a t i o n "   :   {  
         	  
                 " i s D i r t y " :                             f a l s e ,  
                 " t i m e r I d " :                             n u l l ,  
                 " t i m e r D e l a y " :                       ( 1 0   *   1 0 0 0 ) ,  
                 " c h a n g e C o u n t " :                     0 ,     / / T h e   m o r e   t h e y   c h a n g e ,   t h e   l e s s   w e   u p d a t e    
                  
                 " d o e s P o d E x i s t "   :   f u n c t i o n   ( t a b I d ,   p o d I d )   {  
 	 	 	 	 	  
 	 	 	 	 	 v a r   t a b X P a t h   =   " "  
 	 	 	 	 	 i f   ( t a b I d )   t a b X P a t h   =   " [ @ i d = ' "   +   t a b I d   +   " ' ] " ;  
                      
                     v a r   p o d N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B "   +   t a b X P a t h   +   " / P O D [ @ i d = ' "   +   p o d I d   +   " ' ] " ) ;  
                     i f   ( p o d N o d e )   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 ;  
                 } ,  
                  
                  
                 " i n s e r t P o d " :             f u n c t i o n   ( t a b I d ,   p o d I d ,   d r o p C o l N u m ,   s e q ,   g a d g e t I d ,   p o d L a b e l ,   p o s t C h g )   {  
  
                     / /   f i n d   t h e   t a b   -   w e   a s s u m e   t h a t   i t   e x i s t s  
                     v a r   p o d T a b   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B [ @ i d = ' "   +   t a b I d   +   " ' ] " ) ;  
                     i f   ( ! p o d T a b )   a l e r t ( " P o d T a b   "   +   t a b I d   +   "   d o e s n ' t   e x i s t " ) ;  
                      
                     / /   C r e a t e   t h e   P O D   n o d e  
                     v a r   p o d N o d e   =   p o d T a b . s e l e c t S i n g l e N o d e ( " P O D [ @ i d = ' "   +   p o d I d   +   " ' ] " ) ;  
                     i f   ( ! p o d N o d e )    
                     {    
                         p o d N o d e   =   p o d T a b . o w n e r D o c u m e n t . c r e a t e E l e m e n t ( " P O D " ) ;  
                         p o d N o d e . s e t A t t r i b u t e ( " i d " ,   p o d I d ) ;  
                     }  
  
 	 	             v a r   g a d g e t N o d e   =   p o d T o o l s . g e t G a d g e t D e f ( g a d g e t I d ) ;  
  
 	 	 	 	 	 / /   A d d   p r e f e r e n c e s   i f   a n y   a r e   r e q u i r e d 	 	 	 	 	  
 	 	 	 	 	 v a r   s r c P r e f N o d e   =   g a d g e t N o d e . s e l e c t S i n g l e N o d e ( " P R E F " ) ;  
 	 	 	 	 	 i f   ( s r c P r e f N o d e   & &   s r c P r e f N o d e . g e t A t t r i b u t e ( " r e q u i r e d " ) )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 v a r   p o d P r e f N o d e   =   p o d N o d e . a p p e n d C h i l d ( p o d N o d e . o w n e r D o c u m e n t . c r e a t e E l e m e n t ( " P R E F " ) ) ;  
 	 	 	 	 	 	 v a r   v a l L i s t   =   s r c P r e f N o d e . s e l e c t N o d e s ( " . / / i n p u t " ) ;  
 	 	 	 	 	 	 f o r   ( v a r   i = 0 ;   i < v a l L i s t . l e n g t h ;   i + + )  
 	 	 	 	 	 	 {  
 	 	                 	 v a r   i t e m   =   v a l L i s t [ i ] ;  
 	 	                 	  
 	 	                     v a r   n a m e   =   i t e m . g e t A t t r i b u t e ( " i d " ) ;  
 	 	                     v a r   v a l u e   =   i t e m . g e t A t t r i b u t e ( " v a l u e " ) ;  
 	 	                      
 	 	                     v a r   v a l u e N o d e   =   p o d P r e f N o d e . s e l e c t S i n g l e N o d e ( " V A L U E [ @ n a m e = ' "   +   n a m e   +   " ' ] " ) ;  
 	 	                     i f   ( ! v a l u e N o d e )  
 	 	                     {  
 	 	                         v a l u e N o d e   =   p o d P r e f N o d e . a p p e n d C h i l d ( p o d P r e f N o d e . o w n e r D o c u m e n t . c r e a t e E l e m e n t ( " V A L U E " ) ) ;  
 	 	                         v a l u e N o d e . s e t A t t r i b u t e ( " n a m e " ,   n a m e ) ;                          
 	 	                     }  
 	 	                     i f ( v a l u e ! = n u l l )   v a l u e N o d e . t e x t   =   v a l u e   ; 	 	 	 	  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
 	 	 	 	 	 	 	 	 	 	  
                      
                     / /   F i n d   t h e   l o c a t i o n   w h e r e   t h e   P O D   b e l o n g s  
                     i f   ( s e q )  
                     {  
                         / /   v a r   c o l N o d e s   =   p o d T a b . s e l e c t N o d e s ( " P O D [ @ c o l = ' "   +   d r o p C o l N u m   +   " ' ] " ) ;  
                         / /   i n s e r t B e f o r e . . .  
                     }  
                     e l s e  
                     {  
                         p o d T a b . a p p e n d C h i l d ( p o d N o d e ) ;  
                     }  
                      
  
                     i f   ( ! s e q )  
                     {  
                         v a r   p s   =   p o d N o d e . p r e v i o u s S i b l i n g ;  
                         i f   ( p s )  
                         {  
 	                         w h i l e ( p s . g e t A t t r i b u t e ( " c o l " )   ! =   d r o p C o l N u m   & &   p s . p r e v i o u s S i b l i n g )   p s   =   p s . p r e v i o u s S i b l i n g ;  
 	                         i f   ( p s )   s e q   =   p a r s e I n t ( p s . g e t A t t r i b u t e ( " s e q " ) ) ;  
 	                         i f   ( i s N a N ( s e q )   | |   ! s e q )   s e q   =   1 ;  
 	                         e l s e   s e q   + =   1 ;                          
 	                     }  
     	                 e l s e   s e q   =   1 ;  
                     }  
  
                     / / S e t   t h e   p o t   a t t r i b u t e s  
                     i f   ( s e q )   p o d N o d e . s e t A t t r i b u t e ( " s e q " ,   s e q ) ;  
                     i f   ( d r o p C o l N u m )   p o d N o d e . s e t A t t r i b u t e ( " c o l " ,   d r o p C o l N u m ) ;  
                     i f   ( p o d L a b e l )   p o d N o d e . s e t A t t r i b u t e ( " l a b e l " ,   p o d L a b e l ) ;                      
                     p o d N o d e . s e t A t t r i b u t e ( " r e f i d " ,   g a d g e t I d ) ;  
  
                     i f   ( p o s t C h g )   p o d T o o l s . n o t i f i c a t i o n . p o s t T o H o s t ( ) ;  
                      
                     r e t u r n   p o d N o d e ;  
                 } ,  
  
                 " r e m o v e P o d " :             f u n c t i o n   ( p o d I d ,   p o s t C h g )   {  
  
                     v a r   p o d N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B / P O D [ @ i d = ' "   +   p o d I d   +   " ' ] " ) ;  
                     i f   ( p o d N o d e )   p o d N o d e . p a r e n t N o d e . r e m o v e C h i l d ( p o d N o d e ) ;  
  
                     i f   ( p o s t C h g )   p o d T o o l s . n o t i f i c a t i o n . p o s t T o H o s t ( ) ;  
                 } ,  
  
                 " m i n i m i z e P o d " :             f u n c t i o n   ( p o d I d ,   p o s t C h g )   {  
  
                     v a r   p o d N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B / P O D [ @ i d = ' "   +   p o d I d   +   " ' ] " ) ;  
                     i f   ( ! p o d N o d e )   r e t u r n ;  
  
                     v a r   o l d V a l   =   p o d N o d e . g e t A t t r i b u t e ( " d i s p l a y " ) ;  
                     i f   ( o l d V a l ! = " m i n " )  
                     {    
                         p o d N o d e . s e t A t t r i b u t e ( " d i s p l a y " ,   " m i n " ) ;  
                         i f   ( p o s t C h g )   p o d T o o l s . n o t i f i c a t i o n . b e g i n D e l a y e d P o s t ( ) ;  
                     }  
                 } ,    
  
                 " m a x i m i z e P o d " :             f u n c t i o n   ( p o d I d ,   p o s t C h g )   {  
  
                     / /     F o r   n o w ,   w e r   a r e   n o t   a l l o w i n g   p o d s   t o   b e   s a v e d   a s   m a x i m i z e d  
                     / *  
                     v a r   p o d N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B / P O D [ @ i d = ' "   +   p o d I d   +   " ' ] " ) ;  
                     i f   ( ! p o d N o d e )   r e t u r n ;  
  
                     v a r   o l d V a l   =   p o d N o d e . g e t A t t r i b u t e ( " d i s p l a y " ) ;  
                     i f   ( o l d V a l ! = " m a x " )  
                     {    
                         p o d N o d e . s e t A t t r i b u t e ( " d i s p l a y " ,   " m a x " ) ;  
                         i f   ( p o s t C h g )   p o d T o o l s . n o t i f i c a t i o n . b e g i n D e l a y e d P o s t ( ) ;  
                     }  
                     * /  
                 } ,    
  
                 " n o r m a l i z e P o d " :             f u n c t i o n   ( p o d I d ,   p o s t C h g )   {  
  
                     v a r   p o d N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B / P O D [ @ i d = ' "   +   p o d I d   +   " ' ] " ) ;  
                     i f   ( ! p o d N o d e )   r e t u r n ;    
  
                     v a r   o l d V a l   =   p o d N o d e . g e t A t t r i b u t e ( " d i s p l a y " ) ;  
                     i f   ( o l d V a l ! = " n o r m " )  
                     {    
                         p o d N o d e . s e t A t t r i b u t e ( " d i s p l a y " ,   " n o r m " ) ;  
                         i f   ( p o s t C h g )   p o d T o o l s . n o t i f i c a t i o n . b e g i n D e l a y e d P o s t ( ) ;  
                     }  
                 } ,    
                  
                 " m o v e P o d " :   f u n c t i o n   ( p o d I d ,   d r o p C o l ,   d r o p A f t e r P o d I d ,   p o s t C h g )   {  
  
                     v a r   p o d N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B / P O D [ @ i d = ' "   +   p o d I d   +   " ' ] " ) ;  
                     v a r   o l d C o l   =   p o d N o d e . g e t A t t r i b u t e ( " c o l " ) ;  
                     v a r   t a b N o d e   =   p o d N o d e . p a r e n t N o d e ;  
                     v a r   c h a n g e d   =   f a l s e ;  
  
 	 	 	 	 	 / /   R e i n s e r t   t h e   p o d   i n t o   t h e   c o r r e c t   l o c a t i o n  
                     i f   ( ! d r o p A f t e r P o d I d )  
                     {  
                     	 / /   I f   t h e   d r o p A f t e r P o d I d   v a r i a b l e   u s   n u l l ,   t h e n   w e   i n s e r t   b e f o r e   t h e   f i r s t   p o d  
                     	 t a b N o d e . i n s e r t B e f o r e ( p o d N o d e ,   t a b N o d e . f i r s t C h i l d ) ;  
                     }  
                     e l s e  
                     {  
                     	 v a r   t h i s P o d   =   t a b N o d e . f i r s t C h i l d ;  
                     	  
                     	 w h i l e   ( t h i s P o d )  
                     	 { 	 	 	 	 	  
 	                     	 i f   ( t h i s P o d . g e t A t t r i b u t e ( " i d " )   = =   d r o p A f t e r P o d I d )  
 	                     	 {  
 	                     	 	 i f ( t h i s P o d . n e x t S i b l i n g )  
 	 	 	                     	 t a b N o d e . i n s e r t B e f o r e ( p o d N o d e ,   t h i s P o d . n e x t S i b l i n g ) ;  
 	 	 	                     e l s e  
 	 	 	                     	 t a b N o d e . a p p e n d C h i l d ( p o d N o d e ) ;  
 	 	 	                     	  
 	 	 	                   b r e a k ;  
 	                     	 }  
                     	 	 t h i s P o d   =   t h i s P o d . n e x t S i b l i n g  
 	                     }  
 	                 }  
  
                     / /   s e t   n e w   c o l u m n    
                     p o d N o d e . s e t A t t r i b u t e ( " c o l " ,   d r o p C o l ) ;  
  
                     / /   c h a n g e   s e q u e n c e   o f   n e w   c o l u m n  
                     v a r   n e w C o l N o d e s   =   t a b N o d e . s e l e c t N o d e s ( " P O D [ @ c o l = ' "   +   d r o p C o l   +   " ' ] " ) ;  
                     f o r   ( v a r   i = 0 ;   i <   n e w C o l N o d e s . l e n g t h ;   i + + )  
                     {  
                     	 i f   ( n e w C o l N o d e s [ i ] . g e t A t t r i b u t e ( " s e q " )   ! =   i + 1 )  
                     	 {  
                     	 	 c h a n g e d   =   t r u e ;  
                         	 n e w C o l N o d e s [ i ] . s e t A t t r i b u t e ( " s e q " ,   i   +   1 ) ;  
                         }  
                     }  
  
                   	 / /   c h a n g e   s e q u e n c e   o f   o l d   c o l u m n   i f   t h e   p o d   w a s   d r a g g e d   f r o m   o n e    
                   	 / /   c o l u m n   t o   a   s e c o n d   c o l u m n .  
 	 	 	 	 	 i f   ( d r o p C o l   ! =   o l d C o l )  
 	 	 	 	 	 {  
                     	 v a r   o l d C o l N o d e s   =   t a b N o d e . s e l e c t N o d e s ( " P O D [ @ c o l = ' "   +   o l d C o l   +   " ' ] " ) ;  
                     	 f o r   ( v a r   i = 0 ;   i <   o l d C o l N o d e s . l e n g t h ;   i + + )  
 	 	 	 	 	 	 {  
 	                     	 i f   ( o l d C o l N o d e s [ i ] . g e t A t t r i b u t e ( " s e q " )   ! =   i + 1 )  
     	 	 	 	 	 	 {  
 	                     	 	 c h a n g e d   =   t r u e ;  
     	                         o l d C o l N o d e s [ i ] . s e t A t t r i b u t e ( " s e q " ,   i   +   1 ) ;  
     	                     }  
                         }  
                   	 }    
                      
                     / /   S e n d   t h e   c h a n g e s   t o   t h e   h o s t . . . i f   t h e r e   a r e   a n y   c h a n g e s  
                     i f   ( p o s t C h g   & &   c h a n g e d )   p o d T o o l s . n o t i f i c a t i o n . b e g i n D e l a y e d P o s t ( ) ;  
  
                 } ,    
                  
                 " s a v e P r e f s " :             f u n c t i o n   ( p o d I d ,   p o s t C h g )   {  
                  
                     / / W e   a l r e a d y   u p d a t e d   t h e   X M L   s o   a l l   w e   n e e d   t o   d o   i s   p o s t   t h e   c h a n g e   t o   t h e   h o s t  
                     i f   ( p o s t C h g )   p o d T o o l s . n o t i f i c a t i o n . p o s t T o H o s t ( ) ;  
  
                 } ,  
  
                 " i n s e r t T a b " :             f u n c t i o n   ( t a b I d ,   l a b e l ,   s e q ,   i s T e m p ,   p o s t C h g )   {  
  
                     v a r   p o d T C   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S " ) ;  
                     v a r   p o d T a b   =   p o d T C . s e l e c t S i n g l e N o d e ( " P O D T A B [ @ i d = ' "   +   t a b I d   +   " ' ] " ) ;  
                     i f   ( p o d T a b )   a l e r t ( " p o d T a b   "   +   t a b I d   +   "   a l r e a d y   e x i s t s " ) ;  
  
                     p o d T a b   =   p o d T C . o w n e r D o c u m e n t . c r e a t e E l e m e n t ( " P O D T A B " ) ;  
                     i f   ( s e q )  
                     {  
                         v a r   i n s e r t P o i n t   =   n u l l ;  
                         f o r   ( v a r   i = 0 ;   i <   p o d T C . c h i l d N o d e s . l e n g t h ;   i + + )  
                         {  
                             v a r   p d   =   p o d T C . c h i l d N o d e s [ i ] ;  
                             i f   ( s e q   < =   i + 1 )   i n s e r t P o i n t   =   p d ;  
                             e l s e   p d . s e t A t t r i b u t e ( " s e q " ,   i + 1 ) ;  
                         }  
                         i f ( i n s e r t P o i n t )   p o d T C . i n s e r t B e f o r e ( p o d T a b ,   i n s e r t P o i n t ) ;  
                         e l s e   p o d T C . a p p e n d C h i l d ( p o d T a b ) ;  
                     }  
                     e l s e  
                     {  
                         p o d T C . a p p e n d C h i l d ( p o d T a b ) ;  
                     }  
  
                     p o d T a b . s e t A t t r i b u t e ( " i d " ,   t a b I d ) ;  
                     i f   ( l a b e l )   p o d T a b . s e t A t t r i b u t e ( " l a b e l " ,   l a b e l ) ;  
                     i f   ( i s T e m p )   p o d T a b . s e t A t t r i b u t e ( " t e m p " ,   " t r u e " ) ;  
                      
  
                     i f   ( p o s t C h g )   p o d T o o l s . n o t i f i c a t i o n . p o s t T o H o s t ( ) ;  
  
                     r e t u r n   p o d T a b ;  
                 } ,  
  
                 " r e m o v e T a b "   :   f u n c t i o n   ( t a b I d ,   p o s t C h g )   {  
  
                     v a r   p t N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B [ @ i d = ' "   +   t a b I d   +   " ' ] " ) ;  
                     i f   ( p t N o d e )   p t N o d e . p a r e n t N o d e . r e m o v e C h i l d ( p t N o d e ) ;  
  
                     i f   ( p o s t C h g )   p o d T o o l s . n o t i f i c a t i o n . p o s t T o H o s t ( ) ;  
                 } ,  
  
                 " r e n a m e T a b " :   f u n c t i o n ( t a b I d ,   t a b L a b e l ,   p o s t C h g )   {  
  
                     v a r   p t N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B [ @ i d = ' "   +   t a b I d   +   " ' ] " ) ;  
                     p t N o d e . s e t A t t r i b u t e ( " l a b e l " ,   t a b L a b e l ) ;  
  
                     i f   ( p o s t C h g )   p o d T o o l s . n o t i f i c a t i o n . p o s t T o H o s t ( ) ;  
                 } ,  
  
                 " c h a n g e T a b L a y o u t " :   f u n c t i o n ( t a b I d ,   l a y o u t ,   p o s t C h g )   {  
  
                     v a r   p t N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B [ @ i d = ' "   +   t a b I d   +   " ' ] " ) ;  
                     p t N o d e . s e t A t t r i b u t e ( " l a y o u t " ,   l a y o u t ) ;  
  
                     i f   ( p o s t C h g )   p o d T o o l s . n o t i f i c a t i o n . p o s t T o H o s t ( ) ;  
                 } ,  
  
                 " s e t P o d L o c a t i o n " :   f u n c t i o n ( p o d I d ,   c o l ,   s e q ,   p o s t C h g )   {  
  
                     v a r   p d N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B / P O D [ @ i d = ' "   +   p o d I d   +   " ' ] " ) ;  
                     p d N o d e . s e t A t t r i b u t e ( " c o l " ,   c o l ) ;  
                     p d N o d e . s e t A t t r i b u t e ( " s e q " ,   s e q ) ;  
  
                     i f   ( p o s t C h g )   p o d T o o l s . n o t i f i c a t i o n . p o s t T o H o s t ( ) ;  
  
                 } ,  
                  
                 " r e s e q u e n c e T a b N o d e s " :   f u n c t i o n ( t a b I d ,   p o s t C h g )   {  
            
                     v a r   p t N o d e   =   p o d T o o l s . d a s h O p t s . s e l e c t S i n g l e N o d e ( " / / P O D T A B S / P O D T A B [ @ i d = ' "   +   t a b I d   +   " ' ] " ) ;  
                     v a r   h l d   =   p t N o d e . i n s e r t B e f o r e ( p t N o d e . o w n e r D o c u m e n t . c r e a t e E l e m e n t ( " P L A C E H O L D E R " ) , p t N o d e . f i r s t C h i l d ) ;  
                      
                     v a r   m o r e C o l s   =   t r u e ;  
                     v a r   m o r e S e q s   =   t r u e ;  
                     v a r   c o l   =   0 ;  
                     v a r   s e q   =   0 ;  
                     v a r   l a s t s e q   =   0 ;  
                      
                     w h i l e   ( m o r e C o l s )  
                     {  
                         s e q   =   0 ;  
                         m o r e S e q s   =   t r u e ;  
                         v a r   c o l F o u n d   =   f a l s e ;  
                         w h i l e   ( m o r e S e q s )  
                         {  
                             v a r   c u r N o d e   =   h l d . n e x t S i b l i n g  
                             v a r   s e q F o u n d   =   f a l s e ;  
                             w h i l e   ( c u r N o d e )  
                             {  
                                 i f   ( c u r N o d e . g e t A t t r i b u t e ( " c o l " ) = = c o l )  
                                 {  
                                     c o l F o u n d   =   t r u e ;  
                                     i f   ( c u r N o d e . g e t A t t r i b u t e ( " s e q " ) = = s e q )  
                                     {  
                                         s e q F o u n d   =   t r u e ;  
                                         v a r   t N o d e   =   c u r N o d e . n e x t S i b l i n g ;    
                                         p t N o d e . i n s e r t B e f o r e ( c u r N o d e ,   h l d ) ;  
                                         c u r N o d e   =   t N o d e ;  
                                         l a s t s e q   =   s e q ;  
                                     }  
                                     e l s e   c u r N o d e   =   c u r N o d e . n e x t S i b l i n g ;  
                                 }        
                                 e l s e   c u r N o d e   =   c u r N o d e . n e x t S i b l i n g ;  
                             }  
                             s e q   + =   1 ;  
                             i f   ( ( s e q F o u n d   = =   f a l s e   & &   c o l F o u n d = = f a l s e )   | |   ( s e q - l a s t s e q   >   5 ) )   m o r e S e q s   =   f a l s e ;  
                         }  
                         c o l   + =   1 ;  
                         i f   ( c o l > 2 )   m o r e C o l s   =   f a l s e ;  
                     }  
  
                     h l d . p a r e n t N o d e . r e m o v e C h i l d ( h l d ) ;  
  
                     i f   ( p o s t C h g )   p o d T o o l s . n o t i f i c a t i o n . p o s t T o H o s t ( ) ;  
                 } ,  
              
                 / *   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *   * /  
                  
                 " s h o w T r a n P e n d i n g " :   f u n c t i o n ( s h o w I t )   {  
                     i f   ( p o d T o o l s . t r a n D s p A r e a )  
 	 	 	 	 	 {  
 	 	 	 	 	 	 v a r   e l   =   $ ( p o d T o o l s . t r a n D s p A r e a ) ;  
 	 	 	 	 	 	 i f   ( e l )  
 	 	 	 	 	 	 {  
 	 	 	 	 	 	 	 i f ( s h o w I t )  
 	 	 	 	 	 	 	 	 e l . s e t S t y l e ( " d i s p l a y " ,   " " ) ;  
 	 	 	 	 	 	 	 e l s e  
 	 	 	 	 	 	 	 	 e l . s e t S t y l e ( " d i s p l a y " ,   " n o n e " ) ;  
 	 	 	 	 	 	 }  
 	 	 	 	 	 }  
                 } ,  
                  
                 " b e g i n D e l a y e d P o s t " :   f u n c t i o n ( )   {  
                 	  
                 	 p o d T o o l s . n o t i f i c a t i o n . d i r t y   =   t r u e ;  
                     p o d T o o l s . n o t i f i c a t i o n . c a n c e l D e l a y e d P o s t ( ) ;  
                     p o d T o o l s . n o t i f i c a t i o n . t i m e r I d   =    
                             w i n d o w . s e t T i m e o u t ( " p o d T o o l s . n o t i f i c a t i o n . p o s t T o H o s t ( ) " ,   p o d T o o l s . n o t i f i c a t i o n . t i m e r D e l a y )  
                              
                     p o d T o o l s . n o t i f i c a t i o n . s h o w T r a n P e n d i n g ( t r u e ) ;  
                 } ,  
  
                 " c a n c e l D e l a y e d P o s t " :   f u n c t i o n ( )   {  
                  
                     i f   ( p o d T o o l s . n o t i f i c a t i o n . t i m e r I d )   w i n d o w . c l e a r T i m e o u t ( p o d T o o l s . n o t i f i c a t i o n . t i m e r I d ) ;    
                     p o d T o o l s . n o t i f i c a t i o n . t i m e r I d   =   n u l l ;  
                      
                     p o d T o o l s . n o t i f i c a t i o n . s h o w T r a n P e n d i n g ( f a l s e ) ;  
                 } ,  
  
 	 	 	 	 " f i n i s h D e l a y e d P o s t " :   f u n c t i o n ( )   {  
 	 	 	 	 	  
 	 	 	 	 	 i f ( p o d T o o l s . n o t i f i c a t i o n . t i m e r I d   ! =   n u l l )   p o d T o o l s . n o t i f i c a t i o n . p o s t T o H o s t ( ) ; 	 	 	 	 	  
  
                     p o d T o o l s . n o t i f i c a t i o n . s h o w T r a n P e n d i n g ( f a l s e ) ;  
 	 	 	 	 } ,  
                  
                 " p o s t T o H o s t " :   f u n c t i o n   ( )   {  
                  
                     p o d T o o l s . n o t i f i c a t i o n . c a n c e l D e l a y e d P o s t ( ) ;  
                     p o d T o o l s . n o t i f i c a t i o n . t i m e r I d   =   n u l l ;  
                 	 p o d T o o l s . n o t i f i c a t i o n . d i r t y   =   f a l s e ;  
                                    
 	 	 	 	 	 v a r   d o c T o S e n d   =   n e w   A c t i v e X O b j e c t ( ' M S X M L 2 . D O M D o c u m e n t ' ) ;  
 	 	 	 	 	 d o c T o S e n d . l o a d X M L ( p o d T o o l s . d a s h O p t s . x m l ) ;  
  
                     v a r   t m p L i s t   =   d o c T o S e n d . s e l e c t N o d e s ( " . / / P O D T A B [ @ t e m p = ' t r u e ' ] " ) ;  
                     f o r   ( v a r   i = t m p L i s t . l e n g t h - 1 ;   i > = 0 ;   i - - )  
                     {  
                     	 t m p L i s t [ i ] . p a r e n t N o d e . r e m o v e C h i l d ( t m p L i s t [ i ] ) ;  
                     }  
                      
                                        
 	 	 	 	 	 v a r   u r i   =   w i n d o w . t o p . _ a g t . v a l e t D i r e c t o r y U R L ( " a g e n t " , " p r i v a t e " ,   " p o s t " ,   " d a s h b o a r d o p t i o n s . x m l " ) ;  
 	 	 	 	 	 w i n d o w . t o p . t e m p t r a n . p o s t T e x t ( u r i ,   d o c T o S e n d . x m l ,   t r u e ) ;  
        
                     p o d T o o l s . n o t i f i c a t i o n . s h o w T r a n P e n d i n g ( f a l s e ) ;  
                 }    
         }  
                  
 } ;  
  
  
  
  
  
  
  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
 / *                                                                                                                                                                                                   * /  
 / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /  
  
  
  
  
  
 v a r   p o d H e l p e r s   =   {  
  
 	 " b u i l d P r e f P o d " :   f u n c t i o n   ( p o d I d ,   t i t l e T e x t ,   i s D r a g g a b l e )   {  
 	  
 	     v a r   b o r d e r P a r t s   =   p o d T o o l s . d s p B u i l d B o r d e r s ( ) ;  
 	  
 	 	 i f   ( t i t l e T e x t )  
 	 	 {  
 	 	     v a r   t i t l e p a r e n t   =   n e w   E l e m e n t ( " d i v " ,   {   ' c l a s s ' :   ' p o d t i t l e d i v   r p b t a b b e d m e n u   p o d t i t l e e x t r a ' ,   ' i d ' :   p o d I d   +   ' _ t i t l e ' ,   ' o w n e r i d ' :   p o d I d   } )  
 	 	  
 	 	     v a r   t i t l e d i v   =   n e w   E l e m e n t ( " d i v " ,   { ' i d ' :   p o d I d   +   ' _ t i t l e b o x ' ,   ' o w n e r i d ' :   p o d I d     } ) ;  
 	 	     i f   ( i s D r a g g a b l e )   t i t l e d i v . a d d C l a s s ( " p o d t i t l e d i v b o x " ) ;  
 	 	      
 	 	     v a r   t i t l e t e x t   =   n e w   E l e m e n t ( " s p a n " ,   {   ' c l a s s ' :   ' p o d t i t l e t e x t ' ,   ' i d ' :   p o d I d   +   ' _ t i t l e t e x t '   } ) . s e t T e x t ( t i t l e T e x t ) ;  
 	 	     v a r   t i t l e b u t t o n s   =   n e w   E l e m e n t ( " s p a n " ,   {   ' c l a s s ' :   ' p o d t i t l e b u t t o n s '   } ) ;  
 	 	     v a r   e n d f l o a t   =   n e w   E l e m e n t ( " s p a n " ) . s e t S t y l e ( ' c l e a r ' , ' b o t h ' )  
 	 	  
 	 	  
 	 	  
 	 	     t i t l e t e x t . i n j e c t ( t i t l e d i v ,   ' t o p ' ) ;  
 	 	     t i t l e d i v . i n j e c t ( t i t l e p a r e n t ) ;  
 	 	     t i t l e b u t t o n s . i n j e c t ( t i t l e d i v ,   ' b o t t o m ' ) ;  
 	 	 	 e n d f l o a t . i n j e c t ( t i t l e d i v ,   ' b o t t o m ' ) ;  
 	 	 	 t i t l e p a r e n t . i n j e c t ( b o r d e r P a r t s . p o d I n s i d e B o x ) ;  
 	 	 }  
 	  
 	     v a r   b a s e   =   n e w   E l e m e n t ( " d i v " ,   {   " c l a s s " :   " p o d   n o r m a l i z e d p o d " ,   " i d " :   p o d I d   } ) ;  
 	     $ ( b o r d e r P a r t s . p o d O u t s i d e B o x ) . i n j e c t ( b a s e ) ;  
 	  
 	 	 r e t u r n   { p o d O u t s i d e B o x   :   b a s e ,   p o d I n s i d e B o x   :   b o r d e r P a r t s . p o d I n s i d e B o x } ;  
 	  
 	 } ,  
  
 	 " c o n v e r t P o d W o r t h H T M L " :   f u n c t i o n ( )   {  
  
 	 	 $ $ ( ' . p o d w o r t h y ' ) . e a c h ( f u n c t i o n ( i t e m ) {  
 	 	 	 	 v a r   t i t l e T e x t   =   i t e m . g e t A t t r i b u t e ( " t i t l e t e x t " ) ;  
 	  
 	 	 	 	 i t e m . r e m o v e C l a s s ( " p o d w o r t h y " ) ;  
 	  
 	 	 	 	 v a r   p o d i d   =   ' p d '   +   M a t h . f l o o r ( M a t h . r a n d o m ( ) * 1 0 0 1 )   +   ( n e w   D a t e ) . g e t T i m e ( ) ; 	 	  
 	 	 	 	 v a r   n e w P o d   =   p o d H e l p e r s . b u i l d P r e f P o d ( p o d i d ,   t i t l e T e x t ,   f a l s e ) ;  
 	 	 	 	  
 	 	 	 	 v a r   i p   =   i t e m . 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 P o d . p o d O u t s i d e B o x ) ;  
 	 	 	 	 n e w P o d . p o d I n s i d e B o x . a p p e n d C h i l d ( i t e m ) ;  
 	 	 	 	  
 	 	 	 } ) ;  
 	 	  
 	 }  
 	  
 } ;  
  
 
