var now = new Date();
var month = now.getMonth();
var date = now.getDate();
var year = now.getYear();
m = new Array("January","February","March","April","May","June","July",
"August","September","October","November","December");
if (year < 2000) year = year + 1900;
var monarr = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var gerarr = new Array(21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21);

//Check for Leap Year
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) monarr[1] = "29";
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) gerarr[2] = "22";

//Finds the Day of the Year
yearday = date;
othermonth = month;
while (othermonth != 0) {yearday = yearday + monarr[(othermonth - 1)]; othermonth = othermonth -1; };

//Calculates the Gerund Stuff
gerundday = yearday;
gerund = 0;
while ((gerundday - gerarr[gerund]) > 0) 
{gerundday = gerundday - gerarr[gerund]; gerund = gerund + 1; };
gerund = gerund + 1;


function writecalimage(){
xxgerund = gerund;
if (xxgerund < 10) {xxgerund = '0' + xxgerund;}
xxgerundday = gerundday;
if (xxgerundday < 10) {xxgerundday = '0' + xxgerundday;}
document.write('<div style=\"margin: 10px 10px 10px 10px;\"><table cellspacing=0 cellpadding=0 border=0 width=170><tr><td><center><a href=\"http://www.marktopia.com/legislative/index-calendar.html\" target=\"_top\"><img src=\"http://www.marktopia.com/calendar/sp-cal-g' + xxgerund + '.gif\" alt=\"\" width=20 height=155 border=0></a></center></td><td><center><a href=\"http://www.marktopia.com/legislative/index-calendar.html\" target=\"_top\"><img src=\"http://www.marktopia.com/calendar/sp-cal' + xxgerundday + '.gif\" alt=\"\" width=150 height=155 border=0></a></center></td></tr></table></div>');
}