var lunarInfo=new Array(//阴历数据 0x04bd8,0x04ae0,0x0a570,0x054d5,0x0d260,0x0d950,0x16554,0x056a0,0x09ad0,0x055d2, 0x04ae0,0x0a5b6,0x0a4d0,0x0d250,0x1d255,0x0b540,0x0d6a0,0x0ada2,0x095b0,0x14977, 0x04970,0x0a4b0,0x0b4b5,0x06a50,0x06d40,0x1ab54,0x02b60,0x09570,0x052f2,0x04970, 0x06566,0x0d4a0,0x0ea50,0x06e95,0x05ad0,0x02b60,0x186e3,0x092e0,0x1c8d7,0x0c950, 0x0d4a0,0x1d8a6,0x0b550,0x056a0,0x1a5b4,0x025d0,0x092d0,0x0d2b2,0x0a950,0x0b557, 0x06ca0,0x0b550,0x15355,0x04da0,0x0a5d0,0x14573,0x052d0,0x0a9a8,0x0e950,0x06aa0, 0x0aea6,0x0ab50,0x04b60,0x0aae4,0x0a570,0x05260,0x0f263,0x0d950,0x05b57,0x056a0, 0x096d0,0x04dd5,0x04ad0,0x0a4d0,0x0d4d4,0x0d250,0x0d558,0x0b540,0x0b5a0,0x195a6, 0x095b0,0x049b0,0x0a974,0x0a4b0,0x0b27a,0x06a50,0x06d40,0x0af46,0x0ab60,0x09570, 0x04af5,0x04970,0x064b0,0x074a3,0x0ea50,0x06b58,0x055c0,0x0ab60,0x096d5,0x092e0, 0x0c960,0x0d954,0x0d4a0,0x0da50,0x07552,0x056a0,0x0abb7,0x025d0,0x092d0,0x0cab5, 0x0a950,0x0b4a0,0x0baa4,0x0ad50,0x055d9,0x04ba0,0x0a5b0,0x15176,0x052b0,0x0a930, 0x07954,0x06aa0,0x0ad50,0x05b52,0x04b60,0x0a6e6,0x0a4e0,0x0d260,0x0ea65,0x0d530, 0x05aa0,0x076a3,0x096d0,0x04bd7,0x04ad0,0x0a4d0,0x1d0b6,0x0d250,0x0d520,0x0dd45, 0x0b5a0,0x056d0,0x055b2,0x049b0,0x0a577,0x0a4b0,0x0aa50,0x1b255,0x06d20,0x0ada0) var solar_month=new Array(31,28,31,30,31,30,31,31,30,31,30,31); var day_gan=new Array("甲","乙","丙","丁","戊","己","庚","辛","壬","癸"); var day_zhi=new Array("子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"); var Animals=new Array("鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"); var solar_term = new Array("","","","","","","","","","","","","","","","","","","","","","","","") //计算某年的第n个节气公历日期所需要的基础数据(类似于每月的多少天) var sterm_info = new Array(0,21208,42467,63836,85337,107014,128867,150921,173149,195551,218072,240693,263343,285989,308563,331033,353350,375494,397447,419210,440795,462224,483532,504758) var n_str1= new Array('','','','','','','','','','','') var n_str2 = new Array('','','','','') //国历节日 *表示放假日 var solar_fes = new Array( "20241109*事件", "20241109*事件", "20241116*事件", "20241116*事件", "20241116*事件", "20241123*事件", "20241102*事件", "20241102*事件", "20241102*事件", "20241019*事件", "20241019*事件", "20241019*事件", "20241005*事件", "20241005*事件", "20241005*事件", "20240928*事件", "20240928*事件", "20240928*事件", "20241114*事件", "20241004*事件", "20240829*事件", "20240907*事件", "20240907*事件", "20240812*事件", "20240812*事件", "20240813*事件", "20240805*事件", "20240817*事件", "20240817*事件", "20240817*事件", "20240907*事件", "20240907*事件", "20240907*事件", "20240727*事件", "20240727*事件", "20240727*事件", "20240612*事件", "20240629*事件", "20240629*事件", "20240603*事件", "20240603*事件", "20240528*事件", "20240622*事件", "20240615*事件", "20240615*事件", "20240615*事件", "20240614*事件", "20240614*事件", "20240614*事件", "20240507*事件", "20240525*事件", "20240525*事件", "20240525*事件", "20240424*事件", "20240427*事件", "20240427*事件", "20240427*事件", "20240420*事件", "20240420*事件", "20240420*事件", "20240326*事件", "20240314*事件", "20240314*事件", "20240330*事件", "20240301*事件", "20240227*事件", "20240227*事件", "20240322*事件", "20240302*事件", "20240302*事件", "20240302*事件", "20240215*事件", "20240203*事件", "20240203*事件", "20231219*事件", "20231219*事件", "20231228*事件", "20231228*事件", "20231211*事件", "20231211*事件", "20231222*事件", "20231216*事件", "20231216*事件", "20231202*事件", "20231202*事件", "20231202*事件", "20231108*事件", "20231125*事件", "20231125*事件", "20231118*事件", "20231118*事件", "20231118*事件", "20231104*事件", "20231104*事件", "20231104*事件", "20231112*事件", "20231112*事件", "20231021*事件", "20231021*事件", "20231021*事件", "20230927*事件", "20231029*事件", "20230914*事件", "20231027*事件", "20230830*事件", "20230830*事件", "20230909*事件", "20230909*事件", "20230909*事件", "20230826*事件", "20230826*事件", "20230826*事件", "20230902*事件", "20230819*事件", "20230819*事件", "20230819*事件", "20230729*事件", "20230729*事件", "20230729*事件", "20230723*事件", "20230722*事件", "20230722*事件", "20230722*事件", "20230629*事件", "20230608*事件", "20230608*事件", "20230608*事件", "20230608*事件", "20230603*事件", "20230603*事件", "20230603*事件", "20230520*事件", "20230520*事件", "20230520*事件", "20230511*事件", "20230511*事件", "20230511*事件", "20230506*事件", "20230506*事件", "20230506*事件", "20230429*事件", "20230411*事件", "20230421*事件", "20230415*事件", "20230415*事件", "20230415*事件", "20230413*事件", "20230413*事件", "20230413*事件", "20230309*事件", "20230318*事件", "20230318*事件", "20230318*事件", "20230304*事件", "20230304*事件", "20230304*事件", "20230311*事件", "20230311*事件", "20230211*事件", "20230212*事件", "20230105*事件", "20221213*事件", "20221230*事件", "20221218*事件", "20221218*事件", "20221218*事件", "20221203*事件", "20221203*事件", "20221210*事件", "20221118*事件", "20221118*事件", "20221029*事件", "20221029*事件", "20221029*事件", "20220922*事件", "20220917*事件", "20220917*事件", "20220917*事件", "20221001*事件", "20220902*事件", "20220820*事件", "20220820*事件", "20220820*事件", "20220707*事件", "20220707*事件", "20220702*事件", "20220702*事件", "20220702*事件", "20220726*事件", "20220701*事件", "20220625*事件", "20220625*事件", "20220625*事件", "20220914*事件", "20220716*事件", "20220611*事件", "20220521*事件", "20220521*事件", "20220521*事件", "20220430*事件", "20220430*事件", "20220430*事件", "20220416*事件", "20220416*事件", "20220416*事件", "20220331*事件", "20220323*事件", "20220524*事件", "20220326*事件", "20220314*事件", "20220326*事件", "20220326*事件", "20220321*事件", "20220308*事件", "20220311*事件", "20220311*事件", "20220311*事件", "20220319*事件", "20220319*事件", "20220222*事件", "20220219*事件", "20220210*事件", "20220210*事件", "20220208*事件", "20220208*事件", "20220128*事件", "20220210*事件", "20220207*事件", "20220128*事件", "20220107*事件", "20220101*事件", "20220115*事件", "20211227*事件", "20211225*事件", "20211226*事件", "20211218*事件", "20211218*事件", "20211110*事件", "20211111*事件", "20211204*事件", "20211111*事件", "20211106*事件", "20211106*事件", "20211120*事件", "20211023*事件", "20211016*事件", "20210919*事件", "20211026*事件", "20210925*事件", "20211016*事件", "20210904*事件", "20210726*事件", "20210726*事件", "20210719*事件", "20210714*事件", "20210512*事件", "20210428*事件", "20210421*事件", "20210409*事件", "20210318*事件", "20210310*事件", "20210309*事件", "20210308*事件", "20210303*事件", "20210220*事件", "20210220*事件", "20210123*事件", "20210118*事件", "20210108*事件", "20210105*事件", "20211105*事件", "20210811*事件", "20210811*事件", "20210814*事件", "20210807*事件", "20200924*事件", "20200806*事件", "20191127*事件", "20191008*事件", "20191008*事件", "20180720*事件", "20180716*事件", "20180612*事件", "20180529*事件", "20180525*事件", "20180504*事件", "20180504*事件", "20180418*事件", "20180320*事件", "20180319*事件", "20180308*事件", "20180214*事件", "20180129*事件", "20180105*事件", "20171208*事件", "20171208*事件", "20171019*事件", "20171019*事件", "20170915*事件", "20170913*事件", "20170905*事件", "20170810*事件", "20170810*事件", "20170726*事件", "20170724*事件", "20170606*事件", "20170606*事件", "20170531*事件", "20170419*事件", "20170316*事件", "20170316*事件", "20170222*事件", "20170222*事件", "20170214*事件", "20170122*事件", "20170122*事件", "20170117*事件", "20170104*事件", "20161212*事件", "20161125*事件", "20161118*事件", "20161118*事件", "20161031*事件", "20160902*事件", "20160819*事件", "20160807*事件", "20160712*事件", "20160712*事件", "20160712*事件", "20160603*事件", "20160526*事件", "20160512*事件", "20160428*事件", "20160428*事件", "20160322*事件", "20160321*事件", "20160304*事件", "20160304*事件", "20160301*事件", "20160220*事件", "20160126*事件", "20160115*事件", "20160107*事件", "20160107*事件", "20160107*事件", "20151203*事件", "20151203*事件", "20151203*事件", "20151102*事件", "20151027*事件", "20151012*事件", "20150917*事件", "20150827*事件", "20150814*事件", "20150810*事件", "20150806*事件", "20150717*事件", "20150716*事件", "20150706*事件", "20150705*事件", "20150705*事件", "20150705*事件", "20150705*事件", "20150630*事件", "20150618*事件", "20150529*事件", "20150529*事件", "20150529*事件", "20150517*事件", "20150517*事件", "20150506*事件", "20150506*事件", "20150506*事件", "20150501*事件", "20150426*事件", "20150413*事件", "20150320*事件", "20150320*事件", "20150311*事件", "20150214*事件", "20150214*事件", "20150214*事件", "20150208*事件", "20141216*事件", "20141210*事件", "20141027*事件", "20141027*事件", "20141002*事件", "20140917*事件", "20140914*事件", "20140822*事件", "20140819*事件", "20140718*事件", "20140709*事件", "20140708*事件", "20140622*事件", "20140609*事件", "20140515*事件", "20140505*事件", "20140501*事件", "20140501*事件", "20140427*事件", "20140318*事件", "20140316*事件", "20140219*事件", "20140213*事件", "20140122*事件", "20140122*事件", "20131229*事件", "20131229*事件", "20131229*事件", "20131229*事件", "20131229*事件", "20131229*事件", "20131229*事件", "20131114*事件", "20131105*事件", "20131030*事件", "20131030*事件", "20131014*事件", "20131014*事件", "20131009*事件", "20131009*事件", "20131005*事件", "20130910*事件", "20130821*事件", "20130813*事件", "20130808*事件", "20130805*事件", "20130722*事件", "20130717*事件", "20130712*事件", "20130628*事件", "20130628*事件", "20130626*事件", "20130607*事件", "20130606*事件", "20130606*事件", "20130528*事件", "20130510*事件", "20130507*事件", "20130415*事件", "20130415*事件", "20130415*事件", "20130327*事件", "20130327*事件", "20130131*事件", "20130122*事件", "20130122*事件", "20130116*事件", "20130116*事件", "20121226*事件", "20121226*事件", "20121226*事件", "20121218*事件", "20121204*事件", "20121119*事件", "20121029*事件", "20121017*事件", "20121005*事件", "20120930*事件", "20120923*事件", "20120923*事件", "20120923*事件", "20120825*事件", "20120818*事件", "20120730*事件", "20120718*事件", "20120718*事件", "20120712*事件", "20120708*事件", "20120708*事件", "20120601*事件", "20120524*事件", "20120524*事件", "20120415*事件", "20120403*事件", "20120315*事件", "20120215*事件", "20120215*事件", "20120215*事件", "20120206*事件", "20120113*事件", "20111215*事件", "20111209*事件", "20111209*事件", "20111123*事件", "20111111*事件", "20111111*事件", "20111102*事件", "20111027*事件", "20111018*事件", "20110907*事件", "20110901*事件", "20110817*事件", "20110812*事件", "20110812*事件", "20110805*事件", "20110805*事件", "20110801*事件", "20110801*事件", "20110701*事件", "20110621*事件", "20110617*事件", "20110615*事件", "20110615*事件", "20110602*事件", "20110602*事件", "20110502*事件", "20110502*事件", "20110502*事件", "20110325*事件", "20110325*事件", "20110325*事件", "20110315*事件", "20110315*事件", "20110315*事件", "20110215*事件", "20110215*事件", "20110201*事件", "20110201*事件", "20110127*事件", "20110126*事件", "20110113*事件", "20110113*事件", "20101224*事件", "20210719*事件", "20210714*事件", "20210702*事件", "20200924*事件", "20200806*事件", "20200724*事件", "20200724*事件", "20200710*事件", "20200709*事件", "20200707*事件", "20200707*事件", "20200707*事件", "20200630*事件", "20200630*事件", "20191107*事件", "20191023*事件", "20191021*事件", "20191008*事件", "20191008*事件", "20180729*事件", "20180729*事件", "20180729*事件", "20180729*事件", "20180724*事件", "20180716*事件", "20180703*事件", "20180703*事件", "20180626*事件", "20180626*事件", "20180612*事件", "20180529*事件", "20180522*事件", "20180521*事件", "20180510*事件", "20180510*事件", "20180422*事件", "20180416*事件", "20180416*事件", "20180323*事件", "20180226*事件", "20180214*事件", "20180129*事件", "20171231*事件", "20171231*事件", "20171226*事件", "20171218*事件", "20171023*事件", "20171023*事件", "20171023*事件", "20171016*事件", "20171005*事件", "20171005*事件", "20170922*事件", "20170920*事件", "20170920*事件", "20170825*事件", "20170728*事件", "20170724*事件", "20170713*事件", "20170704*事件", "20170628*事件", "20170623*事件", "20170612*事件", "20170606*事件", "20170606*事件", "20170509*事件", "20170502*事件", "20170423*事件", "20170419*事件", "20170412*事件", "20170412*事件", "20170318*事件", "20170318*事件", "20170316*事件", "20170222*事件", "20170214*事件", "20161215*事件", "20161215*事件", "20161215*事件", "20161113*事件", "20161113*事件", "20161031*事件", "20161011*事件", "20161005*事件", "20160902*事件", "20160721*事件", "20160712*事件", "20160622*事件", "20160616*事件", "20160616*事件", "20160603*事件", "20160526*事件", "20160526*事件", "20160512*事件", "20160506*事件", "20160420*事件", "20160420*事件", "20160407*事件", "20160322*事件", "20160307*事件", "20160126*事件", "20151102*事件", "20151102*事件", "20151102*事件", "20151012*事件", "20151012*事件", "20151012*事件", "20150908*事件", "20150827*事件", "20150726*事件", "20150726*事件", "20150726*事件", "20150618*事件", "20150604*事件", "20150521*事件", "20150517*事件", "20150426*事件", "20150417*事件", "20150225*事件", "20150214*事件", "20141224*事件", "20141224*事件", "20141224*事件", "20141112*事件", "20141104*事件", "20141010*事件", "20141002*事件", "20140917*事件", "20140907*事件", "20140828*事件", "20140801*事件", "20140721*事件", "20140721*事件", "20140709*事件", "20140608*事件", "20140525*事件", "20140519*事件", "20140515*事件", "20140501*事件", "20140423*事件", "20140415*事件", "20140330*事件", "20140122*事件", "20131229*事件", "20131211*事件", "20131028*事件", "20130918*事件", "20130808*事件", "20130712*事件", "20130708*事件", "20130626*事件", "20130606*事件", "20130524*事件", "20130402*事件", "20130402*事件", "20130311*事件", "20130306*事件", "20130227*事件", "20130109*事件", "20121226*事件", "20121023*事件", "20120930*事件", "20120911*事件", "20120708*事件", "20120613*事件", "20120514*事件", "20120427*事件", "20120427*事件", "20120420*事件", "20120412*事件", "20120327*事件", "20120208*事件", "20120119*事件", "20111222*事件", "20111215*事件", "20111130*事件", "20111123*事件", "20111118*事件", "20111114*事件", "20111107*事件", "20111102*事件", "20111011*事件", "20111011*事件", "20111007*事件", "20110922*事件", "20110920*事件", "20110913*事件", "20110901*事件", "20110830*事件", "20110809*事件", "20110805*事件", "20110801*事件", "20110721*事件", "20110714*事件", "20110712*事件", "20110701*事件", "20110630*事件", "20110622*事件", "20110602*事件", "20110602*事件", "20110602*事件", "20110526*事件", "20110520*事件", "20110517*事件", "20110516*事件", "20110505*事件", "20110504*事件", "20110426*事件", "20110426*事件", "20110407*事件", "20210322*事件", "20200924*事件", "20191023*事件", "20180716*事件", "20180612*事件", "20180521*事件", "20180323*事件", "20180214*事件", "20180129*事件", "20171231*事件", "20171218*事件", "20171026*事件", "20171005*事件", "20170817*事件", "20170703*事件", "20170619*事件", "20161031*事件", "20161021*事件", "20160712*事件", "20160331*事件", "20160307*事件", "20160304*事件", "20160205*事件", "20160111*事件", "20151106*事件", "20151106*事件", "20150810*事件", "20150630*事件", "20150526*事件", "20150421*事件", "20150323*事件", "20150214*事件", "20150122*事件", "20150114*事件", "20141225*事件", "20141105*事件", "20140914*事件", "20140828*事件", "20140715*事件", "20140702*事件", "20140625*事件", "20140608*事件", "20140207*事件", "20131218*事件", "20131114*事件", "20130918*事件", "20130910*事件", "20130808*事件", "20130712*事件", "20130430*事件", "20130415*事件", "20130402*事件", "20130311*事件", "20130302*事件", "20130219*事件", "20121218*事件", "20121108*事件", "20121031*事件", "20121005*事件", "20120923*事件", "20120923*事件", "20120818*事件", "20120725*事件", "20120708*事件", "20120627*事件", "20120627*事件", "20120504*事件", "20120403*事件", "20120223*事件", "20120201*事件", "20120201*事件", "20120201*事件", "20120113*事件", "20111110*事件", "20111025*事件", "20111018*事件", "20111013*事件", "20111007*事件", "20111007*事件", "20110617*事件", "20210625*事件", "20210811*事件", "20201022*事件", "20200520*事件", ) //农历节日 *表示放假日 var lunar_fes = new Array(); var w_fes = new Array(); var today = new Date(); var tY = today.getFullYear(); var tM = today.getMonth(); var tD = today.getDate(); var width = "130"; var offsetx = 2; var offsety = 16; var x = 0; var y = 0; var snow = 0; var sw = 0; var cnt = 0; var dStyle; // 时钟clock setInterval("oTime()",1000); function oTime() { today = new Date(); var hou = today.getHours(); var min=today.getMinutes(); //分 var sec =today.getSeconds(); //秒 if(sec<10) var sec ="0"+sec; if(min<10) var min= "0"+min; if(hou<10) var hou = "0"+hou; clock.innerHTML = ''+hou+':'+min+':'+sec+''; } //返回农历第y年的总天数 function lunar_day(y) { var i, sum = 348 for(i=0x8000; i>0x8; i>>=1) sum += (lunarInfo[y-1900] & i)? 1: 0 return(sum+lunar_leap(y)) } //返回农历第y年闰月的天数 function lunar_leap(y) { if(lunar_leap_m(y)) return((lunarInfo[y-1900] & 0x10000)? 30: 29) else return(0) } //返回农历第y年闰几月(1-12月),没闰返回0 function lunar_leap_m(y) { return(lunarInfo[y-1900] & 0xf) } //返回农历第y年第m月的总天数 function lunar_leap_d(y,m) { return( (lunarInfo[y-1900] & (0x10000>>m))? 30: 29 ) } //算出农历,把值传入到日期控件,返回农历日期控件 //该农历日期对象的属性:.year,.month,.day,.isLeap, //.yearCyl,.monthCyl,.dayCyl function Lunar(objDate) { var i, leap=0, temp=0 var baseDate = new Date(1900,0,31); var offset = (objDate - baseDate)/86400000 this.dayCyl = offset + 40 this.monCyl = 14 for(i=1900; i<2050 && offset>0; i++) { temp = lunar_day(i) offset -= temp this.monCyl += 12 } if(offset<0) { offset += temp; i--; this.monCyl -= 12 } this.year = i this.yearCyl = i-1864 leap = lunar_leap_m(i) this.isLeap = false for(i=1; i<13 && offset>0; i++) { if(leap>0 && i==(leap+1) && this.isLeap==false) { --i; this.isLeap = true; temp = lunar_leap(this.year); } else { temp = lunar_leap_d(this.year, i); } if(this.isLeap==true && i==(leap+1)) this.isLeap = false offset -= temp if(this.isLeap == false) this.monCyl ++ } if(offset==0 && leap>0 && i==leap+1) if(this.isLeap) { this.isLeap = false; } else { this.isLeap = true; --i; --this.monCyl;} if(offset<0){ offset += temp; --i; --this.monCyl; } this.month = i this.day = offset + 1 } function solar_day(y,m) { if(m==1) return(((y%4 == 0) && (y%100 != 0) || (y%400 == 0))? 29: 28) else return(solar_month[m]) } //传入offset 传回干支,0=甲子 function cyclical(num) { return(day_gan[num%10]+day_zhi[num%12]) } function cal_ele(sy,s_m,s_d,week,lYear,l_m,l_d,isLeap,c_y,c_m,cal_d) { this.color = ''; this.lunar_festival = ''; this.solar_festival = ''; this.solarTerms = ''; this.istoday = false; this.sy = sy; this.s_m = s_m; this.s_d = s_d; this.week = week; this.lYear = lYear; this.l_m = l_m; this.l_d = l_d; this.isLeap = isLeap; this.c_y = c_y; this.c_m = c_m; this.cal_d = cal_d; } //某年的第n个节气的公历日期(从0小寒算起);节气的公历日期的计算参考网上算法 function sTerm(y,n) { var off_date = new Date( ( 31556925974.7*(y-1900) +sterm_info[n]*60000 ) + Date.UTC(1900,0,6,2,5) ) return(off_date.getUTCDate()) } function calendar(y,m) { var lunar_dpos = new Array(3) var solor_dobj, lunar_dobj, lY, lM, lD=1, lL, lX=0, t_1, t_2 var n = 0,first_lunarm = 0 solor_dobj = new Date(y,m,1) this.length = solar_day(y,m) this.firstWeek = solor_dobj.getDay() for(var i=0;ilX) { solor_dobj = new Date(y,m,i+1) lunar_dobj = new Lunar(solor_dobj) lY = lunar_dobj.year lM = lunar_dobj.month lD = lunar_dobj.day lL = lunar_dobj.isLeap lX = lL? lunar_leap(lY): lunar_leap_d(lY,lM) if(n==0) first_lunarm = lM lunar_dpos[n++] = i-lD+1 } this[i] = new cal_ele(y, m+1, i+1, n_str1[(i+this.firstWeek)%7], lY, lM, lD++, lL, cyclical(lunar_dobj.yearCyl) ,cyclical(lunar_dobj.monCyl), cyclical(lunar_dobj.dayCyl++) ) if((i+this.firstWeek)%7==0) this[i].color = '#FF5F07' if((i+this.firstWeek)%14==13) this[i].color = '#FF5F07' } t_1=sTerm(y,m*2 )-1 t_2=sTerm(y,m*2+1)-1 this[t_1].solarTerms = solar_term[m*2] this[t_2].solarTerms = solar_term[m*2+1] if(m==3) this[t_1].color = '#FF5F07' for(i in w_fes) if(w_fes[i].match(/^(\d{2})(\d)(\d)([\s\*])(.+)$/)) if(Number(RegExp.$1)==(m+1)) { t_1=Number(RegExp.$2) t_2=Number(RegExp.$3) this[((this.firstWeek>t_2)?7:0) + 7*(t_1-1) + t_2 - this.firstWeek].solar_festival += RegExp.$5 + ' ' } for(i in lunar_fes) if(lunar_fes[i].match(/^(\d{2})(.{2})([\s\*])(.+)$/)) { t_1=Number(RegExp.$1)-first_lunarm if(t_1==-11) t_1=1 if(t_1 >=0 && t_1= 0 && t_2'; for(i=0;i<42;i++) { solar_obj=eval('SD'+ i); lunar_obj=eval('LD'+ i); solar_obj.style.background = ''; lunar_obj.style.background = ''; sD = i - cld.firstWeek; if(sD>-1 && sD'; else lunar_obj.innerHTML = cal_d(cld[sD].l_d); s=cld[sD].lunar_festival; if(s.length>0) { if(s.length>5) s = s.substr(0, 3)+'…'; } else { s=cld[sD].solar_festival; if(s.length>0) { size = (s.charCodeAt(0)>0 && s.charCodeAt(0)<128)?8:4; if(s.length>size+1) s = s.substr(0, size-1)+'…'; s = s.fontcolor('#FF5C33'); //节日 solar_obj.style.background = '#b1e3e7'; //節日底色 } else { s=cld[sD].solarTerms;//24节气 if(s.length>0) s = s.fontcolor('#2EBEB7'); } } if(s.length>0) lunar_obj.innerHTML = s; } else { solar_obj.innerHTML = ' '; lunar_obj.innerHTML = ' '; } } } function chaCld() { var y,m; y=calender_content.SY.selectedIndex+1900; m=calender_content.SM.selectedIndex; setCld(y,m); } // 年份,月份选择菜单栏 function BtN(V) { if(V=='year_d'&&calender_content.SY.selectedIndex>0) calender_content.SY.selectedIndex--; else if(V=='year_a'&&calender_content.SY.selectedIndex<149) calender_content.SY.selectedIndex++; else if(V=='month_d'){ if(calender_content.SM.selectedIndex>0) {calender_content.SM.selectedIndex--; }else {calender_content.SM.selectedIndex=11; if(calender_content.SY.selectedIndex>0) calender_content.SY.selectedIndex--; } } else if(V=='month_a'){ if(calender_content.SM.selectedIndex<11) { calender_content.SM.selectedIndex++; }else {calender_content.SM.selectedIndex=0; if(calender_content.SY.selectedIndex<149) calender_content.SY.selectedIndex++; } } else { calender_content.SY.selectedIndex=tY-1900; calender_content.SM.selectedIndex=tM; } chaCld(); //---年份月份更動呼叫父視窗函數--- window.parent.clanderDateOnChange(calender_content.SY.selectedIndex+1900,calender_content.SM.selectedIndex+1); } //生成日历数据 function addDay(v) { var s,fes; var solar_obj=eval('SD'+ v); var d=solar_obj.innerHTML-1; if(solar_obj.innerHTML!='') { if(cld[d].solar_festival.length>0){ solar_obj.style.cursor = 'pointer'; }else{ solar_obj.style.cursor = 'default'; } fes = ''+ '
'+''+cld[d].solarTerms + ' ' + cld[d].solar_festival + ' ' + cld[d].lunar_festival+'
'; day_detal= ''; date_content.innerHTML = day_detal; window.parent.clanderDateOnClickDay(cld[d].s_d); } } function setCookie(name, value) { var today = new Date() var expires = new Date() expires.setTime(today.getTime() + 1000*60*60*24*365) document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString() } function getCookie(Name) { var search = Name + "=" if(document.cookie.length > 0) { offset = document.cookie.indexOf(search) if(offset != -1) { offset += search.length end = document.cookie.indexOf(";", offset) if(end == -1) end = document.cookie.length return unescape(document.cookie.substring(offset, end)) } else return "" } } function initial() { dStyle = detail.style; calender_content.SY.selectedIndex=tY-1900; calender_content.SM.selectedIndex=tM; setCld(tY,tM); }