<%@ LANGUAGE = VBScript %> <% Option Explicit %> <% On Error Resume Next Dim blurcntrl, datecntrl, Dy, Mo, Yr, nextmonth, startwith, thisMo, thisYr, thisDate Dim prevMonthLastDate, currMonthLastDate, i, j, lastnum, AnyDate datecntrl= Request("cntrl") blurcntrl= Request("blurcntrl") if( blurcntrl = "" ) then blurcntrl=datecntrl end if Dy = CInt(Request("Dy")) Mo = CInt(Request("Mo")) Yr = CInt(Request("Yr")) nextmonth = false %> <%= L_CALENDARTITLE_TEXT %> " LINK="Navy">
<%= sFont("","","",True) %> <%= writeMonths(Mo) %> <%= sFont("","","",True) %> <%= writeYears(Yr) %>
" BORDERCOLORDARK="<%= Session("BGCOLOR") %>" BORDERCOLORLIGHT="<%= Session("BGCOLOR") %>" CELLPADDING=2 CELLSPACING=0> <% function nextDate(startwith, maxdays) startwith = startwith + 1 if startwith > maxdays then startwith = 1 end if nextDate = startwith end function function GetLastDay(Mo,Yr) if Mo=2 then if (Yr Mod 4)=0 then GetLastDay = 29 else GetLastDay = 28 end if elseif ((Mo = 0) OR (Mo = 1) OR (Mo = 3) OR (Mo = 5) OR (Mo = 7) OR (Mo = 8) OR (Mo = 10) OR (Mo = 12)) then GetLastDay = 31 else GetLastDay = 30 end if end function function GetFirstDayOffset(Mo,Yr) GetFirstDayOffset = weekday(Mo & "/01/" & Yr)-1 end function function writeMonths(selMo) dim i, selstr selstr = "" writeMonths = selstr end function function writeYears(selYear) dim i, selstr selstr = "" writeYears = selstr end function prevMonthLastDate=GetLastDay((Mo-1),Yr) currMonthLastDate=GetLastDay(Mo,Yr) startwith=(prevMonthLastDate-GetFirstDayOffset(Mo, Yr)) %> <% For j = 1 to 6 %> <% For i = 1 to 7 %> <% if j = 1 then %> <% startwith = nextDate(startwith, prevMonthLastDate) %> <% if startwith = Dy and startwith < 7 then %> <% else %> <% lastnum = startwith %> <% startwith = nextDate(startwith, currMonthLastDate) %> <% if lastnum > startwith then%> <% nextmonth = true %> <% end if %> <% if startwith = Dy and not nextmonth then %> <% end if %> <% Next %> <% Next %>
HEIGHT = <%= L_CALENDARCELL_NUM %> BGCOLOR="Gray" BORDERCOLOR="<%= Session("BGCOLOR") %>" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" > <%= sFont("","","#FFFFFF",True) %><%= L_CALSHORTSUN_TEXT %> HEIGHT = <%= L_CALENDARCELL_NUM %> BGCOLOR="Gray" BORDERCOLOR="<%= Session("BGCOLOR") %>" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" > <%= sFont("","","#FFFFFF",True) %><%= L_CALSHORTMON_TEXT %> HEIGHT = <%= L_CALENDARCELL_NUM %> BGCOLOR="Gray" BORDERCOLOR="<%= Session("BGCOLOR") %>" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" > <%= sFont("","","#FFFFFF",True) %><%= L_CALSHORTTUE_TEXT %> HEIGHT = <%= L_CALENDARCELL_NUM %> BGCOLOR="Gray" BORDERCOLOR="<%= Session("BGCOLOR") %>" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" > <%= sFont("","","#FFFFFF",True) %><%= L_CALSHORTWED_TEXT %> HEIGHT = <%= L_CALENDARCELL_NUM %> BGCOLOR="Gray" BORDERCOLOR="<%= Session("BGCOLOR") %>" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" > <%= sFont("","","#FFFFFF",True) %><%= L_CALSHORTTHU_TEXT %> HEIGHT = <%= L_CALENDARCELL_NUM %> BGCOLOR="Gray" BORDERCOLOR="<%= Session("BGCOLOR") %>" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" > <%= sFont("","","#FFFFFF",True) %><%= L_CALSHORTFRI_TEXT %> HEIGHT = <%= L_CALENDARCELL_NUM %> BGCOLOR="Gray" BORDERCOLOR="<%= Session("BGCOLOR") %>" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" style="font-family: Helv,Arial; font-size: 10pt;"> <%= sFont("","","#FFFFFF",True) %><%= L_CALSHORTSAT_TEXT %>
HEIGHT = <%= L_CALENDARCELL_NUM %> BGCOLOR="#AAAAAA" BORDERCOLOR="#AAAAAA" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#AAAAAA" > <% else %> HEIGHT = <%= L_CALENDARCELL_NUM %> BORDERCOLOR="<%= Session("BGCOLOR") %>" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" > <% end if %> <% thisYr = Yr %> <%= sFont("","","",True) %> <% if startwith < 7 then %> <% thisMo = Mo %> <% else %> <% thisMo = Mo - 1 %> <% if thisMo = 0 then %> <% thisMo = 12 %> <% thisYr = Yr-1 %> <% end if %> <% end if %> <% response.write startwith %> HEIGHT = <%= L_CALENDARCELL_NUM %> BGCOLOR="#AAAAAA" BORDERCOLOR="#AAAAAA" BORDERCOLORDARK="#AAAAAA" BORDERCOLORLIGHT="#FFFFFF" > <% else %> HEIGHT = <%= L_CALENDARCELL_NUM %> BORDERCOLOR="<%= Session("BGCOLOR") %>" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" > <% end if %> <% thisYr = Yr %> <% if not nextmonth then %> <% thisMo = Mo %> <% else %> <% thisMo = Mo + 1 %> <% if thisMo = 13 then %> <% thisMo = 1 %> <% thisYr = Yr+1 %> <% end if %> <% end if %> <%= sFont("","","",True) %> <% response.write startwith %>