html编写的生理期计算器Word格式文档下载.docx
《html编写的生理期计算器Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《html编写的生理期计算器Word格式文档下载.docx(29页珍藏版)》请在冰豆网上搜索。
none;
color:
008040}
visited{text-decoration:
008040}
hover{text-decoration:
underline;
red}
active{text-decoration:
12px;
-->
/style>
title>
妇女安全期测试<
/title>
scriptlanguage=javascript>
functionhero(){
varherowidth=480;
//改为你要的网页宽度
varheroheight=490;
//改为你要的网页高度
window.resizeTo(herowidth,heroheight);
hero();
/script>
scriptlanguage="
JavaScript"
--Hidethisscriptfromoldbrowsers--
if(!
document.layers&
&
document.all)
event="
test"
functionshowtip2(current,e,text,index){
if(document.all&
document.readyState=="
complete"
){
eval("
vartooltip=document.all.tooltip"
+index+"
)
//tooltip.innerHTML='
marqueestyle="
border:
1pxsolidblack"
'
+text+'
/marquee>
tooltip.innerHTML='
+text+'
/TABLE>
tooltip.style.pixelLeft=event.clientX+document.body.scrollLeft+10
tooltip.style.pixelTop=event.clientY+document.body.scrollTop+10
tooltip.style.visibility="
visible"
}
elseif(document.layers){
vartooltip=document.tooltip"
varnstip=document.tooltip"
.document.nstip"
nstip.document.write('
b>
/b>
nstip.document.close()
nstip.left=0
//currentscroll=setInterval("
scrolltip("
)"
100)
tooltip.left=e.pageX+10
tooltip.top=e.pageY+10
tooltip.visibility="
show"
functionhidetip2(index){
if(document.all)
document.all.tooltip"
.style.visibility='
hidden'
);
//clearInterval(currentscroll)
document.tooltip"
.visibility='
functionscrolltip(index){
eval("
if(nstip.left>
=-nstip.document.width)
nstip.left-=5
else
nstip.left=150
functionmontharr(m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11)
{
this[0]=m0;
this[1]=m1;
this[2]=m2;
this[3]=m3;
this[4]=m4;
this[5]=m5;
this[6]=m6;
this[7]=m7;
this[8]=m8;
this[9]=m9;
this[10]=m10;
this[11]=m11;
varCalendarOuterHTML='
varToday=newDate();
varDaysPerMonth=0;
//Getthenumberofdayinsomemonth
functionGetDayPerMonth(year,month)
varmonthDays=newmontharr(31,28,31,30,31,30,31,31,30,31,30,31);
if(((year%4==0)&
(year%100!
=0))||(year%400==0))
monthDays[1]=29;
DaysPerMonth=monthDays[month];
functionGetCalendarOuterHTML(CalendarIndex,HaveLayer)
CalendarOuterHTML='
varthisYear=frmInput.txtYear.value;
varthisMonth=parseInt(frmInput.txtMonth.value)+CalendarIndex-1;
if(thisMonth>
12)
{
thisYear=parseInt(frmInput.txtYear.value)+1;
thisMonth=thisMonth%12;
//titleofthecalendar
CalendarOuterHTML=CalendarOuterHTML+"
tableborder=0cellspacing=0cellpadding=3id=Calendar"
+CalendarIndex+"
TRbgcolor=#FFCCCC>
TDcolspan=7class=p2align=center>
CalendarOuterHTML=CalendarOuterHTML+thisYear+'
年'
CalendarOuterHTML=CalendarOuterHTML+thisMonth+'
月'
TRbgcolor=#DADADA>
TDwidth=18class=p2>
日<
一<
二<
三<
四<
五<
六"
TRbgcolor=#FFFFFF>
//GetthedayofthefirstDay
varfirstDay=newDate(Date.UTC(frmInput.txtYear.value,(parseInt(frmInput.txtMonth.value)-2+CalendarIndex),1));
testMe=firstDay.getDate();
if(testMe==2)
firstDay.setDate(0);
startDay=firstDay.getDay();
//displayemptycellsbeforethefirstdayofthemonth
column=0;
for(i=0;
i<
startDay;
i++)
CalendarOuterHTML=CalendarOuterHTML+"
column++;
}
//displaythegridsinthecalendar
varLastday=newDate(Date.UTC(frmInput.txtYear.value,(parseInt(frmInput.txtMonth.value)-1),frmInput.txtDay.value))
GetDayPerMonth(thisYear,thisMonth-1)
for(i=1;
=DaysPerMonth;
varcolor="
blue"
//defaultcolorwithoutlayerdisplayed
//GetlayerHTML
if(HaveLayer)
{
varThisDay=newDate(Date.UTC(thisYear,thisMonth-1,i))
varmsPerDay=24*60*60*1000;
varmensesCyc=parseInt(frmInput.txtMinMensesCyc.value);
//MinmensesCycle
varmsDiff=ThisDay.getTime()-Lastday.getTime();
dayDiff=Math.floor(msDiff/msPerDay);
//getthedaysbetweenthisdayandlastday
dayRemainder=(dayDiff%mensesCyc+mensesCyc)%mensesCyc;
//if(i<
2){alert(ThisDay.toLocaleString());
alert(Lastday.toLocaleString());
alert(dayDiff);
alert(dayRemainder);
vartooltips="
//contentoflayer
if(dayRemainder>
=0&
dayRemainder<
=4)
{color="
#FF9900"
tooltips="
这是月经期,要注意经期卫生,当然也要“节欲”,避免性事哦!
}
=5&
=(mensesCyc-20))
#009933"
这是安全期,性事一般不会受孕,您放心吧!
=(mensesCyc-19)&
=(mensesCyc-10))
#FF3300"
这是危险期,亦称排卵期,性事受孕可能性大,千万要注意哦!
=(mensesCyc-9)&
=(mensesCyc-1))
iLayerIndex=40*CalendarIndex+i;
//indexoflayer
tooltips="
TABLEborder=0cellPadding=2cellSpacing=1width=100%align=centerbgcolor=#008080>
+
"
TR>
TDstyle=BACKGROUND-COLOR:
white;
COLOR:
+color+"
FONT-FAMILY:
宋体;
FONT-SIZE:
9pt;
TEXT-DECORATION:
none>
"
tooltips+"
/TD>
/TR>
CalendarOuterHTML=CalendarOuterHTML+"
divid=\"
tooltip"
+iLayerIndex+"
\"
style=\"
position:
absolute;
visibility:
hidden;
clip:
rect(01501500);
width:
150px;
background-color:
seashell\"
layername=\"
nstip"
width=\"
1000px\"
bgColor=\"
height=\"
500px\"
/layer>
/div>
ahref=\"
#\"
onMouseOver=\"
showtip2(this,event,'
+tooltips+"
"
)\"
onMouseOut=\"
hidetip2("
}
FONTCOLOR=\"
+i+"
/FONT>
if(column==7)
{
column=0;
}
//displayemptycellsafterthefinaldayofthemonth
varFinalDay=newDate(Date.UTC(frmInput.txtYear.value,(parseInt(frmInput.txtMonth.value)-2+CalendarIndex),DaysPerMonth));
testMe=FinalDay.getDate();
FinalDay.setDate(0);
EndDay=FinalDay.getDay();
for(i=EndDay;
6;
//tocheckinputerrorsanddisplaybothcalendars
functionDisplayCalendar()
//checkwhetherthedateislegal
if(frmInput.txtYear.value<
1900||isNaN(frmInput.txtYear.value))
alert("
请输入合法年份!
frmInput.txtYear.focus();
returnfalse;
if(isNaN(frmInput.txtMonth.value)||frmInput.txtMonth.value<
1||frmInput.txtMonth.value>
12)
请输入合法月份!
frmInput.txtMonth.focus();
GetDayPerMonth(frmInput.txtYear.value,frmInput.txtMonth.value-1)
if(isNaN(frmInput.txtDay.value)||frmInput.txtDay.value<
1||frmInput.txtDay.value>
DaysPerMonth)
请输入合法日期!
frmInput.txtDay.focus();
if((Today.getTime()-Lastday.getTime())<
0)
请输入正确的上次月经时间(不能早于当前时间)!
//checkinput
if(isNaN(frmInput.txtMinMensesCyc.value))
请输入数字!
frmInput.txtMinMensesCyc.focus();
if(parseInt(frmInput.txtMinMensesCyc.value)>
40||parseInt(frmInput.txtMinMensesCyc.value)<
24)
您输入的最短月经周期与标准月经周期相差太大,程序无法测试,请仔细核对。
\n\n如输入确无问题请咨询医生!
if(isNaN(frmInput.txtMaxMensesCyc.value)||parseInt(frmInput.txtMaxMensesCyc.value)<
parseInt(frmInput.txtMinMensesCyc.value))
输入错误,请仔细核对您的输入周期!
frmInput.txtMaxMensesCyc.focus();
//displaycalendars
GetCalendarOuterHTML(1,1);
document.all.Calendar1.outerHTML=CalendarOuterHTML;
GetCalendarOuterHTML(2,1);
document.all.Calendar2.outerHTML=CalendarOuterHTML;
//Initialize
functionInitialCalendar()
//Initializethedateinputboxes
frmInput.txtYear.value=Today.getYear();
frmInput.txtMonth.value=Today.getMonth()+1;
frmInput.txtDay.value=Today.getDate();
//Initializethecalendars
Ge