www.pudn.com > ierili.zip > IE万年历.htm, change:2001-05-20,size:1902b


<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<title>万年历</title> 
<style> 
th{color:#FFF;background-color:#F89807} 
td{color:#000;background-color:#FDEDCC} 
input,textarea,th,td{font-size:9pt} 
</style> 
</head> 
<body> 
<div id="hyout"></div> 
<script> 
//万年历程序虹雨设计www.chy2000.com 
var hy=new Date() 
var hyd=new Date() 
var cnt=new Array("日","一","二","三","四","五","六") 
function hyout(hyy,hym){ 
	var outxt="" 
	outxt+="<table border=0 width=100% cellspacing=0><tr><th><font color=#FFFFFF>" 
	outxt+=hym+"月</font>" 
	outxt+="<table border=0 width=100% cellspacing=1 cellpadding=0><tr align=center>" 
	for(i=0;i<cnt.length;i++){ 
		outxt+="<td>"+cnt[i]+"</td>" 
	} 
	outxt+="</tr><tr align=center>" 
	var j=0 
	hyd.setYear(hyy) 
	hyd.setMonth(--hym) 
	hyd.setDate(1) 
	for(var i=1;i<=42;i++){ 
		if((i%7)==1&&i>1)outxt+="</tr><tr align=center>" 
		if((i<=hyd.getDay())||(hyd.getMonth()!=hym)){ 
			outxt+="<td> </td>" 
		}else{ 
			hyd.setDate(++j) 
			if(hyd.getMonth()==hym){ 
				if(hyd.getDate()==hy.getDate()&&hyd.getMonth()==hy.getMonth()&&hyd.getYear()==hy.getYear()){ 
					outxt+="<th>"+j+"</th>" 
				}else{ 
					outxt+="<td>"+j+"</td>" 
				} 
			}else{ 
				outxt+="<td> </td>" 
			} 
		} 
	} 
	outxt+="</tr></table></th></tr><tr><th></th></tr></table>" 
	return outxt 
} 
function hyouty(hyy){ 
	hyy=parseFloat(0+hyy) 
	if(hyy==0) hyy=hy.getYear() 
	outxt="<table width=100% border=1 bordercolor=#000000><form><tr><td colspan=4 align=right>公元:<input type=text name=hyyear size=4 maxlength=4 value="+hyy+"> 年 <input type=button value=查看 onclick=hyouty(this.form.hyyear.value)></td></form></tr><tr>" 
	for(var i=1;i<=12;i++){ 
		if(i%4==1&&i>1)outxt+="</tr><tr>" 
		outxt+="<td>"+hyout(hyy,i)+"</td>" 
	} 
	outxt+="</tr></table>" 
	document.all["hyout"].innerHTML=outxt 
} 
hyouty(hy.getYear()) 
</script> 
</body> 
</html>