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