��<html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> <META NAME="Author: Harry Tran (Thi�n Y) in USA" CONTENT="Nghi�n C�u D�ch L�"> <title>Lap Que Mai Hoa Dich So</title> <script type="text/javascript" src="amlich.js"></script> </head> <body onLoad="javascript:Init();"> <SCRIPT language="JavaScript"> /* Changes: 06/12/05 Rev 1.04 Used the Chinese traditional calendar. 06/12/14 Rev 1.05 Fixed yearly display date. 07/01/01 Rev 1.06 Corrected Tiet Khi, added Khong Vong. 07/01/20 Rev 1.07 Changed to run with FireFox/NS */ var Today = new Date(); var CY = Today.getFullYear(); var CM = Today.getMonth()+1; var CD = Today.getDate(); var CL = new MaiHoaDate(CD, CM, CY); var IE, NS; function Init() { IE = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4); NS = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4); if (IE) setInterval("doFlash()",700); else setTimeout("doFlash()",700); } function Write(Id, val) { if (IE) eval(Id).innerText = val; else document.getElementById(Id).innerHTML = val; } function Read(Id) { var val; if (IE) val = eval(Id).innerText; else val = document.getElementById(Id).innerHTML; return val; } function SetColor(Id, val) { if (IE) eval(Id).style.color = val; else document.getElementById(Id).style.color = val; } function SetView(Id, val) { if (IE) eval(Id).style.visibility = val; else document.getElementById(Id).style.visibility = val; } // i�u ch�nh l�i theo ti�t function MaiHoaDate(dd, mm, yy) { var oLunar = new LunarDate(dd,mm,yy); var t = TietKhi(yy,(mm-1)*2); var oTiet = new LunarDate(t,mm,yy); // Ti�t l�nh this.tue = oLunar.year; this.tiet= mm-1; if (this.tiet == 0) { this.tiet = 12; if (this.tue == yy) this.tue--; } if (oLunar.dd < oTiet.dd) { if (this.tiet <= 12) { this.tiet--; if (this.tiet == 0) { this.tiet = 12; if (this.tue == yy) this.tue--; } } t = TietKhi(this.tue, this.tiet*2); delete oTiet; oTiet = new LunarDate(t,this.tiet+1, this.tue); } if (this.tiet == 1 && this.tue < yy) this.tue=yy; this.tn = oLunar.dd - oTiet.dd + 1; // Ti�t ng�y this.y = yy; this.m = mm; this.d = dd; this.day = oLunar.day; this.month = oLunar.month; this.year = oLunar.year; this.isLeap = oLunar.isLeap; this.dd = oLunar.dd; this.mm = oLunar.mm; this.yy = oLunar.yy; delete oTiet; delete oLunar; } function capThoi() { var td = new Date(); with (MaiHoa) { year.value = CY; month.value = CM; day.value = td.getDate(); hour.value = td.getHours(); min.value = td.getMinutes(); sec.value = td.getSeconds(); } delete td; } function setupOption(tok) { var k, a, z; var j = new Date(); switch(tok) { case 'M': case 'n': if (tok == 'M') k = j.getMonth()+1; else // Th�ng �m l�ch k = CL.month; a = 1; z = 12; break; case 'D': k = j.getDate(); a = 1; z = 31; break; case 'd': // Ng�y �m l�ch k = CL.day; a = 1; z = 30; break; case 'H': k = j.getHours(); a = 0; z = 23; break; case 'm': k = j.getMinutes(); a = 0; z = 59; break; case 's': k = j.getSeconds(); a = 0; z = 59; break; case 'Q': k = 1; a = 1; z = 8; break; case 'Y': k = 0; a = 0; z = 6; break; } for (i=a;i<=z;i++) { document.write("<option value=" + i + (i == k ? " selected>" : ">") + i + "</option>") } delete j; } var quai_tuong = new Array( "7&", "0&", "1&", "2&", "3&", "4&", "5&", "6&" ); var quai_danh = new Array( "Kh�n", "Ki�n", "o�i", "Ly", "Ch�n", "T�n", "Kh�m", "C�n" ); var que_tuong = new Array( "�a", "Thi�n", "Tr�ch", "H�a", "L�i", "Phong", "Th�y", "S�n" ); var quai_hanh = new Array( "Th�", "Kim", "Kim", "H�a", "M�c", "M�c", "Th�y", "Th�" ); var ht_huong = new Array( " ", "B�c", "T�y Nam", "�ng", "�ng Nam", "Trung", "T�y B�c", "T�y", "�ng B�c", "Nam" ); // C�ch l�y Tr�ng Qu�i function layTrungQuai(t_quai, h_quai) { var tq = "" // Tr�ng Qu�i if (t_quai == h_quai) { tq = quai_danh[t_quai] + " vi " + que_tuong[h_quai] return tq; } tq = que_tuong[t_quai] + " " + que_tuong[h_quai] + " " switch(t_quai) { case 0: // Kh�n (�a) switch(h_quai) { case 1: tq += "Th�i"; break // Ki�n (Thi�n) case 2: tq += "L�m"; break; // o�i (Tr�ch) case 3: tq += "Minh Di"; break; // Ly (H�a) case 4: tq += "Ph�c"; break; // Ch�n (L�i) case 5: tq += "Thng"; break; // T�n (Phong) case 6: tq += "S�"; break; // Kh�m (Th�y) case 7: tq += "Khi�m"; break; // C�n (S�n) } break; case 1: // Ki�n switch(h_quai) { case 0: tq += "B)"; break // Kh�n (�a) case 2: tq += "L�"; break; // o�i (Tr�ch) case 3: tq += "�ng Nh�n"; break; // Ly (H�a) case 4: tq += "V� V�ng"; break; // Ch�n (L�i) case 5: tq += "C�u"; break; // T�n (Phong) case 6: tq += "T�ng"; break; // Kh�m (Th�y) case 7: tq += "�n"; break; // C�n (S�n) } break; case 2: // o�i (Tr�ch) switch(h_quai) { case 0: tq += "T�y"; break; // Kh�n (�a) case 1: tq += "Qu�i"; break; // Ki�n (Thi�n) case 3: tq += "C�ch"; break; // Ly (H�a) case 4: tq += "T�y"; break; // Ch�n (L�i) case 5: tq += "�i Qu�"; break; // T�n (Phong) case 6: tq += "Kh�n"; break; // Kh�m (Th�y) case 7: tq += "H�m"; break; // C�n (S�n) } break; case 3: // Ly (H�a) switch(h_quai) { case 0: tq += "T�n"; break; // Kh�n (�a) case 1: tq += "�i H�u"; break; // Ki�n (Thi�n) case 2: tq += "Khu�"; break; // o�i (Tr�ch) case 4: tq += "Ph� H�p"; break; // Ch�n (L�i) case 5: tq += "�nh"; break; // T�n (Phong) case 6: tq += "V� T�"; break; // Kh�m (Th�y) case 7: tq += "L�"; break; // C�n (S�n) } break; case 4: // Ch�n (L�i) switch(h_quai) { case 0: tq += "D�"; break; // Kh�n (�a) case 1: tq += "�i Tr�ng"; break; // Ki�n (Thi�n) case 2: tq += "Qui Mu�i"; break; // o�i (Tr�ch) case 3: tq += "Phong"; break; // Ly (H�a) case 5: tq += "H�ng"; break; // T�n (Phong) case 6: tq += "Gi�i"; break; // Kh�m (Th�y) case 7: tq += "Ti�u Qu�"; break; // C�n (S�n) } break; case 5: // T�n (Phong) switch(h_quai) { case 0: tq += "Qu�n"; break; // Kh�n (�a) case 1: tq += "Ti�u S�c"; break; // Ki�n (Thi�n) case 2: tq += "Trung Phu"; break; // o�i (Tr�ch) case 3: tq += "Gia Nh�n"; break; // Ly (H�a) case 4: tq += "�ch"; break; // Ch�n (L�i) case 6: tq += "Ho�n"; break; // Kh�m (Th�y) case 7: tq += "Ti�m"; break; // C�n (S�n) } break; case 6: // Kh�m (Th�y) switch(h_quai) { case 0: tq += "T�"; break; // Kh�n (�a) case 1: tq += "Nhu"; break; // Ki�n (Thi�n) case 2: tq += "Ti�t"; break; // o�i (Tr�ch) case 3: tq += "K� T�"; break; // Ly (H�a) case 4: tq += "Tru�n"; break; // Ch�n (L�i) case 5: tq += "T�nh"; break; // T�n (Phong) case 7: tq += "Ki�n"; break; // C�n (S�n) } break; case 7: // C�n (S�n) switch(h_quai) { case 0: tq += "B�c"; break; // Kh�n (�a) case 1: tq += "�i S�c"; break; // Ki�n (Thi�n) case 2: tq += "T�n"; break; // o�i (Tr�ch) case 3: tq += "B�"; break; // Ly (H�a) case 4: tq += "Di"; break; // Ch�n (L�i) case 5: tq += "C�"; break; // T�n (Phong) case 6: tq += "M�ng"; break; // Kh�m (Th�y) } break; } return tq; } // H�o T��ng function ghiHao(vi, hao) { this.vi = vi; // h�o v� [1-6] this.hao = hao; // h�o �m=6 (l�c) hay d��ng=9 (c�u) this.hd = 0; // �t H�o �ng v�o hay kh�ng this.th = 0; // ch�a an Th�ng } // Qu� Ki�n function que1(q) { var i = q.length; q.push(new ghiHao(++i, 9)) // h�o c�u s� hay 4 q.push(new ghiHao(++i, 9)) // h�o c�u 2 hay 5 q.push(new ghiHao(++i, 9)) // h�o c�u 3 hay 6 return q; } // Qu� o�i function que2(q) { var i = q.length; q.push(new ghiHao(++i, 9)) // h�o c�u s� hay 4 q.push(new ghiHao(++i, 9)) // h�o c�u 2 hay 5 q.push(new ghiHao(++i, 6)) // h�o l�c 3 hay 6 return q; } // Qu� Ly function que3(q) { var i = q.length; q.push(new ghiHao(++i, 9)) // h�o c�u s� hay 4 q.push(new ghiHao(++i, 6)) // h�o l�c 2 hay 5 q.push(new ghiHao(++i, 9)) // h�o c�u 3 hay 6 return q; } // Qu� Ch�n function que4(q) { var i = q.length; q.push(new ghiHao(++i, 9)) // h�o c�u s� hay 4 q.push(new ghiHao(++i, 6)) // h�o l�c 2 hay 5 q.push(new ghiHao(++i, 6)) // h�o l�c 3 hay 6 return q; } // Qu� T�n function que5(q) { var i = q.length; q.push(new ghiHao(++i, 6)) // h�o l�c s� hay 4 q.push(new ghiHao(++i, 9)) // h�o c�u 2 hay 5 q.push(new ghiHao(++i, 9)) // h�o c�u 3 hay 6 return q; } // Qu� Kh�m function que6(q) { var i = q.length; q.push(new ghiHao(++i, 6)) // h�o l�c s� hay 4 q.push(new ghiHao(++i, 9)) // h�o c�u 2 hay 5 q.push(new ghiHao(++i, 6)) // h�o l�c 3 hay 6 return q; } // Qu� C�n function que7(q) { var i = q.length; q.push(new ghiHao(++i, 6)) // h�o l�c s� hay 4 q.push(new ghiHao(++i, 6)) // h�o l�c 2 hay 5 q.push(new ghiHao(++i, 9)) // h�o c�u 3 hay 6 return q; } // Qu� Kh�n function que8(q) { var i = q.length; q.push(new ghiHao(++i, 6)) // h�o l�c s� hay 4 q.push(new ghiHao(++i, 6)) // h�o l�c 2 hay 5 q.push(new ghiHao(++i, 6)) // h�o l�c 3 hay 6 return q; } // L�y N�i (H�) Qu� function layNoiQue(hq) { var que = new Array(); switch(hq) { case 1: que = que1(que); break; // Ki�n Thi�n case 2: que = que2(que); break; // o�i Tr�ch case 3: que = que3(que); break; // Ly H�a case 4: que = que4(que); break; // Ch�n L�i case 5: que = que5(que); break; // T�n Phong case 6: que = que6(que); break; // Kh�m Th�y case 7: que = que7(que); break; // C�n S�n case 0: que = que8(que); break; // Kh�n �a } return que; } // L�p Qu� g�m 6 H�o function lucHao(tq, hq) { var hao; switch(tq) { case 1: hao = que1(layNoiQue(hq)); break; // Ki�n Thi�n case 2: hao = que2(layNoiQue(hq)); break; // o�i Tr�ch case 3: hao = que3(layNoiQue(hq)); break; // Ly H�a case 4: hao = que4(layNoiQue(hq)); break; // Ch�n L�i case 5: hao = que5(layNoiQue(hq)); break; // T�n Phong case 6: hao = que6(layNoiQue(hq)); break; // Kh�m Th�y case 7: hao = que7(layNoiQue(hq)); break; // C�n S�n case 0: hao = que8(layNoiQue(hq)); break; // Kh�n �a } return hao; } // L�p Qu� hay Tr�ng Qu� function lapQue(tq, hq) { this.tq = tq; // Th��ng Qu�i this.hq = hq; // H� Qu�i this.hao = lucHao(tq, hq); // Th�c Qu� g�m 6 h�o } // L�p H� Qu� function lapHoQue(que) { this.tq = layHoQuai1(que.tq, que.hq); // Th��ng Qu�i this.hq = layHoQuai2(que.tq, que.hq); // H� Qu�i this.hao = lucHao(this.tq, this.hq); // Th�c Qu� g�m 6 h�o } // X�a u�c c� B�n Qu� l�n Bi�n Qu� function xoaQue(que) { if (que == null) return; for (var i=0; i < que.hao.length; i++) delete que.hao[i]; delete que.hao; delete que; que = null; } // C�ch l�y Tr�ng Qu�i S� function soQue(t_quai, h_quai) { var i; switch(t_quai) { case 6: // Kh�m (Th�y) switch(h_quai) { case 6: i = 29; break // Kh�m (Th�y) case 0: i = 8; break // Kh�n (�a) case 4: i = 3; break // Ch�n (L�i) case 5: i = 48; break // T�n (Phong) case 1: i = 5; break // Ki�n (Thi�n) case 2: i = 60; break // o�i (Tr�ch) case 7: i = 39; break // C�n (S�n) case 3: i = 63; break // Ly (H�a) } break; case 0: // Kh�n (�a) switch(h_quai) { case 6: i = 7; break // Kh�m (Th�y) case 0: i = 2; break // Kh�n (�a) case 4: i = 24; break // Ch�n (L�i) case 5: i = 46; break // T�n (Phong) case 1: i = 11; break // Ki�n (Thi�n) case 2: i = 19; break // o�i (Tr�ch) case 7: i = 15; break // C�n (S�n) case 3: i = 36; break // Ly (H�a) } break; case 4: // Ch�n (L�i) switch(h_quai) { case 6: i = 40; break // Kh�m (Th�y) case 0: i = 16; break // Kh�n (�a) case 4: i = 51; break // Ch�n (L�i) case 5: i = 32; break // T�n (Phong) case 1: i = 34; break // Ki�n (Thi�n) case 2: i = 54; break // o�i (Tr�ch) case 7: i = 62; break // C�n (S�n) case 3: i = 55; break // Ly (H�a) } break; case 5: // T�n (Phong) switch(h_quai) { case 6: i = 59; break // Kh�m (Th�y) case 0: i = 20; break // Kh�n (�a) case 4: i = 42; break // Ch�n (L�i) case 5: i = 57; break // T�n (Phong) case 1: i = 9; break // Ki�n (Thi�n) case 2: i = 61; break // o�i (Tr�ch) case 7: i = 53; break // C�n (S�n) case 3: i = 37; break // Ly (H�a) } break; case 1: // Ki�n (Thi�n) switch(h_quai) { case 6: i = 6; break // Kh�m (Th�y) case 0: i = 12; break // Kh�n (�a) case 4: i = 25; break // Ch�n (L�i) case 5: i = 44; break // T�n (Phong) case 1: i = 1; break // Ki�n (Thi�n) case 2: i = 10; break // o�i (Tr�ch) case 7: i = 33; break // C�n (S�n) case 3: i = 13; break // Ly (H�a) } break; case 2: // o�i (Tr�ch) switch(h_quai) { case 6: i = 47; break // Kh�m (Th�y) case 0: i = 45; break // Kh�n (�a) case 4: i = 17; break // Ch�n (L�i) case 5: i = 28; break // T�n (Phong) case 1: i = 43; break // Ki�n (Thi�n) case 2: i = 58; break // o�i (Tr�ch) case 7: i = 31; break // C�n (S�n) case 3: i = 49; break // Ly (H�a) } break; case 7: // C�n (S�n) switch(h_quai) { case 6: i = 4; break // Kh�m (Th�y) case 0: i = 23; break // Kh�n (�a) case 4: i = 27; break // Ch�n (L�i) case 5: i = 18; break // T�n (Phong) case 1: i = 26; break // Ki�n (Thi�n) case 2: i = 41; break // o�i (Tr�ch) case 7: i = 52; break // C�n (S�n) case 3: i = 22; break // Ly (H�a) } break; case 3: // Ly (H�a) switch(h_quai) { case 6: i = 64; break // Kh�m (Th�y) case 0: i = 35; break // Kh�n (�a) case 4: i = 21; break // Ch�n (L�i) case 5: i = 50; break // T�n (Phong) case 1: i = 14; break // Ki�n (Thi�n) case 2: i = 38; break // o�i (Tr�ch) case 7: i = 56; break // C�n (S�n) case 3: i = 30; break // Ly (H�a) } break; } return i; } // C�ch l�y H� Qu�i cho th��ng qu�i function layHoQuai1(t_quai, h_quai) { var hq = 0; switch(t_quai) { case 0: // Kh�n (�a) case 7: // C�n (S�n) switch(h_quai) { case 0: hq = 0; break; // Kh�n (�a) case 1: hq = 4; break; // Ki�n (Thi�n) case 2: hq = 0; break; // o�i (Tr�ch) case 3: hq = 4; break; // Ly (H�a) case 4: hq = 0; break; // Ch�n (L�i) case 5: hq = 4; break; // T�n (Phong) case 6: hq = 0; break; // Kh�m (Th�y) case 7: hq = 4; break; // C�n (S�n) } break; case 1: // Ki�n case 2: // o�i (Tr�ch) switch(h_quai) { case 0: hq = 5; break; // Kh�n (�a) case 1: hq = 1; break; // Ki�n (Thi�n) case 2: hq = 5; break; // o�i (Tr�ch) case 3: hq = 1; break; // Ly (H�a) case 4: hq = 5; break; // Ch�n (L�i) case 5: hq = 1; break; // T�n (Phong) case 6: hq = 5; break; // Kh�m (Th�y) case 7: hq = 1; break; // C�n (S�n) } break; case 3: // Ly (H�a) case 4: // Ch�n (L�i) switch(h_quai) { case 0: hq = 6; break; // Kh�n (�a) case 1: hq = 2; break; // Ki�n (Thi�n) case 2: hq = 6; break; // o�i (Tr�ch) case 3: hq = 2; break; // Ly (H�a) case 4: hq = 6; break; // Ch�n (L�i) case 5: hq = 2; break; // T�n (Phong) case 6: hq = 6; break; // Kh�m (Th�y) case 7: hq = 2; break; // C�n (S�n) } break; case 5: // T�n (Phong) case 6: // Kh�m (Th�y) switch(h_quai) { case 0: hq = 7; break; // Kh�n (�a) case 1: hq = 3; break; // Ki�n (Thi�n) case 2: hq = 7; break; // o�i (Tr�ch) case 3: hq = 3; break; // Ly (H�a) case 4: hq = 7; break; // Ch�n (L�i) case 5: hq = 3; break; // T�n (Phong) case 6: hq = 7; break; // Kh�m (Th�y) case 7: hq = 3; break; // C�n (S�n) } break; } return hq; } // C�ch l�y H� Qu�i cho h� qu�i function layHoQuai2(t_quai, h_quai) { var hq = 0; switch(t_quai) { case 1: // Ki�n case 2: // o�i (Tr�ch) case 3: // Ly (H�a) case 4: // Ch�n (L�i) switch(h_quai) { case 0: hq = 7; break; // Kh�n (�a) case 1: hq = 1; break; // Ki�n (Thi�n) case 2: hq = 3; break; // o�i (Tr�ch) case 3: hq = 5; break; // Ly (H�a) case 4: hq = 7; break; // Ch�n (L�i) case 5: hq = 1; break; // T�n (Phong) case 6: hq = 3; break; // Kh�m (Th�y) case 7: hq = 5; break; // C�n (S�n) } break; case 0: // Kh�n (�a) case 5: // T�n (Phong) case 6: // Kh�m (Th�y) case 7: // C�n (S�n) switch(h_quai) { case 0: hq = 0; break; // Kh�n (�a) case 1: hq = 2; break; // Ki�n (Thi�n) case 2: hq = 4; break; // o�i (Tr�ch) case 3: hq = 6; break; // Ly (H�a) case 4: hq = 0; break; // Ch�n (L�i) case 5: hq = 2; break; // T�n (Phong) case 6: hq = 4; break; // Kh�m (Th�y) case 7: hq = 6; break; // C�n (S�n) } break; } return hq; } // C�ch l�y Bi�n Qu�i function layBienQuai(quai, donghao) { var bq = 0; if (donghao > 3 || donghao < 0) return bq; if (donghao == 0) return quai; switch(quai) { case 0: switch(donghao) { case 1: bq = 4; break; case 2: bq = 6; break; case 3: bq = 7; break; } break; case 1: switch(donghao) { case 1: bq = 5; break; case 2: bq = 3; break; case 3: bq = 2; break; } break; case 2: switch(donghao) { case 1: bq = 6; break; case 2: bq = 4; break; case 3: bq = 1; break; } break; case 3: switch(donghao) { case 1: bq = 7; break; case 2: bq = 1; break; case 3: bq = 4; break; } break; case 4: switch(donghao) { case 1: bq = 0; break; case 2: bq = 2; break; case 3: bq = 3; break; } break; case 5: switch(donghao) { case 1: bq = 1; break; case 2: bq = 7; break; case 3: bq = 6; break; } break; case 6: switch(donghao) { case 1: bq = 2; break; case 2: bq = 0; break; case 3: bq = 5; break; } break; case 7: switch(donghao) { case 1: bq = 3; break; case 2: bq = 5; break; case 3: bq = 0; break; } break; } return bq; } // Bi�n Qu� theo �ng h�o function lapBienQue(bon, donghao) { var c=0,i=0,k=0,p=0; // Bi�n qu�i if (donghao < 4) { this.tq = bon.tq; if (donghao > 0) this.hq = layBienQuai(bon.hq, donghao); else this.hq = bon.hq; } else { this.tq = layBienQuai(bon.tq, donghao - 3); this.hq = bon.hq; } this.hao = lucHao(this.tq, this.hq); // Th�c Qu� g�m 6 h�o if (donghao) { // An h�o �ng cho Bi�n Qu� bon.hao[donghao-1].hd = 1; this.hao[donghao-1].hd = 1; } } // So s�nh gi�a Ch� v� Kh�ch var ChuKhack = new Array("t� h�a", "sinh nh�p", "kh�c nh�p", "sinh xu�t", "kh�c xu�t" ); var TheDung = new Array("th� d�ng t� h�a", "d�ng sinh th�", "d�ng kh�c th�", "th� sinh d�ng", "th� kh�c d�ng" ); var TheHo = new Array("th� h� t� h�a", "h� sinh th�", "h� kh�c th�", "th� sinh h�", "th� kh�c h�" ); var DungHo = new Array("d�ng h� t� h�a", "h� sinh d�ng", "h� kh�c d�ng", "d�ng sinh h�", "d�ng kh�c h�" ); var CatHung = new Array("ti�u c�t", "�i c�t", "�i hung", "ti�t kh�", "ti�u c�t"); var TheCatHung = new Array("�i l�i", "�i l�i", "�i b�t l�i", "b�t l�i", "b�t l�i"); var DungCatHung = new Array("�i b�t l�i", "�i b�t l�i", "l�i", "l�i", "l�i"); function soSanh(chu, khach) { var rstat; switch(chu) { case 1: // Ki�n Kim case 2: // o�i Kim switch(khach) { case 1: // Ki�n Kim case 2: // o�i Kim rstat = 0; break; case 3: // Ly H�a rstat = 2; break; case 4: // Ch�n M�c case 5: // T�n M�c rstat = 4; break; case 6: // Kh�m Th�y rstat = 3; break; case 0: // Kh�n Th� case 7: // C�n Th� rstat = 1; break; } break; case 3: // Ly H�a switch(khach) { case 1: // Ki�n Kim case 2: // o�i Kim rstat = 4; break; case 3: // Ly H�a rstat = 0; break; case 4: // Ch�n M�c case 5: // T�n M�c rstat = 1; break; case 6: // Kh�m Th�y rstat = 2; break; case 0: // Kh�n Th� case 7: // C�n Th� rstat = 3; break; } break; case 4: // Ch�n M�c case 5: // T�n M�c switch(khach) { case 1: // Ki�n Kim case 2: // o�i Kim rstat = 2; break; case 3: // Ly H�a rstat = 3; break; case 4: // Ch�n M�c case 5: // T�n M�c rstat = 0; break; case 6: // Kh�m Th�y rstat = 1; break; case 0: // Kh�n Th� case 7: // C�n Th� rstat = 4; break; } break; case 6: // Kh�m Th�y switch(khach) { case 1: // Ki�n Kim case 2: // o�i Kim rstat = 1; break; case 3: // Ly H�a rstat = 4; break; case 4: // Ch�n M�c case 5: // T�n M�c rstat = 3; break; case 6: // Kh�m Th�y rstat = 0; break; case 0: // Kh�n Th� case 7: // C�n Th� rstat = 2; break; } break; case 0: // Kh�n Th� case 7: // C�n Th� switch(khach) { case 1: // Ki�n Kim case 2: // o�i Kim rstat = 3; break; case 3: // Ly H�a rstat = 1; break; case 4: // Ch�n M�c case 5: // T�n M�c rstat = 2; break; case 6: // Kh�m Th�y rstat = 4; break; case 0: // Kh�n Th� case 7: // C�n Th� rstat = 0; break; } break; } return rstat; } function laySo(quai) { if (quai == 0) quai = 8; return quai; } // T�m Kh�ng Vong; nh�p Can & Chi Nm; return chi �u trong m�i c�p function khongVong(can, chi) { // Trong v�ng ------------ Gi�p T�, G. Tu�t, G. Th�n, G. Ng�, G. Th�n, G. D�n // Kh�ng Vong lu�n c� �i: Tu�t H�i, Th�n D�u, Ng� M�i, Th�n T�, D�n M�o, T� S�u var KV1 = [10,8,6,4,2,0]; //var KV2 = [11,9,7,5,3,1]; var canvi = canVi(can); var chivi = chiVi(chi); var biet = chivi - canvi; if (biet < 0) biet += 12; switch(biet) { case 0: kv=KV1[0]; break; case 2: kv=KV1[5]; break; case 4: kv=KV1[4]; break; case 6: kv=KV1[3]; break; case 8: kv=KV1[2]; break; case 10: kv=KV1[1]; break; } return kv; } // T�m Kh�ng Vong Th�i; Nh�p Can ng�y, return chi GI� �u trong m�i c�p function gioKhongVong(can) { // Kh�ng Vong lu�n c� �i: Tu�t H�i, Th�n D�u, Ng� M�i, Th�n T�, D�n M�o, T� S�u var KV1 = [10,8,6,4,2,0]; //var KV2 = [11,9,7,5,3,1]; var can = canVi(can); var kv=0; switch(can) { case 0: case 5: kv=KV1[1]; break; // Ng�y Gi�p K� : gi� Th�n D�u case 1: case 6: kv=KV1[2]; break; // Ng�y �t Canh : gi� Ng� M�i case 2: case 7: kv=KV1[3]; break; // Ng�y B�nh T�n : gi� Th�n T� case 3: case 8: kv=KV1[4]; break; // Ng�y inh Nh�m: gi� D�n M�o case 4: case 9: kv=KV1[0]; break; // Ng�y M�u K� : gi� T� S�u } return kv; } // Kh� c�a T� Th�i var TuThoi = new Array("V��ng", "T��ng", "H�u", "T�", "T�"); // Xem Kh� c�a T� Th�i function xemKhi(mm, quai) { var k = 0; // Kh�: V��ng, T��ng, H�u, T�, T� switch(mm) { case 1: case 2: // Xu�n M�c switch(quai) { case 1: // Ki�n Kim case 2: // o�i Kim k = 3; break; // M�c v��ng, Kim T� th�nh v� kh� case 3: // Ly H�a k = 1; break; // M�c sinh H�a case 4: // Ch�n M�c case 5: // T�n M�c k = 0; break; // T� H�a: V��ng case 6: // Kh�m Th�y k = 2; break; // Th�y sinh M�c: H�u case 0: // Kh�n Th� case 7: // C�n Th� k = 4; break; // M�c kh�c Th�: T� th�nh v� kh� } break; case 3: case 6: case 9: case 12: // T� Qu� Th� switch(quai) { case 1: // Ki�n Kim case 2: // o�i Kim k = 1; break; // Th� sinh Kim: T��ng case 3: // Ly H�a k = 2; break; // Th� v��ng th� H�a h�u (gi�) case 4: // Ch�n M�c case 5: // T�n M�c k = 3; break; // T� th�nh v� kh� case 6: // Kh�m Th�y k = 4; break; // T� th�nh v� kh� case 0: // Kh�n Th� case 7: // C�n Th� k = 0; break; // V��ng } break; case 4: case 5: // H� H�a switch(quai) { case 1: // Ki�n Kim case 2: // o�i Kim k = 4; break; // Kim T� th�nh v� kh� case 3: // Ly H�a k = 0; break; // H�a V��ng case 4: // Ch�n M�c case 5: // T�n M�c k = 2; break; // H�a V��ng, M�c H�u case 6: // Kh�m Th�y k = 3; break; // Th�y T� th�nh v� kh� case 0: // Kh�n Th� case 7: // C�n Th� k = 1; break; // H�a sinh Th�: t��ng } break; case 7: case 8: // Thu Kim switch(quai) { case 1: // Ki�n Kim case 2: // o�i Kim k = 0; break; // Kim V��ng case 3: // Ly H�a k = 3; break; // H�a T� th�nh v� kh� case 4: // Ch�n M�c case 5: // T�n M�c k = 4; break; // M�c T� th�nh v� kh� case 6: // Kh�m Th�y k = 1; break; // Kim sinh Th�y: T��ng case 0: // Kh�n Th� case 7: // C�n Th� k = 2; break; // Th� H�u (gi�) } break; case 10: case 11: // �ng Th�y switch(quai) { case 1: // Ki�n Kim case 2: // o�i Kim k = 2; break; // Kim H�u (gi�) case 3: // Ly H�a k = 4; break; // H�a T� th�nh v� kh� case 4: // Ch�n M�c case 5: // T�n M�c k = 1; break; // M�c T��ng case 6: // Kh�m Th�y k = 0; break; // Th�y V��ng case 0: // Kh�n Th� case 7: // C�n Th� k = 3; break; // Th� T� th�nh v� kh� } break; } return k; } // Lu�n o�n qu� function luanDoan(ketqua, chu, khach, month) { var khi; var s = ""; if (month == 0) { s = " t�c " + CatHung[ketqua]; return s; } switch(ketqua) { case 0: // T� h�a khi = xemKhi(month, chu); if (khi < 2) s = " t�c " + CatHung[ketqua]; else s = " nh�ng th�ng "+month+" "+quai_hanh[chu]+" l� "+TuThoi[khi]+" kh�"; break; case 1: // D�ng sinh Th� khi = xemKhi(month, khach); if (khi < 2) s = " t�c " + CatHung[ketqua]; else if (khi == 2) s = " nh�ng ti�t th�ng "+month+", "+quai_hanh[khach]+" l� "+TuThoi[khi]+" kh�;\ncho n�n kh�ng ho�n to�n t�t"; else s = " nh�ng ti�t th�ng "+month+", "+quai_hanh[khach]+" l� "+TuThoi[khi]+" kh�;\ncho n�n l� v� kh�, v� c�t"; break; case 2: // D�ng kh�c Th� khi = xemKhi(month, khach); if (khi < 2) s = " t�c " + CatHung[ketqua]; else if (khi == 2) s = " nh�ng ti�t th�ng "+month+", "+quai_hanh[khach]+" l� "+TuThoi[khi]+" kh�;\ncho n�n � hung"; else s = " nh�ng ti�t th�ng "+month+", "+quai_hanh[khach]+" l� "+TuThoi[khi]+" kh�;\ncho n�n v� h�i"; break; case 3: // Th� sinh D�ng khi = xemKhi(month, chu); if (khi < 2) s = " t�c " + CatHung[ketqua]; else if (khi == 2) s = " nh�ng ti�t th�ng "+month+", "+quai_hanh[chu]+" l� "+TuThoi[khi]+" kh�;\nti�t kh�, cho n�n b�t l�i"; else s = " nh�ng ti�t th�ng "+month+", "+quai_hanh[chu]+" l� "+TuThoi[khi]+" kh�;\nti�t kh�, nh�ng l� v� kh�"; break; case 4: // Th� kh�c d�ng khi = xemKhi(month, chu); if (khi < 2) s = " t�c " + CatHung[ketqua]; else if (khi == 2) s = " nh�ng ti�t th�ng "+month+", "+quai_hanh[chu]+" l� "+TuThoi[khi]+" kh�"; else s = " nh�ng ti�t th�ng "+month+", "+quai_hanh[chu]+" l� "+TuThoi[khi]+" kh�;\ncho n�n l� v� kh�, v� c�t"; break; default: s = " t�c " + CatHung[ketqua]; break; } return s; } var z=0; var concurrent = 0; var colors = new Array("black", "red"); var blinkObj = new Array(); function doFlash() { if (z) z = 0; else z = 1; if (concurrent) { if (NS) setTimeout("doFlash()",700); return; } var hObj; for (i=0; i < blinkObj.length; i++) { hObj = eval(blinkObj[i]) hObj.style.color = colors[z]; } if (NS) setTimeout("doFlash()",700); } var bonQue=null, bienQue=null; // B�n Qu� v� Bi�n Qu� var hoQue=null; // H� B�n var DUONG = "visible"; var AM = "hidden"; function layQue() { var iYear, iMon, iDay, iHour, iMin; with (MaiHoa) { iYear = parseInt(year.value); iMon = parseInt(month.value); iDay = parseInt(day.value); iHour = parseInt(hour.value); iMin = parseInt(min.value); if (isNaN(iYear)) { alert("Xin vui l�ng i�n v�o nm!"); MaiHoa.year.focus(); return; } } var oLich = new MaiHoaDate(iDay, iMon, iYear); var s = ""; var gio = 0; switch(iHour) { case 0: case 23: gio = 1; break; default: iHour += 1; gio = parseInt(iHour / 2) + 1; break; } var jNam; if (MaiHoa.TietThang[0].checked == true) jNam = ((oLich.year + 8) % 12) + 1; else jNam = ((oLich.tue + 8) % 12) + 1; var th_quai = 0; var ha_quai = 0; var donghao = 0; if (MaiHoa.ChonLua[1].checked == true) { th_quai = parseInt(MaiHoa.quai1.value); if (th_quai == 8) th_quai = 0; ha_quai = parseInt(MaiHoa.quai2.value); if (ha_quai == 8) ha_quai = 0; donghao = parseInt(MaiHoa.haodong.value); s = "T� nh�p th��ng qu�i: " + quai_danh[th_quai] + " v� h� qu�i: " + quai_danh[ha_quai]; } else { var TQ, HQ, S2, GiaSo; if (MaiHoa.ChonLua[0].checked == true) { GiaSo = parseInt(MaiHoa.giaso.value); if (isNaN(GiaSo)) GiaSo = 0; if (MaiHoa.TietThang[0].checked == true) TQ = jNam + oLich.month + oLich.day; else if (MaiHoa.TietThang[1].checked == true) TQ = jNam + oLich.tiet + oLich.tn; // D�ng ti�t th�ng v� ng�y sau ti�t l�nh else TQ = jNam + oLich.tiet + oLich.day; // D�ng ti�t th�ng v� ng�y trong th�ng AL HQ = TQ + gio + GiaSo; } else if (MaiHoa.ChonLua[4].checked == true) { iYear = parseInt(MaiHoa.al_nam.value) + 1; iMon = parseInt(MaiHoa.al_thang.value); iDay = parseInt(MaiHoa.al_ngay.value); iHour = parseInt(MaiHoa.al_gio.value) + 1; GiaSo = parseInt(MaiHoa.al_giaso.value); if (isNaN(GiaSo)) GiaSo = 0; TQ = iYear + iMon + iDay; HQ = TQ + iHour + GiaSo; } else { TQ = parseInt(MaiHoa.sotren.value); S2 = parseInt(MaiHoa.soduoi.value); if (MaiHoa.ChonLua[2].checked == true) HQ = S2 + gio; else HQ = TQ + S2; } th_quai = (TQ % 8); ha_quai = (HQ % 8); donghao = (HQ % 6); if (donghao == 0) donghao = 6; var thang = 0; var tueCan,tueChi,ngCan,ngChi,nhCan,nhChi,thCan,thChi; if (MaiHoa.ChonLua[0].checked == true) { if (MaiHoa.TietThang[0].checked == true) { tueCan = TueCan(oLich.year); tueChi = TueChi(oLich.year); ngCan=ThienCan(oLich.mm); ngChi=DiaChi(oLich.mm); s = "Nm " + tueCan + " " + tueChi; s += ", th�ng " + ngCan + " " + ngChi; thang = oLich.month; } else { tueCan = TueCan(oLich.tue); tueChi = TueChi(oLich.tue); ngCan=NguyetCan(tueCan, oLich.tiet-1); thang=(oLich.tiet+1)%12; ngChi=CHI[thang]; // D�ng ti�t th�ng s = "Nm " + tueCan + " " + tueChi; s += ", ti�t th�ng " + ngCan + " " + ngChi; thang = oLich.tiet; } nhCan = ThienCan(oLich.dd); nhChi = DiaChi(oLich.dd); thCan = ThoiCan(ThienCan(oLich.dd) , gio-1); thChi = CHI[gio-1]; s += ", ng�y " + nhCan + " " + nhChi; s += ", gi� " + ThoiCan(ThienCan(oLich.dd) , gio-1) + " " + CHI[gio-1]; } else if (MaiHoa.ChonLua[2].checked == true) s = "T� nh�p s�_1 l� " + TQ + " v� s�_2 l� " + S2 + " v�o gi� " + CHI[gio-1]; else if (MaiHoa.ChonLua[3].checked == true) s = "T� nh�p s�_1 l� " + TQ + " v� s�_2 l� " + S2; else if (MaiHoa.ChonLua[4].checked == true) { s = "T� ch�n �m l�ch"; thang = iMon; } else s = "T� ch�n l�ch nh� ch� �nh"; } // L�p B�n Qu�, H� Qu�, v� Bi�n Qu� if (bonQue!=null) xoaQue(bonQue); bonQue = new lapQue(th_quai, ha_quai); if (hoQue!=null) xoaQue(hoQue); hoQue = new lapHoQue(bonQue); if (bienQue!=null) xoaQue(bienQue); bienQue = new lapBienQue(bonQue, donghao); var chu, khach, b_chu, b_khach, ho_chu, ho_khach; if (donghao < 4) { if (donghao == 0) { Write('ThuongQuai', "X"); Write('HaQuai', "X"); } else { Write('ThuongQuai', "Th�"); Write('HaQuai', "D�ng"); } chu = bonQue.tq; khach = bonQue.hq; ho_chu = hoQue.tq; ho_khach = hoQue.hq; b_chu = bienQue.tq; b_khach = bienQue.hq; } else { Write('ThuongQuai', "D�ng"); Write('HaQuai', "Th�"); chu = bonQue.hq; khach = bonQue.tq; ho_chu = hoQue.hq; ho_khach = hoQue.tq; b_chu = bienQue.hq; b_khach = bienQue.tq; } // Reset colors concurrent = 1; for (i=0; i < blinkObj.length; i++) { SetColor(blinkObj[i], colors[0]); delete blinkObj[i]; blinkObj[i] = null; } blinkObj.length = 0; delete blinkObj; SetView('MaiHoaText', "visible"); Write('ChiemQue', s); Write('ChuQue', layTrungQuai(bonQue.tq, bonQue.hq)); Write('BQ_TQ', quai_danh[bonQue.tq]); Write('BQ_TH', quai_hanh[bonQue.tq]); Write('BQ_HQ', quai_danh[bonQue.hq]); Write('BQ_HH', quai_hanh[bonQue.hq]); var j; var hao = ""; var hid; for (i=0; i < bonQue.hao.length; i++) { j=i+1; hao = ((bonQue.hao[6-j].hao == 9) ? DUONG : AM); hid = 'BQ_H'+(6-i); if (donghao && (6-i)==donghao) blinkObj.push(hid); SetView(hid+'C', hao); } Write('HoQue', layTrungQuai(hoQue.tq, hoQue.hq)); Write('HQ_TQ', quai_danh[hoQue.tq]); Write('HQ_TH', quai_hanh[hoQue.tq]); Write('HQ_HQ', quai_danh[hoQue.hq]); Write('HQ_HH', quai_hanh[hoQue.hq]); for (i=0; i < hoQue.hao.length; i++) { j=i+1; hao = ((hoQue.hao[6-j].hao == 9) ? DUONG : AM); SetView('HQ_H'+(6-i)+'C', hao); } Write('BienQue', layTrungQuai(bienQue.tq, bienQue.hq)); Write('QB_TQ', quai_danh[bienQue.tq]); Write('QB_TH', quai_hanh[bienQue.tq]); Write('QB_HQ', quai_danh[bienQue.hq]); Write('QB_HH', quai_hanh[bienQue.hq]); for (i=0; i < bienQue.hao.length; i++) { j=i+1; hao = ((bienQue.hao[6-j].hao == 9) ? DUONG : AM); hid = 'QB_H'+(6-i); if (donghao && (6-i)==donghao) blinkObj.push(hid); SetView(hid+'C', hao); } if (MaiHoa.ChonLua[0].checked == true) { var kv = khongVong(tueCan,tueChi); // Tu� if (MaiHoa.TietThang[0].checked == true) Write('m_nam', oLich.year); else Write('m_nam', oLich.tue); Write('m_nam_cc', tueCan+" "+tueChi); Write('m_nam_kv', CHI[kv]+" "+CHI[kv+1]); kv = khongVong(ngCan,ngChi); // Nguy�t Write('m_tiet', thang); Write('m_tiet_cc', ngCan+" "+ngChi); Write('m_tiet_kv', CHI[kv]+" "+CHI[kv+1]); kv = khongVong(nhCan,nhChi); // Nh�t Write('m_nhat', oLich.day); Write('m_nhat_cc', nhCan+" "+nhChi); Write('m_nhat_kv', CHI[kv]+" "+CHI[kv+1]); kv = khongVong(thCan,thChi); // Th�i Write('m_thoi', iHour); Write('m_thoi_cc', thCan+" "+thChi); Write('m_thoi_kv', CHI[kv]+" "+CHI[kv+1]); kv = gioKhongVong(nhCan); // Nh�t -> Gi� Write('m_ngay_cc', nhCan); Write('m_gio_kv', CHI[kv]+" "+CHI[kv+1]); SetView('kv_luan', "visible"); } else { SetView('kv_luan', "hidden"); } if (donghao > 0) s = "H�o " + donghao + " �ng"; else s = "Kh�ng c� h�o �ng"; Write('m_haodong', s); if (donghao != 0) { var cq = soSanh(chu, khach); var bq = soSanh(b_chu, b_khach); var hq = soSanh(ho_chu, ho_khach); var ch = soSanh(chu, ho_chu); var kh = soSanh(khach, ho_khach); s = (laySo(chu) + laySo(khach) + laySo(b_chu) + laySo(b_khach) + laySo(ho_chu) + laySo(ho_khach)); SetView('MaiHoaGiai', "visible"); Write('m_bonQue', TheDung[cq]); Write('l_bonQue', luanDoan(cq, chu, khach, thang)); Write('m_theHo', TheHo[ch]); Write('l_theHo', TheCatHung[ch]); Write('m_dungHo', DungHo[kh]); Write('l_dungHo', DungCatHung[kh]); Write('m_hoQue', TheDung[hq]); Write('l_hoQue', luanDoan(hq, ho_chu, ho_khach, thang)); Write('m_bienQue', TheDung[bq]); Write('l_bienQue', luanDoan(bq, b_chu, b_khach, thang)); Write('m_tongSo', s); } else { SetView('MaiHoaGiai', "hidden"); } delete oLich; concurrent = 0; } // X�a qu� function xoaMaiHoa() { if (IE) { document.all.MaiHoaText.style.visibility = "hidden"; document.all.MaiHoaGiai.style.visibility = "hidden"; } else { document.getElementById('MaiHoaText').style.visibility = "hidden"; document.getElementById('MaiHoaGiai').style.visibility = "hidden"; } MaiHoa.ChonLua[0].checked = true; MaiHoa.giaso.value = 0; MaiHoa.sotren.value = 0; MaiHoa.soduoi.value = 0; MaiHoa.quai1.value = 1; MaiHoa.quai2.value = 1; MaiHoa.haodong.value = 0; concurrent = 1; var i; for (i=0; i < blinkObj.length; i++) { SetColor(blinkObj[i], colors[0]); delete blinkObj[i]; blinkObj[i] = null; } blinkObj.length = 0; delete blinkObj; // NS does not handle on the sub threads if (NS) for (i=1; i <= 6; i++) { SetView('BQ_H'+i+'C', "hidden"); SetView('HQ_H'+i+'C', "hidden"); SetView('QB_H'+i+'C', "hidden"); } capThoi(); } function yKienXayDung() { var s = "Xin c�m �n qu� v� d�ng k� ch��ng n�y. N�u qu� v� c� � ki�n v� c� l�ng\n"; s += "h�o t�m mu�n �ng g�p x�y d�ng � c� b�n k� ch��ng t�t �p h�n trong\n"; s += "t��ng lai; xin vui l�ng li�n l�c v�i t�c gi� Thi�n Y qua �a ch� sau:\n"; s += "\[email protected]\n"; s += "a t�"; alert(s); } function layCan(CanChi) { var i = 0; var j = CanChi.indexOf(' '); return CanChi.substring(i, j); } function layChi(CanChi) { var j = CanChi.indexOf(' '); var i = j + 1; j = CanChi.length; return CanChi.substring(i, j); } function XemCanChi(m) { } function chiTiet(muc) { } </script> <center> <h2>Mai Hoa D�ch S�</h2> <!-- <p> <FONT face="Arial" size=2>K� ch��ng b�ng JavaScript c�p 1.07x1</FONT><BR> <FONT face="Arial" color=blue size=1>T�t nh�t l� d�ng v�i Internet Explorer!</FONT></p> --> <TABLE border="1" cellSpacing="0" background="wm1.jpg"> <FORM name="MaiHoa" ACTION=""> <TR> <TD colSpan="3" align="center"><img src="mh1.jpg"><FONT face="Arial" size=4>Chi�m theo l�ch ho�c t� l�a c�ch</FONT></TD> </TR> <FORM name="MaiHoa" ACTION=""> <TR> <TD colSpan="3" align=center><TABLE border="0" cellSpacing="0"> <TR> <TD><FONT face=Arial size=2>Nm</FONT></TD> <TD><FONT face=Arial size=2>Th�ng</FONT></TD> <TD><FONT face=Arial size=2>Ng�y</FONT></TD> <TD><FONT face=Arial size=2>Gi�</FONT></TD> <TD><FONT face=Arial size=2>Ph�t</FONT></TD> <TD><FONT face=Arial size=2>Gi�y</FONT></TD> </TR> <TR> <TD><INPUT TYPE="text" style="FONT-SIZE:12pt" SIZE="1" MAXLENGTH="4" NAME="year"><script language="Javascript"> if (NS) document.getElementById('year').size = "2"; document.MaiHoa.year.value = CY; </script> </TD> <TD><SELECT style="FONT-SIZE:12pt" NAME="month"><script language="Javascript">setupOption('M')</script></SELECT></TD> <TD><SELECT style="FONT-SIZE:12pt" NAME="day"><script language="Javascript">setupOption('D')</script></SELECT></TD> <TD><SELECT style="FONT-SIZE:12pt" NAME="hour"><script language="Javascript">setupOption('H')</script></SELECT></TD> <TD><SELECT style="FONT-SIZE:12pt" NAME="min"><script language="Javascript">setupOption('m')</script></SELECT></TD> <TD><SELECT style="FONT-SIZE:12pt" NAME="sec"><script language="Javascript">setupOption('s')</script></SELECT></TD> </TR> </TABLE></TD> </TR> <TR> <TD colSpan="3" align=center> <FONT face=Arial size=4>C�ch ch�n l�y qu�</FONT><br> <input type="radio" name="TietThang"><FONT face=Arial size=3 color=blue>Th�ng</FONT> <input type="radio" name="TietThang" checked><FONT face=Arial size=3 color=blue>Ti�t</FONT> <input type="radio" name="TietThang"><FONT face=Arial size=3 color=blue>Ti�t+Ng�y AL</FONT> </TD> </TR> <TR align=center> <TD> <TABLE border="0" cellSpacing="0"> <!-- style="width=150;" --> <TR align=center> <TD><input type="radio" name="ChonLua" checked><FONT face=Arial size=3 color=blue>Theo l�ch</FONT></TD> </TR> <TR align=center> <TD><FONT face=Arial size=2>Gia S�</FONT></TD> </TR> <TR align=center> <TD><INPUT style="FONT-SIZE:12pt" TYPE="text" SIZE="1" MAXLENGTH="4" VALUE="0" NAME="giaso"></TD> </TR> </TABLE> </TD> <TD> <TABLE border="0" cellSpacing="0"> <!-- style="width=150;"--> <TR align=center> <TD colSpan=3><input type="radio" name="ChonLua"><FONT face=Arial size=3 color=blue>Nh�p qu�i</FONT></TD> </TR> <TR align=center> <TD><FONT face=Arial size=2>Qu�i 1</FONT></TD> <TD><FONT face=Arial size=2>Qu�i 2</FONT></TD> <TD><FONT face=Arial size=2>H�o �ng</FONT></TD> </TR> <TR align=center> <TD><SELECT style="FONT-SIZE:12pt" NAME="quai1"><script language="Javascript">setupOption('Q')</script></SELECT></TD> <TD><SELECT style="FONT-SIZE:12pt" NAME="quai2"><script language="Javascript">setupOption('Q')</script></SELECT></TD> <TD><SELECT style="FONT-SIZE:12pt" NAME="haodong"><script language="Javascript">setupOption('Y')</script></SELECT></TD> </TR> </TABLE> </TD> <TD> <TABLE border="0" cellSpacing="0"> <!-- style="width=150;" --> <TR align=center> <TD><input type="radio" name="ChonLua"><FONT face=Arial size=3 color=blue>S�+gi�</FONT></TD> <TD><input type="radio" name="ChonLua"><FONT face=Arial size=3 color=blue>S�</FONT></TD> </TR> <TR align=center> <TD><FONT face=Arial size=2>S� 1</FONT></TD> <TD><FONT face=Arial size=2>S� 2</FONT></TD> </TR> <TR align=center> <TD><INPUT style="FONT-SIZE:12pt" TYPE="text" SIZE="1" MAXLENGTH="4" VALUE="0" NAME="sotren"></TD> <TD><INPUT style="FONT-SIZE:12pt" TYPE="text" SIZE="1" MAXLENGTH="4" VALUE="0" NAME="soduoi"></TD> </TR> </TABLE> </TD> </TR> <TR> <TD colSpan="3" align=center> <TABLE border="0" cellSpacing="0"> <!-- style="width=150;"--> <TR align=center> <TD colSpan=5><input type="radio" name="ChonLua"><FONT face=Arial size=3 color=blue>T� nh�p �m l�ch</FONT></TD> </TR> <TR align=center> <TD><FONT face=Arial size=2>Nm</FONT></TD> <TD><FONT face=Arial size=2>Th�ng</FONT></TD> <TD><FONT face=Arial size=2>Ng�y</FONT></TD> <TD><FONT face=Arial size=2>Gi�</FONT></TD> <TD><FONT face=Arial size=2>Gia s�</FONT></TD> </TR> <TR align=center> <TD><SELECT style="FONT-SIZE:12pt" NAME="al_nam"> <script language="Javascript"> k = ((CL.year + 8) % 12); for (var i=0;i<12;i++) document.write("<option value=" + i + (i == k ? " selected>" : ">") + CHI[i] + "</option>"); </script> </SELECT> </TD> <TD><SELECT style="FONT-SIZE:12pt" NAME="al_thang"><script language="Javascript">setupOption('n')</script></SELECT></TD> <TD><SELECT style="FONT-SIZE:12pt" NAME="al_ngay"><script language="Javascript">setupOption('d')</script></SELECT></TD> <TD><SELECT style="FONT-SIZE:12pt" NAME="al_gio"> <script language="Javascript"> var k = parseInt(Today.getHours()) + 1; k = parseInt(k / 2); for (var i=0;i<12;i++) document.write("<option value=" + i + (i == k ? " selected>" : ">") + CHI[i] + "</option>"); </script> </SELECT> <TD><INPUT TYPE="text" style="FONT-SIZE:12pt" SIZE="1" MAXLENGTH="4" VALUE="0" NAME="al_giaso"></TD> </TD> </TR> </TABLE> </TD> </TR> <TR> <TD colSpan="3" align=center> <FONT face=Arial size=3 color=blue>Tr� d�ng Ti�n Thi�n Qu�i S�</FONT><BR><FONT face=Arial size=2> <script language="Javascript"> var s = ""; for (var i=1;i<8;i++) s += quai_danh[i] + " " + i + ", "; s += quai_danh[0] + " 8"; document.write(s); </script> </FONT> </TD> </TR> </FORM> <TR> <!-- CONTROL PANEL --> <TD colSpan="3" align=center><TABLE border="0" cellSpacing="0"> <TR> <TD><BUTTON style="width=100;height=32;FONT-SIZE:12pt" onclick="layQue()">Chi�m</BUTTON></TD> <TD><FONT face="Courier New" size=2>&nbsp;</FONT></TD> <TD><FONT face="Courier New" size=2>&nbsp;</FONT></TD> <TD><BUTTON style="width=100;height=32;FONT-SIZE:12pt" onclick="capThoi()">C�p gi�</BUTTON></TD> <TD><FONT face="Courier New" size=2>&nbsp;</FONT></TD> <TD><FONT face="Courier New" size=2>&nbsp;</FONT></TD> <TD><BUTTON style="width=100;height=32;FONT-SIZE:12pt" onclick="xoaMaiHoa()">X�a</BUTTON></TD> </TR></TABLE> </TD> </TR> </TABLE> <BR> <TABLE align=center border="1" cellPadding="3" cellSpacing="0" style="visibility:hidden" id="MaiHoaText" background="wm1.jpg"> <TR> <TD colSpan=11 align="center"><FONT face="Times New Roman" size=5 color=green>Mai Hoa D�ch S�<br></FONT><FONT face="Times New Roman" size=4 ID="ChiemQue"></FONT></TD> </TR> <TR> <TD align="center" onclick="yKienXayDung();"><img src="mh2.jpg"></TD> <TD align="center" onclick=javascript:chiTiet(1) style="cursor:hand"><FONT face=Arial size=3>B�n Qu�<BR><FONT face="Times New Roman" size=3 color=blue ID="ChuQue"></FONT></TD> <TD align="center" onclick=javascript:chiTiet(2) style="cursor:hand"><FONT face=Arial size=3>H� Qu�<BR><FONT face="Times New Roman" size=3 color=blue ID="HoQue"> </FONT></TD> <TD align="center" onclick=javascript:chiTiet(3) style="cursor:hand"><FONT face=Arial size=3>Bi�n Qu�<BR><FONT face="Times New Roman" size=3 color=blue ID="BienQue"></FONT></TD> </TR> <TR> <!- Th� D�ng -> <TD align="center"><table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111"> <tr> <TD rowSpan=3 align="left"><FONT face=Arial size=3 ID="ThuongQuai">X</FONT></TD> <td align="center"><FONT face="Courier New" size=2>&nbsp;</FONT></td> </tr> <tr><td align="center"><FONT face="Courier New" size=2>-></FONT></td></tr> <tr><td align="center"><FONT face="Courier New" size=2>&nbsp;</FONT></td></tr> <tr> <TD rowSpan=3 align="left"><FONT face=Arial size=3 ID="HaQuai">Y</FONT></TD> <td align="center"><FONT face="Courier New" size=2>&nbsp;</FONT></td> </tr> <tr><td align="center"><FONT face="Courier New" size=2>-></FONT></td></tr> <tr><td align="center"><FONT face="Courier New" size=2>&nbsp;</FONT></td></tr> </table></td> <!-- Th��ng Qu�i -- H� Qu�i --> <TD align="center"><table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111"> <tr> <td rowSpan=3 align="center"><FONT face=Arial size=3 ID="BQ_TQ">Ly</FONT></td> <td align="center"><FONT face=Arial size=2 ID="BQ_H6">�%�%<SPAN ID="BQ_H6C">�%�%</SPAN>�%�%</FONT></td> <td rowSpan=3 align="center"><FONT face=Arial size=3 ID="BQ_TH">H�a</FONT></td> </tr> <tr><td align="center"><FONT face=Arial size=2 ID="BQ_H5">�%�%<SPAN ID="BQ_H5C">�%�%</SPAN>�%�%</FONT></td></tr> <tr><td align="center"><FONT face=Arial size=2 ID="BQ_H4">�%�%<SPAN ID="BQ_H4C">�%�%</SPAN>�%�%</FONT></td></tr> <tr> <td rowSpan=3 align="center"><FONT face=Arial size=3 ID="BQ_HQ">Ly</FONT></td> <td align="center"><FONT face=Arial size=2 ID="BQ_H3">�%�%<SPAN ID="BQ_H3C">�%�%</SPAN>�%�%</FONT></td> <td rowSpan=3 align="center"><FONT face=Arial size=3 ID="BQ_HH">H�a</FONT></td> </tr> <tr><td align="center"><FONT face=Arial size=2 ID="BQ_H2">�%�%<SPAN ID="BQ_H2C">�%�%</SPAN>�%�%</FONT></td></tr> <tr><td align="center"><FONT face=Arial size=2 ID="BQ_H1">�%�%<SPAN ID="BQ_H1C">�%�%</SPAN>�%�%</FONT></td></tr> </table></td> <TD align="center"><table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111"> <tr> <td rowSpan=3 align="center"><FONT face=Arial size=3 ID="HQ_TQ">Ly</FONT></td> <td align="center"><FONT face=Arial size=2 ID="HQ_H6">�%�%<SPAN ID="HQ_H6C">�%�%</SPAN>�%�%</FONT></td> <td rowSpan=3 align="center"><FONT face=Arial size=3 ID="HQ_TH">H�a</FONT></td> </tr> <tr><td align="center"><FONT face=Arial size=2 ID="HQ_H5">�%�%<SPAN ID="HQ_H5C">�%�%</SPAN>�%�%</FONT></td></tr> <tr><td align="center"><FONT face=Arial size=2 ID="HQ_H4">�%�%<SPAN ID="HQ_H4C">�%�%</SPAN>�%�%</FONT></td></tr> <tr> <td rowSpan=3 align="center"><FONT face=Arial size=3 ID="HQ_HQ">Ly</FONT></td> <td align="center"><FONT face=Arial size=2 ID="HQ_H3L">�%�%<SPAN ID="HQ_H3C">�%�%</SPAN>�%�%</FONT></td> <td rowSpan=3 align="center"><FONT face=Arial size=3 ID="HQ_HH">H�a</FONT></td> </tr> <tr><td align="center"><FONT face=Arial size=2 ID="HQ_H2">�%�%<SPAN ID="HQ_H2C">�%�%</SPAN>�%�%</FONT></td></tr> <tr><td align="center"><FONT face=Arial size=2 ID="HQ_H1">�%�%<SPAN ID="HQ_H1C">�%�%</SPAN>�%�%</FONT></td></tr> </table></td> <TD align="center"><table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111"> <tr> <td rowSpan=3 align="center"><FONT face=Arial size=3 ID="QB_TQ">Ly</FONT></td> <td align="center"><FONT face=Arial size=2 ID="QB_H6">�%�%<SPAN ID="QB_H6C">�%�%</SPAN>�%�%</FONT></td> <td rowSpan=3 align="center"><FONT face=Arial size=3 ID="QB_TH">H�a</FONT></td> </tr> <tr><td align="center"><FONT face=Arial size=2 ID="QB_H5">�%�%<SPAN ID="QB_H5C">�%�%</SPAN>�%�%</FONT></td></tr> <tr><td align="center"><FONT face=Arial size=2 ID="QB_H4">�%�%<SPAN ID="QB_H4C">�%�%</SPAN>�%�%</FONT></td></tr> <tr> <td rowSpan=3 align="center"><FONT face=Arial size=3 ID="QB_HQ">Ly</FONT></td> <td align="center"><FONT face=Arial size=2 ID="QB_H3">�%�%<SPAN ID="QB_H3C">�%�%</SPAN>�%�%</FONT></td> <td rowSpan=3 align="center"><FONT face=Arial size=3 ID="QB_HH">H�a</FONT></td> </tr> <tr><td align="center"><FONT face=Arial size=2 ID="QB_H2">�%�%<SPAN ID="QB_H2C">�%�%</SPAN>�%�%</FONT></td></tr> <tr><td align="center"><FONT face=Arial size=2 ID="QB_H1">�%�%<SPAN ID="QB_H1C">�%�%</SPAN>�%�%</FONT></td></tr> </table></td> </TR> <TR> <TD colSpan=4 align="center"><TABLE border="0" cellSpacing="0" style="visibility:hidden" id="MaiHoaGiai"> <TR align="center"> <!-- Kh�ng vong lu�n --> <TD><TABLE border="0" cellSpacing="0" style="visibility:hidden" id="kv_luan"> <TR> <TD align="center"> <FONT face=Arial size=3>Nm </FONT><FONT face=Arial size=3 ID="m_nam">xx</FONT><FONT face=Arial size=3> - <a href=javascript:XemCanChi("m_nam_cc")></FONT><FONT face=Arial size=3 color=blue ID="m_nam_cc">cc</FONT></a> <FONT face=Arial size=3>, kh�ng vong l� </FONT><FONT face=Arial size=3 color=blue ID="m_nam_kv">kv</FONT><FONT face=Arial size=3>;</FONT> </TD> </TR> <TR> <TD align="center"> <FONT face=Arial size=3>Ti�t </FONT><FONT face=Arial size=3 ID="m_tiet">xx</FONT><FONT face=Arial size=3> - <a href=javascript:XemCanChi("m_tiet_cc")></FONT><FONT face=Arial size=3 color=blue ID="m_tiet_cc">cc</FONT></a> <FONT face=Arial size=3>, kh�ng vong l� </FONT><FONT face=Arial size=3 color=blue ID="m_tiet_kv">kv</FONT><FONT face=Arial size=3>;</FONT> </TD> </TR> <TR> <TD align="center"> <FONT face=Arial size=3>Ng�y </FONT><FONT face=Arial size=3 ID="m_nhat">xx</FONT><FONT face=Arial size=3> - <a href=javascript:XemCanChi("m_nhat_cc")></FONT><FONT face=Arial size=3 color=blue ID="m_nhat_cc">cc</FONT></a> <FONT face=Arial size=3>, kh�ng vong l� </FONT><FONT face=Arial size=3 color=blue ID="m_nhat_kv">kv</FONT><FONT face=Arial size=3>;</FONT> </TD> </TR> <TR> <TD align="center"> <FONT face=Arial size=3>Gi� </FONT><FONT face=Arial size=3 ID="m_thoi">xx</FONT><FONT face=Arial size=3> - <a href=javascript:XemCanChi("m_thoi_cc")></</FONT><FONT face=Arial size=3 color=blue ID="m_thoi_cc">cc</FONT></a> <FONT face=Arial size=3>, kh�ng vong l� </FONT><FONT face=Arial size=3 color=blue ID="m_thoi_kv">kv</FONT><FONT face=Arial size=3>;</FONT> </TD> </TR> <TR> <TD align="center"> <FONT face=Arial size=3>Ngo�i ra, g�p ng�y can </FONT><FONT face=Arial size=3 color=blue ID="m_ngay_cc">cc</FONT> <FONT face=Arial size=3>, gi� tri�t l� kh�ng vong l� </FONT><FONT face=Arial size=3 color=blue ID="m_gio_kv">kv</FONT><FONT face=Arial size=3>.</FONT> </TD> </TR> </TABLE></TD> </TR> <tr> <TD align="center"><hr></TD> </tr> <!-- Lu�n gi�i --> <TR> <TD align="center"> <FONT face=Arial size=3 color=blue ID="m_haodong">cc</FONT><FONT face=Arial size=3>; lu�n o�n d�a v�o k�t qu� sau:</FONT> </TD> </TR> <TR> <TD align="center"> <LI><FONT face=Arial size=3>B�n qu� l� </FONT><FONT face=Arial size=3 color=blue ID="m_bonQue">cc</FONT><FONT face=Arial size=3 ID="l_bonQue">luan</FONT><FONT face=Arial size=3>;</FONT></LI> </TD> </TR> <TR> <TD align="center"> <LI><FONT face=Arial size=3>gi�a th� v� h� l� </FONT><FONT face=Arial size=3 color=blue ID="m_theHo">cc</FONT><FONT face=Arial size=3> t�c </FONT><FONT face=Arial size=3 ID="l_theHo">luan</FONT><FONT face=Arial size=3>;</FONT></LI> </TD> </TR> <TR> <TD align="center"> <LI><FONT face=Arial size=3>gi�a d�ng v� h� l� </FONT><FONT face=Arial size=3 color=blue ID="m_dungHo">cc</FONT><FONT face=Arial size=3> t�c </FONT><FONT face=Arial size=3 ID="l_dungHo">luan</FONT><FONT face=Arial size=3>;</FONT></LI> </TD> </TR> <TR> <TD align="center"> <LI><FONT face=Arial size=3>ri�ng h� qu� l� </FONT><FONT face=Arial size=3 color=blue ID="m_hoQue">cc</FONT><FONT face=Arial size=3 ID="l_hoQue">luan</FONT><FONT face=Arial size=3>;</FONT></LI> </TD> </TR> <TR> <TD align="center"> <LI><FONT face=Arial size=3>v� bi�n qu� l� </FONT><FONT face=Arial size=3 color=blue ID="m_bienQue">cc</FONT><FONT face=Arial size=3 ID="l_bienQue">luan</FONT><FONT face=Arial size=3>.</FONT></LI> </TD> </TR> <TR> <TD align="center"> <LI><FONT face=Arial size=3>T�ng s� qu�i (B�n + H� + Bi�n) l� </FONT><FONT face=Arial size=3 color=blue ID="m_tongSo">cc</FONT><FONT face=Arial size=3>.</FONT></LI> </TD> </TR> </TABLE></TD> </TR> <TR> <td colSpan=4 align="center"><table border="0" cellpadding="3" cellspacing="0"> <th colSpan=7> <FONT face=Arial size=3 color=blue>Ngi H�nh trong T� Th�i</FONT> </th> <tr> <TD align=center><FONT face=Arial size=3><B>M�a</B></FONT></TD> <TD align=center><FONT face=Arial size=3><B>Ti�t</B></FONT></TD> <TD align=center><FONT face=Arial size=3><B>V��ng</B></FONT></TD> <TD align=center><FONT face=Arial size=3><B>T��ng</B></FONT></TD> <TD align=center><FONT face=Arial size=3><B>H�u</B></FONT></TD> <TD align=center><FONT face=Arial size=3><B>T�</B></FONT></TD> <TD align=center><FONT face=Arial size=3><B>T�</B></FONT></TD> </tr> <tr> <TD colSpan=7><hr></TD> </tr> <tr> <TD align=center><FONT face=Arial size=3><B>Xu�n</B></FONT></TD> <TD align=center><FONT face=Arial size=3 color=green>1 2</FONT></TD> <TD align=center><FONT face=Arial size=3>M�c</FONT></TD> <TD align=center><FONT face=Arial size=3>H�a</FONT></TD> <TD align=center><FONT face=Arial size=3>Th�y</FONT></TD> <TD align=center><FONT face=Arial size=3>Kim</FONT></TD> <TD align=center><FONT face=Arial size=3>Th�</FONT></TD> </tr> <tr> <TD align=center><FONT face=Arial size=3><B>H�</B></FONT></TD> <TD align=center><FONT face=Arial size=3 color=red>4 5</FONT></TD> <TD align=center><FONT face=Arial size=3>H�a</FONT></TD> <TD align=center><FONT face=Arial size=3>Th�</FONT></TD> <TD align=center><FONT face=Arial size=3>M�c</FONT></TD> <TD align=center><FONT face=Arial size=3>Th�y</FONT></TD> <TD align=center><FONT face=Arial size=3>Kim</FONT></TD> </tr> <tr> <TD align=center><FONT face=Arial size=3><B>Thu</B></FONT></TD> <TD align=center><FONT face=Arial size=3 color=blue>7 8</FONT></TD> <TD align=center><FONT face=Arial size=3>Kim</FONT></TD> <TD align=center><FONT face=Arial size=3>Th�y</FONT></TD> <TD align=center><FONT face=Arial size=3>Th�</FONT></TD> <TD align=center><FONT face=Arial size=3>H�a</FONT></TD> <TD align=center><FONT face=Arial size=3>M�c</FONT></TD> </tr> <tr> <TD align=center><FONT face=Arial size=3><B>�ng</B></FONT></TD> <TD align=center><FONT face=Arial size=3 color=black>10 11</FONT></TD> <TD align=center><FONT face=Arial size=3>Th�y</FONT></TD> <TD align=center><FONT face=Arial size=3>M�c</FONT></TD> <TD align=center><FONT face=Arial size=3>Kim</FONT></TD> <TD align=center><FONT face=Arial size=3>Th�</FONT></TD> <TD align=center><FONT face=Arial size=3>H�a</FONT></TD> </tr> <tr> <TD align=center><FONT face=Arial size=3><B>T� Qu�</B></FONT></TD> <TD align=center><FONT face=Arial size=3 color=brown>3,6,9,12</FONT></TD> <TD align=center><FONT face=Arial size=3>Th�</FONT></TD> <TD align=center><FONT face=Arial size=3>Kim</FONT></TD> <TD align=center><FONT face=Arial size=3>H�a</FONT></TD> <TD align=center><FONT face=Arial size=3>M�c</FONT></TD> <TD align=center><FONT face=Arial size=3>Th�y</FONT></TD> </tr> </table></td> </TR> </TABLE> </center> <script language="Javascript"> </script> </body> </html>