<!--
//Begin
//Define month names

monthnames = new Array(12);
monthnames[0]="January";
monthnames[1]="February";
monthnames[2]="March";
monthnames[3]="April";
monthnames[4]="May";
monthnames[5]="June";
monthnames[6]="July";
monthnames[7]="August";
monthnames[8]="September";
monthnames[9]="October";
monthnames[10]="November";
monthnames[11]="December";

// Define # of links
var linkcount=2;
function addlink(month, day, href, description) {
var entry = new Array(4);
entry[0] = month;
entry[1] = day;
entry[2] = href;
entry[3] = description;
this[linkcount++] = entry;
}
Array.prototype.addlink = addlink;

// Define links (month,day,href,description)

// linkdays = new Array(3);
// linkdays[0] = new Array("2001","2","21","http://www.yahoo.com", "Go to Yahoo");
// linkdays[1] = new Array("2001","2","15","", "Premier Lodging Committee Meets at 10AM in FEB conference room, 26 Federal Plaza,<br>#1715");
// linkdays[2] = new Array("2001","2","23","javascript:(subject.innerHTML='Hello')", "How about it");

//Define # of days per month
monthdays = new Array(12);
monthdays[0]=31;
monthdays[1]=28;
monthdays[2]=31;
monthdays[3]=30;
monthdays[4]=31;
monthdays[5]=30;
monthdays[6]=31;
monthdays[7]=31;
monthdays[8]=30;
monthdays[9]=31;
monthdays[10]=30;
monthdays[11]=31;

//Get current date, month, year
todayDate=new Date();
CurDate=new Date();
Curmonth=CurDate.getMonth();
Curyr=GetFullYear(CurDate);
Curyear = Curyr % 100;
Curyear = ((Curyear < 50) ? (2000 + Curyear) : (1900 + Curyear));
Curyearmonth=(Curyear*100)+(Curmonth+1);
CurDate2= CurDate.getDate();

// If querystring parameter is present, get the month/year ("calendar.htm?YYYYMM")
if (location.search.length > 1) {
	requestyrmo = parseInt(location.search.substring(1,location.search.length));
	if ((""+requestyrmo).length == 6) {
		todayDate=new Date( ( (requestyrmo - (requestyrmo % 100))/100 ), (requestyrmo % 100)-1,1 );
                            CurDate2= CurDate.getDate();
	}
}
thisday=todayDate.getDay();
thismonth=todayDate.getMonth();
thisdate=todayDate.getDate();
yr=GetFullYear(todayDate);
if ( ( ((yr % 4) == 0) && (yr % 100) != 0) || (yr % 400) == 0) {
	monthdays[1]=28;
}
thisyear = yr % 100;

mo=thismonth;

thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear));
yearmonth=(thisyear*100)+(thismonth+1);

if (((thisyear % 4 == 0)
&& !(thisyear % 100 == 0))
||(thisyear % 400 == 0)) monthdays[1]++;
startspaces=thisdate;
while (startspaces > 7) startspaces-=7;
startspaces = thisday - startspaces + 1;
if (startspaces < 0) startspaces+=7;
//End Initialization of Date

  //Begin Main Table
    function Calendar()
	{
	var jump1="";
	var jump2="";
	var thispage = window.location.pathname;

	document.write("<table summary='New York City Federal Executive Board monthly calendar showing events and meetings scheduled.' border=2 bgcolor=#fffff0 ");
	document.write("bordercolor=black width=100%><font size=6 face=arial color=black>");
	document.write("<caption><FONT SIZE=6 face=arial><B>NYC FEB Calendar of Events</B></FONT></caption>");

  jump1 += '<td colspan=2 align=center nowrap><a href="' + thispage + '?'+PrevYearMonth(yearmonth)+'">&lt;-- View '+monthnames[PrevMonth(mo)]+'</a></td>';
        document.write("<tr>" + jump1);
	document.write("<td colspan=3 nowrap><font size=5 face=arial><center><strong>" + monthnames[mo] + " " +  thisyear + "</strong></center></font></td>");

  jump2 += '<td colspan=2 align=center nowrap><a href="' + thispage + '?'+NextYearMonth(yearmonth)+'">View '+monthnames[NextMonth(mo)]+' --&gt;</a></td>'; 
	document.write(jump2 + "</tr>");

  //Define Days of the Week
	document.write("<tr>");
	document.write("<th scope='column' align=center WIDTH=14%>Sunday</th>");
	document.write("<th scope='column' align=center WIDTH=14%>Monday</th>");
	document.write("<th scope='column' align=center WIDTH=14%>Tuesday</th>");
	document.write("<th scope='column' align=center WIDTH=14%>Wednesday</th>");
	document.write("<th scope='column' align=center WIDTH=14%>Thursday</th>");
	document.write("<th scope='column' align=center WIDTH=14%>Friday</th>");
	document.write("<th scope='column' align=center WIDTH=14%>Saturday</th>");
	document.write("</tr>");
	document.write("<tr>");

  //Define Days of the Month
	for (s=0;s<startspaces;s++) {
		document.write("<td> </td>");
	}
	count=1;
	while (count <= monthdays[thismonth]) {
		for (b = startspaces;b<7;b++) {
		linktrue=false;
		document.write("<td align='right' valign='top'>");

	//Check for above links - Turns day into a hyperlink
	for (c=0;c<linkdays.length;c++) {
		if (linkdays[c] != null) {
		if ((linkdays[c][0]==thisyear) && (linkdays[c][1]==thismonth + 1) && (linkdays[c][2]==count) && (linkdays[c][3]!="")) {
		document.write("<strong><a href=\"" + linkdays[c][3] + "\">");
		linktrue=true;
       		}   
                          }   
	}

	//Mark off today in a color
	//if (count==thisdate && Curyearmonth==yearmonth) {
	if (count==CurDate2 && Curyearmonth==yearmonth) { 
	document.write("<font face=arial color='FF0000' size=5><strong>");                  
	    }
                 else  {               
	document.write("<font face=arial color='000000' size=5><strong>"); 
      }

	//Write out days
	if (count <= monthdays[thismonth]) {
	document.write(count);
	}
		else {
		document.write(" ");
		}
	//Close special font for today's date
	//if (count==thisdate) {
	if (count==CurDate2) {
	document.write("</strong></font>");
	}
	if (linktrue) {
	document.write("</a></strong>");}
	document.write("<br>");
	//Writes out description for links
	for (d=0;d<linkdays.length;d++)
	    {
	     if(linkdays[d] != null) {
	      if ((linkdays[d][0]==thisyear) && (linkdays[d][1]==thismonth + 1) && (linkdays[d][2]==count)){
	      document.write("<font face=arial color='000000' size=1>");
	      document.write(linkdays[d][4]);
	      document.write("</font>");
	      }
	    }
	   }
	document.write("</td>");
	count++;
	}
      document.write("</tr>");
//    document.write("<tr>");
 startspaces=0;
}
document.write("</table></p>");
// Finish Table
// End -->
}

function PrevMonth(mth) {
	if (mth == 0) return 11;
	if (mth == 1) return 0;
	else return (mth-1);
}

function NextMonth(mth) {
	if (mth == 11) return 0;
	else return (mth+1);
}

function PrevYearMonth(yrmth) {
	if ((yrmth % 100) == 1) return ((yrmth-100)+11);
	else return (yrmth-1);
}

function NextYearMonth(yrmth) {
	if ((yrmth % 100) == 12) return ((yrmth-11)+100);
	else return (yrmth+1);
}

function GetFullYear(d) {
	yr = d.getYear();
	if (yr < 1000) {
	yr +=1900;}
	return yr;
}