⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 safetest.htm

📁 全HTML网址站
💻 HTM
📖 第 1 页 / 共 2 页
字号:
				tooltips = "这是危险期,亦称排卵期,性事受孕可能性大,千万要注意哦!";
			}
			if (dayRemainder>=(mensesCyc-9) && dayRemainder<=(mensesCyc-1))	
			{	color = "#009933";
				tooltips = "这是安全期,性事一般不会受孕,您放心吧!";	
			}
		
			iLayerIndex = 40*CalendarIndex + i ;		//index of layer

			tooltips = "<TABLE border=0 cellPadding=2 cellSpacing=1 width=100% align=center bgcolor=#008080>" +
						"<TR><TD style=BACKGROUND-COLOR:white;COLOR:" + color + ";FONT-FAMILY:宋体;FONT-SIZE:9pt;TEXT-DECORATION:none> " +
						tooltips + "</TD></TR></TABLE>";
						
			CalendarOuterHTML = CalendarOuterHTML + "<div id=\"tooltip" + iLayerIndex + "\" style=\"position:absolute;visibility:hidden;clip:rect(0 150 150 0);width:150px;background-color:seashell\">";
			CalendarOuterHTML = CalendarOuterHTML + "<layer name=\"nstip" + iLayerIndex + "\" width=\"1000px\" bgColor=\"seashell\" height=\"500px\"></layer></div>";
			CalendarOuterHTML = CalendarOuterHTML + "<a href=\"#\" onMouseOver=\"showtip2(this,event,'" + tooltips + "'," + iLayerIndex + ")\" onMouseOut=\"hidetip2(" + iLayerIndex + ")\">";
		}
		
		CalendarOuterHTML = CalendarOuterHTML + "<FONT COLOR=\"" + color + "\">" + i + "</FONT>";
		
		column++;
		
		if (column == 7)
		{
			CalendarOuterHTML = CalendarOuterHTML + "<TR bgcolor=#FFFFFF>"; 
			column = 0;
		}
	}
	
	//display empty cells  after the final day of the month    
	var FinalDay = new Date(Date.UTC(frmInput.txtYear.value,(parseInt(frmInput.txtMonth.value)-2+CalendarIndex),DaysPerMonth));
	testMe = FinalDay.getDate();
	if (testMe == 2)
		FinalDay.setDate(0); 
	EndDay = FinalDay.getDay();
	for (i=EndDay; i<6; i++)
	{
		CalendarOuterHTML = CalendarOuterHTML + "<TD width=18 class=p2>";
	}
	
	CalendarOuterHTML = CalendarOuterHTML + "</TABLE>";
}

//to check input errors and display both calendars
function DisplayCalendar()
{
	//check whether the date is legal
	if (frmInput.txtYear.value<1900||isNaN(frmInput.txtYear.value))
	{
		alert("请输入合法年份!")
		frmInput.txtYear.focus();
		return false;
	}
	if (isNaN(frmInput.txtMonth.value) || frmInput.txtMonth.value<1 || frmInput.txtMonth.value>12)
	{
		alert("请输入合法月份!")
		frmInput.txtMonth.focus();
		return false;
	}
	GetDayPerMonth(frmInput.txtYear.value,frmInput.txtMonth.value-1)
	if (isNaN(frmInput.txtDay.value) || frmInput.txtDay.value<1 || frmInput.txtDay.value>DaysPerMonth)
	{
		alert("请输入合法日期!")
		frmInput.txtDay.focus();
		return false;
	}
	var Lastday = new Date(Date.UTC(frmInput.txtYear.value,(parseInt(frmInput.txtMonth.value)-1),frmInput.txtDay.value))	
	if ((Today.getTime() - Lastday.getTime())<0)
	{
		alert("请输入正确的上次月经时间(不能早于当前时间)!")
		frmInput.txtYear.focus();
		return false;
	}	
	//check input
	if(isNaN(frmInput.txtMinMensesCyc.value))
	{
		alert("请输入数字!")
		frmInput.txtMinMensesCyc.focus();
		return false;
	}
	if(parseInt(frmInput.txtMinMensesCyc.value)>40 || parseInt(frmInput.txtMinMensesCyc.value)<24 )
	{
		alert("您输入的最短月经周期与标准月经周期相差太大,程序无法测试,请仔细核对。\n\n如输入确无问题请咨询医生!")
		frmInput.txtMinMensesCyc.focus();
		return false;
	}
	
	if(isNaN(frmInput.txtMaxMensesCyc.value) || parseInt(frmInput.txtMaxMensesCyc.value)<parseInt(frmInput.txtMinMensesCyc.value))
	{
		alert("输入错误,请仔细核对您的输入周期!");
		frmInput.txtMaxMensesCyc.focus();
		return false;
	}
	//display calendars
	GetCalendarOuterHTML(1,1);
	document.all.Calendar1.outerHTML = CalendarOuterHTML;
	GetCalendarOuterHTML(2,1);
	document.all.Calendar2.outerHTML = CalendarOuterHTML;	
}

