<script language= "JavaScript" >
var months = new Array ("One", "two", "three", "four", "five", "six", "seven", "eight", "Nine", "Ten", "11", "12");
var daysinmonth = new Array (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var days = new Array ("Day", "one", "two", "three", "four", "five", "six");
var classtemp;
var today=new gettoday ();
var year=today.year;
var month=today.month;
var newcal;
function getdays (month, year) {
if (1 = month) return ((0 = year% 4) && (0!= (year% 100)) | | (0 = year% 400)? 29:28;
else return daysinmonth[month];
}
function Gettoday () {
This.now = new Date ();
This.year = This.now.getFullYear ();
This.month = This.now.getMonth ();
This.day = This.now.getDate ();
}
function Calendar () {
newcal = new Date (year,month,1);
today = new Gettoday ();
var day =-1;
var startday = Newcal.getday ();
var endday=getdays (Newcal.getmonth (), newcal.getfullyear ());
var daily = 0;
if ((Today.year = Newcal.getfullyear ()) && (Today.month = = Newcal.getmonth ())
{
day = Today.day;
}
var caltable = Document.all.caltable.tBodies.calendar;
var intdaysinmonth =getdays (Newcal.getmonth (), newcal.getfullyear ());
for (var intweek = 0; Intweek < caltable.rows.length;intweek++)
for (var intday = 0;intday < caltable.rows[intweek].cells.length;intday++)
{
var cell = caltable.rows[ Intweek].cells[intday];
var montemp= (Newcal.getmonth () +1) <10? ("0" + (Newcal.getmonth () +1)):(Newcal.getmonth () +1);
if ((Intday = = startday) && (0 = daily) {daily = 1;}
var daytemp=daily<10? ("0" +daily):(daily);
var d= < "+newcal.getfullyear () +"-"+montemp+"-"+daytemp+" >;
if (day==daily) cell.classname= "Daynow";
Else if (intday==6) cell.classname = "Daysat";
Else if (intday==0) cell.classname = "Daysun";
Else Cell.classname= "Day";
if (daily > 0) && (daily <= Intdaysinmonth)
{
cell.innertext = daily;
daily++
Else
{
cell.classname= "CALENDARTD";
cell.innertext = "";
}
}
Document.all.year.value=year;
document.all.month.value=month+1;
}
function Submonth ()
{
if ((month-1) <0)
{
month=11;
Year=year-1;
Else
{
Month=month-1;
}
Calendar ();
}
function Addmonth ()
{
if ((month+1) >11)
{
month=0;
year=year+1;
Else
{
month=month+1;
}
Calendar ();
}
function setdate ()
{
if (document.all.month.value<1| | DOCUMENT.ALL.MONTH.VALUE>12)
{
Alert ("The effective range of the month is between 1-12!");
Return;
}
Year=math.ceil (Document.all.year.value);
Month=math.ceil (document.all.month.value-1);
Calendar ();
}
</Script>
<Script>
function Buttonover ()
{
var obj = window.event.srcElement;
Obj.runtimeStyle.cssText = "Background-color: #FFFFFF";
Obj.classname= "Hover";
}
function Buttonout ()
{
var obj = window.event.srcElement;
Window.settimeout (function () {obj.runtimeStyle.cssText = "";},300);
}
</Script>
<Style>
Input {font-family:verdana;font-size:9pt;text-decoration:none;background-color: #FFFFFF; height:20px;border:1px Solid #666666; color: #000000;}
. Calendar {font-family:verdana;text-decoration:none;width:170;background-color: #C0D0E8; font-size:9pt;border:0px Dotted #1C6FA5;
. CALENDARTD {font-family:verdana;font-size:7pt;color: #000000; Background-color: #f6f6f6; height:20px;width:11%; Text-align:center;
. Title {font-family:verdana;font-size:11pt;font-weight:normal;height:24px;text-align:center;color: #333333; Text-decoration:none;background-color: #A4B9D7; Border-top-width:1px;border-right-width:1px;border-bottom-width: 1px;border-left-width:1px;border-bottom-style:1px;border-top-color: #999999; Border-right-color: #999999; Border-bottom-color: #999999; Border-left-color: #999999;}
. Day {font-family:verdana;font-size:7pt;color: #243F65; Background-color: #E5E9F2; height:20px;width:11%;text-align: Center;
. Daysat {font-family:verdana;font-size:7pt;color: #FF0000; Text-decoration:none;background-color: #E5E9F2; text-align:center;height:18px;width:12%;
. Daysun {font-family:verdana;font-size:7pt;color: #FF0000; Text-decoration:none;background-color: #E5E9F2; text-align:center;height:18px;width:12%;
. Daynow {font-family:verdana;font-size:7pt;font-weight:bold;color: #000000; Background-color: #FFFFFF; height:20px; Text-align:center;
. Daytitle {font-family:verdana;font-size:9pt;color: #000000; Background-color: #C0D0E8; height:20px;width:11%; Text-align:center;
. Daysattitle {font-family:verdana;font-size:9pt;color: #FF0000; Text-decoration:none;background-color: #C0D0E8; text-align:center;height:20px;width:12%;
. Daysuntitle {font-family:verdana;font-size:9pt;color: #FF0000; Text-decoration:none;background-color: #C0D0E8; text-align:center;height:20px;width:12%;
. Daybutton {font-family:webdings;font-size:9pt;font-weight:bold;color: #243F65; Cursor:hand;text-decoration:none}
</Style>
<table border= "0" cellpadding= "0" cellspacing= "1" class= "Calendar" id= "caltable" >
<thead>
<tr align= "center" valign= "Middle" >
<td colspan= "7" class= "Title" >
<a href= "Javascript:submonth ()" title= "Previous month" class= "Daybutton" >3</a> <input name= "Year" type= "text" Size= "4" maxlength= "4" onkeydown= "if (event.keycode==13) {setdate ()}" onkeyup= "This.value=this.value.replace (/[^0-9 ]/g, "onpaste=" This.value=this.value.replace (/[^0-9]/g, ') "> Year <input name=" month "type=" text "size=" 1 " Maxlength= "2" onkeydown= "if (event.keycode==13) {setdate ()}" onkeyup= "This.value=this.value.replace (/[^0-9]/g,") " Onpaste= "This.value=this.value.replace (/[^0-9]/g,") "> Month <a href=" Javascript:addmonth (); "Title=" Next month "Class=" Daybutton ">4</a>
</td>
</tr>
<tr align= "center" valign= "Middle" >
<script language= "JavaScript" >
document.write ("<td class=daysuntitle id=diary >" + days[0] + "</TD>");
for (var intloop = 1; intloop < days.length-1;intloop++)
document.write ("<td class=daytitle id=diary>" + days[intloop) + "</TD>");
document.write ("<td class=daysattitle id=diary>" + days[intloop) + "</TD>");
</Script>
</TR>
</thead>
<tbody border=1 cellspacing= "0" cellpadding= "0" id= "Calendar" Align=center onclick= "Getdiary ()" >
<script language= "JavaScript" >
for (var intweeks = 0; intweeks < 6; intweeks++)
{
document.write ("<tr style= ' Cursor:hand ' >");
for (var intdays = 0; intdays < days.length;intdays++) document.write ("<td class=calendartd onMouseover=" Buttonover (); ' onmouseout= ' buttonout (); ></TD> ");
document.write ("</TR>");
}
</Script>
</TBODY>
</TABLE>
<script language= "JavaScript" >
Calendar ();
</Script>