ÿþ/ /   J a v a S c r i p t   D o c u m e n t  
  
 f u n c t i o n   H i g h t l i g h t G r i d R o w ( ) {  
 	 v a r   o R o w s   =   $ ( ' . G r i d   . D a t a - r o w ' ) ;  
 	 o R o w s . e a c h ( f u n c t i o n ( ) {  
 	 	 v a r   o R o w   =   $ ( t h i s ) ;  
 	 	 o R o w . h o v e r ( f u n c t i o n ( ) { o R o w . c s s ( ' b a c k g r o u n d - c o l o r ' , ' # f 8 f 8 f 8 ' ) } , f u n c t i o n ( ) { o R o w . c s s ( ' b a c k g r o u n d - c o l o r ' , ' ' ) } ) 	 	 	 	        
 	 } )  
 }  
  
 f u n c t i o n   L o a d M o d e l s ( ) {  
                  
                 $ ( ' s e l e c t [ n a m e = P e r i o d I D ]   o p t i o n : g t ( 0 ) ' ) . r e m o v e ( ) ;  
                 $ ( ' s e l e c t [ n a m e = P e r i o d I D ] ' ) . g e t ( 0 ) . s e l e c t e d I n d e x = 0 ;  
                  
                 v a r   d i v C o n t a i n e r   =   $ ( ' s e l e c t [ n a m e = M o d e l I D ] ' ) . p a r e n t ( ) ;  
                 v a r   d i v O v e r l a y   =   $ ( ' < d i v   c l a s s = " L o a d i n g - o v e r l a y "   s t y l e = " w i d t h : '   +   d i v C o n t a i n e r . w i d t h ( )   +   ' p x ;   h e i g h t : '   +   d i v C o n t a i n e r . h e i g h t ( )   +   ' p x ;   b a c k g r o u n d - p o s i t i o n : 1 5 2 p x   c e n t e r " > < / d i v > ' ) ;  
                 d i v C o n t a i n e r . p r e p e n d ( d i v O v e r l a y ) ;  
                                
                 $ . a j a x ( {  
                         t y p e : " P O S T " ,  
                         u r l   : ' G e t C o n t e n t . a s p x ? a c t = l o a d m o d e l & m a k e r i d = '   +   $ ( ' s e l e c t [ n a m e = M a k e r I D ] ' ) . v a l ( ) ,                          
                         s u c c e s s :   f u n c t i o n ( s R t n ) {  
                                 i f ( $ . t r i m ( s R t n ) ! = ' ' )  
                                         $ ( ' s e l e c t [ n a m e = M o d e l I D ] ' ) . e m p t y ( ) . a p p e n d ( s R t n )                                  
                                 e l s e  
                                         $ ( ' s e l e c t [ n a m e = M o d e l I D ]   o p t i o n : g t ( 0 ) ' ) . r e m o v e ( ) ;  
                                 $ ( ' s e l e c t [ n a m e = M o d e l I D ] ' ) . g e t ( 0 ) . s e l e c t e d I n d e x = 0 ;  
                                 d i v O v e r l a y . r e m o v e ( ) ;  
                         }  
                 } ) ;  
 }  
          
 f u n c t i o n   L o a d P e r i o d s ( ) {  
                  
                 v a r   d i v C o n t a i n e r   =   $ ( ' s e l e c t [ n a m e = P e r i o d I D ] ' ) . p a r e n t ( ) ;  
                 v a r   d i v O v e r l a y   =   $ ( ' < d i v   c l a s s = " L o a d i n g - o v e r l a y "   s t y l e = " w i d t h : '   +   d i v C o n t a i n e r . w i d t h ( )   +   ' p x ;   h e i g h t : '   +   d i v C o n t a i n e r . h e i g h t ( )   +   ' p x ;   b a c k g r o u n d - p o s i t i o n : 1 5 2 p x   c e n t e r " > < / d i v > ' ) ;  
                 d i v C o n t a i n e r . p r e p e n d ( d i v O v e r l a y ) ;  
                  
                 $ . a j a x ( {  
                         t y p e : " P O S T " ,  
                         u r l   : ' G e t C o n t e n t . a s p x ? a c t = l o a d p e r i o d & m o d e l i d = '   +   $ ( ' s e l e c t [ n a m e = M o d e l I D ] ' ) . v a l ( ) ,                          
                         s u c c e s s :   f u n c t i o n ( s R t n ) {  
                                 i f ( $ . t r i m ( s R t n ) ! = ' ' )  
                                         $ ( ' s e l e c t [ n a m e = P e r i o d I D ] ' ) . e m p t y ( ) . a p p e n d ( s R t n )  
                                 e l s e  
                                         $ ( ' s e l e c t [ n a m e = P e r i o d I D ]   o p t i o n : g t ( 0 ) ' ) . r e m o v e ( ) ;  
                                  
                                 $ ( ' s e l e c t [ n a m e = P e r i o d I D ] ' ) . g e t ( 0 ) . s e l e c t e d I n d e x = 0 ;  
                                 d i v O v e r l a y . r e m o v e ( ) ;  
                         }  
                 } ) ;  
 }  
  
 f u n c t i o n   G e t S e a r c h Q u e r y ( ) {  
         i f ( $ ( ' . S e a r c h - f o r m - c e l l   i n p u t [ n a m e = K e y w o r d ] ' ) . v a l ( ) = = ' T ë  k h ó a   l i ê n   q u a n ' )  
                 r e t u r n   ' P r o d u c t s . a s p x ? a c t = s e a r c h & '   +   $ ( ' . S e a r c h - f o r m - c e l l   . I n p u t - i t e m : n o t ( [ n a m e = K e y w o r d ] ) , i n p u t [ n a m e = O r d e r ] ' ) . s e r i a l i z e ( )  
         e l s e  
 	         r e t u r n   ' P r o d u c t s . a s p x ? a c t = s e a r c h & '   +   $ ( ' . S e a r c h - f o r m - c e l l   i n p u t , . S e a r c h - f o r m - c e l l   . I n p u t - i t e m , i n p u t [ n a m e = O r d e r ] ' ) . s e r i a l i z e ( )  
 }  
          
 f u n c t i o n   I n i t S e a r c h B o x ( ) {  
                 $ ( ' . S e a r c h - f o r m - c e l l   i n p u t [ n a m e = K e y w o r d ] ' ) . f o c u s ( f u n c t i o n ( ) {  
                         i f ( $ ( t h i s ) . v a l ( ) = = ' T ë  k h ó a   l i ê n   q u a n ' )   $ ( t h i s ) . v a l ( ' ' )  
                 } ) . b l u r ( f u n c t i o n ( ) {  
                         i f ( $ . t r i m ( $ ( t h i s ) . v a l ( ) ) = = ' ' )   $ ( t h i s ) . c s s ( ' c o l o r ' , ' # 3 3 3 3 3 3 ' ) . v a l ( ' T ë  k h ó a   l i ê n   q u a n ' )  
                 } )  
                          
                 $ ( ' # t b S e a r c h   . S e a r c h - f o r m - c e l l ' ) . k e y p r e s s ( f u n c t i o n ( e ) {  
 	                 i f ( e . w h i c h = = 1 3 )   $ ( d o c u m e n t ) . g e t ( 0 ) . l o c a t i o n   =   G e t S e a r c h Q u e r y ( ) ;  
 	         } )  
 	         $ ( ' # b t n S e a r c h ' ) . c l i c k ( f u n c t i o n ( ) {  
 	                 $ ( d o c u m e n t ) . g e t ( 0 ) . l o c a t i o n   =   G e t S e a r c h Q u e r y ( ) ;  
 	         } )  
 }        
          
  
 $ ( d o c u m e n t ) . r e a d y ( f u n c t i o n ( ) {  
         I n i t S e a r c h B o x ( ) ;  
 	 H i g h t l i g h t G r i d R o w ( ) ;  
 } ) 
