1pxsolidblack">'+text+''
tooltip.innerHTML=''+text+''
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){
eval("vartooltip=document.tooltip"+index+";")
eval("varnstip=document.tooltip"+index+".document.nstip"+index+";")
nstip.document.write(''+text+'')
nstip.document.close()
nstip.left=0
//currentscroll=setInterval("scrolltip("+index+")",100)
tooltip.left=e.pageX+10
tooltip.top=e.pageY+10
tooltip.visibility="show"
}
}
functionhidetip2(index){
if(document.all)
eval("document.all.tooltip"+index+".style.visibility='hidden';");
elseif(document.layers){
//clearInterval(currentscroll)
eval("document.tooltip"+index+".visibility='hidden';")
}
}
functionscrolltip(index){
eval("varnstip=document.tooltip"+index+".document.nstip"+index+";")
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+"";
CalendarOuterHTML=CalendarOuterHTML+"";
CalendarOuterHTML=CalendarOuterHTML+thisYear+'年';
CalendarOuterHTML=CalendarOuterHTML+thisMonth+'月';
CalendarOuterHTML=CalendarOuterHTML+"日一二三四五六";
CalendarOuterHTML=CalendarOuterHTML+"";
//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{
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;i<=DaysPerMonth;i++)
{
CalendarOuterHTML=CalendarOuterHTML+"";
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="这是月经期,要注意经期卫生,当然也要“节欲”,避免性事哦!
"
}
if(dayRemainder>=5&&dayRemainder<=(mensesCyc-20))
{color="#009933";
tooltips="这是安全期,性事一般不会受孕,您放心吧!
";
}
if(dayRemainder>=(mensesCyc-19)&&dayRemainder<=(mensesCyc-10))
{color="#FF3300";
tooltips="这是危险期,亦称排卵期,性事受孕可能性大,千万要注意哦!
";
}
if(dayRemainder>=(mensesCyc-9)&&dayRemainder<=(mensesCyc-1))
{color="#009933";
tooltips="这是安全期,性事一般不会受孕,您放心吧!
";
}
iLayerIndex=40*CalendarIndex+i;//indexoflayer
tooltips=""+
"
white;COLOR:
"+color+";FONT-FAMILY:
宋体;FONT-SIZE:
9pt;TEXT-DECORATION:
none>"+
tooltips+"
";
CalendarOuterHTML=CalendarOuterHTML+"absolute;visibility:
hidden;clip:
rect(01501500);width:
150px;background-color:
seashell\">";
CalendarOuterHTML=CalendarOuterHTML+"