//Initialize
function InitialCalendar()
{
	//Initialize the date input boxes
	frmInput.txtYear.value = Today.getYear();
	frmInput.txtMonth.value = Today.getMonth()+1;
	frmInput.txtDay.value = Today.getDate();
	
	//Initialize the calendars
	GetCalendarOuterHTML(1,0);
	document.all.Calendar1.outerHTML = CalendarOuterHTML;
	GetCalendarOuterHTML(2,0);
	document.all.Calendar2.outerHTML = CalendarOuterHTML;
	
	//Set focus
	frmInput.btnCalculate.focus();
}

// -- End Hiding Here -->
</script>
<br>
<table width="400" border="1" align="center" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#CC0000" bgcolor="#efefef">
  <tr>
    <td align="center" class="p4"><p><b><font color="#CC0000"><br>
      妇女安全期测试<br>
        </font></b><br>
    </p></td>
  </tr>
  <tr>
    <td><form method="post" action="#" name="frmInput"
    onSubmit="javascript:DisplayCalendar();">
      <table class="p2" width="400" border="1" cellspacing="0" cellpadding="1" align="center"
      bordercolorlight="#000000" bordercolordark="#FFFFFF">
        <tr bgcolor="#FFCCCC" align="center">
          <td width="100">上次月经时间</td>
          <td width="300" bgcolor="#FFCCCC"><input type="text" name="txtYear" size="8" maxlength="4"
          class="inputform"> 年 <input type="text" name="txtMonth" size="8" maxlength="2"
          class="inputform"> 月 <input type="text" name="txtDay" size="8" maxlength="2"
          class="inputform"> 日 </td>
        </tr>
      </table>
      <table width="400" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr align="center">
          <td height="38"><input type="button" name="btnCalculate" value="开始计算"
          style="border: 1 solid #000000; background: #DADADA font-family:宋体; font-size:9pt"
          onClick="javascript:DisplayCalendar();">   <input type="reset" name="reset"
          value="重新输入"
          style="background:#dadada; border:1 solid #000000; font-family:宋体; font-size:9pt"> </td>
        </tr>
      </table>
      <table width="400" border="1" cellspacing="0" cellpadding="3" bordercolorlight="#666666"
      align="center" bordercolordark="#FFFFFF" class="p2">
        <tr align="center" bgcolor="#DADADA">
          <td colspan="2">如果您的月经周期不是28天,请设置您的周期,再计算!</td>
        </tr>
        <tr bgcolor="#FFCCCC" align="center">
          <td width="200">最短月经周期 <input type="text" name="txtMinMensesCyc" size="8"
          maxlength="2" class="inputform" value="28"> 天</td>
          <td width="200" bgcolor="#FFCCCC">最长月经周期 <input type="text"
          name="txtMaxMensesCyc" size="8" maxlength="2" class="inputform" value="28"> 天</td>
        </tr>
      </table>
      <table width="400" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr align="center">
          <td height="28"><input type="button" name="Submit3" value="设置完成"
          style="background:#dadada; border:1 solid #000000; font-family:宋体; font-size:9pt"
          onClick="javascript:DisplayCalendar();"> </td>
        </tr>
      </table>
      <p><br>
      </p>
      <table width="300" border="0" cellspacing="0" cellpadding="2" align="center">
        <tr>
          <td width="30" bgcolor="#009933"><spacer type="block" width="30"></td>
          <td width="75" class="p1"> 安全期</td>
          <td width="30" bgcolor="#FF3300"><spacer type="block" width="30"></td>
          <td width="75" class="p1"> 危险期</td>
          <td width="30" bgcolor="#FFCC00"><spacer type="block" width="30"></td>
          <td width="60" class="p1"> 月经期</td>
        </tr>
      </table>
      <table width="400" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr align="center">
          <td height="35" colspan="2" class="p4"><font color="#FF3300"><b><font color="#CC0000">结果显示</font> 
          </b></font></td>
        </tr>
        <tr>
          <td class="p2" width="200" align="left"><table border="0" cellspacing="0" cellpadding="3"
          id="Calendar1">
          </table>
          </td>
          <td class="p2" width="200" align="right"><table border="0" cellspacing="0" cellpadding="3"
          id="Calendar2">
          </table>
          </td>
        </tr>
      </table>
    </form>
    </td>
  </tr>
</table>
<p>&nbsp;</p>
<p align="center">『找无忧』网址之家 &nbsp;版权所有! &nbsp;&nbsp;<span class="style6">www.zhao51.com</span><br>
</p>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -