ÿþv a r   A B O U T   =   " \ u 0 0 C 2 m   l \ u 1 E C B c h   V i \ u 1 E C 7 t   N a m   " + " \ n P h °Ûc   K h á n h   A n   W e b s i t e   h t t p : / / c h u a h o a n g p h a p . c o m . v n " ; v a r   n g a y l e ; v a r   l e h o i = " " ; v a r   C n g a y l e = " n g a y t h a n g " ; v a r   t p t = " \ n   C h ù a   H o ±n g   P h á p   T Õ  C h éc   K h ó a   T u   P h ­t   T h ¥t   l §n   t h é  " ; v a r   t 1 n = " \ n   C h ù a   H o ±n g   P h á p   T Õ  C h éc   K h ó a   T u   M Ùt   N g à y \ n " ; v a r   q u y y t a m b a o = "   C h ù a   H o ±n g   P h á p   t Õ  c h éc   l Å  q u y   y   T a m   B £o \ n " ;  
 v a r   T K 1 9   =   n e w   A r r a y ( 0 x 3 0 b a a 3 ,   0 x 5 6 a b 5 0 ,   0 x 4 2 2 b a 0 ,   0 x 2 c a b 6 1 ,   0 x 5 2 a 3 7 0 ,   0 x 3 c 5 1 e 8 ,   0 x 6 0 d 1 6 0 ,   0 x 4 a e 4 b 0 ,   0 x 3 7 6 9 2 6 ,   0 x 5 8 d a a 0 ,   0 x 4 4 5 b 5 0 ,   0 x 3 1 1 6 d 2 ,   0 x 5 6 2 a e 0 ,   0 x 3 e a 2 e 0 ,   0 x 2 8 e 2 d 2 ,   0 x 4 e c 9 5 0 ,   0 x 3 8 d 5 5 6 ,   0 x 5 c b 5 2 0 ,   0 x 4 6 b 6 9 0 ,   0 x 3 2 5 d a 4 ,   0 x 5 8 5 5 d 0 ,   0 x 4 2 2 5 d 0 ,   0 x 2 c a 5 b 3 ,   0 x 5 2 a 2 b 0 ,   0 x 3 d a 8 b 7 ,   0 x 6 0 a 9 5 0 ,   0 x 4 a b 4 a 0 ,   0 x 3 5 b 2 a 5 ,   0 x 5 a a d 5 0 ,   0 x 4 4 5 5 b 0 ,   0 x 3 0 2 b 7 4 ,   0 x 5 6 2 5 7 0 ,   0 x 4 0 5 2 f 9 ,   0 x 6 4 5 2 b 0 ,   0 x 4 e 6 9 5 0 ,   0 x 3 8 6 d 5 6 ,   0 x 5 e 5 a a 0 ,   0 x 4 6 a b 5 0 ,   0 x 3 2 5 6 d 4 ,   0 x 5 8 4 a e 0 , 0 x 4 2 a 5 7 0 ,   0 x 2 d 4 5 5 3 ,   0 x 5 0 d 2 a 0 ,   0 x 3 b e 8 a 7 ,   0 x 6 0 d 5 5 0 ,   0 x 4 a 5 a a 0 ,   0 x 3 4 a d a 5 ,   0 x 5 a 9 5 d 0 ,   0 x 4 6 4 a e 0 ,   0 x 2 e a a b 4 ,   0 x 5 4 a 4 d 0 ,   0 x 3 e d 2 b 8 ,   0 x 6 4 b 2 9 0 ,   0 x 4 c b 5 5 0 ,   0 x 3 8 5 7 5 7 ,   0 x 5 e 2 d a 0 ,   0 x 4 8 9 5 d 0 ,   0 x 3 2 4 d 7 5 ,   0 x 5 8 4 9 b 0 ,   0 x 4 2 a 4 b 0 ,   0 x 2 d a 4 b 3 ,   0 x 5 0 6 a 9 0 ,   0 x 3 a a d 9 8 ,   0 x 6 0 6 b 5 0 ,   0 x 4 c 2 b 6 0 ,   0 x 3 5 9 3 6 5 ,   0 x 5 a 9 3 7 0 ,   0 x 4 6 4 9 7 0 ,   0 x 3 0 6 9 6 4 ,   0 x 5 2 e 4 a 0 ,   0 x 3 c e a 6 a ,   0 x 6 2 d a 9 0 ,   0 x 4 e 5 a d 0 ,   0 x 3 9 2 a d 6 ,   0 x 5 e 2 a e 0 ,   0 x 4 8 9 2 e 0 ,   0 x 3 2 c a d 5 ,   0 x 5 6 c 9 5 0 ,   0 x 4 0 d 4 a 0 ,   0 x 2 b d 4 a 3 ,   0 x 5 0 b 6 9 0 ,   0 x 3 a 5 7 a 7 ,   0 x 6 0 5 5 b 0 ,   0 x 4 c 2 5 d 0 ,   0 x 3 6 9 5 b 5 ,   0 x 5 a 9 2 b 0 ,   0 x 4 4 a 9 5 0 ,   0 x 2 e d 9 5 4 ,   0 x 5 4 b 4 a 0 ,   0 x 3 c b 5 5 0 ,   0 x 2 8 6 b 5 2 ,   0 x 4 e 5 5 b 0 ,   0 x 3 a 2 7 7 6 ,   0 x 5 e 2 5 7 0 ,   0 x 4 8 5 2 b 0 ,   0 x 3 2 a a a 5 ,   0 x 5 6 e 9 5 0 ,   0 x 4 0 6 a a 0 ,   0 x 2 a b a a 3 ,   0 x 5 0 a b 5 0 ) ;   / *   Y e a r s   2 0 0 0 - 2 0 9 9   * /  
 v a r   T K 2 0   =   n e w   A r r a y ( 0 x 3 c 4 b d 8 ,   0 x 6 2 4 a e 0 ,   0 x 4 c a 5 7 0 ,   0 x 3 8 5 4 d 5 ,   0 x 5 c d 2 6 0 ,   0 x 4 4 d 9 5 0 ,   0 x 3 1 5 5 5 4 ,   0 x 5 6 5 6 a 0 ,   0 x 4 0 9 a d 0 ,   0 x 2 a 5 5 d 2 ,   0 x 5 0 4 a e 0 ,   0 x 3 a a 5 b 6 ,   0 x 6 0 a 4 d 0 ,   0 x 4 8 d 2 5 0 ,   0 x 3 3 d 2 5 5 ,   0 x 5 8 b 5 4 0 ,   0 x 4 2 d 6 a 0 ,   0 x 2 c a d a 2 ,   0 x 5 2 9 5 b 0 ,   0 x 3 f 4 9 7 7 ,   0 x 6 4 4 9 7 0 ,   0 x 4 c a 4 b 0 ,   0 x 3 6 b 4 b 5 ,   0 x 5 c 6 a 5 0 ,   0 x 4 6 6 d 5 0 ,   0 x 3 1 2 b 5 4 ,   0 x 5 6 2 b 6 0 ,   0 x 4 0 9 5 7 0 ,   0 x 2 c 5 2 f 2 ,   0 x 5 0 4 9 7 0 ,   0 x 3 a 6 5 6 6 ,   0 x 5 e d 4 a 0 ,   0 x 4 8 e a 5 0 ,   0 x 3 3 6 a 9 5 ,   0 x 5 8 5 a d 0 ,   0 x 4 4 2 b 6 0 ,   0 x 2 f 8 6 e 3 ,   0 x 5 2 9 2 e 0 ,   0 x 3 d c 8 d 7 ,   0 x 6 2 c 9 5 0 ,   0 x 4 c d 4 a 0 ,   0 x 3 5 d 8 a 6 ,   0 x 5 a b 5 5 0 ,   0 x 4 6 5 6 a 0 ,   0 x 3 1 a 5 b 4 ,   0 x 5 6 2 5 d 0 ,   0 x 4 0 9 2 d 0 ,   0 x 2 a d 2 b 2 ,   0 x 5 0 a 9 5 0 ,   0 x 3 8 b 5 5 7 ,   0 x 5 e 6 c a 0 ,   0 x 4 8 b 5 5 0 ,   0 x 3 5 5 3 5 5 ,   0 x 5 8 4 d a 0 ,   0 x 4 2 a 5 b 0 ,   0 x 2 f 4 5 7 3 ,   0 x 5 4 5 2 b 0 ,   0 x 3 c a 9 a 8 ,   0 x 6 0 e 9 5 0 ,   0 x 4 c 6 a a 0 ,   0 x 3 6 a e a 6 ,   0 x 5 a a b 5 0 ,   0 x 4 6 4 b 6 0 ,   0 x 3 0 a a e 4 ,   0 x 5 6 a 5 7 0 ,   0 x 4 0 5 2 6 0 ,   0 x 2 8 f 2 6 3 ,   0 x 4 e d 9 4 0 ,   0 x 3 8 d b 4 7 ,   0 x 5 c d 6 a 0 ,   0 x 4 8 9 6 d 0 ,   0 x 3 4 4 d d 5 ,   0 x 5 a 4 a d 0 ,   0 x 4 2 a 4 d 0 ,   0 x 2 c d 4 b 4 ,   0 x 5 2 b 2 5 0 ,   0 x 3 c d 5 5 8 ,   0 x 6 0 b 5 4 0 ,   0 x 4 a b 5 a 0 ,   0 x 3 7 5 5 a 6 ,   0 x 5 c 9 5 b 0 ,   0 x 4 6 4 9 b 0 ,   0 x 3 0 a 9 7 4 ,   0 x 5 6 a 4 b 0 ,   0 x 4 0 a a 5 0 ,   0 x 2 9 a a 5 2 ,   0 x 4 e 6 d 2 0 ,   0 x 3 9 a d 4 7 ,   0 x 5 e a b 6 0 ,   0 x 4 8 9 3 7 0 ,   0 x 3 4 4 a f 5 ,   0 x 5 a 4 9 7 0 ,   0 x 4 4 6 4 b 0 ,   0 x 2 c 7 4 a 3 ,   0 x 5 0 e a 5 0 ,   0 x 3 d 6 a 5 8 ,   0 x 6 2 5 6 a 0 ,   0 x 4 a a a d 0 ,   0 x 3 6 9 6 d 5 ,   0 x 5 c 9 2 e 0 ) ;   / *   Y e a r s   1 9 0 0 - 1 9 9 9   * /  
 v a r   T K 2 1   =   n e w   A r r a y ( 0 x 4 6 c 9 6 0 ,   0 x 2 e d 9 5 4 ,   0 x 5 4 d 4 a 0 ,   0 x 3 e d a 5 0 ,   0 x 2 a 7 5 5 2 ,   0 x 4 e 5 6 a 0 ,   0 x 3 8 a 7 a 7 ,   0 x 5 e a 5 d 0 ,   0 x 4 a 9 2 b 0 ,   0 x 3 2 a a b 5 ,   0 x 5 8 a 9 5 0 ,   0 x 4 2 b 4 a 0 ,   0 x 2 c b a a 4 ,   0 x 5 0 a d 5 0 ,   0 x 3 c 5 5 d 9 ,   0 x 6 2 4 b a 0 ,   0 x 4 c a 5 b 0 ,   0 x 3 7 5 1 7 6 ,   0 x 5 c 5 2 7 0 ,   0 x 4 6 6 9 3 0 ,   0 x 3 0 7 9 3 4 ,   0 x 5 4 6 a a 0 ,   0 x 3 e a d 5 0 ,   0 x 2 a 5 b 5 2 ,   0 x 5 0 4 b 6 0 ,   0 x 3 8 a 6 e 6 ,   0 x 5 e a 4 e 0 ,   0 x 4 8 d 2 6 0 ,   0 x 3 2 e a 6 5 ,   0 x 5 6 d 5 2 0 ,   0 x 4 0 d a a 0 ,   0 x 2 d 5 6 a 3 ,   0 x 5 2 5 6 d 0 ,   0 x 3 c 4 a f b ,   0 x 6 2 4 9 d 0 ,   0 x 4 c a 4 d 0 ,   0 x 3 7 d 0 b 6 ,   0 x 5 a b 2 5 0 ,   0 x 4 4 b 5 2 0 ,   0 x 2 e d d 2 5 ,   0 x 5 4 b 5 a 0 ,   0 x 3 e 5 5 d 0 ,   0 x 2 a 5 5 b 2 ,   0 x 5 0 4 9 b 0 ,   0 x 3 a a 5 7 7 ,   0 x 5 e a 4 b 0 ,   0 x 4 8 a a 5 0 ,   0 x 3 3 b 2 5 5 ,   0 x 5 8 6 d 2 0 ,   0 x 4 0 a d 6 0 ,   0 x 2 d 4 b 6 3 ,   0 x 5 2 5 3 7 0 ,   0 x 3 e 4 9 e 8 ,   0 x 6 0 c 9 7 0 ,   0 x 4 c 5 4 b 0 ,   0 x 3 7 6 8 a 6 ,   0 x 5 a d a 5 0 ,   0 x 4 4 5 a a 0 ,   0 x 2 f a 6 a 4 ,   0 x 5 4 a a d 0 ,   0 x 4 0 5 2 e 0 ,   0 x 2 8 d 2 e 3 ,   0 x 4 e c 9 5 0 ,   0 x 3 8 d 5 5 7 ,   0 x 5 e d 4 a 0 ,   0 x 4 6 d 9 5 0 ,   0 x 3 2 5 d 5 5 ,   0 x 5 8 5 6 a 0 ,   0 x 4 2 a 6 d 0 ,   0 x 2 c 5 5 d 4 ,   0 x 5 2 5 2 b 0 ,   0 x 3 c a 9 b 8 ,   0 x 6 2 a 9 3 0 ,   0 x 4 a b 4 9 0 ,   0 x 3 4 b 6 a 6 ,   0 x 5 a a d 5 0 ,   0 x 4 6 5 5 a 0 ,   0 x 2 e a b 6 4 ,   0 x 5 4 a 5 7 0 ,   0 x 4 0 5 2 b 0 ,   0 x 2 a b 1 7 3 ,   0 x 4 e 6 9 3 0 ,   0 x 3 8 6 b 3 7 ,   0 x 5 e 6 a a 0 ,   0 x 4 8 a d 5 0 ,   0 x 3 3 2 a d 5 ,   0 x 5 8 2 b 6 0 ,   0 x 4 2 a 5 7 0 ,   0 x 2 e 5 2 e 4 ,   0 x 5 0 d 1 6 0 ,   0 x 3 a e 9 5 8 ,   0 x 6 0 d 5 2 0 ,   0 x 4 a d a 9 0 ,   0 x 3 5 5 a a 6 ,   0 x 5 a 5 6 d 0 ,   0 x 4 6 2 a e 0 ,   0 x 3 0 a 9 d 4 ,   0 x 5 4 a 2 d 0 ,   0 x 3 e d 1 5 0 ,   0 x 2 8 e 9 5 2 ) ;   / *   Y e a r s   2 0 0 0 - 2 0 9 9   * /  
 v a r   T K 2 2   =   n e w   A r r a y ( 0 x 4 e b 5 2 0 ,   0 x 3 8 d 7 2 7 ,   0 x 5 e a d a 0 ,   0 x 4 a 5 5 b 0 ,   0 x 3 6 2 d b 5 ,   0 x 5 a 4 5 b 0 ,   0 x 4 4 a 2 b 0 ,   0 x 2 e b 2 b 4 ,   0 x 5 4 a 9 5 0 ,   0 x 3 c b 5 5 9 ,   0 x 6 2 6 b 2 0 ,   0 x 4 c a d 5 0 ,   0 x 3 8 5 7 6 6 ,   0 x 5 c 5 3 7 0 ,   0 x 4 8 4 5 7 0 ,   0 x 3 2 6 5 7 4 ,   0 x 5 8 5 2 b 0 ,   0 x 4 0 6 9 5 0 ,   0 x 2 a 7 9 5 3 ,   0 x 5 0 5 a a 0 ,     0 x 3 b a a a 7 ,   0 x 5 e a 6 d 0 ,   0 x 4 a 4 a e 0 ,   0 x 3 5 a 2 e 5 ,   0 x 5 a a 5 5 0 ,   0 x 4 2 d 2 a 0 ,   0 x 2 d e 2 a 4 ,   0 x 5 2 d 5 5 0 ,   0 x 3 e 5 a b b ,   0 x 6 2 5 6 a 0 ,     0 x 4 c 9 6 d 0 ,   0 x 3 9 4 9 b 6 ,   0 x 5 e 4 a b 0 ,   0 x 4 6 a 8 d 0 ,   0 x 3 0 d 4 b 5 ,   0 x 5 6 b 2 9 0 ,   0 x 4 0 b 5 5 0 ,   0 x 2 a 6 d 5 2 ,   0 x 5 0 4 d a 0 ,   0 x 3 b 9 5 6 7 ,     0 x 6 0 9 5 7 0 ,   0 x 4 a 4 9 b 0 ,   0 x 3 4 a 9 7 5 ,   0 x 5 a 6 4 b 0 ,   0 x 4 4 6 a 9 0 ,   0 x 2 c b a 9 4 ,   0 x 5 2 6 b 5 0 ,   0 x 3 e 2 b 6 0 ,   0 x 2 8 a b 6 1 ,   0 x 4 c 9 5 7 0 ,     0 x 3 8 4 a e 6 ,   0 x 5 c d 1 6 0 ,   0 x 4 6 e 4 a 0 ,   0 x 2 e e d 2 5 ,   0 x 5 4 d a 9 0 ,   0 x 4 0 5 b 5 0 ,   0 x 2 c 3 6 d 3 ,   0 x 5 0 2 a e 0 ,   0 x 3 a 9 3 d 7 ,   0 x 6 0 9 2 d 0 ,     0 x 4 a c 9 5 0 ,   0 x 3 2 d 5 5 6 ,   0 x 5 8 b 4 a 0 ,   0 x 4 2 b 6 9 0 ,   0 x 2 e 5 d 9 4 ,   0 x 5 2 5 5 b 0 ,   0 x 3 e 2 5 f a ,   0 x 6 4 2 5 b 0 ,   0 x 4 e 9 2 b 0 ,   0 x 3 6 a a b 6 ,     0 x 5 c 6 9 5 0 ,   0 x 4 6 7 4 a 0 ,   0 x 3 1 b 2 a 5 ,   0 x 5 4 a d 5 0 ,   0 x 4 0 5 5 a 0 ,   0 x 2 a a b 7 3 ,   0 x 5 2 2 5 7 0 ,   0 x 3 a 5 3 7 7 ,   0 x 6 0 5 2 b 0 ,   0 x 4 a 6 9 5 0 ,     0 x 3 4 6 d 5 6 ,   0 x 5 8 5 a a 0 ,   0 x 4 2 a b 5 0 ,   0 x 2 e 5 6 d 4 ,   0 x 5 4 4 a e 0 ,   0 x 3 c a 5 7 0 ,   0 x 2 8 6 4 d 2 ,   0 x 4 c d 2 6 0 ,   0 x 3 6 e a a 6 ,   0 x 5 a d 5 5 0 ,     0 x 4 6 5 a a 0 ,   0 x 3 0 a d a 5 ,   0 x 5 6 9 5 d 0 ,   0 x 4 0 4 a d 0 ,   0 x 2 a a 9 b 3 ,   0 x 5 0 a 4 d 0 ,   0 x 3 a d 2 b 7 ,   0 x 5 e b 2 5 0 ,   0 x 4 8 b 5 4 0 ,   0 x 3 3 d 5 5 6 ) ;   / *   Y e a r s   2 1 0 0 - 2 1 9 9   * /  
 v a r   L E H   = [ " " , " 0 9 - 0 1 " , " " , " 2 1 - 0 3   v à   2 9 - 0 3 " , " 0 3 - 0 4 " , " 1 6 - 0 5 " , " 1 3 - 0 6 " , " 1 8 - 0 7 " , " 1 5 - 0 8 " , " 1 2 - 0 9 " , " 1 0 - 1 0 " , " 0 7 - 1 1 " , " 1 2 - 1 2 " ] ;  
 v a r   L E K H A C = [ " " , " L Å  C §u   A n   §u   N m     \ n " , " " , " " , " L Å  P h ­t   £n   1 5 - 0 4   \ n " , " " , " " , " L Å  V u   L a n   1 5 - 0 7   \ n " , " " , " " , " L Å  G i ×  T Õ  1 6 - 1 0   \ n " , " L Å  v í a   P h ­t   A   D i   à   1 7 - 1 1   \ n " , " " ] ;  
 v a r   C A N   =   n e w   A r r a y ( " G i \ 3 4 1 p " ,   " \ u 1 E A 4 t " ,   " B \ 3 5 5 n h " ,   " \ u 0 1 1 0 i n h " ,   " M \ u 1 E A D u " ,   " K \ u 1 E F 7 " ,   " C a n h " ,   " T \ 3 4 2 n " ,   " N h \ 3 4 2 m " ,   " Q u \ 3 7 5 " ) ;  
 v a r   C H I   =   n e w   A r r a y ( " T \ 3 7 5 " ,   " S \ u 1 E E D u " ,   " D \ u 1 E A 7 n " ,   " M \ 3 4 3 o " ,   " T h \ 3 5 4 n " ,   " T \ u 1 E F 5 " ,   " N g \ u 1 E C D " ,   " M \ 3 7 1 i " ,   " T h \ 3 4 2 n " ,   " D \ u 1 E A D u " ,   " T u \ u 1 E A 5 t " ,   " H \ u 1 E E 3 i " ) ;  
 v a r   T U A N   =   n e w   A r r a y ( " C h \ u 1 E E 7   n h \ u 1 E A D t " ,   " T h \ u 1 E E 9   h a i " ,   " T h \ u 1 E E 9   b a " ,   " T h \ u 1 E E 9   t \ u 0 1 B 0 " ,   " T h \ u 1 E E 9   n \ u 0 1 0 3 m " ,   " T h \ u 1 E E 9   s \ 3 4 1 u " ,   " T h \ u 1 E E 9   b \ u 1 E A 3 y " ) ;  
 v a r   G I O _ H D   =   n e w   A r r a y ( " 1 1 0 1 0 0 1 0 1 1 0 0 " ,   " 0 0 1 1 0 1 0 0 1 0 1 1 " ,   " 1 1 0 0 1 1 0 1 0 0 1 0 " ,   " 1 0 1 1 0 0 1 1 0 1 0 0 " ,   " 0 0 1 0 1 1 0 0 1 1 0 1 " ,   " 0 1 0 0 1 0 1 1 0 0 1 1 " ) ;  
 v a r   T I E T K H I   =   n e w   A r r a y ( " X u \ u 0 0 E 2 n   p h \ u 0 0 E 2 n " ,   " T h a n h   m i n h " ,   " C \ u 1 E D 1 c   v \ u 0 1 6 9 " ,   " L \ u 1 E A D p   h \ u 1 E A 1 " ,   " T i \ u 1 E C 3 u   m \ u 0 0 E 3 n " ,   " M a n g   c h \ u 1 E E 7 n g " ,   " H \ u 1 E A 1   c h \ u 0 0 E D " ,   " T i \ u 1 E C 3 u   t h \ u 1 E E D " ,   " \ u 0 1 1 0 \ u 1 E A 1 i   t h \ u 1 E E D " ,   " L \ u 1 E A D p   t h u " ,   " X \ u 1 E E D   t h \ u 1 E E D " ,   " B \ u 1 E A 1 c h   l \ u 1 E D 9 " ,   " T h u   p h \ u 0 0 E 2 n " ,   " H \ u 0 0 E 0 n   l \ u 1 E D 9 " ,   " S \ u 0 1 B 0 \ u 0 1 A 1 n g   g i \ u 0 0 E 1 n g " ,   " L \ u 1 E A D p   \ u 0 1 1 1 \ u 0 0 F 4 n g " ,   " T i \ u 1 E C 3 u   t u y \ u 1 E B F t " ,   " \ u 0 1 1 0 \ u 1 E A 1 i   t u y \ u 1 E B F t " ,   " \ u 0 1 1 0 \ u 0 0 F 4 n g   c h \ u 0 0 E D " ,   " T i \ u 1 E C 3 u   h \ u 0 0 E 0 n " ,   " \ u 0 1 1 0 \ u 1 E A 1 i   h \ u 0 0 E 0 n " ,   " L \ u 1 E A D p   x u \ u 0 0 E 2 n " ,   " V \ u 0 1 6 9   T h \ u 1 E E 7 y " ,   " K i n h   t r \ u 1 E A D p " ) ;  
 f u n c t i o n   n g a y l e H P ( n g d , t h d , n g a y , t h a n g , n a m ) {  
 v a r   P T = [ " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " ] ;  
 v a r   L Q Y = [ " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " ] ;  
 v a r   n g a y t h a n g = n g a y + " - " + t h a n g ;  
 v a r   n g a y a m = n g d + " - " + t h d ;  
   v a r   s ;   C n g a y l e = " n g a y t h a n g " ;   v a r   l e h o i 1 = " N g à y   "   +   n g a y a m   +   "   K ÷  S íu   "   + n a m ;   s = " " ;    
   i f ( n g a y a m = = " 1 5 - 1 " ) {   s   + =   " \ n N g à y     " + L E K H A C [ 1 ] ; C n g a y l e = " t e t " ; }  
   i f ( n g a y a m = = " 1 5 - 4 " ) {   s   + =   " \ n N g à y   " + L E K H A C [ 4 ] ; C n g a y l e = " t e t " ; }  
   i f ( n g a y a m = = " 1 5 - 7 " ) {   s   + =   " \ n N g à y   " + L E K H A C [ 7 ] ; C n g a y l e = " t e t " ; }  
   i f ( n g a y a m = = " 1 6 - 1 0 " ) { s   + =   " \ n N g à y   " + L E K H A C [ 1 0 ] ; C n g a y l e = " t e t " ; }  
   i f ( n g a y a m = = " 1 7 - 1 1 " ) { s   + =   " \ n N g à y   " + L E K H A C [ 1 1 ] ; C n g a y l e = " t e t " ; }  
 i f ( n a m = = 2 0 0 9 ) {    
 v a r   P T = [ " " , " " , " 1 5   ¿n   2 2 / 0 2 / 2 0 0 9 " , " " , " 1 2   ¿n   1 9 / 0 4 / 2 0 0 9 " , " " , " " , " " , " " , " 0 6   ¿n   1 3 / 0 9 / 2 0 0 9 " , " " , " 0 8   ¿n   1 5 / 1 1 / 2 0 0 9 " , " 2 6 - 1 2 - 2 0 0 9   ¿n   2 - 0 1 - 2 0 1 0 " ] ;  
 v a r   L Q Y = [ " " , " " , " " , " " , " \ n 0 5 - 0 4 " , " " , " " , " " , " \ n 3 0 - 0 8 " , " " , " " , " " , " " ] ;  
 s w i t c h ( n g a y t h a n g ) {  
 	 c a s e   " 5 - 4 " : c a s e   " 3 0 - 8 " : s   + =   " N g à y   " + n g a y t h a n g + q u y y t a m b a o   ; l e h o i = " < / b r > < f o n t   c o l o r = ' # 0 0 0 0 F F ' >   N g à y   " + s ; C n g a y l e = " t e t " ; b r e a k ;  
 	 	 c a s e   " 1 7 - 1 " : c a s e   " 1 - 3 " :   c a s e   " 2 9 - 3 " :   c a s e   " 2 6 - 4 " :   c a s e   " 3 1 - 5 " :   c a s e   " 2 8 - 6 " :   c a s e   " 2 6 - 7 " :   c a s e   " 2 3 - 8 " :   c a s e   " 2 0 - 9 " :   c a s e   " 2 5 - 1 0 " :   c a s e   " 2 2 - 1 1 " :   c a s e   " 2 0 - 1 2 " :   s = t 1 n ; C n g a y l e = " t e t " ; b r e a k ;  
 	 c a s e   " 1 5 - 2 " : c a s e   " 1 6 - 2 " : c a s e   " 1 7 - 2 " : c a s e   " 1 8 - 2 " :   c a s e   " 1 9 - 2 " : c a s e   " 2 0 - 2 " : c a s e   " 2 1 - 2 " : c a s e   " 2 2 - 2 " : s = t p t + "   5 5 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 c a s e   " 1 5 - 4 " : c a s e   " 1 6 - 4 " : c a s e   " 1 7 - 4 " : c a s e   " 1 8 - 4 " :   c a s e   " 1 9 - 4 " : c a s e   " 2 0 - 4 " : c a s e   " 2 1 - 4 " : c a s e   " 2 2 - 4 " : s = t p t + "   5 6 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 c a s e   " 6 - 9 " : c a s e   " 7 - 9 " : c a s e   " 8 - 9 " : c a s e   " 9 - 9 " :   c a s e   " 1 0 - 9 " : c a s e   " 1 1 - 9 " : c a s e   " 1 2 - 9 " : c a s e   " 1 3 - 9 " : s = t p t + "   5 7 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 	 c a s e   " 8 - 1 1 " : c a s e   " 9 - 1 1 " : c a s e   " 1 0 - 1 1 " : c a s e   " 1 1 - 1 1 " :   c a s e   " 1 2 - 1 1 " : c a s e   " 1 3 - 1 1 " : c a s e   " 1 4 - 1 1 " : c a s e   " 1 5 - 1 1 " : s = t p t + "   5 8 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 c a s e   " 2 6 - 1 2 " : c a s e   " 2 7 - 1 2 " : c a s e   " 2 8 - 1 2 " : c a s e   " 2 9 - 1 2 " :   c a s e   " 3 0 - 1 2 " : c a s e   " 3 1 - 1 2 " : c a s e   " 1 - 1 " : c a s e   " 2 - 1 " : s = t p t + "   5 9 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 	 c a s e   " 1 2 - 7 " : c a s e   " 1 3 - 7 " : c a s e   " 1 4 - 7 " : c a s e   " 1 5 - 7 " :   c a s e   " 1 6 - 7 " : c a s e   " 1 7 - 7 " : c a s e   " 1 8 - 7 " : c a s e   " 1 9 - 7 " : s = "   C h ù a   H o ±n g   P h á p   T Õ  C h éc   K h ó a   T u   M ù a   H è " ; C n g a y l e = " t e t " ; b r e a k ;      
       d e f a u l t : ;  
       }  
 }  
 i f ( n a m = = 2 0 1 0 ) {    
 v a r   P T = [ " " , " " , " " , " 7   ¿n   1 4 / 0 3 / 2 0 1 0 " , " " , " 0 2   ¿n   0 9 / 0 5 / 2 0 1 0 " , " " , " " , " 2 9 / 8   ¿n   0 5 / 0 9 / 2 0 1 0 " , " " , " 2 4   ¿n   3 1 / 1 0 / 2 0 1 0 " , " " , " 1 6   ¿n   2 3 / 1 0 / 2 0 1 0 " ] ;  
 v a r   L Q Y = [ " " , " \ n 1 0 - 0 1 " , " " , " " , " \ n 2 5 - 0 4 " , " " , " " , " " , " " , " " , " " , " " , " " ] ;  
   s w i t c h ( n g a y t h a n g ) {  
 	 c a s e   " 1 0 - 1 " :   c a s e   " 2 5 - 4 " : c a s e   " 2 2 - 8 " : s   + =   " N g à y   " + n g a y t h a n g + q u y y t a m b a o   ; l e h o i = " < / b r > < f o n t   c o l o r = ' # 0 0 0 0 F F ' >   N g à y   " + s ; C n g a y l e = " t e t " ; b r e a k ;  
 	 	 c a s e   " 1 7 - 1 " : c a s e   " 2 1 - 3 " :   c a s e   " 1 8 - 4 " :   c a s e   " 1 6 - 5 " :   c a s e   " 1 3 - 6 " :   c a s e   " 1 8 - 7 " :   c a s e   " 1 5 - 8 " :   c a s e   " 1 2 - 9 " :   c a s e   " 1 0 - 1 0 " :   c a s e   " 7 - 1 1 " :   c a s e   " 1 2 - 1 2 " :   s = t 1 n ; C n g a y l e = " t e t " ; b r e a k ;  
 	 c a s e   " 1 - 1 " : c a s e   " 2 - 1 " : s = t p t + "   5 9 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 c a s e   " 7 - 3 " : c a s e   " 8 - 3 " : c a s e   " 9 - 3 " : c a s e   " 1 0 - 3 " :   c a s e   " 1 1 - 3 " : c a s e   " 1 2 - 3 " : c a s e   " 1 3 - 3 " : c a s e   " 1 7 - 3 " : s = t p t + "   6 0 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 c a s e   " 2 - 5 " : c a s e   " 3 - 5 " : c a s e   " 4 - 5 " : c a s e   " 5 - 5 " :   c a s e   " 6 - 5 " : c a s e   " 7 - 5 " : c a s e   " 8 - 5 " : c a s e   " 9 - 5 " : s = t p t + "   6 1 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 c a s e   " 2 9 - 8 " : c a s e   " 3 0 - 8 " : c a s e   " 3 1 - 8 " : c a s e   " 1 - 9 " :   c a s e   " 2 - 9 " : c a s e   " 3 - 9 " : c a s e   " 4 - 9 " : c a s e   " 5 - 9 " : s = t p t + "   6 2 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 	 c a s e   " 2 4 - 1 0 " : c a s e   " 2 5 - 1 0 " : c a s e   " 2 6 - 1 0 " : c a s e   " 2 7 - 1 0 " :   c a s e   " 2 8 - 1 0 " : c a s e   " 2 9 - 1 0 " : c a s e   " 3 0 - 1 0 " : c a s e   " 3 1 - 1 0 " : s = t p t + "   6 3 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 	 c a s e   " 1 6 - 1 2 " : c a s e   " 1 7 - 1 2 " : c a s e   " 1 8 - 1 2 " : c a s e   " 1 9 - 1 2 " :   c a s e   " 2 0 - 1 2 " : c a s e   " 2 1 - 1 2 " : c a s e   " 2 2 - 1 2 " : c a s e   " 2 3 - 1 2 " : s = t p t + "   6 4 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 	 c a s e   " 2 0 - 6 " : c a s e   " 2 1 - 6 " : c a s e   " 2 2 - 6 " : c a s e   " 2 3 - 6 " :   c a s e   " 2 4 - 6 " : c a s e   " 2 5 - 6 " : c a s e   " 2 6 - 6 " : c a s e   " 2 7 - 6 " : s = "   C h ù a   H o ±n g   P h á p   T Õ  C h éc   K h ó a   T u   M ù a   H è " ; C n g a y l e = " t e t " ; b r e a k ;      
       d e f a u l t : ;  
     }  
 }  
 i f ( n a m = = 2 0 1 1 )  
 {    
 v a r   P T = [ " " , " " , " " , " 7   ¿n   1 4 / 0 3 / 2 0 1 0 " , " t ë  1 7   ¿n   2 7 / 0 4 / 2 0 1 1 " , " 0 2   ¿n   0 9 / 0 5 / 2 0 1 1 " , " " , " " , " 2 9 / 8   ¿n   0 5 / 0 9 / 2 0 1 1 " , " " , " 2 4   ¿n   3 1 / 1 0 / 2 0 1 0 " , " " , " 1 6   ¿n   2 3 / 1 0 / 2 0 1 1 " ] ;  
 v a r   L Q Y = [ " " , " \ n 0 2 - 0 1 " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " , " " ] ;  
   s w i t c h ( n g a y t h a n g )  
 {  
 	 c a s e   " 1 0 - 4 " : c a s e   " 2 2 - 8 " : s   + =   " N g à y   " + n g a y t h a n g + q u y y t a m b a o   ; l e h o i = " < / b r > < f o n t   c o l o r = ' # 0 0 0 0 F F ' >   N g à y   " + s ; C n g a y l e = " t e t " ; b r e a k ;  
 	 c a s e   " 1 7 - 1 " : c a s e   " 6 - 3 " :   c a s e   " 3 - 4 " :   c a s e   " 8 - 5 " :   c a s e   " 5 - 6 " :   c a s e   " 3 - 7 " :   c a s e   " 3 1 - 7 " :   c a s e   " 4 - 9 " :   c a s e   " 2 - 1 0 " :   c a s e   " 3 0 - 1 0 " :   c a s e   " 2 7 - 1 1 " :   c a s e   " 2 5 - 1 2 " :   s = t 1 n ; C n g a y l e = " t e t " ; b r e a k ;  
 	 c a s e   " 1 - 1 " : c a s e   " 2 - 1 " : s = t p t + "   5 9 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 c a s e   " 7 - 3 " : c a s e   " 8 - 3 " : c a s e   " 9 - 3 " : c a s e   " 1 0 - 3 " :   c a s e   " 1 1 - 3 " : c a s e   " 1 2 - 3 " : c a s e   " 1 3 - 3 " : c a s e   " 1 7 - 3 " : s = t p t + "   6 5 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 c a s e   " 1 7 - 4 " : c a s e   " 1 8 - 4 " : c a s e   " 1 9 - 4 " : c a s e   " 2 0 - 4 " :   c a s e   " 2 1 - 4 " : c a s e   " 2 2 - 4 " : c a s e   " 2 3 - 4 " : c a s e   " 2 4 - 4 " : s = t p t + "   6 6 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 c a s e   " 2 9 - 8 " : c a s e   " 2 1 - 8 " : c a s e   " 2 2 - 8 " : c a s e   " 2 3 - 8 " :   c a s e   " 2 4 - 8 " : c a s e   " 2 5 - 8 " : c a s e   " 2 6 - 8 " : c a s e   " 2 7 - 8 " : s = t p t + "   6 7 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 c a s e   " 1 6 - 1 0 " : c a s e   " 1 7 - 1 0 " : c a s e   " 1 8 - 1 0 " : c a s e   " 1 9 - 1 0 " :   c a s e   " 2 0 - 1 0 " : c a s e   " 2 1 - 1 0 " : c a s e   " 2 2 - 1 0 " : c a s e   " 2 3 - 1 0 " : s = t p t + "   6 8 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 c a s e   " 5 - 1 2 " : c a s e   " 6 - 1 2 " : c a s e   " 7 - 1 2 " : c a s e   " 8 - 1 2 " :   c a s e   " 9 - 1 2 " : c a s e   " 1 0 - 1 2 " : c a s e   " 1 1 - 1 2 " : c a s e   " 1 2 - 1 2 " : s = t p t + "   6 9 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 c a s e   " 1 9 - 6 " : c a s e   " 2 0 - 6 " : c a s e   " 2 1 - 6 " : c a s e   " 2 2 - 6 " :   c a s e   " 2 3 - 6 " : c a s e   " 2 4 - 6 " : c a s e   " 2 5 - 6 " : c a s e   " 2 6 - 6 " : s = "   C h ù a   H o ±n g   P h á p   T Õ  C h éc   K h ó a   T u   M ù a   H è   ãt   1 " ; C n g a y l e = " t e t " ; b r e a k ;      
 	 c a s e   " 1 4 - 7 " : c a s e   " 1 5 - 7 " : c a s e   " 1 6 - 7 " : c a s e   " 1 7 - 7 " :   c a s e   " 1 8 - 7 " : c a s e   " 1 9 - 7 " : c a s e   " 2 0 - 7 " : c a s e   " 2 1 - 7 " : s = "   C h ù a   H o ±n g   P h á p   T Õ  C h éc   K h ó a   T u   M ù a   H è   ãt   2 " ; C n g a y l e = " t e t " ; b r e a k ;    
 	 c a s e   " 2 0 - 3 " : c a s e   " 2 2 - 5 " : c a s e   " 2 4 - 7 " : c a s e   " 1 8 - 9 " :   c a s e   " 2 0 - 1 1 " : s = "   C h ù a   H o ±n g   P h á p   T Õ  C h éc   K h ó a   T u   S i n h   V i ê n " ; C n g a y l e = " t e t " ; b r e a k ;      
       d e f a u l t : ;  
      
 }  
   s   + =   " \ n " ;  
   s   =   " (   N g \ u 0 0 E 0 y   "   +   n g d + "   -   " + t h d   +   "   "   +   g e t Y e a r C a n C h i ( n a m ) + "   ) \ n "   + s ;  
   i f ( L E K H A C [ t h d ] ! = " " )   l e h o i + = " < / b r > < f o n t   c o l o r = ' # 8 0 0 0 0 0 ' >   N g à y   " + L E K H A C [ t h d ] + "   "   +   g e t Y e a r C a n C h i ( n a m ) ;  
   i f ( L E H [ t h a n g ] ! = " " ) l e h o i + = " < f o n t   c o l o r = ' # 0 0 8 0 8 0 ' > < b r > < / b r >   N g à y   " +   L E H [ t h a n g ] + " - " + n a m + "   " + t 1 n + " < / f o n t > " ;  
   i f ( P T [ t h a n g ] ! = " " )   l e h o i + = " < / b r > < f o n t   c o l o r = ' # 8 0 0 0 0 0 ' > < / b r >   N g à y   " +   P T [ t h a n g ] + "   C h ù a   H o ±n g   P h á p   T Õ  C h éc   K h ó a   T u   P h ­t   T h ¥t < / f o n t > " ;  
   i f ( L Q Y [ t h a n g ] ! = " " )     l e h o i + = " < / b r > < f o n t   c o l o r = ' # 0 0 0 0 F F ' >   N g à y   " + L Q Y [ t h a n g ] +   " - " + n a m + "   C h ù a   H o ±n g   P h á p   T Õ  C h éc   L Å  Q u y   Y   T a m   B £o \ n " ;  
   i f ( t h a n g = = 6 )   l e h o i + = " < / b r > < f o n t   c o l o r = ' # 8 8 0 0 0 0 ' >   C h ù a   H o ±n g   P h á p   T Õ  C h éc   K h ó a   T u   M ù a   H è   T ë  N g à y   2 0   ¿n   2 7 / 0 6 / 2 0 1 0 " ;  
   n g a y l e = s ;  
   r e t u r n   s ;  
 }  
  
 f u n c t i o n   L u n a r D a t e ( d d ,   m m ,   y y ,   l e a p ,   j d )   {     t h i s . d a y   =   d d ;   t h i s . m o n t h   =   m m ;   t h i s . y e a r   =   y y ;   t h i s . l e a p   =   l e a p ;   t h i s . j d   =   j d ; } v a r   P I   =   M a t h . P I ; f u n c t i o n   I N T ( d ) { r e t u r n   M a t h . f l o o r ( d ) ; } f u n c t i o n   j d n ( d d ,   m m ,   y y ) { v a r   a   =   I N T ( ( 1 4   -   m m )   /   1 2 ) ; v a r   y   =   y y + 4 8 0 0 - a ; v a r   m   =   m m + 1 2 * a - 3 ;   v a r   j d   =   d d   +   I N T ( ( 1 5 3 * m + 2 ) / 5 )   +   3 6 5 * y   +   I N T ( y / 4 )   -   I N T ( y / 1 0 0 )   +   I N T ( y / 4 0 0 )   -   3 2 0 4 5 ;   r e t u r n   j d ; } f u n c t i o n   j d n 2 d a t e ( j d )   {   v a r   Z ,   A ,   a l p h a ,   B ,   C ,   D ,   E ,   d d ,   m m ,   y y y y ,   F ; Z   =   j d ;   i f   ( Z   <   2 2 9 9 1 6 1 )   { A   =   Z ; }   e l s e   {   a l p h a   =   I N T ( ( Z - 1 8 6 7 2 1 6 . 2 5 ) / 3 6 5 2 4 . 2 5 ) ;   A   =   Z   +   1   +   a l p h a   -   I N T ( a l p h a / 4 ) ; }   B   =   A   +   1 5 2 4 ; C   =   I N T (   ( B - 1 2 2 . 1 ) / 3 6 5 . 2 5 ) ; D   =   I N T (   3 6 5 . 2 5 * C   ) ; E   =   I N T (   ( B - D ) / 3 0 . 6 0 0 1   ) ; d d   =   I N T ( B   -   D   -   I N T ( 3 0 . 6 0 0 1 * E ) ) ;   i f   ( E   <   1 4 ) { m m   =   E   -   1 ; }   e l s e   { m m   =   E   -   1 3 ; }   i f   ( m m   <   3 )   { y y y y   =   C   -   4 7 1 5 ; }   e l s e   {   y y y y   =   C   -   4 7 1 6 ; }   r e t u r n   n e w   A r r a y ( d d ,   m m ,   y y y y ) ; } f u n c t i o n   d e c o d e L u n a r Y e a r ( y y ,   k )   {   v a r   m o n t h L e n g t h s ,   r e g u l a r M o n t h s ,   o f f s e t O f T e t ,   l e a p M o n t h ,   l e a p M o n t h L e n g t h ,   s o l a r N Y ,   c u r r e n t J D ,   j ,   m m ; v a r   l y   =   n e w   A r r a y ( ) ;   m o n t h L e n g t h s   =   n e w   A r r a y ( 2 9 ,   3 0 ) ; r e g u l a r M o n t h s   =   n e w   A r r a y ( 1 2 ) ; o f f s e t O f T e t   =   k   > >   1 7 ; l e a p M o n t h   =   k   &   0 x f ;   l e a p M o n t h L e n g t h   =   m o n t h L e n g t h s [ k   > >   1 6   &   0 x 1 ] ;   s o l a r N Y   =   j d n ( 1 ,   1 ,   y y ) ;   c u r r e n t J D   =   s o l a r N Y + o f f s e t O f T e t ;     j   =   k   > >   4 ;     f o r ( i   =   0 ;   i   <   1 2 ;   i + + )   { r e g u l a r M o n t h s [ 1 2   -   i   -   1 ]   =   m o n t h L e n g t h s [ j   &   0 x 1 ] ;   j   > > =   1 ; }   i f   ( l e a p M o n t h   = =   0 )   { f o r ( m m   =   1 ;   m m   < =   1 2 ;   m m + + )   { l y . p u s h ( n e w   L u n a r D a t e ( 1 ,   m m ,   y y ,   0 ,   c u r r e n t J D ) ) ; c u r r e n t J D   + =   r e g u l a r M o n t h s [ m m - 1 ] ; }   }       e l s e   { f o r ( m m   =   1 ;   m m   < =   l e a p M o n t h ;   m m + + )   { l y . p u s h ( n e w   L u n a r D a t e ( 1 ,   m m ,   y y ,   0 ,   c u r r e n t J D ) ) ; c u r r e n t J D   + =   r e g u l a r M o n t h s [ m m - 1 ] ; }   l y . p u s h ( n e w   L u n a r D a t e ( 1 ,   l e a p M o n t h ,   y y ,   1 ,   c u r r e n t J D ) ) ;   c u r r e n t J D   + =   l e a p M o n t h L e n g t h ; f o r ( m m   =   l e a p M o n t h + 1 ;   m m   < =   1 2 ;   m m + + )   {   l y . p u s h ( n e w   L u n a r D a t e ( 1 ,   m m ,   y y ,   0 ,   c u r r e n t J D ) ) ;   c u r r e n t J D   + =   r e g u l a r M o n t h s [ m m - 1 ] ;   }   } r e t u r n   l y ; } f u n c t i o n   g e t Y e a r I n f o ( y y y y )   { v a r   y e a r C o d e ; i f   ( y y y y   <   1 9 0 0 )   {   y e a r C o d e   =   T K 1 9 [ y y y y   -   1 8 0 0 ] ; }   e l s e   i f   ( y y y y   <   2 0 0 0 )   {   y e a r C o d e   =   T K 2 0 [ y y y y   -   1 9 0 0 ] ;   }   e l s e   i f   ( y y y y   <   2 1 0 0 )   {     y e a r C o d e   =   T K 2 1 [ y y y y   -   2 0 0 0 ] ;   }   e l s e   {     y e a r C o d e   =   T K 2 2 [ y y y y   -   2 1 0 0 ] ;   }   r e t u r n   d e c o d e L u n a r Y e a r ( y y y y ,   y e a r C o d e ) ; } v a r   F I R S T _ D A Y   =   j d n ( 2 5 ,   1 ,   1 8 0 0 ) ; v a r   L A S T _ D A Y   =   j d n ( 3 1 ,   1 2 ,   2 1 9 9 ) ; f u n c t i o n   f i n d L u n a r D a t e ( j d ,   l y )   { i f   ( j d   >   L A S T _ D A Y   | |   j d   <   F I R S T _ D A Y   | |   l y [ 0 ] . j d   >   j d )   {   r e t u r n   n e w   L u n a r D a t e ( 0 ,   0 ,   0 ,   0 ,   j d ) ; }     v a r   i   =   l y . l e n g t h - 1 ;   w h i l e   ( j d   <   l y [ i ] . j d )   {     i - - ;   }   v a r   o f f   =   j d   -   l y [ i ] . j d ;   r e t   =   n e w   L u n a r D a t e ( l y [ i ] . d a y + o f f ,   l y [ i ] . m o n t h ,   l y [ i ] . y e a r ,   l y [ i ] . l e a p ,   j d ) ;   r e t u r n   r e t ; } f u n c t i o n   g e t L u n a r D a t e ( d d ,   m m ,   y y y y )   {   v a r   l y ,   j d ;   l y   =   g e t Y e a r I n f o ( y y y y ) ;   j d   =   j d n ( d d ,   m m ,   y y y y ) ;   i f   ( j d   <   l y [ 0 ] . j d )   {   l y   =   g e t Y e a r I n f o ( y y y y   -   1 ) ;   }   r e t u r n   f i n d L u n a r D a t e ( j d ,   l y ) ; } f u n c t i o n   S u n L o n g i t u d e ( j d n )   {   v a r   T ,   T 2 ,   d r ,   M ,   L 0 ,   D L ,   L ; T   =   ( j d n   -   2 4 5 1 5 4 5 . 0   )   /   3 6 5 2 5 ;   T 2   =   T * T ;   d r   =   P I / 1 8 0 ;     M   =   3 5 7 . 5 2 9 1 0   +   3 5 9 9 9 . 0 5 0 3 0 * T   -   0 . 0 0 0 1 5 5 9 * T 2   -   0 . 0 0 0 0 0 0 4 8 * T * T 2 ;     L 0   =   2 8 0 . 4 6 6 4 5   +   3 6 0 0 0 . 7 6 9 8 3 * T   +   0 . 0 0 0 3 0 3 2 * T 2 ;   D L   =   ( 1 . 9 1 4 6 0 0   -   0 . 0 0 4 8 1 7 * T   -   0 . 0 0 0 0 1 4 * T 2 ) * M a t h . s i n ( d r * M ) ;   D L   =   D L   +   ( 0 . 0 1 9 9 9 3   -   0 . 0 0 0 1 0 1 * T ) * M a t h . s i n ( d r * 2 * M )   +   0 . 0 0 0 2 9 0 * M a t h . s i n ( d r * 3 * M ) ;   L   =   L 0   +   D L ;     L   =   L * d r ;   L   =   L   -   P I * 2 * ( I N T ( L / ( P I * 2 ) ) ) ;     r e t u r n   L ; } f u n c t i o n   g e t S u n L o n g i t u d e ( d a y N u m b e r ,   t i m e Z o n e )   {   r e t u r n   I N T ( S u n L o n g i t u d e ( d a y N u m b e r   -   0 . 5   -   t i m e Z o n e / 2 4 . 0 )   /   P I   *   1 2 ) ; } v a r   t o d a y   =   n e w   D a t e ( ) ; v a r   c u r r e n t L u n a r D a t e   =   g e t L u n a r D a t e ( t o d a y . g e t D a t e ( ) ,   t o d a y . g e t M o n t h ( ) + 1 ,   t o d a y . g e t F u l l Y e a r ( ) ) ; v a r   c u r r e n t M o n t h   =   t o d a y . g e t M o n t h ( ) + 1 ; v a r   c u r r e n t Y e a r   =   t o d a y . g e t F u l l Y e a r ( ) ; f u n c t i o n   p a r s e Q u e r y ( q )   { v a r   r e t   =   n e w   A r r a y ( ) ;   i f   ( q . l e n g t h   <   2 )   r e t u r n   r e t ;   v a r   s   =   q . s u b s t r i n g ( 1 ,   q . l e n g t h ) ;   v a r   a r r   =   s . s p l i t ( " & " ) ;   v a r   i ,   j ;   f o r   ( i   =   0 ;   i   <   a r r . l e n g t h ;   i + + )   {     v a r   a   =   a r r [ i ] . s p l i t ( " = " ) ;     f o r   ( j   =   0 ;   j   <   a . l e n g t h ;   j + + )   {       r e t . p u s h ( a [ j ] ) ;     }   }   r e t u r n   r e t ; } f u n c t i o n   g e t S e l e c t e d M o n t h ( )   {   v a r   q u e r y   =   w i n d o w . l o c a t i o n . s e a r c h ;   v a r   a r r   =   p a r s e Q u e r y ( q u e r y ) ;   v a r   i d x ;   f o r   ( i d x   =   0 ;   i d x   <   a r r . l e n g t h ;   i d x + + )   {     i f   ( a r r [ i d x ]   = =   " m m " )   {       c u r r e n t M o n t h   =   p a r s e I n t ( a r r [ i d x + 1 ] ) ;     }   e l s e   i f   ( a r r [ i d x ]   = =   " y y " )   {       c u r r e n t Y e a r   =   p a r s e I n t ( a r r [ i d x + 1 ] ) ;     }   } } f u n c t i o n   g e t M o n t h ( m m ,   y y )   {   v a r   l y 1 ,   l y 2 ,   t e t 1 ,   j d 1 ,   j d 2 ,   m m 1 ,   y y 1 ,   r e s u l t ,   i ;   i f   ( m m   <   1 2 )   {     m m 1   =   m m   +   1 ;     y y 1   =   y y ;   }   e l s e   {     m m 1   =   1 ;     y y 1   =   y y   +   1 ;   }   j d 1   =   j d n ( 1 ,   m m ,   y y ) ;   j d 2   =   j d n ( 1 ,   m m 1 ,   y y 1 ) ;   l y 1   =   g e t Y e a r I n f o ( y y ) ;   t e t 1   =   l y 1 [ 0 ] . j d ;   r e s u l t   =   n e w   A r r a y ( ) ;   i f   ( t e t 1   < =   j d 1 )   {     f o r   ( i   =   j d 1 ;   i   <   j d 2 ;   i + + )   {     r e s u l t . p u s h ( f i n d L u n a r D a t e ( i ,   l y 1 ) ) ;     }   }   e l s e   i f   ( j d 1   <   t e t 1   & &   j d 2   <   t e t 1 )   {     l y 1   =   g e t Y e a r I n f o ( y y   -   1 ) ;     f o r   ( i   =   j d 1 ;   i   <   j d 2 ;   i + + )   {       r e s u l t . p u s h ( f i n d L u n a r D a t e ( i ,   l y 1 ) ) ;     }   }   e l s e   i f   ( j d 1   <   t e t 1   & &   t e t 1   < =   j d 2 )   {   l y 2   =   g e t Y e a r I n f o ( y y   -   1 ) ;     f o r   ( i   =   j d 1 ;   i   <   t e t 1 ;   i + + )   {       r e s u l t . p u s h ( f i n d L u n a r D a t e ( i ,   l y 2 ) ) ;     }     f o r   ( i   =   t e t 1 ;   i   <   j d 2 ;   i + + )   {       r e s u l t . p u s h ( f i n d L u n a r D a t e ( i ,   l y 1 ) ) ;     }   }   r e t u r n   r e s u l t ; } f u n c t i o n   g e t D a y N a m e ( l u n a r D a t e , n g a y , t h a n g , n a m )   {   i f   ( l u n a r D a t e . d a y   = =   0 )   {     r e t u r n   " " ;   }   v a r   c c   =   g e t C a n C h i ( l u n a r D a t e ) ;   v a r   s ;     s   =   " B ¥m   c h u Ùt   v à o   Ã  b i ¿t   t h ô n g   t i n   n g à y   t h á n g \ n " + n g a y l e H P ( l u n a r D a t e . d a y , l u n a r D a t e . m o n t h , n g a y , t h a n g , n a m ) + " N g \ u 0 0 E 0 y   "   +   c c [ 0 ]   + " ,   t h \ 3 4 1 n g   " + c c [ 1 ]   +   " ,   n \ u 0 1 0 3 m   "   +   c c [ 2 ] + " \ n " ;   r e t u r n   s ; } f u n c t i o n   g e t Y e a r C a n C h i ( y e a r )   {   r e t u r n   C A N [ ( y e a r + 6 )   %   1 0 ]   +   "   "   +   C H I [ ( y e a r + 8 )   %   1 2 ] ; } f u n c t i o n   g e t C a n H o u r 0 ( j d n )   {   r e t u r n   C A N [ ( j d n - 1 ) * 2   %   1 0 ] ; } f u n c t i o n   g e t C a n C h i ( l u n a r )   {   v a r   d a y N a m e ,   m o n t h N a m e ,   y e a r N a m e ;   d a y N a m e   =   C A N [ ( l u n a r . j d   +   9 )   %   1 0 ]   +   "   "   +   C H I [ ( l u n a r . j d + 1 ) % 1 2 ] ;   m o n t h N a m e   =   C A N [ ( l u n a r . y e a r * 1 2 + l u n a r . m o n t h + 3 )   %   1 0 ]   +   "   "   +   C H I [ ( l u n a r . m o n t h + 1 ) % 1 2 ] ;   i f   ( l u n a r . l e a p   = =   1 )   {     m o n t h N a m e   + =   "   ( n h u \ u 1 E A D n ) " ;   }   y e a r N a m e   =   g e t Y e a r C a n C h i ( l u n a r . y e a r ) ;   r e t u r n   n e w   A r r a y ( d a y N a m e ,   m o n t h N a m e ,   y e a r N a m e ) ; } f u n c t i o n   g e t D a y S t r i n g ( l u n a r ,   s o l a r D a y ,   s o l a r M o n t h ,   s o l a r Y e a r )   {   v a r   s ;   v a r   d a y O f W e e k   =   T U A N [ ( l u n a r . j d   +   1 )   %   7 ] ;   s   =   d a y O f W e e k   +   "   "   +   s o l a r D a y   +   " / "   +   s o l a r M o n t h   +   " / "   +   s o l a r Y e a r   +   " \ n " ;       s + = n g a y l e H P ( l u n a r . d a y , l u n a r . m o n t h , s o l a r D a y   , s o l a r M o n t h   , s o l a r Y e a r   ) +   " N g a  y   " + g e t C a n C h i ( l u n a r ) [ 0 ] + " ,   T h a n g   " + g e t C a n C h i ( l u n a r ) [ 1 ]   +   " ,   N m   "   +   g e t C a n C h i ( l u n a r ) [ 2 ]   + "   -   " ;   i f   ( l u n a r . l e a p   = =   1 )   {     s   =   s   +   "   n h u \ u 1 E A D n " ;   }   r e t u r n   s ; } f u n c t i o n   g e t T o d a y S t r i n g 1 ( )   {   v a r   s ;   v a r   d a y O f W e e k   =   T U A N [ ( l u n a r . j d   +   1 )   %   7 ] ;   s   =   d a y O f W e e k   +   "   "   +   s o l a r D a y   +   " / "   +   s o l a r M o n t h   +   " / "   +   s o l a r Y e a r   +   " \ n " ;     s + = n g a y l e H P ( l u n a r . d a y , l u n a r . m o n t h , s o l a r D a y   , s o l a r M o n t h   , s o l a r Y e a r   ) + " N g a  y   " + g e t C a n C h i ( l u n a r ) [ 0 ] + " ,   T h a n g   " + g e t C a n C h i ( l u n a r ) [ 1 ]   +   " ,   N m   "   +   g e t C a n C h i ( l u n a r ) [ 2 ]   + "   -   " ;     i f   ( l u n a r . l e a p   = =   1 )   {     s   =   s   +   "   n h u \ u 1 E A D n " ;   }   r e t u r n   s ; } f u n c t i o n   g e t T o d a y S t r i n g ( )   {   v a r   s   =   g e t D a y S t r i n g ( c u r r e n t L u n a r D a t e ,   t o d a y . g e t D a t e ( ) ,   t o d a y . g e t M o n t h ( ) + 1 ,   t o d a y . g e t F u l l Y e a r ( ) ) ;   s   + =   "   n \ u 0 1 0 3 m   "   +   g e t Y e a r C a n C h i ( c u r r e n t L u n a r D a t e . y e a r ) ;   r e t u r n   s ; } f u n c t i o n   g e t C u r r e n t T i m e ( )   {   t o d a y   =   n e w   D a t e ( ) ;   v a r   S t d   =   t o d a y . g e t H o u r s ( ) ;   v a r   M i n   =   t o d a y . g e t M i n u t e s ( ) ;   v a r   S e c   =   t o d a y . g e t S e c o n d s ( ) ;   v a r   s 1     =   ( ( S t d   <   1 0 )   ?   " 0 "   +   S t d   :   S t d ) ;   v a r   s 2     =   ( ( M i n   <   1 0 )   ?   " 0 "   +   M i n   :   M i n ) ;   r e t u r n   s 1   +   " : "   +   s 2 ; } f u n c t i o n   g e t G i o H o a n g D a o ( j d )   {   v a r   c h i O f D a y   =   ( j d + 1 )   %   1 2 ;   v a r   g i o H D   =   G I O _ H D [ c h i O f D a y   %   6 ] ;     v a r   r e t   =   " " ;   v a r   c o u n t   =   0 ;   f o r   ( v a r   i   =   0 ;   i   <   1 2 ;   i + + )   {     i f   ( g i o H D . c h a r A t ( i )   = =   ' 1 ' )   {       r e t   + =   C H I [ i ] ;       r e t   + =   '   ( ' + ( i * 2 + 2 3 ) % 2 4 + ' - ' + ( i * 2 + 1 ) % 2 4 + ' ) ' ;       i f   ( c o u n t + +   <   5 )   r e t   + =   ' ,   ' ;       i f   ( c o u n t   = =   3 )   r e t   + =   ' \ n ' ;     }   }   r e t u r n   r e t ; } v a r   D A Y N A M E S   =   n e w   A r r a y ( " C N " ,   " T 2 " ,   " T 3 " ,   " T 4 " ,   " T 5 " ,   " T 6 " ,   " T 7 " ) ; v a r   P R I N T _ O P T S   =   n e w   O u t p u t O p t i o n s ( ) ; v a r   F O N T _ S I Z E S   =   n e w   A r r a y ( " 9 p t " ,   " 1 3 p t " ,   " 1 7 p t " ) ; v a r   T A B _ W I D T H S   =   n e w   A r r a y ( " 1 8 0 p x " ,   " 4 2 0 p x " ,   " 6 0 0 p x " ) ; f u n c t i o n   O u t p u t O p t i o n s ( )   {   t h i s . f o n t S i z e   =   " 8 p t " ;   t h i s . t a b l e W i d t h   =   " 1 6 0 p x " ; } f u n c t i o n   s e t O u t p u t S i z e ( s i z e )   {   v a r   i d x   =   1 ;   i f   ( s i z e   = =   " s m a l l " )   {     i d x   =   0 ;   }   e l s e   i f   ( s i z e   = =   " b i g " )   {     i d x   =   2 ;   }   e l s e   {     i d x   =   1 ;   }   P R I N T _ O P T S . f o n t S i z e   =   F O N T _ S I Z E S [ i d x ] ;   P R I N T _ O P T S . t a b l e W i d t h   =   T A B _ W I D T H S [ i d x ] ; } f u n c t i o n   p r i n t S e l e c t e d M o n t h ( )   {   g e t S e l e c t e d M o n t h ( ) ;   r e t u r n   p r i n t M o n t h ( c u r r e n t M o n t h ,   c u r r e n t Y e a r ) ; } f u n c t i o n   p r i n t M o n t h ( m m ,   y y )   {   v a r   r e s   =   " " ;   r e s   + =   p r i n t S t y l e ( ) ;   r e s   + =   p r i n t T a b l e ( m m ,   y y ) ;   r e s   + =   p r i n t F o o t ( ) ;   r e t u r n   r e s ; } f u n c t i o n   p r i n t Y e a r ( y y )   {   v a r   y e a r N a m e   =   " N & # x 1 0 3 ; m   "   +   g e t Y e a r C a n C h i ( y y )   +   "   "   +   y y ;   v a r   r e s   =   " " ;   r e s   + =   p r i n t S t y l e ( ) ;   r e s   + =   ' < t a b l e   a l i g n = c e n t e r > \ n ' ;   r e s   + =   ( ' < t r > < t d   c o l s p a n = " 3 "   c l a s s = " t e n n a m "   o n C l i c k = " s h o w Y e a r S e l e c t ( ) ; " > ' + y e a r N a m e + ' < / t d > < / t r > \ n ' ) ;   f o r   ( v a r   i   =   1 ;   i < =   1 2 ;   i + + )   {     i f   ( i   %   3   = =   1 )   r e s   + =   ' < t r > \ n ' ;     r e s   + =   ' < t d > \ n ' ;     r e s   + =   p r i n t T a b l e ( i ,   y y ) ;     r e s   + =   ' < / t d > \ n ' ;     i f   ( i   %   3   = =   0 )   r e s   + =   ' < / t r > \ n ' ;   }   r e s   + =   ' < t a b l e > \ n ' ;   r e s   + =   p r i n t F o o t ( ) ;   r e t u r n   r e s ; } f u n c t i o n   p r i n t S e l e c t e d Y e a r ( )   {   g e t S e l e c t e d M o n t h ( ) ;   r e t u r n   p r i n t Y e a r ( c u r r e n t Y e a r ) ; } f u n c t i o n   p r i n t S t y l e ( )   {   v a r   f o n t S i z e   =   P R I N T _ O P T S . f o n t S i z e ;   v a r   r e s   =   " " ;   r e s   + =   ' < s t y l e   t y p e = " t e x t / c s s " > \ n ' ;   r e s   + =   ' < ! - - \ n ' ;     r e s   + =   '     . t e n n a m   { t e x t - a l i g n : c e n t e r ;   f o n t - s i z e : 1 5 0 % ;   l i n e - h e i g h t : 1 2 0 % ;   f o n t - w e i g h t : b o l d ;   c o l o r : # 0 0 0 0 0 0 ;   b a c k g r o u n d - c o l o r :   # C C C C C C } \ n ' ;   r e s   + =   '     . t h a n g   { f o n t - s i z e :   ' + f o n t S i z e + ' ;   p a d d i n g : 1 ;   l i n e - h e i g h t : 1 0 0 % ;   f o n t - f a m i l y : T a h o m a , V e r d a n a , A r i a l ;   t a b l e - l a y o u t : f i x e d } \ n ' ;   r e s   + =   '     . t e n t h a n g   { t e x t - a l i g n : c e n t e r ;   f o n t - s i z e : 1 4 5 % ;   l i n e - h e i g h t : 1 0 0 % ;   f o n t - w e i g h t : b o l d ;   c o l o r : # 3 3 0 0 3 3 ;   b a c k g r o u n d - c o l o r :   # C C F F C C } \ n ' ;     r e s   + =   '     . n a v i - l   { t e x t - a l i g n : c e n t e r ;   f o n t - s i z e : 7 5 % ;   l i n e - h e i g h t : 1 0 0 % ;   f o n t - f a m i l y : V e r d a n a , T i m e s   N e w   R o m a n , A r i a l ;   f o n t - w e i g h t : b o l d ;   c o l o r : r e d ;   b a c k g r o u n d - c o l o r :   # C C F F C C } \ n ' ;     r e s   + =   '     . n a v i - r   { t e x t - a l i g n : c e n t e r ;   f o n t - s i z e : 7 5 % ;   l i n e - h e i g h t : 1 0 0 % ;   f o n t - f a m i l y : V e r d a n a , A r i a l , T i m e s   N e w   R o m a n ;   f o n t - w e i g h t : b o l d ;   c o l o r : # 3 3 0 0 3 3 ;   b a c k g r o u n d - c o l o r :   # C C F F C C } \ n ' ;   r e s   + =   '     . n g a y t u a n   { w i d t h : 1 4 % ;   t e x t - a l i g n : c e n t e r ;   f o n t - s i z e : 1 2 5 % ;   l i n e - h e i g h t : 1 0 0 % ;   c o l o r : # 3 3 0 0 3 3 ;   b a c k g r o u n d - c o l o r :   # E 0 E 0 E 0 } \ n ' ;   r e s   + =   '     . h o m n a y   { b a c k g r o u n d - c o l o r : # F F F 0 0 0 } \ n ' ;   r e s   + =   '     . t e t   { b a c k g r o u n d - c o l o r : # F F C C 9 9 } \ n ' ;   r e s   + =   '     . c h u n g   { b a c k g r o u n d - c o l o r : # A A C C 0 0 } \ n ' ;     r e s   + =   '     . a m   { t e x t - a l i g n : r i g h t ; f o n t - s i z e : 7 5 % ; l i n e - h e i g h t : 1 0 0 % ; c o l o r : b l u e } \ n ' ;   r e s   + =   '     . a m 2   { t e x t - a l i g n : r i g h t ; f o n t - s i z e : 7 5 % ; l i n e - h e i g h t : 1 0 0 % ; c o l o r : # 0 0 4 0 8 0 } \ n ' ;   r e s   + =   '     . t 2 t 6   { t e x t - a l i g n : l e f t ; f o n t - s i z e : 1 2 5 % ; c o l o r : b l a c k } \ n ' ;   r e s   + =   '     . t 7   { t e x t - a l i g n : l e f t ; f o n t - s i z e : 1 2 5 % ; l i n e - h e i g h t : 1 0 0 % ; c o l o r : g r e e n } \ n ' ;   r e s   + =   '     . c n   { t e x t - a l i g n : l e f t ; f o n t - s i z e : 1 2 5 % ; l i n e - h e i g h t : 1 0 0 % ; c o l o r : r e d } \ n ' ; r e s   + =   ' - - > \ n ' ;   r e s   + =   ' < / s t y l e > \ n ' ;   r e t u r n   r e s ; } f u n c t i o n   p r i n t T a b l e ( m m ,   y y )   {   v a r   i ,   j ,   k ,   s o l a r ,   l u n a r ,   c e l l C l a s s ,   s o l a r C l a s s ,   l u n a r C l a s s ;   v a r   c u r r e n t M o n t h   =   g e t M o n t h ( m m ,   y y ) ;   i f   ( c u r r e n t M o n t h . l e n g t h   = =   0 )   r e t u r n ;   v a r   l d 1   =   c u r r e n t M o n t h [ 0 ] ;   v a r   e m p t y C e l l s   =   ( l d 1 . j d   +   1 )   %   7 ;   v a r   M o n t h H e a d   =   m m   +   " / "   +   y y ;   v a r   L u n a r H e a d   =   g e t Y e a r C a n C h i ( l d 1 . y e a r ) ;   v a r   r e s   =   " " ;       r e s   + =   ( ' < t a b l e   c l a s s = " t h a n g "     b a c k g r o u n d = " i m a g e s / s k i n / b g _ l i c h . j p g "   b o r d e r = " 0 "   c e l l p a d d i n g = " 1 "   c e l l s p a c i n g = " 1 "   w i d t h = " ' + P R I N T _ O P T S . t a b l e W i d t h + ' " > \ n ' ) ;   r e s   + =   p r i n t H e a d ( c u r r e n t M o n t h [ t o d a y . g e t D a t e ( ) - 1 ] , m m ,   y y ) ;   f o r   ( i   =   0 ;   i   <   6 ;   i + + )   {     r e s   + =   ( " < t r > \ n " ) ;     f o r   ( j   =   0 ;   j   <   7 ;   j + + )   {       k   =   7   *   i   +   j ;       i f   ( k   <   e m p t y C e l l s   | |   k   > =   e m p t y C e l l s   +   c u r r e n t M o n t h . l e n g t h )   {         r e s   + =   p r i n t E m p t y C e l l ( ) ;       }   e l s e   { s o l a r   =   k   -   e m p t y C e l l s   +   1 ;   l d 1   =   c u r r e n t M o n t h [ k   -   e m p t y C e l l s ] ;     r e s   + =   p r i n t C e l l ( l d 1 ,   s o l a r ,   m m ,   y y ) ;       }     }       r e s   + =   ( " < / t r > \ n " ) ;   }   r e s   + =   ( ' < / t a b l e > \ n ' ) ;   r e t u r n   r e s ; } f u n c t i o n   g e t P r e v M o n t h L i n k ( m m ,   y y )   {   v a r   m m 1   =   m m   >   1   ?   m m - 1   :   1 2 ;   v a r   y y 1   =   m m   >   1   ?   y y   :   y y - 1 ;   r e t u r n   ' < a > T h Ã ¡ n g   < / a > ' ; } f u n c t i o n   g e t N e x t M o n t h L i n k ( m m ,   y y )   {   v a r   m m 1   =   m m   <   1 2   ?   m m + 1   :   1 ;   v a r   y y 1   =   m m   <   1 2   ?   y y   :   y y + 1 ;   r e t u r n   ' < a > D L   < / a > ' ; } f u n c t i o n   g e t P r e v Y e a r L i n k ( m m ,   y y )   {   r e t u r n   ' < a   h r e f = " " > < / a > ' ; } f u n c t i o n   g e t N e x t Y e a r L i n k ( m m ,   y y )   {   r e t u r n   ' < a   h r e f = "   " > < / a > ' ; }  
 f u n c t i o n   p r i n t H e a d ( t s , m m , y y )   {    
 v a r   r e s   =   " " ;   v a r   m o n t h N a m e   =   m m + "   /   " + y y ;    
 v a r   l u n a r   =   n e w   L u n a r D a t e ( t o d a y . g e t D a t e ( ) ,   m m ,   y y ,   m m ,   " C N " ) ;    
 v a r   s = n g a y l e H P ( t s . d a y , t s . m o n t h , t o d a y . g e t D a t e ( ) , m m , y y ) ;  
 r e s   + = ( ' < t d   c o l s p a n = " 7 "   c l a s s = " t e n t h a n g "     b a c k g r o u n d = " i m a g e s / s k i n / b g 1 _ l i c h . j p g " >   < p   s t y l e = " m a r g i n - t o p :   2 p x ;   m a r g i n - b o t t o m :   2 p x "   a l i g n = " c e n t e r " > < f o n t   s i z e = " 2 " > ' ) ;  
 r e s   + =   ( ' < m a r q u e e     b e h a v i o r = " s c r o l l "   d i r e c t i o n = " u p "   h e i g h t = " 4 0 "   s c r o l l d e l a y = " 1 2 0 "   s c r o l l a m o u n t = " 1 " > < p   a l i g n = " c e n t e r " > ' + l e h o i + ' < / m a r q u e e >   < / b r >   < / t d > \ n ' ) ;    
 r e s   + =   ( ' < t r   o n C l i c k = " a l e r t A b o u t ( ) ; " > \ n ' ) ;   f o r ( v a r   i = 0 ; i < = 6 ; i + + )   {     r e s   + =   ( ' < t d   c l a s s = n g a y t u a n   h e i g h t =   " 2 0 "   w i d t h = " 2 0 "   > ' + D A Y N A M E S [ i ] + ' < / t d > \ n ' ) ;   }   r e s   + =   ( ' < \ / t r > \ n ' ) ;    
 r e t u r n   r e s ; }  
  
  
 f u n c t i o n   p r i n t E m p t y C e l l ( )   {     r e t u r n   ' < t d   c l a s s = n g a y t h a n g > < d i v   c l a s s = c n > & n b s p ; < / d i v >   < d i v   c l a s s = a m > & n b s p ; < / d i v > < / t d > \ n ' ; }  
 f u n c t i o n   p r i n t C e l l ( l u n a r D a t e ,   s o l a r D a t e ,   s o l a r M o n t h ,   s o l a r Y e a r )   {   v a r   c e l l C l a s s ,   s o l a r C l a s s ,   l u n a r C l a s s ,   s o l a r C o l o r ;   c e l l C l a s s   =   " n g a y t h a n g " ;   s o l a r C l a s s   =   " t 2 t 6 " ;   l u n a r C l a s s   =   " a m " ;   s o l a r C o l o r   =   " b l a c k " ;   v a r   d o w   =   ( l u n a r D a t e . j d   +   1 )   %   7 ;   n g a y l e H P ( l u n a r D a t e . d a y , l u n a r D a t e . m o n t h , s o l a r D a t e , s o l a r M o n t h , s o l a r Y e a r ) ;   c e l l C l a s s = C n g a y l e ;     i f   ( d o w   = =   0 )   {     s o l a r C l a s s   =   " c n " ;     s o l a r C o l o r   =   " r e d " ;   }   e l s e   i f   ( d o w   = =   6 )   {     s o l a r C l a s s   =   " t 7 " ;     s o l a r C o l o r   =   " g r e e n " ;   }   i f   ( s o l a r D a t e   = =   t o d a y . g e t D a t e ( )   & &   s o l a r M o n t h   = =   t o d a y . g e t M o n t h ( ) + 1   & &   s o l a r Y e a r   = =   t o d a y . g e t F u l l Y e a r ( ) )   {     c e l l C l a s s   =   " h o m n a y " ;   } i f   ( l u n a r D a t e . d a y   = =   1   & &   l u n a r D a t e . m o n t h   = =   1 )   {     c e l l C l a s s   =   " t e t " ;   }   i f   ( l u n a r D a t e . l e a p   = =   1 )   {     l u n a r C l a s s   =   " a m 2 " ;   }   v a r   l u n a r   =   l u n a r D a t e . d a y ;   i f   ( s o l a r D a t e   = =   1   | |   l u n a r   = =   1 )   {     l u n a r   =   l u n a r D a t e . d a y   +   " / "   +   l u n a r D a t e . m o n t h ;   }   v a r   r e s   =   " " ;   v a r   a r g s   =   l u n a r D a t e . d a y   +   " , "   +   l u n a r D a t e . m o n t h   +   " , "   +   l u n a r D a t e . y e a r   +   " , "   +   l u n a r D a t e . l e a p ;   a r g s   + =   ( " , "   +   l u n a r D a t e . j d   +   " , "   +   s o l a r D a t e   +   " , "   +   s o l a r M o n t h   +   " , "   +   s o l a r Y e a r ) ;   r e s   + =   ( ' < t d   c l a s s = " ' + c e l l C l a s s + ' " ' ) ;   i f   ( l u n a r D a t e   ! =   n u l l )   r e s   + =   ( '   t i t l e = " ' + g e t D a y N a m e ( l u n a r D a t e , s o l a r D a t e , s o l a r M o n t h , s o l a r Y e a r ) + ' "   o n C l i c k = " a l e r t D a y I n f o ( ' + a r g s + ' ) ; " ' ) ;     r e s   + =   ( '   < d i v   s t y l e = c o l o r : ' + s o l a r C o l o r + '   c l a s s = " ' + s o l a r C l a s s + ' " > ' + s o l a r D a t e + ' < / d i v >   < d i v   c l a s s = " ' + l u n a r C l a s s + ' " > ' + l u n a r + ' < / d i v > < / t d > \ n ' ) ;   r e t u r n   r e s ;   } f u n c t i o n   p r i n t F o o t ( )   {   v a r   r e s   =   " " ;   r e s   + =   ' < s c r i p t   l a n g u a g e = " J a v a S c r i p t "   s r c = " a m l i c h h p . j s " > < / s c r i p t > \ n ' ;   r e t u r n   r e s ; } f u n c t i o n   s h o w M o n t h S e l e c t ( )   {   v a r   h o m e   =   "   " ;   w i n d o w . o p e n ( h o m e ,   " w i n 2 7 0 2 " ,   " m e n u b a r = y e s , s c r o l l b a r s = y e s , s t a t u s = y e s , t o o l b a r = y e s , r e s i z a b l e = y e s , l o c a t i o n = y e s " ) ; } f u n c t i o n   s h o w Y e a r S e l e c t ( )   {   w i n d o w . p r i n t ( ) ; } f u n c t i o n   i n f o C e l l S e l e c t ( i d )   {   i f   ( i d   = =   0 )   {   } } f u n c t i o n   a l e r t D a y I n f o ( d d ,   m m ,   y y ,   l e a p ,   j d ,   s d a y ,   s m o n t h ,   s y e a r )   {   v a r   l u n a r   =   n e w   L u n a r D a t e ( d d ,   m m ,   y y ,   l e a p ,   j d ) ;   v a r   s   =   g e t D a y S t r i n g ( l u n a r ,   s d a y ,   s m o n t h ,   s y e a r ) ;   s   + =   "   \ u 0 0 E 2 m   l \ u 1 E C B c h \ n " ;     a l e r t ( s ) ; } f u n c t i o n   a l e r t A b o u t ( )   {   a l e r t ( A B O U T ) ; } f u n c t i o n   s h o w V i e t C a l ( )   {   w i n d o w . s t a t u s   =   g e t C u r r e n t T i m e ( )   +   "   - + -   "   +   g e t T o d a y S t r i n g ( ) ;   w i n d o w . w i n d o w . s e t T i m e o u t ( " s h o w V i e t C a l ( ) " , 5 0 0 0 ) ; }  
  
 
